From 0e525a668db3952d53d1e682a2a8edbb2f28b99c Mon Sep 17 00:00:00 2001 From: Pete Savage Date: Wed, 15 Sep 2021 18:11:07 +0100 Subject: [PATCH] Fix genconfig schema for metadata --- .../cloud.redhat.com/clowdapp_controller.go | 2 +- .../cloud.redhat.com/config/schema.json | 36 + controllers/cloud.redhat.com/config/types.go | 691 +++++++++--------- 3 files changed, 392 insertions(+), 337 deletions(-) diff --git a/controllers/cloud.redhat.com/clowdapp_controller.go b/controllers/cloud.redhat.com/clowdapp_controller.go index 10bb2d15b..028bcf38e 100644 --- a/controllers/cloud.redhat.com/clowdapp_controller.go +++ b/controllers/cloud.redhat.com/clowdapp_controller.go @@ -462,7 +462,7 @@ func updateMetadata(app *crd.ClowdApp, appConfig *config.AppConfig) { metadata.Deployments = append(metadata.Deployments, deploymentMetadata) } - appConfig.Metadata = metadata + appConfig.Metadata = &metadata } func (r *ClowdAppReconciler) runProviders(log logr.Logger, provider *providers.Provider, a *crd.ClowdApp) error { diff --git a/controllers/cloud.redhat.com/config/schema.json b/controllers/cloud.redhat.com/config/schema.json index 93a37cc64..28ef5d9d2 100644 --- a/controllers/cloud.redhat.com/config/schema.json +++ b/controllers/cloud.redhat.com/config/schema.json @@ -31,6 +31,9 @@ "logging": { "$ref": "#/definitions/LoggingConfig" }, + "metadata": { + "$ref": "#/definitions/AppMetadata" + }, "kafka": { "$ref": "#/definitions/KafkaConfig" }, @@ -85,6 +88,39 @@ "type" ] }, + "AppMetadata": { + "title": "AppMetadata", + "type": "object", + "description": "Arbitrary metadata pertaining to the application application", + "properties": { + "deployments": { + "description": "Metadata pertaining to an application's deployments", + "type": "array", + "items": { + "$ref": "#/definitions/DeploymentMetadata" + } + } + } + }, + "DeploymentMetadata": { + "title": "DeploymentMetadata", + "type": "object", + "description": "Deployment Metadata", + "properties": { + "name": { + "description": "Name of deployment", + "type": "string" + }, + "image": { + "description": "Image used by deployment", + "type": "string" + } + }, + "required": [ + "name", + "image" + ] + }, "CloudWatchConfig": { "title": "CloudWatchConfig", "type": "object", diff --git a/controllers/cloud.redhat.com/config/types.go b/controllers/cloud.redhat.com/config/types.go index 6a9177f98..78e277ad4 100644 --- a/controllers/cloud.redhat.com/config/types.go +++ b/controllers/cloud.redhat.com/config/types.go @@ -2,17 +2,78 @@ package config -import ( - "encoding/json" - "fmt" - "reflect" -) +import "fmt" +import "encoding/json" +import "reflect" + +// UnmarshalJSON implements json.Unmarshaler. +func (j *CloudWatchConfig) UnmarshalJSON(b []byte) error { + var raw map[string]interface{} + if err := json.Unmarshal(b, &raw); err != nil { + return err + } + if v, ok := raw["accessKeyId"]; !ok || v == nil { + return fmt.Errorf("field accessKeyId: required") + } + if v, ok := raw["logGroup"]; !ok || v == nil { + return fmt.Errorf("field logGroup: required") + } + if v, ok := raw["region"]; !ok || v == nil { + return fmt.Errorf("field region: required") + } + if v, ok := raw["secretAccessKey"]; !ok || v == nil { + return fmt.Errorf("field secretAccessKey: required") + } + type Plain CloudWatchConfig + var plain Plain + if err := json.Unmarshal(b, &plain); err != nil { + return err + } + *j = CloudWatchConfig(plain) + return nil +} + +// UnmarshalJSON implements json.Unmarshaler. +func (j *DatabaseConfig) UnmarshalJSON(b []byte) error { + var raw map[string]interface{} + if err := json.Unmarshal(b, &raw); err != nil { + return err + } + if v, ok := raw["adminPassword"]; !ok || v == nil { + return fmt.Errorf("field adminPassword: required") + } + if v, ok := raw["adminUsername"]; !ok || v == nil { + return fmt.Errorf("field adminUsername: required") + } + if v, ok := raw["hostname"]; !ok || v == nil { + return fmt.Errorf("field hostname: required") + } + if v, ok := raw["name"]; !ok || v == nil { + return fmt.Errorf("field name: required") + } + if v, ok := raw["password"]; !ok || v == nil { + return fmt.Errorf("field password: required") + } + if v, ok := raw["port"]; !ok || v == nil { + return fmt.Errorf("field port: required") + } + if v, ok := raw["sslMode"]; !ok || v == nil { + return fmt.Errorf("field sslMode: required") + } + if v, ok := raw["username"]; !ok || v == nil { + return fmt.Errorf("field username: required") + } + type Plain DatabaseConfig + var plain Plain + if err := json.Unmarshal(b, &plain); err != nil { + return err + } + *j = DatabaseConfig(plain) + return nil +} // ClowdApp deployment configuration for Clowder enabled apps. type AppConfig struct { - // Arbitrary metadata pertaining to the application application - Metadata AppMetadata `json:"metadata,omitempty"` - // Database corresponds to the JSON schema field "database". Database *DatabaseConfig `json:"database,omitempty"` @@ -31,6 +92,9 @@ type AppConfig struct { // Logging corresponds to the JSON schema field "logging". Logging LoggingConfig `json:"logging"` + // Metadata corresponds to the JSON schema field "metadata". + Metadata *AppMetadata `json:"metadata,omitempty"` + // Defines the path to the metrics server that the app should be configured to // listen on for metric traffic. MetricsPath string `json:"metricsPath"` @@ -57,19 +121,176 @@ type AppConfig struct { WebPort *int `json:"webPort,omitempty"` } -// Application Metadata -type AppMetadata struct { - // Metadata pertaining to an application's deployments - Deployments []DeploymentMetadata `json:"deployments,omitempty"` +// UnmarshalJSON implements json.Unmarshaler. +func (j *DependencyEndpoint) UnmarshalJSON(b []byte) error { + var raw map[string]interface{} + if err := json.Unmarshal(b, &raw); err != nil { + return err + } + if v, ok := raw["app"]; !ok || v == nil { + return fmt.Errorf("field app: required") + } + if v, ok := raw["hostname"]; !ok || v == nil { + return fmt.Errorf("field hostname: required") + } + if v, ok := raw["name"]; !ok || v == nil { + return fmt.Errorf("field name: required") + } + if v, ok := raw["port"]; !ok || v == nil { + return fmt.Errorf("field port: required") + } + type Plain DependencyEndpoint + var plain Plain + if err := json.Unmarshal(b, &plain); err != nil { + return err + } + *j = DependencyEndpoint(plain) + return nil } -// Deployment Metadata -type DeploymentMetadata struct { - // Name of deployment - Name string `json:"name"` +// UnmarshalJSON implements json.Unmarshaler. +func (j *PrivateDependencyEndpoint) UnmarshalJSON(b []byte) error { + var raw map[string]interface{} + if err := json.Unmarshal(b, &raw); err != nil { + return err + } + if v, ok := raw["app"]; !ok || v == nil { + return fmt.Errorf("field app: required") + } + if v, ok := raw["hostname"]; !ok || v == nil { + return fmt.Errorf("field hostname: required") + } + if v, ok := raw["name"]; !ok || v == nil { + return fmt.Errorf("field name: required") + } + if v, ok := raw["port"]; !ok || v == nil { + return fmt.Errorf("field port: required") + } + type Plain PrivateDependencyEndpoint + var plain Plain + if err := json.Unmarshal(b, &plain); err != nil { + return err + } + *j = PrivateDependencyEndpoint(plain) + return nil +} - // Image used by deployment - Image string `json:"image"` +// UnmarshalJSON implements json.Unmarshaler. +func (j *FeatureFlagsConfig) UnmarshalJSON(b []byte) error { + var raw map[string]interface{} + if err := json.Unmarshal(b, &raw); err != nil { + return err + } + if v, ok := raw["hostname"]; !ok || v == nil { + return fmt.Errorf("field hostname: required") + } + if v, ok := raw["port"]; !ok || v == nil { + return fmt.Errorf("field port: required") + } + type Plain FeatureFlagsConfig + var plain Plain + if err := json.Unmarshal(b, &plain); err != nil { + return err + } + *j = FeatureFlagsConfig(plain) + return nil +} + +// UnmarshalJSON implements json.Unmarshaler. +func (j *ObjectStoreConfig) UnmarshalJSON(b []byte) error { + var raw map[string]interface{} + if err := json.Unmarshal(b, &raw); err != nil { + return err + } + if v, ok := raw["hostname"]; !ok || v == nil { + return fmt.Errorf("field hostname: required") + } + if v, ok := raw["port"]; !ok || v == nil { + return fmt.Errorf("field port: required") + } + if v, ok := raw["tls"]; !ok || v == nil { + return fmt.Errorf("field tls: required") + } + type Plain ObjectStoreConfig + var plain Plain + if err := json.Unmarshal(b, &plain); err != nil { + return err + } + *j = ObjectStoreConfig(plain) + return nil +} + +// UnmarshalJSON implements json.Unmarshaler. +func (j *InMemoryDBConfig) UnmarshalJSON(b []byte) error { + var raw map[string]interface{} + if err := json.Unmarshal(b, &raw); err != nil { + return err + } + if v, ok := raw["hostname"]; !ok || v == nil { + return fmt.Errorf("field hostname: required") + } + if v, ok := raw["port"]; !ok || v == nil { + return fmt.Errorf("field port: required") + } + type Plain InMemoryDBConfig + var plain Plain + if err := json.Unmarshal(b, &plain); err != nil { + return err + } + *j = InMemoryDBConfig(plain) + return nil +} + +type BrokerConfigAuthtype string + +// UnmarshalJSON implements json.Unmarshaler. +func (j *ObjectStoreBucket) UnmarshalJSON(b []byte) error { + var raw map[string]interface{} + if err := json.Unmarshal(b, &raw); err != nil { + return err + } + if v, ok := raw["name"]; !ok || v == nil { + return fmt.Errorf("field name: required") + } + if v, ok := raw["requestedName"]; !ok || v == nil { + return fmt.Errorf("field requestedName: required") + } + type Plain ObjectStoreBucket + var plain Plain + if err := json.Unmarshal(b, &plain); err != nil { + return err + } + *j = ObjectStoreBucket(plain) + return nil +} + +// UnmarshalJSON implements json.Unmarshaler. +func (j *BrokerConfigAuthtype) UnmarshalJSON(b []byte) error { + var v string + if err := json.Unmarshal(b, &v); err != nil { + return err + } + var ok bool + for _, expected := range enumValues_BrokerConfigAuthtype { + if reflect.DeepEqual(v, expected) { + ok = true + break + } + } + if !ok { + return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_BrokerConfigAuthtype, v) + } + *j = BrokerConfigAuthtype(v) + return nil +} + +const BrokerConfigAuthtypeMtls BrokerConfigAuthtype = "mtls" +const BrokerConfigAuthtypeSasl BrokerConfigAuthtype = "sasl" + +// Arbitrary metadata pertaining to the application application +type AppMetadata struct { + // Metadata pertaining to an application's deployments + Deployments []DeploymentMetadata `json:"deployments,omitempty"` } // Broker Configuration @@ -90,19 +311,113 @@ type BrokerConfig struct { Sasl *KafkaSASLConfig `json:"sasl,omitempty"` } -type BrokerConfigAuthtype string - -const BrokerConfigAuthtypeMtls BrokerConfigAuthtype = "mtls" -const BrokerConfigAuthtypeSasl BrokerConfigAuthtype = "sasl" - -// Cloud Watch configuration -type CloudWatchConfig struct { - // Defines the access key that the app should use for configuring CloudWatch. - AccessKeyId string `json:"accessKeyId"` - - // Defines the logGroup that the app should use for configuring CloudWatch. - LogGroup string `json:"logGroup"` - +// UnmarshalJSON implements json.Unmarshaler. +func (j *BrokerConfig) UnmarshalJSON(b []byte) error { + var raw map[string]interface{} + if err := json.Unmarshal(b, &raw); err != nil { + return err + } + if v, ok := raw["hostname"]; !ok || v == nil { + return fmt.Errorf("field hostname: required") + } + type Plain BrokerConfig + var plain Plain + if err := json.Unmarshal(b, &plain); err != nil { + return err + } + *j = BrokerConfig(plain) + return nil +} + +// UnmarshalJSON implements json.Unmarshaler. +func (j *DeploymentMetadata) UnmarshalJSON(b []byte) error { + var raw map[string]interface{} + if err := json.Unmarshal(b, &raw); err != nil { + return err + } + if v, ok := raw["image"]; !ok || v == nil { + return fmt.Errorf("field image: required") + } + if v, ok := raw["name"]; !ok || v == nil { + return fmt.Errorf("field name: required") + } + type Plain DeploymentMetadata + var plain Plain + if err := json.Unmarshal(b, &plain); err != nil { + return err + } + *j = DeploymentMetadata(plain) + return nil +} + +// UnmarshalJSON implements json.Unmarshaler. +func (j *TopicConfig) UnmarshalJSON(b []byte) error { + var raw map[string]interface{} + if err := json.Unmarshal(b, &raw); err != nil { + return err + } + if v, ok := raw["name"]; !ok || v == nil { + return fmt.Errorf("field name: required") + } + if v, ok := raw["requestedName"]; !ok || v == nil { + return fmt.Errorf("field requestedName: required") + } + type Plain TopicConfig + var plain Plain + if err := json.Unmarshal(b, &plain); err != nil { + return err + } + *j = TopicConfig(plain) + return nil +} + +// UnmarshalJSON implements json.Unmarshaler. +func (j *LoggingConfig) UnmarshalJSON(b []byte) error { + var raw map[string]interface{} + if err := json.Unmarshal(b, &raw); err != nil { + return err + } + if v, ok := raw["type"]; !ok || v == nil { + return fmt.Errorf("field type: required") + } + type Plain LoggingConfig + var plain Plain + if err := json.Unmarshal(b, &plain); err != nil { + return err + } + *j = LoggingConfig(plain) + return nil +} + +// UnmarshalJSON implements json.Unmarshaler. +func (j *KafkaConfig) UnmarshalJSON(b []byte) error { + var raw map[string]interface{} + if err := json.Unmarshal(b, &raw); err != nil { + return err + } + if v, ok := raw["brokers"]; !ok || v == nil { + return fmt.Errorf("field brokers: required") + } + if v, ok := raw["topics"]; !ok || v == nil { + return fmt.Errorf("field topics: required") + } + type Plain KafkaConfig + var plain Plain + if err := json.Unmarshal(b, &plain); err != nil { + return err + } + *j = KafkaConfig(plain) + return nil +} + +// Cloud Watch configuration +type CloudWatchConfig struct { + // Defines the access key that the app should use for configuring CloudWatch. + AccessKeyId string `json:"accessKeyId"` + + // Defines the logGroup that the app should use for configuring CloudWatch. + LogGroup string `json:"logGroup"` + // Defines the region that the app should use for configuring CloudWatch. Region string `json:"region"` @@ -155,6 +470,15 @@ type DependencyEndpoint struct { Port int `json:"port"` } +// Deployment Metadata +type DeploymentMetadata struct { + // Image used by deployment + Image string `json:"image"` + + // Name of deployment + Name string `json:"name"` +} + // Feature Flags Configuration type FeatureFlagsConfig struct { // Defines the client access token to use when connect to the FeatureFlags server @@ -272,311 +596,6 @@ type TopicConfig struct { RequestedName string `json:"requestedName"` } -// UnmarshalJSON implements json.Unmarshaler. -func (j *TopicConfig) UnmarshalJSON(b []byte) error { - var raw map[string]interface{} - if err := json.Unmarshal(b, &raw); err != nil { - return err - } - if v, ok := raw["name"]; !ok || v == nil { - return fmt.Errorf("field name: required") - } - if v, ok := raw["requestedName"]; !ok || v == nil { - return fmt.Errorf("field requestedName: required") - } - type Plain TopicConfig - var plain Plain - if err := json.Unmarshal(b, &plain); err != nil { - return err - } - *j = TopicConfig(plain) - return nil -} - -// UnmarshalJSON implements json.Unmarshaler. -func (j *BrokerConfig) UnmarshalJSON(b []byte) error { - var raw map[string]interface{} - if err := json.Unmarshal(b, &raw); err != nil { - return err - } - if v, ok := raw["hostname"]; !ok || v == nil { - return fmt.Errorf("field hostname: required") - } - type Plain BrokerConfig - var plain Plain - if err := json.Unmarshal(b, &plain); err != nil { - return err - } - *j = BrokerConfig(plain) - return nil -} - -// UnmarshalJSON implements json.Unmarshaler. -func (j *KafkaConfig) UnmarshalJSON(b []byte) error { - var raw map[string]interface{} - if err := json.Unmarshal(b, &raw); err != nil { - return err - } - if v, ok := raw["brokers"]; !ok || v == nil { - return fmt.Errorf("field brokers: required") - } - if v, ok := raw["topics"]; !ok || v == nil { - return fmt.Errorf("field topics: required") - } - type Plain KafkaConfig - var plain Plain - if err := json.Unmarshal(b, &plain); err != nil { - return err - } - *j = KafkaConfig(plain) - return nil -} - -// UnmarshalJSON implements json.Unmarshaler. -func (j *BrokerConfigAuthtype) UnmarshalJSON(b []byte) error { - var v string - if err := json.Unmarshal(b, &v); err != nil { - return err - } - var ok bool - for _, expected := range enumValues_BrokerConfigAuthtype { - if reflect.DeepEqual(v, expected) { - ok = true - break - } - } - if !ok { - return fmt.Errorf("invalid value (expected one of %#v): %#v", enumValues_BrokerConfigAuthtype, v) - } - *j = BrokerConfigAuthtype(v) - return nil -} - -// UnmarshalJSON implements json.Unmarshaler. -func (j *CloudWatchConfig) UnmarshalJSON(b []byte) error { - var raw map[string]interface{} - if err := json.Unmarshal(b, &raw); err != nil { - return err - } - if v, ok := raw["accessKeyId"]; !ok || v == nil { - return fmt.Errorf("field accessKeyId: required") - } - if v, ok := raw["logGroup"]; !ok || v == nil { - return fmt.Errorf("field logGroup: required") - } - if v, ok := raw["region"]; !ok || v == nil { - return fmt.Errorf("field region: required") - } - if v, ok := raw["secretAccessKey"]; !ok || v == nil { - return fmt.Errorf("field secretAccessKey: required") - } - type Plain CloudWatchConfig - var plain Plain - if err := json.Unmarshal(b, &plain); err != nil { - return err - } - *j = CloudWatchConfig(plain) - return nil -} - -// UnmarshalJSON implements json.Unmarshaler. -func (j *InMemoryDBConfig) UnmarshalJSON(b []byte) error { - var raw map[string]interface{} - if err := json.Unmarshal(b, &raw); err != nil { - return err - } - if v, ok := raw["hostname"]; !ok || v == nil { - return fmt.Errorf("field hostname: required") - } - if v, ok := raw["port"]; !ok || v == nil { - return fmt.Errorf("field port: required") - } - type Plain InMemoryDBConfig - var plain Plain - if err := json.Unmarshal(b, &plain); err != nil { - return err - } - *j = InMemoryDBConfig(plain) - return nil -} - -// UnmarshalJSON implements json.Unmarshaler. -func (j *LoggingConfig) UnmarshalJSON(b []byte) error { - var raw map[string]interface{} - if err := json.Unmarshal(b, &raw); err != nil { - return err - } - if v, ok := raw["type"]; !ok || v == nil { - return fmt.Errorf("field type: required") - } - type Plain LoggingConfig - var plain Plain - if err := json.Unmarshal(b, &plain); err != nil { - return err - } - *j = LoggingConfig(plain) - return nil -} - -// UnmarshalJSON implements json.Unmarshaler. -func (j *FeatureFlagsConfig) UnmarshalJSON(b []byte) error { - var raw map[string]interface{} - if err := json.Unmarshal(b, &raw); err != nil { - return err - } - if v, ok := raw["hostname"]; !ok || v == nil { - return fmt.Errorf("field hostname: required") - } - if v, ok := raw["port"]; !ok || v == nil { - return fmt.Errorf("field port: required") - } - type Plain FeatureFlagsConfig - var plain Plain - if err := json.Unmarshal(b, &plain); err != nil { - return err - } - *j = FeatureFlagsConfig(plain) - return nil -} - -// UnmarshalJSON implements json.Unmarshaler. -func (j *ObjectStoreBucket) UnmarshalJSON(b []byte) error { - var raw map[string]interface{} - if err := json.Unmarshal(b, &raw); err != nil { - return err - } - if v, ok := raw["name"]; !ok || v == nil { - return fmt.Errorf("field name: required") - } - if v, ok := raw["requestedName"]; !ok || v == nil { - return fmt.Errorf("field requestedName: required") - } - type Plain ObjectStoreBucket - var plain Plain - if err := json.Unmarshal(b, &plain); err != nil { - return err - } - *j = ObjectStoreBucket(plain) - return nil -} - -// UnmarshalJSON implements json.Unmarshaler. -func (j *DependencyEndpoint) UnmarshalJSON(b []byte) error { - var raw map[string]interface{} - if err := json.Unmarshal(b, &raw); err != nil { - return err - } - if v, ok := raw["app"]; !ok || v == nil { - return fmt.Errorf("field app: required") - } - if v, ok := raw["hostname"]; !ok || v == nil { - return fmt.Errorf("field hostname: required") - } - if v, ok := raw["name"]; !ok || v == nil { - return fmt.Errorf("field name: required") - } - if v, ok := raw["port"]; !ok || v == nil { - return fmt.Errorf("field port: required") - } - type Plain DependencyEndpoint - var plain Plain - if err := json.Unmarshal(b, &plain); err != nil { - return err - } - *j = DependencyEndpoint(plain) - return nil -} - -// UnmarshalJSON implements json.Unmarshaler. -func (j *ObjectStoreConfig) UnmarshalJSON(b []byte) error { - var raw map[string]interface{} - if err := json.Unmarshal(b, &raw); err != nil { - return err - } - if v, ok := raw["hostname"]; !ok || v == nil { - return fmt.Errorf("field hostname: required") - } - if v, ok := raw["port"]; !ok || v == nil { - return fmt.Errorf("field port: required") - } - if v, ok := raw["tls"]; !ok || v == nil { - return fmt.Errorf("field tls: required") - } - type Plain ObjectStoreConfig - var plain Plain - if err := json.Unmarshal(b, &plain); err != nil { - return err - } - *j = ObjectStoreConfig(plain) - return nil -} - -// UnmarshalJSON implements json.Unmarshaler. -func (j *DatabaseConfig) UnmarshalJSON(b []byte) error { - var raw map[string]interface{} - if err := json.Unmarshal(b, &raw); err != nil { - return err - } - if v, ok := raw["adminPassword"]; !ok || v == nil { - return fmt.Errorf("field adminPassword: required") - } - if v, ok := raw["adminUsername"]; !ok || v == nil { - return fmt.Errorf("field adminUsername: required") - } - if v, ok := raw["hostname"]; !ok || v == nil { - return fmt.Errorf("field hostname: required") - } - if v, ok := raw["name"]; !ok || v == nil { - return fmt.Errorf("field name: required") - } - if v, ok := raw["password"]; !ok || v == nil { - return fmt.Errorf("field password: required") - } - if v, ok := raw["port"]; !ok || v == nil { - return fmt.Errorf("field port: required") - } - if v, ok := raw["sslMode"]; !ok || v == nil { - return fmt.Errorf("field sslMode: required") - } - if v, ok := raw["username"]; !ok || v == nil { - return fmt.Errorf("field username: required") - } - type Plain DatabaseConfig - var plain Plain - if err := json.Unmarshal(b, &plain); err != nil { - return err - } - *j = DatabaseConfig(plain) - return nil -} - -// UnmarshalJSON implements json.Unmarshaler. -func (j *PrivateDependencyEndpoint) UnmarshalJSON(b []byte) error { - var raw map[string]interface{} - if err := json.Unmarshal(b, &raw); err != nil { - return err - } - if v, ok := raw["app"]; !ok || v == nil { - return fmt.Errorf("field app: required") - } - if v, ok := raw["hostname"]; !ok || v == nil { - return fmt.Errorf("field hostname: required") - } - if v, ok := raw["name"]; !ok || v == nil { - return fmt.Errorf("field name: required") - } - if v, ok := raw["port"]; !ok || v == nil { - return fmt.Errorf("field port: required") - } - type Plain PrivateDependencyEndpoint - var plain Plain - if err := json.Unmarshal(b, &plain); err != nil { - return err - } - *j = PrivateDependencyEndpoint(plain) - return nil -} - var enumValues_BrokerConfigAuthtype = []interface{}{ "mtls", "sasl",