/
model_shipment_event_type_code.go
136 lines (115 loc) · 3.78 KB
/
model_shipment_event_type_code.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
/*
DCSA OpenAPI specification for Track & Trace
Provides equipment actual milestones along with Estimated Time of Arrival following DCSA standards
API version: 2.2.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package api
import (
"encoding/json"
"fmt"
)
// ShipmentEventTypeCode The status of the document in the process. Possible values are - RECE (Received) - DRFT (Drafted) - PENA (Pending Approval) - PENU (Pending Update) - REJE (Rejected) - APPR (Approved) - ISSU (Issued) - SURR (Surrendered) - SUBM (Submitted) - VOID (Void) - CONF (Confirmed) - REQS (Requested) - CMPL (Completed) - HOLD (On Hold) - RELS (Released) More details can be found on <a href=\"https://github.com/dcsaorg/DCSA-Information-Model/blob/master/datamodel/referencedata.d/shipmenteventtypecodes.csv\">GitHub</a>
type ShipmentEventTypeCode string
// List of shipmentEventTypeCode
const (
RECE ShipmentEventTypeCode = "RECE"
DRFT ShipmentEventTypeCode = "DRFT"
PENA ShipmentEventTypeCode = "PENA"
PENU ShipmentEventTypeCode = "PENU"
REJE ShipmentEventTypeCode = "REJE"
APPR ShipmentEventTypeCode = "APPR"
ISSU ShipmentEventTypeCode = "ISSU"
SURR ShipmentEventTypeCode = "SURR"
SUBM ShipmentEventTypeCode = "SUBM"
VOID ShipmentEventTypeCode = "VOID"
CONF ShipmentEventTypeCode = "CONF"
REQS ShipmentEventTypeCode = "REQS"
CMPL ShipmentEventTypeCode = "CMPL"
HOLD ShipmentEventTypeCode = "HOLD"
RELS ShipmentEventTypeCode = "RELS"
)
// All allowed values of ShipmentEventTypeCode enum
var AllowedShipmentEventTypeCodeEnumValues = []ShipmentEventTypeCode{
"RECE",
"DRFT",
"PENA",
"PENU",
"REJE",
"APPR",
"ISSU",
"SURR",
"SUBM",
"VOID",
"CONF",
"REQS",
"CMPL",
"HOLD",
"RELS",
}
func (v *ShipmentEventTypeCode) UnmarshalJSON(src []byte) error {
var value string
err := json.Unmarshal(src, &value)
if err != nil {
return err
}
enumTypeValue := ShipmentEventTypeCode(value)
for _, existing := range AllowedShipmentEventTypeCodeEnumValues {
if existing == enumTypeValue {
*v = enumTypeValue
return nil
}
}
return fmt.Errorf("%+v is not a valid ShipmentEventTypeCode", value)
}
// NewShipmentEventTypeCodeFromValue returns a pointer to a valid ShipmentEventTypeCode
// for the value passed as argument, or an error if the value passed is not allowed by the enum
func NewShipmentEventTypeCodeFromValue(v string) (*ShipmentEventTypeCode, error) {
ev := ShipmentEventTypeCode(v)
if ev.IsValid() {
return &ev, nil
} else {
return nil, fmt.Errorf("invalid value '%v' for ShipmentEventTypeCode: valid values are %v", v, AllowedShipmentEventTypeCodeEnumValues)
}
}
// IsValid return true if the value is valid for the enum, false otherwise
func (v ShipmentEventTypeCode) IsValid() bool {
for _, existing := range AllowedShipmentEventTypeCodeEnumValues {
if existing == v {
return true
}
}
return false
}
// Ptr returns reference to shipmentEventTypeCode value
func (v ShipmentEventTypeCode) Ptr() *ShipmentEventTypeCode {
return &v
}
type NullableShipmentEventTypeCode struct {
value *ShipmentEventTypeCode
isSet bool
}
func (v NullableShipmentEventTypeCode) Get() *ShipmentEventTypeCode {
return v.value
}
func (v *NullableShipmentEventTypeCode) Set(val *ShipmentEventTypeCode) {
v.value = val
v.isSet = true
}
func (v NullableShipmentEventTypeCode) IsSet() bool {
return v.isSet
}
func (v *NullableShipmentEventTypeCode) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableShipmentEventTypeCode(val *ShipmentEventTypeCode) *NullableShipmentEventTypeCode {
return &NullableShipmentEventTypeCode{value: val, isSet: true}
}
func (v NullableShipmentEventTypeCode) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableShipmentEventTypeCode) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}