<commit_before>/*
 * Copyright 2018, EnMasse authors.
 * License: Apache License 2.0 (see the file LICENSE or http://apache.org/licenses/LICENSE-2.0.html).
 */

package v1beta1

import (
	corev1 "k8s.io/api/core/v1"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

/*
 * Be careful with the comments in this file. The prefix "+" indicates that this is being processed
 * by the client generator. The location, empty lines, and other comments in this file may confuse
 * the generator, and produce a non-version version.
 */

// ** AddressSpace

// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

type AddressSpace struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   AddressSpaceSpec   `json:"spec"`
	Status AddressSpaceStatus `json:"status"`
}

type AddressSpaceSpec struct {
	Plan string `json:"plan"`
	Type string `json:"type"`

	AuthenticationService *AuthenticationService `json:"authenticationService,omitempty"`

	Endpoints  []EndpointSpec  `json:"endpoints,omitempty"`
	Connectors []ConnectorSpec `json:"connectors,omitempty"`
}

type AuthenticationService struct {
	Type string `json:"type,omitempty"`
	Name string `json:"name,omitempty"`

	Overrides *AuthenticationServiceSettings `json:"overrides,omitempty"`
}

type AuthenticationServiceSettings struct {
	Host  string `json:"host,omitempty"`
	Port  int    `json:"port,omitempty"`
	Realm string `json:"realm,omitempty"`

	CaCertSecret     *corev1.SecretReference `json:"caCertSecret,omitempty"`
	ClientCertSecret *corev1.SecretReference `json:"clientCertSecret,omitempty"`
}

type EndpointSpec struct {
	Name        string           `json:"name"`
	Service     string           `json:"service"`
	Certificate *CertificateSpec `json:"cert,omitempty"`
	Expose      *ExposeSpec      `json:"expose,omitempty"`
}

type CertificateSpec struct {
	Provider string `json:"provider"`
}

type ExposeSpec struct {
	Type                string `json:"route"`
	RouteServicePort    string `json:"routeServicePort"`
	RouteTlsTermination string `json:"routeTlsTermination"`
}

type ConnectorSpec struct {
	Name          string                   `json:"name"`
	EndpointHosts []ConnectorEndpointHost  `json:"endpointHosts"`
	Tls           ConnectorTlsSpec         `json:"tls,omitempty"`
	Credentials   ConnectorCredentialsSpec `json:"credentials,omitempty"`
	Addresses     []ConnectorAddressRule   `json:"addresses"`
}

type ConnectorEndpointHost struct {
	Host string `json:"host"`
	Port int    `json:"port,omitempty"`
}

type ConnectorTlsSpec struct {
	CaCert     StringOrSecretSelector `json:"caCert,omitempty"`
	ClientCert StringOrSecretSelector `json:"clientCert,omitempty"`
	ClientKey  StringOrSecretSelector `json:"clientKey,omitempty"`
}

type ConnectorCredentialsSpec struct {
	Username StringOrSecretSelector `json:"username"`
	Password StringOrSecretSelector `json:"password"`
}

type StringOrSecretSelector struct {
	Value           string            `json:"value,omitempty"`
	ValueFromSecret SecretKeySelector `json:"valueFromSecret,omitempty"`
}

type SecretKeySelector struct {
	Name string `json:"name"`
	Key  string `json:"key,omitempty"`
}

type ConnectorAddressRule struct {
	Name    string `json:"name"`
	Pattern string `json:"pattern"`
}

type AddressSpaceStatus struct {
	IsReady        bool              `json:"isReady"`
	Messages       []string          `json:"messages,omitempty"`
	CACertificate  []byte            `json:"caCert,omitempty"`
	EndpointStatus []EndpointStatus  `json:"endpointStatuses,omitempty"`
	Connectors     []ConnectorStatus `json:"connectors,omitempty"`
}

type EndpointStatus struct {
	Name        string `json:"name"`
	Certificate []byte `json:"cert,omitempty"`

	ServiceHost  string `json:"serviceHost"`
	ServicePorts []Port `json:"servicePorts,omitempty"`

	ExternalHost  string `json:"externalHost"`
	ExternalPorts []Port `json:"externalPorts,omitempty"`
}

