Skip to content

Commit

Permalink
adding field descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
Integralist committed Nov 3, 2022
1 parent 187cf99 commit bf2d7e3
Show file tree
Hide file tree
Showing 57 changed files with 2,012 additions and 1,074 deletions.
74 changes: 51 additions & 23 deletions fastly/acl_entry.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,18 @@ func (s entriesByID) Less(i, j int) bool {

// ListACLEntriesInput is the input parameter to ListACLEntries function.
type ListACLEntriesInput struct {
ACLID string
// ACLID is an alphanumeric string identifying a ACL.
ACLID string
// Direction is the direction in which to sort results.
Direction string
Page int
PerPage int
// Page is the current page.
Page int
// PerPage is the number of records per page.
PerPage int
// ServiceID is an alphanumeric string identifying the service.
ServiceID string
Sort string
// Sort is the field on which to sort.
Sort string
}

// ListACLEntries retrieves all resources.
Expand Down Expand Up @@ -236,12 +242,18 @@ func (c *Client) GetACLEntry(i *GetACLEntryInput) (*ACLEntry, error) {

// CreateACLEntryInput is the input parameter to the CreateACLEntry function.
type CreateACLEntryInput struct {
ACLID string
IP string `url:"ip"`
// ACLID is an alphanumeric string identifying a ACL.
ACLID string
// Comment is a freeform descriptive note.
Comment string `url:"comment,omitempty"`
// IP is an IP address.
IP string `url:"ip"`
// Negated is whether to negate the match. Useful primarily when creating individual exceptions to larger subnets.
Negated Compatibool `url:"negated,omitempty"`
// ServiceID is an alphanumeric string identifying the service.
ServiceID string
Comment string `url:"comment,omitempty"`
Negated Compatibool `url:"negated,omitempty"`
Subnet int `url:"subnet,omitempty"`
// Subnet is a number of bits for the subnet mask applied to the IP address.
Subnet int `url:"subnet,omitempty"`
}

// CreateACLEntry creates a new resource.
Expand Down Expand Up @@ -317,13 +329,20 @@ func (c *Client) DeleteACLEntry(i *DeleteACLEntryInput) error {

// UpdateACLEntryInput is the input parameter to UpdateACLEntry function.
type UpdateACLEntryInput struct {
ACLID string
Comment *string `url:"comment,omitempty"`
ID string
IP *string `url:"ip,omitempty"`
Negated *Compatibool `url:"negated,omitempty"`
// ACLID is an alphanumeric string identifying a ACL.
ACLID string
// Comment is a freeform descriptive note.
Comment *string `url:"comment,omitempty"`
// ID is an alphanumeric string identifying an ACL Entry.
ID string
// IP is an IP address.
IP *string `url:"ip,omitempty"`
// Negated is whether to negate the match. Useful primarily when creating individual exceptions to larger subnets.
Negated *Compatibool `url:"negated,omitempty"`
// ServiceID is an alphanumeric string identifying the service.
ServiceID string
Subnet *int `url:"subnet,omitempty"`
// Subnet is a number of bits for the subnet mask applied to the IP address.
Subnet *int `url:"subnet,omitempty"`
}

// UpdateACLEntry updates the specified resource.
Expand Down Expand Up @@ -359,19 +378,28 @@ func (c *Client) UpdateACLEntry(i *UpdateACLEntryInput) (*ACLEntry, error) {
// BatchModifyACLEntriesInput is the input parameter to the
// BatchModifyACLEntries function.
type BatchModifyACLEntriesInput struct {
ACLID string `json:"-"`
Entries []*BatchACLEntry `json:"entries"`
ServiceID string `json:"-"`
// ACLID is an alphanumeric string identifying a ACL.
ACLID string `json:"-"`
// Entries is a list of ACL entries.
Entries []*BatchACLEntry `json:"entries"`
// ServiceID is an alphanumeric string identifying the service.
ServiceID string `json:"-"`
}

// BatchACLEntry represents a single ACL entry.
type BatchACLEntry struct {
Comment *string `json:"comment,omitempty"`
ID *string `json:"id,omitempty"`
IP *string `json:"ip,omitempty"`
Negated *Compatibool `json:"negated,omitempty"`
// Comment is a freeform descriptive note.
Comment *string `json:"comment,omitempty"`
// ID is an alphanumeric string identifying an ACL Entry.
ID *string `json:"id,omitempty"`
// IP is an IP address.
IP *string `json:"ip,omitempty"`
// Negated is whether to negate the match. Useful primarily when creating individual exceptions to larger subnets.
Negated *Compatibool `json:"negated,omitempty"`
// Operation is a batching operation variant.
Operation BatchOperation `json:"op"`
Subnet *int `json:"subnet,omitempty"`
// Subnet is the number of bits for the subnet mask applied to the IP address.
Subnet *int `json:"subnet,omitempty"`
}

// BatchModifyACLEntries updates the specified resources.
Expand Down
155 changes: 103 additions & 52 deletions fastly/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,36 +94,63 @@ func (c *Client) ListBackends(i *ListBackendsInput) ([]*Backend, error) {

// CreateBackendInput is used as input to the CreateBackend function.
type CreateBackendInput struct {
Address string `url:"address,omitempty"`
AutoLoadbalance Compatibool `url:"auto_loadbalance,omitempty"`
BetweenBytesTimeout *uint `url:"between_bytes_timeout,omitempty"`
Comment string `url:"comment,omitempty"`
ConnectTimeout *uint `url:"connect_timeout,omitempty"`
ErrorThreshold *uint `url:"error_threshold,omitempty"`
FirstByteTimeout *uint `url:"first_byte_timeout,omitempty"`
HealthCheck string `url:"healthcheck,omitempty"`
MaxConn *uint `url:"max_conn,omitempty"`
MaxTLSVersion string `url:"max_tls_version,omitempty"`
MinTLSVersion string `url:"min_tls_version,omitempty"`
Name string `url:"name,omitempty"`
OverrideHost string `url:"override_host,omitempty"`
Port uint `url:"port,omitempty"`
RequestCondition string `url:"request_condition,omitempty"`
SSLCACert string `url:"ssl_ca_cert,omitempty"`
SSLCertHostname string `url:"ssl_cert_hostname,omitempty"`
SSLCheckCert *Compatibool `url:"ssl_check_cert,omitempty"`
SSLCiphers string `url:"ssl_ciphers,omitempty"`
SSLClientCert string `url:"ssl_client_cert,omitempty"`
SSLClientKey string `url:"ssl_client_key,omitempty"`
SSLHostname string `url:"ssl_hostname,omitempty"`
SSLSNIHostname string `url:"ssl_sni_hostname,omitempty"`
// Address is a hostname, IPv4, or IPv6 address for the backend.
Address string `url:"address,omitempty"`
// AutoLoadbalance is whether or not this backend should be automatically load balanced.
AutoLoadbalance Compatibool `url:"auto_loadbalance,omitempty"`
// BetweenBytesTimeout is the maximum duration in milliseconds that Fastly will wait while receiving no data on a download from a backend.
BetweenBytesTimeout *uint `url:"between_bytes_timeout,omitempty"`
// Comment is a freeform descriptive note.
Comment string `url:"comment,omitempty"`
// ConnectTimeout is the maximum duration in milliseconds to wait for a connection to this backend to be established.
ConnectTimeout *uint `url:"connect_timeout,omitempty"`
// ErrorThreshold is the number of errors to allow before the Backend is marked as down.
ErrorThreshold *uint `url:"error_threshold,omitempty"`
// FirstByteTimeout is how long to wait for the first bytes in milliseconds.
FirstByteTimeout *uint `url:"first_byte_timeout,omitempty"`
// HealthCheck is the name of the healthcheck to use with this backend.
HealthCheck string `url:"healthcheck,omitempty"`
// MaxConn is the maximum number of concurrent connections this backend will accept.
MaxConn *uint `url:"max_conn,omitempty"`
// MaxTLSVersion is the maximum allowed TLS version on SSL connections to this backend.
MaxTLSVersion string `url:"max_tls_version,omitempty"`
// MinTLSVersion is the minimum allowed TLS version on SSL connections to this backend.
MinTLSVersion string `url:"min_tls_version,omitempty"`
// Name is the name of the backend.
Name string `url:"name,omitempty"`
// OverrideHost is, if set, will replace the client-supplied HTTP Host header on connections to this backend.
OverrideHost string `url:"override_host,omitempty"`
// Port is the port on which the backend server is listening for connections from Fastly.
Port uint `url:"port,omitempty"`
// RequestCondition is the name of a Condition, which if satisfied, will select this backend during a request.
RequestCondition string `url:"request_condition,omitempty"`
// SSLCACert is a CA certificate attached to origin.
SSLCACert string `url:"ssl_ca_cert,omitempty"`
// SSLCertHostname is an overrides ssl_hostname, but only for cert verification.
SSLCertHostname string `url:"ssl_cert_hostname,omitempty"`
// SSLCheckCert forces being strict on checking SSL certs.
SSLCheckCert *Compatibool `url:"ssl_check_cert,omitempty"`
// SSLCiphers is a list of OpenSSL ciphers to support for connections to this origin.
SSLCiphers string `url:"ssl_ciphers,omitempty"`
// SSLClientCert is a client certificate attached to origin.
SSLClientCert string `url:"ssl_client_cert,omitempty"`
// SSLClientKey is a client key attached to origin.
SSLClientKey string `url:"ssl_client_key,omitempty"`
// SSLHostname is used for both SNI during the TLS handshake and to validate the cert.
// Deprecated: Use ssl_cert_hostname and ssl_sni_hostname to configure certificate validation.
SSLHostname string `url:"ssl_hostname,omitempty"`
// SSLSNIHostname overrides ssl_hostname, but only for SNI in the handshake. Does not affect cert validation at all.
SSLSNIHostname string `url:"ssl_sni_hostname,omitempty"`
// ServiceID is the ID of the service (required).
ServiceID string
// ServiceVersion is the specific configuration version (required).
ServiceVersion int
Shield string `url:"shield,omitempty"`
UseSSL Compatibool `url:"use_ssl,omitempty"`
Weight *uint `url:"weight,omitempty"`
// Shield is an identifier of the POP to use as a shield.
Shield string `url:"shield,omitempty"`
// UseSSL indicates whether or not to require TLS for connections to this backend.
UseSSL Compatibool `url:"use_ssl,omitempty"`
// Weight is the weight used to load balance this backend against others.
Weight *uint `url:"weight,omitempty"`
}

// CreateBackend creates a new resource.
Expand Down Expand Up @@ -190,37 +217,61 @@ func (c *Client) GetBackend(i *GetBackendInput) (*Backend, error) {

// UpdateBackendInput is used as input to the UpdateBackend function.
type UpdateBackendInput struct {
Address *string `url:"address,omitempty"`
AutoLoadbalance *Compatibool `url:"auto_loadbalance,omitempty"`
BetweenBytesTimeout *uint `url:"between_bytes_timeout,omitempty"`
Comment *string `url:"comment,omitempty"`
ConnectTimeout *uint `url:"connect_timeout,omitempty"`
ErrorThreshold *uint `url:"error_threshold,omitempty"`
FirstByteTimeout *uint `url:"first_byte_timeout,omitempty"`
HealthCheck *string `url:"healthcheck,omitempty"`
MaxConn *uint `url:"max_conn,omitempty"`
MaxTLSVersion *string `url:"max_tls_version,omitempty"`
MinTLSVersion *string `url:"min_tls_version,omitempty"`
// Address is a hostname, IPv4, or IPv6 address for the backend.
Address *string `url:"address,omitempty"`
// AutoLoadbalance is whether or not this backend should be automatically load balanced.
AutoLoadbalance *Compatibool `url:"auto_loadbalance,omitempty"`
// BetweenBytesTimeout is the maximum duration in milliseconds that Fastly will wait while receiving no data on a download from a backend.
BetweenBytesTimeout *uint `url:"between_bytes_timeout,omitempty"`
// Comment is a freeform descriptive note.
Comment *string `url:"comment,omitempty"`
// ConnectTimeout is the maximum duration in milliseconds to wait for a connection to this backend to be established.
ConnectTimeout *uint `url:"connect_timeout,omitempty"`
// ErrorThreshold is the number of errors to allow before the Backend is marked as down.
ErrorThreshold *uint `url:"error_threshold,omitempty"`
// FirstByteTimeout is how long to wait for the first bytes in milliseconds.
FirstByteTimeout *uint `url:"first_byte_timeout,omitempty"`
// HealthCheck is the name of the healthcheck to use with this backend.
HealthCheck *string `url:"healthcheck,omitempty"`
// MaxConn is the maximum number of concurrent connections this backend will accept.
MaxConn *uint `url:"max_conn,omitempty"`
// MaxTLSVersion is the maximum allowed TLS version on SSL connections to this backend.
MaxTLSVersion *string `url:"max_tls_version,omitempty"`
// MinTLSVersion is the minimum allowed TLS version on SSL connections to this backend.
MinTLSVersion *string `url:"min_tls_version,omitempty"`
// Name is the name of the backend to update.
Name string
NewName *string `url:"name,omitempty"`
OverrideHost *string `url:"override_host,omitempty"`
Port *uint `url:"port,omitempty"`
RequestCondition *string `url:"request_condition,omitempty"`
SSLCACert *string `url:"ssl_ca_cert,omitempty"`
SSLCertHostname *string `url:"ssl_cert_hostname,omitempty"`
SSLCheckCert *Compatibool `url:"ssl_check_cert,omitempty"`
SSLCiphers *string `url:"ssl_ciphers,omitempty"`
SSLClientCert *string `url:"ssl_client_cert,omitempty"`
SSLClientKey *string `url:"ssl_client_key,omitempty"`
SSLSNIHostname *string `url:"ssl_sni_hostname,omitempty"`
Name string
NewName *string `url:"name,omitempty"`
// OverrideHost is, if set, will replace the client-supplied HTTP Host header on connections to this backend.
OverrideHost *string `url:"override_host,omitempty"`
// Port is the port on which the backend server is listening for connections from Fastly.
Port *uint `url:"port,omitempty"`
// RequestCondition is the name of a Condition, which if satisfied, will select this backend during a request.
RequestCondition *string `url:"request_condition,omitempty"`
// SSLCACert is a CA certificate attached to origin.
SSLCACert *string `url:"ssl_ca_cert,omitempty"`
// SSLCertHostname is an overrides ssl_hostname, but only for cert verification.
SSLCertHostname *string `url:"ssl_cert_hostname,omitempty"`
// SSLCheckCert forces being strict on checking SSL certs.
SSLCheckCert *Compatibool `url:"ssl_check_cert,omitempty"`
// SSLCiphers is a list of OpenSSL ciphers to support for connections to this origin.
SSLCiphers *string `url:"ssl_ciphers,omitempty"`
// SSLClientCert is a client certificate attached to origin.
SSLClientCert *string `url:"ssl_client_cert,omitempty"`
// SSLClientKey is a client key attached to origin.
SSLClientKey *string `url:"ssl_client_key,omitempty"`
// SSLSNIHostname overrides ssl_hostname, but only for SNI in the handshake. Does not affect cert validation at all.
SSLSNIHostname *string `url:"ssl_sni_hostname,omitempty"`
// ServiceID is the ID of the service (required).
ServiceID string
// ServiceVersion is the specific configuration version (required).
ServiceVersion int
Shield *string `url:"shield,omitempty"`
UseSSL *Compatibool `url:"use_ssl,omitempty"`
Weight *uint `url:"weight,omitempty"`
// Shield is an identifier of the POP to use as a shield.
Shield *string `url:"shield,omitempty"`
// UseSSL indicates whether or not to require TLS for connections to this backend.
UseSSL *Compatibool `url:"use_ssl,omitempty"`
// Weight is the weight used to load balance this backend against others.
Weight *uint `url:"weight,omitempty"`
}

// UpdateBackend updates the specified resource.
Expand Down
Loading

0 comments on commit bf2d7e3

Please sign in to comment.