<commit_before>package brightbox

import (
	"context"
	"path"

	"github.com/brightbox/gobrightbox/v2/status/cloudip"
	"github.com/brightbox/gobrightbox/v2/status/mode"
	"github.com/brightbox/gobrightbox/v2/status/transportprotocol"
)

//go:generate ./generate_status_enum cloudip mapped unmapped
//go:generate ./generate_status_enum mode nat route
//go:generate ./generate_status_enum transportprotocol tcp udp

// CloudIP represents a Cloud IP
// https://api.gb1.brightbox.com/1.0/#cloud_ip
type CloudIP struct {
	ResourceRef
	ID              string
	Name            string
	PublicIP        string `json:"public_ip"`
	PublicIPv4      string `json:"public_ipv4"`
	PublicIPv6      string `json:"public_ipv6"`
	Status          cloudip.Status
	ReverseDNS      string `json:"reverse_dns"`
	Fqdn            string
	Mode            mode.Status
	Account         *Account
	Interface       *Interface
	Server          *Server
	ServerGroup     *ServerGroup     `json:"server_group"`
	PortTranslators []PortTranslator `json:"port_translators"`
	LoadBalancer    *LoadBalancer    `json:"load_balancer"`
	DatabaseServer  *DatabaseServer  `json:"database_server"`
}

// PortTranslator represents a port translator on a Cloud IP
type PortTranslator struct {
	Incoming uint16                   `json:"incoming"`
	Outgoing uint16                   `json:"outgoing"`
	Protocol transportprotocol.Status `json:"protocol"`
}

// CloudIPOptions is used in conjunction with CreateCloudIP and UpdateCloudIP to
// create and update cloud IPs.
type CloudIPOptions struct {
	ID              string           `json:"-"`
	ReverseDNS      *string          `json:"reverse_dns,omitempty"`
	Name            *string          `json:"name,omitempty"`
	PortTranslators []PortTranslator `json:"port_translators,omitempty"`
}

// CloudIPAttachment is used in conjunction with MapCloudIP to specify
// the destination the CloudIP should be mapped to
type CloudIPAttachment struct {
	Destination string `json:"destination"`
}

// MapCloudIP issues a request to map the cloud ip to the destination. The<commit_msg>Add mode to cloud ip create options<commit_after>package brightbox

import (
	"context"
	"path"

	"github.com/brightbox/gobrightbox/v2/status/cloudip"
	"github.com/brightbox/gobrightbox/v2/status/mode"
	"github.com/brightbox/gobrightbox/v2/status/transportprotocol"
)

//go:generate ./generate_status_enum cloudip mapped unmapped
//go:generate ./generate_status_enum mode nat route
//go:generate ./generate_status_enum transportprotocol tcp udp

// CloudIP represents a Cloud IP
// https://api.gb1.brightbox.com/1.0/#cloud_ip
type CloudIP struct {
	ResourceRef
	ID              string
	Name            string
	PublicIP        string `json:"public_ip"`
	PublicIPv4      string `json:"public_ipv4"`
	PublicIPv6      string `json:"public_ipv6"`
	Status          cloudip.Status
	ReverseDNS      string `json:"reverse_dns"`
	Fqdn            string
	Mode            mode.Status
	Account         *Account
	Interface       *Interface
	Server          *Server
	ServerGroup     *ServerGroup     `json:"server_group"`
	PortTranslators []PortTranslator `json:"port_translators"`
	LoadBalancer    *LoadBalancer    `json:"load_balancer"`
	DatabaseServer  *DatabaseServer  `json:"database_server"`
}

// PortTranslator represents a port translator on a Cloud IP
type PortTranslator struct {
	Incoming uint16                   `json:"incoming"`
	Outgoing uint16                   `json:"outgoing"`
	Protocol transportprotocol.Status `json:"protocol,omitempty"`
}

// CloudIPOptions is used in conjunction with CreateCloudIP and UpdateCloudIP to
// create and update cloud IPs.
type CloudIPOptions struct {
	ID              string           `json:"-"`
	ReverseDNS      *string          `json:"reverse_dns,omitempty"`
	Mode            mode.Status      `json:"mode,omitempty"`
	Name            *string          `json:"name,omitempty"`
	PortTranslators []PortTranslator `json:"port_translators,omitempty"`
}

// CloudIPAttachment is used in conjunction with MapCloudIP to specify
// the destination the CloudIP should be mapped to
type CloudIPAttachment struct {
	Destination string `json:"destination"`
}

// MapCloudIP issues a request to map the cloud ip to the destination. The
{'fraction_non_alphanumeric': 0.0883742911153119, 'fraction_numerical': 0.006616257088846881, 'mean_word_length': 3.25, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '756419', 'n_tokens_mistral': 1242, 'n_tokens_neox': 1225, 'n_words': 328}