type Port struct {
	Name string `json:"name"`
	Port uint16 `json:"port"`<commit_msg>add the missing Phase field to Go AddressSpaceStatus (#3472)<commit_after>/*
 * Copyright 2018, EnMasse authors.
 * License: Apache License 2.0 (see the file LICENSE or http://apache.org/licenses/LICENSE-2.0.html).
 */

package v1beta1

import (
	corev1 "k8s.io/api/core/v1"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

/*
 * Be careful with the comments in this file. The prefix "+" indicates that this is being processed
 * by the client generator. The location, empty lines, and other comments in this file may confuse
 * the generator, and produce a non-version version.
 */

// ** AddressSpace

// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

type AddressSpace struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   AddressSpaceSpec   `json:"spec"`
	Status AddressSpaceStatus `json:"status"`
}

type AddressSpaceSpec struct {
	Plan string `json:"plan"`
	Type string `json:"type"`

	AuthenticationService *AuthenticationService `json:"authenticationService,omitempty"`

	Endpoints  []EndpointSpec  `json:"endpoints,omitempty"`
	Connectors []ConnectorSpec `json:"connectors,omitempty"`
}

type AuthenticationService struct {
	Type string `json:"type,omitempty"`
	Name string `json:"name,omitempty"`

	Overrides *AuthenticationServiceSettings `json:"overrides,omitempty"`
}

type AuthenticationServiceSettings struct {
	Host  string `json:"host,omitempty"`
	Port  int    `json:"port,omitempty"`
	Realm string `json:"realm,omitempty"`

	CaCertSecret     *corev1.SecretReference `json:"caCertSecret,omitempty"`
	ClientCertSecret *corev1.SecretReference `json:"clientCertSecret,omitempty"`
}

type EndpointSpec struct {
	Name        string           `json:"name"`
	Service     string           `json:"service"`
	Certificate *CertificateSpec `json:"cert,omitempty"`
	Expose      *ExposeSpec      `json:"expose,omitempty"`
}

type CertificateSpec struct {
	Provider string `json:"provider"`
}

type ExposeSpec struct {
	Type                string `json:"route"`
	RouteServicePort    string `json:"routeServicePort"`
	RouteTlsTermination string `json:"routeTlsTermination"`
}

type ConnectorSpec struct {
	Name          string                   `json:"name"`
	EndpointHosts []ConnectorEndpointHost  `json:"endpointHosts"`
	Tls           ConnectorTlsSpec         `json:"tls,omitempty"`
	Credentials   ConnectorCredentialsSpec `json:"credentials,omitempty"`
	Addresses     []ConnectorAddressRule   `json:"addresses"`
}

type ConnectorEndpointHost struct {
	Host string `json:"host"`
	Port int    `json:"port,omitempty"`
}

type ConnectorTlsSpec struct {
	CaCert     StringOrSecretSelector `json:"caCert,omitempty"`
	ClientCert StringOrSecretSelector `json:"clientCert,omitempty"`
	ClientKey  StringOrSecretSelector `json:"clientKey,omitempty"`
}

type ConnectorCredentialsSpec struct {
	Username StringOrSecretSelector `json:"username"`
	Password StringOrSecretSelector `json:"password"`
}

type StringOrSecretSelector struct {
	Value           string            `json:"value,omitempty"`
	ValueFromSecret SecretKeySelector `json:"valueFromSecret,omitempty"`
}

type SecretKeySelector struct {
	Name string `json:"name"`
	Key  string `json:"key,omitempty"`
}

type ConnectorAddressRule struct {
	Name    string `json:"name"`
	Pattern string `json:"pattern"`
}

type AddressSpaceStatus struct {
	IsReady        bool              `json:"isReady"`
	Phase          string            `json:"phase,omitempty"`
	Messages       []string          `json:"messages,omitempty"`
	CACertificate  []byte            `json:"caCert,omitempty"`
	EndpointStatus []EndpointStatus  `json:"endpointStatuses,omitempty"`
	Connectors     []ConnectorStatus `json:"connectors,omitempty"`
}

type EndpointStatus struct {
	Name        string `json:"name"`
	Certificate []byte `json:"cert,omitempty"`

	ServiceHost  string `json:"serviceHost"`
	ServicePorts []Port `json:"servicePorts,omitempty"`

	ExternalHost  string `json:"externalHost"`
	ExternalPorts []Port `json:"externalPorts,omitempty"`
}

type Port struct {
	Name string `json:"name"`
	Port uint16 `json:"port"`
{'fraction_non_alphanumeric': 0.11240786240786241, 'fraction_numerical': 0.0063882063882063885, 'mean_word_length': 4.753356890459364, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6324164', 'n_tokens_mistral': 2354, 'n_tokens_neox': 2327, 'n_words': 572}