/
model_kafka_user_v3.go
58 lines (45 loc) · 1.6 KB
/
model_kafka_user_v3.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
/*
* Instaclustr API Documentation
*
*
*
* API version: Current
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
*/
package openapi
// KafkaUserV3 - Definition of a Kafka User to be applied to a Kafka cluster.
type KafkaUserV3 struct {
// Password for the Kafka user.
Password string `json:"password,omitempty"`
// Overwrite user if already exists.
OverrideExistingUser bool `json:"overrideExistingUser,omitempty"`
SaslScramMechanism KafkaSaslScramMechanismEnum `json:"saslScramMechanism,omitempty"`
AuthMechanism KafkaAuthMechanismsEnumV2 `json:"authMechanism"`
// ID of the Kafka cluster.
ClusterId string `json:"clusterId"`
// Instaclustr identifier for the Kafka user. The value of this property has the form: [cluster-id]_[kafka-username]
Id string `json:"id,omitempty"`
// Permissions initially granted to Kafka user upon creation.
InitialPermissions string `json:"initialPermissions"`
// Username of the Kafka user.
Username string `json:"username"`
}
// AssertKafkaUserV3Required checks if the required fields are not zero-ed
func AssertKafkaUserV3Required(obj KafkaUserV3) error {
elements := map[string]interface{}{
"authMechanism": obj.AuthMechanism,
"clusterId": obj.ClusterId,
"initialPermissions": obj.InitialPermissions,
"username": obj.Username,
}
for name, el := range elements {
if isZero := IsZeroValue(el); isZero {
return &RequiredError{Field: name}
}
}
return nil
}
// AssertKafkaUserV3Constraints checks if the values respects the defined constraints
func AssertKafkaUserV3Constraints(obj KafkaUserV3) error {
return nil
}