/
model_http_status_enum.go
137 lines (115 loc) · 4.53 KB
/
model_http_status_enum.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
/*
APEX Navigator for Multicloud Storage REST APIs
The public API definitions for APEX Navigator for Multicloud Storage
API version: 1.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package client
import (
"encoding/json"
"fmt"
)
// HttpStatusEnum Possible HTTP status values of completed or failed jobs. * 200 - OK - Successful completion, with a response body. * 201 - Created - Successful completion of a create request (POST to collection resource). * 202 - Accepted - Job has been started. Response body is a job resource instance. Response status and body are available from job when it completes. * 204 - No Content - Successful completion, without a response body. * 206 - Partial Content - Paged response to a collection query. * 299 - Completed with Messages - Core request completed but has messages for client. Ancillary portions of request may have failed. Few requests should be able to return this, as the intent is for requests to be atomic - to either succeed or roll back on failure. * 400 - Invalid Request - The request is incorrect. To the extent possible, validate requests up front and use this code. Details in the response body. * 401 - Unauthorized - The request cannot be authenticated. * 403 - Forbidden - The request is not allowed for this client. * 404 - Not Found - The id value in the request URL is not valid. * 409 - Conflict - The request conflicts with current state of target resource. * 422 - Operation Failed - The request failed during execution. * 429 - Too Many Requests - This particular client needs to slow down and take it easy. Retry after a delay. * 500 - Internal Error - This means the product has a bug and customer should contact support. * 503 - Service Unavailable - The service is temporarily unavailable. Try again later.
type HttpStatusEnum int32
// List of HttpStatusEnum
const (
HTTPSTATUSENUM__200 HttpStatusEnum = 200
HTTPSTATUSENUM__201 HttpStatusEnum = 201
HTTPSTATUSENUM__202 HttpStatusEnum = 202
HTTPSTATUSENUM__204 HttpStatusEnum = 204
HTTPSTATUSENUM__206 HttpStatusEnum = 206
HTTPSTATUSENUM__299 HttpStatusEnum = 299
HTTPSTATUSENUM__400 HttpStatusEnum = 400
HTTPSTATUSENUM__401 HttpStatusEnum = 401
HTTPSTATUSENUM__403 HttpStatusEnum = 403
HTTPSTATUSENUM__404 HttpStatusEnum = 404
HTTPSTATUSENUM__409 HttpStatusEnum = 409
HTTPSTATUSENUM__422 HttpStatusEnum = 422
HTTPSTATUSENUM__429 HttpStatusEnum = 429
HTTPSTATUSENUM__500 HttpStatusEnum = 500
HTTPSTATUSENUM__503 HttpStatusEnum = 503
)
// All allowed values of HttpStatusEnum enum
var AllowedHttpStatusEnumEnumValues = []HttpStatusEnum{
200,
201,
202,
204,
206,
299,
400,
401,
403,
404,
409,
422,
429,
500,
503,
}
func (v *HttpStatusEnum) UnmarshalJSON(src []byte) error {
var value int32
err := json.Unmarshal(src, &value)
if err != nil {
return err
}
enumTypeValue := HttpStatusEnum(value)
for _, existing := range AllowedHttpStatusEnumEnumValues {
if existing == enumTypeValue {
*v = enumTypeValue
return nil
}
}
return fmt.Errorf("%+v is not a valid HttpStatusEnum", value)
}
// NewHttpStatusEnumFromValue returns a pointer to a valid HttpStatusEnum
// for the value passed as argument, or an error if the value passed is not allowed by the enum
func NewHttpStatusEnumFromValue(v int32) (*HttpStatusEnum, error) {
ev := HttpStatusEnum(v)
if ev.IsValid() {
return &ev, nil
} else {
return nil, fmt.Errorf("invalid value '%v' for HttpStatusEnum: valid values are %v", v, AllowedHttpStatusEnumEnumValues)
}
}
// IsValid return true if the value is valid for the enum, false otherwise
func (v HttpStatusEnum) IsValid() bool {
for _, existing := range AllowedHttpStatusEnumEnumValues {
if existing == v {
return true
}
}
return false
}
// Ptr returns reference to HttpStatusEnum value
func (v HttpStatusEnum) Ptr() *HttpStatusEnum {
return &v
}
type NullableHttpStatusEnum struct {
value *HttpStatusEnum
isSet bool
}
func (v NullableHttpStatusEnum) Get() *HttpStatusEnum {
return v.value
}
func (v *NullableHttpStatusEnum) Set(val *HttpStatusEnum) {
v.value = val
v.isSet = true
}
func (v NullableHttpStatusEnum) IsSet() bool {
return v.isSet
}
func (v *NullableHttpStatusEnum) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableHttpStatusEnum(val *HttpStatusEnum) *NullableHttpStatusEnum {
return &NullableHttpStatusEnum{value: val, isSet: true}
}
func (v NullableHttpStatusEnum) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableHttpStatusEnum) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}