From d651e6b415018eff02fda5b10c880daecfa1e212 Mon Sep 17 00:00:00 2001
From: "ngrok-bors-ng[bot]"
<52465704+ngrok-bors-ng[bot]@users.noreply.github.com>
Date: Mon, 14 Mar 2022 20:54:24 +0000
Subject: [PATCH] cut new release for terraform-provider-ngrok
---
.github/workflows/release.yml | 2 +-
CHANGELOG.md | 6 +
docs/resources/agent_ingress.md | 42 +
docs/resources/endpoint_configuration.md | 5 +-
docs/resources/event_destination.md | 12 +-
docs/resources/event_subscription.md | 8 +-
docs/resources/ip_policy.md | 5 +-
docs/resources/ip_policy_rule.md | 3 +-
docs/resources/ip_restriction.md | 6 +-
docs/resources/ip_whitelist_entry.md | 34 -
docs/resources/reserved_domain.md | 3 +-
docs/resources/ssh_host_certificate.md | 4 +-
docs/resources/ssh_user_certificate.md | 4 +-
.../resources/ngrok_agent_ingress/resource.tf | 6 +
.../ngrok_event_subscription/resource.tf | 6 +-
.../ngrok_ip_policy_rule/resource.tf | 2 +-
.../ngrok_ip_restriction/resource.tf | 2 +-
.../ngrok_ip_whitelist_entry/resource.tf | 6 -
.../ngrok_reserved_domain/resource.tf | 2 +-
.../ngrok_ssh_host_certificate/resource.tf | 4 +-
.../ngrok_ssh_user_certificate/resource.tf | 4 +-
go.mod | 81 +-
ngrok/flatten_expand.go | 5072 ++++++++++++-----
ngrok/provider.go | 2 +-
ngrok/resource_agent_ingress.go | 185 +
...test.go => resource_agent_ingress_test.go} | 34 +-
ngrok/resource_api_key_test.go | 2 +-
ngrok/resource_certificate_authority_test.go | 2 +-
ngrok/resource_credential_test.go | 2 +-
ngrok/resource_endpoint_configuration.go | 13 +-
ngrok/resource_endpoint_configuration_test.go | 2 +-
ngrok/resource_event_destination.go | 36 +-
ngrok/resource_event_destination_test.go | 2 +-
ngrok/resource_event_subscription.go | 2 +-
ngrok/resource_event_subscription_test.go | 10 +-
ngrok/resource_ip_policy.go | 8 +-
ngrok/resource_ip_policy_rule.go | 13 +
ngrok/resource_ip_policy_rule_test.go | 4 +-
ngrok/resource_ip_policy_test.go | 2 +-
ngrok/resource_ip_restriction.go | 2 +-
ngrok/resource_ip_restriction_test.go | 6 +-
ngrok/resource_ip_whitelist_entry.go | 143 -
ngrok/resource_reserved_addr.go | 6 +-
ngrok/resource_reserved_addr_test.go | 4 +-
ngrok/resource_reserved_domain.go | 10 +
ngrok/resource_reserved_domain_test.go | 8 +-
...resource_ssh_certificate_authority_test.go | 2 +-
ngrok/resource_ssh_credential_test.go | 2 +-
ngrok/resource_ssh_host_certificate_test.go | 6 +-
ngrok/resource_ssh_user_certificate_test.go | 6 +-
ngrok/resource_tls_certificate_test.go | 2 +-
restapi/debug.go | 2 +
restapi/methods.go | 2773 ++++++---
restapi/resources.go | 626 +-
54 files changed, 6673 insertions(+), 2563 deletions(-)
create mode 100644 docs/resources/agent_ingress.md
delete mode 100644 docs/resources/ip_whitelist_entry.md
create mode 100644 examples/resources/ngrok_agent_ingress/resource.tf
delete mode 100644 examples/resources/ngrok_ip_whitelist_entry/resource.tf
create mode 100644 ngrok/resource_agent_ingress.go
rename ngrok/{resource_ip_whitelist_entry_test.go => resource_agent_ingress_test.go} (56%)
delete mode 100644 ngrok/resource_ip_whitelist_entry.go
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index bb8d0b5..5b4b2af 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -21,7 +21,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v2
with:
- go-version: 1.16
+ go-version: 1.17
- name: Import GPG key
id: import_gpg
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 4fc532b..1e97d63 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,9 @@
+## 0.1.4 (Unreleased)
+
+ENHANCEMENTS:
+
+* Added `nameid_format` field to the SAML endpoint configuration.
+
## 0.1.3 (July 13, 2021)
FIXED:
diff --git a/docs/resources/agent_ingress.md b/docs/resources/agent_ingress.md
new file mode 100644
index 0000000..d16fea4
--- /dev/null
+++ b/docs/resources/agent_ingress.md
@@ -0,0 +1,42 @@
+---
+# generated by https://github.com/hashicorp/terraform-plugin-docs
+page_title: "ngrok_agent_ingress Resource - terraform-provider-ngrok"
+subcategory: ""
+description: |-
+
+---
+
+# ngrok_agent_ingress (Resource)
+
+
+
+## Example Usage
+
+```terraform
+resource "ngrok_agent_ingress" "example" {
+ description = "acme devices"
+ domain = "connect.acme.com"
+}
+```
+
+
+## Schema
+
+### Required
+
+- **domain** (String) the domain that you own to be used as the base domain name to generate regional agent ingress domains.
+
+### Optional
+
+- **description** (String) human-readable description of the use of this Agent Ingress. optional, max 255 bytes.
+- **metadata** (String) arbitrary user-defined machine-readable data of this Agent Ingress. optional, max 4096 bytes
+- **uri** (String) URI to the API resource of this Agent ingress
+
+### Read-Only
+
+- **created_at** (String) timestamp when the Agent Ingress was created, RFC 3339 format
+- **id** (String) unique Agent Ingress resource identifier
+- **ns_targets** (List of String) a list of target values to use as the values of NS records for the domain property these values will delegate control over the domain to ngrok
+- **region_domains** (List of String) a list of regional agent ingress domains that are subdomains of the value of domain this value may increase over time as ngrok adds more regions
+
+
diff --git a/docs/resources/endpoint_configuration.md b/docs/resources/endpoint_configuration.md
index 3117392..0cb6602 100644
--- a/docs/resources/endpoint_configuration.md
+++ b/docs/resources/endpoint_configuration.md
@@ -77,7 +77,7 @@ Optional:
Optional:
- **allow_options** (Boolean) true or false indicating whether to allow OPTIONS requests through without authentication which is necessary for CORS. default is `false`
-- **auth_provider_id** (String) determines how the basic auth credentials are validated. Currently only the value `agent` is supported which means that credentials will be validated against the username and password specified by the ngrok agent's `-auth` flag, if any.
+- **auth_provider_id** (String) determines how the basic auth credentials are validated. Currently only the value `agent` is supported which means that credentials will be validated against the username and password specified by the ngrok agent's `--basic-auth` flag, if any.
- **enabled** (Boolean) `true` if the module will be applied to traffic, `false` to disable. default `true` if unspecified
- **realm** (String) an arbitrary string to be specified in as the 'realm' value in the `WWW-Authenticate` header. default is `ngrok`
@@ -285,6 +285,7 @@ Optional:
- **inactivity_timeout** (Number) Integer number of seconds of inactivity after which if the user has not accessed the endpoint, their session will time out and they will be forced to reauthenticate.
- **maximum_duration** (Number) Integer number of seconds of the maximum duration of an authenticated session. After this period is exceeded, a user must reauthenticate.
- **metadata_url** (String) A public URL where the SP's metadata is hosted. If an IdP supports dynamic configuration, this is the URL it can use to retrieve the SP metadata.
+- **nameid_format** (String) Defines the name identifier format the SP expects the IdP to use in its assertions to identify subjects. If unspecified, a default value of `urn:oasis:names:tc:SAML:2.0:nameid-format:persistent` will be used. A subset of the allowed values enumerated by the SAML specification are supported.
- **options_passthrough** (Boolean) Do not enforce authentication on HTTP OPTIONS requests. necessary if you are supporting CORS.
- **request_signing_certificate_pem** (String) PEM-encoded x.509 certificate of the key pair that is used to sign all SAML requests that the ngrok SP makes to the IdP. Many IdPs do not support request signing verification, but we highly recommend specifying this in the IdP's configuration if it is supported.
- **single_logout_url** (String) The public URL of the SP's Single Logout Service. This is where the IdP will redirect to during a single logout flow. This will optionally need to be specified to the IdP as configuration.
@@ -306,7 +307,7 @@ Optional:
Optional:
- **enabled** (Boolean) `true` if the module will be applied to traffic, `false` to disable. default `true` if unspecified
-- **provider** (String) a string indicating which webhook provider will be sending webhooks to this endpoint. Value must be one of the supported providers: `SLACK`, `SNS`, `STRIPE`, `GITHUB`, `TWILIO`, `SHOPIFY`, `GITLAB`, `INTERCOM`.
+- **provider** (String) a string indicating which webhook provider will be sending webhooks to this endpoint. Value must be one of the supported providers: `SLACK`, `SNS`, `STRIPE`, `GITHUB`, `TWILIO`, `SHOPIFY`, `GITLAB`, `INTERCOM`, `SENDGRID`, `XERO`, `PAGERDUTY`.
- **secret** (String, Sensitive) a string secret used to validate requests from the given provider. All providers except AWS SNS require a secret
diff --git a/docs/resources/event_destination.md b/docs/resources/event_destination.md
index b9eed8f..8ef48e5 100644
--- a/docs/resources/event_destination.md
+++ b/docs/resources/event_destination.md
@@ -71,7 +71,7 @@ Optional:
### Nested Schema for `target.cloudwatch_logs.auth.role`
-Optional:
+Required:
- **aws_access_key_id** (String) The ID portion of an AWS access key.
- **aws_secret_access_key** (String) The secret portion of an AWS access key.
@@ -80,7 +80,7 @@ Optional:
### Nested Schema for `target.cloudwatch_logs.auth.role`
-Optional:
+Required:
- **role_arn** (String) An ARN that specifies the role that ngrok should use to deliver to the configured target.
@@ -115,7 +115,7 @@ Optional:
### Nested Schema for `target.firehose.auth.role`
-Optional:
+Required:
- **aws_access_key_id** (String) The ID portion of an AWS access key.
- **aws_secret_access_key** (String) The secret portion of an AWS access key.
@@ -124,7 +124,7 @@ Optional:
### Nested Schema for `target.firehose.auth.role`
-Optional:
+Required:
- **role_arn** (String) An ARN that specifies the role that ngrok should use to deliver to the configured target.
@@ -150,7 +150,7 @@ Optional:
### Nested Schema for `target.kinesis.auth.role`
-Optional:
+Required:
- **aws_access_key_id** (String) The ID portion of an AWS access key.
- **aws_secret_access_key** (String) The secret portion of an AWS access key.
@@ -159,7 +159,7 @@ Optional:
### Nested Schema for `target.kinesis.auth.role`
-Optional:
+Required:
- **role_arn** (String) An ARN that specifies the role that ngrok should use to deliver to the configured target.
diff --git a/docs/resources/event_subscription.md b/docs/resources/event_subscription.md
index 2dfd078..8d98047 100644
--- a/docs/resources/event_subscription.md
+++ b/docs/resources/event_subscription.md
@@ -14,11 +14,11 @@ description: |-
```terraform
resource "ngrok_event_subscription" "example" {
- description = "low sampling, basic HTTP logs"
- destination_ids = [ "ed_1ro7aylyqQ1LLMWNWrOISvlfveQ" ]
+ description = "ip policy creations"
+ destination_ids = [ "ed_25auH2H0JNlDGXUH01Z3sZdgFFM" ]
metadata = "{\"environment\": \"staging\"}"
sources [ {
- type = "http_request_complete"
+ type = "ip_policy_created.v0"
} ]
}
```
@@ -29,7 +29,7 @@ resource "ngrok_event_subscription" "example" {
### Optional
- **description** (String) Arbitrary customer supplied information intended to be human readable. Optional, max 255 chars.
-- **destination_ids** (List of String) A list of Event Destination IDs which should be used for this Event Stream. Event Streams are required to have at least one Event Destination.
+- **destination_ids** (List of String) A list of Event Destination IDs which should be used for this Event Subscription.
- **id** (String) Unique identifier for this Event Subscription.
- **metadata** (String) Arbitrary customer supplied information intended to be machine readable. Optional, max 4096 chars.
- **sources** (Block List) Sources containing the types for which this event subscription will trigger (see [below for nested schema](#nestedblock--sources))
diff --git a/docs/resources/ip_policy.md b/docs/resources/ip_policy.md
index 3fda623..9006915 100644
--- a/docs/resources/ip_policy.md
+++ b/docs/resources/ip_policy.md
@@ -28,12 +28,9 @@ resource "ngrok_ip_policy" "example" {
## Schema
-### Required
-
-- **action** (String) the IP policy action. Supported values are `allow` or `deny`
-
### Optional
+- **action** (String) this field is deprecated. Please leave it empty and use the ip policy rule object's "action" field instead. It is temporarily retained for backwards compatibility reasons.
- **description** (String) human-readable description of the source IPs of this IP policy. optional, max 255 bytes.
- **metadata** (String) arbitrary user-defined machine-readable data of this IP policy. optional, max 4096 bytes.
diff --git a/docs/resources/ip_policy_rule.md b/docs/resources/ip_policy_rule.md
index cf281df..f0998ab 100644
--- a/docs/resources/ip_policy_rule.md
+++ b/docs/resources/ip_policy_rule.md
@@ -18,7 +18,7 @@ IP Policy Rules are the IPv4 or IPv6 CIDRs entries that
resource "ngrok_ip_policy_rule" "example" {
cidr = "212.3.14.0/24"
description = "nyc office"
- ip_policy_id = "ipp_1rV56VrAxesFteoj4XZxaaYyvXo"
+ ip_policy_id = "ipp_25auGv9R7vPmi6NKs5Cxcyzc2Cm"
}
```
@@ -32,6 +32,7 @@ resource "ngrok_ip_policy_rule" "example" {
### Optional
+- **action** (String) the action to apply to the policy rule, either `allow` or `deny`
- **description** (String) human-readable description of the source IPs of this IP rule. optional, max 255 bytes.
- **id** (String) unique identifier for this IP policy rule
- **metadata** (String) arbitrary user-defined machine-readable data of this IP policy rule. optional, max 4096 bytes.
diff --git a/docs/resources/ip_restriction.md b/docs/resources/ip_restriction.md
index 2161e19..edb31e4 100644
--- a/docs/resources/ip_restriction.md
+++ b/docs/resources/ip_restriction.md
@@ -4,7 +4,7 @@ page_title: "ngrok_ip_restriction Resource - terraform-provider-ngrok"
subcategory: ""
description: |-
An IP restriction is a restriction placed on the CIDRs that are allowed to
- initate traffic to a specific aspect of your ngrok account. An IP
+ initiate traffic to a specific aspect of your ngrok account. An IP
restriction has a type which defines the ingress it applies to. IP
restrictions can be used to enforce the source IPs that can make API
requests, log in to the dashboard, start ngrok agents, and connect to your
@@ -14,7 +14,7 @@ description: |-
# ngrok_ip_restriction (Resource)
An IP restriction is a restriction placed on the CIDRs that are allowed to
- initate traffic to a specific aspect of your ngrok account. An IP
+ initiate traffic to a specific aspect of your ngrok account. An IP
restriction has a type which defines the ingress it applies to. IP
restrictions can be used to enforce the source IPs that can make API
requests, log in to the dashboard, start ngrok agents, and connect to your
@@ -24,7 +24,7 @@ An IP restriction is a restriction placed on the CIDRs that are allowed to
```terraform
resource "ngrok_ip_restriction" "example" {
- ip_policy_ids = [ "ipp_1rV5CMI1Aw8MiqWtjlQCyDDEWnQ" ]
+ ip_policy_ids = [ "ipp_25auGwa4eEWUeCOBfCZkwtwqFey" ]
type = "dashboard"
}
```
diff --git a/docs/resources/ip_whitelist_entry.md b/docs/resources/ip_whitelist_entry.md
deleted file mode 100644
index 8dca149..0000000
--- a/docs/resources/ip_whitelist_entry.md
+++ /dev/null
@@ -1,34 +0,0 @@
----
-# generated by https://github.com/hashicorp/terraform-plugin-docs
-page_title: "ngrok_ip_whitelist_entry Resource - terraform-provider-ngrok"
-subcategory: ""
-description: |-
- The IP Whitelist is deprecated and will be removed. Use an IP Restriction
- with an endpoints type instead.
----
-
-# ngrok_ip_whitelist_entry (Resource)
-
-The IP Whitelist is deprecated and will be removed. Use an IP Restriction
- with an `endpoints` type instead.
-
-## Example Usage
-
-```terraform
-resource "ngrok_ip_whitelist_entry" "example" {
- description = "outbound proxy servers"
- ip_net = "10.1.1.0/24"
-}
-```
-
-
-## Schema
-
-### Optional
-
-- **description** (String) human-readable description of the source IPs for this IP whitelist entry. optional, max 255 bytes.
-- **id** (String) unique identifier for this IP whitelist entry
-- **ip_net** (String) an IP address or IP network range in CIDR notation (e.g. 10.1.1.1 or 10.1.0.0/16) of addresses that will be whitelisted to communicate with your tunnel endpoints
-- **metadata** (String) arbitrary user-defined machine-readable data of this IP whitelist entry. optional, max 4096 bytes.
-
-
diff --git a/docs/resources/reserved_domain.md b/docs/resources/reserved_domain.md
index 91d0591..c977447 100644
--- a/docs/resources/reserved_domain.md
+++ b/docs/resources/reserved_domain.md
@@ -20,7 +20,7 @@ Reserved Domains are hostnames that you can listen for traffic on. Domains
```terraform
resource "ngrok_reserved_domain" "example" {
- certificate_id = "cert_1rV51OQetZPK9V6vTWUVy3Onjir"
+ certificate_id = "cert_25auGELSEngiae3wzmLLesiZn8h"
name = "myapp.mydomain.com"
region = "us"
}
@@ -35,6 +35,7 @@ resource "ngrok_reserved_domain" "example" {
### Optional
+- **acme_challenge_cname_target** (String) DNS CNAME target for the host _acme-challenge.example.com, where example.com is your reserved domain name. This is required to issue certificates for wildcard, non-ngrok reserved domains. Must be null for non-wildcard domains and ngrok subdomains.
- **certificate_id** (String) ID of a user-uploaded TLS certificate to use for connections to targeting this domain. Optional, mutually exclusive with `certificate_management_policy`.
- **certificate_management_policy** (Block Set) configuration for automatic management of TLS certificates for this domain, or null if automatic management is disabled (see [below for nested schema](#nestedblock--certificate_management_policy))
- **cname_target** (String) DNS CNAME target for a custom hostname, or null if the reserved domain is a subdomain of *.ngrok.io
diff --git a/docs/resources/ssh_host_certificate.md b/docs/resources/ssh_host_certificate.md
index b95ed9f..b185f5f 100644
--- a/docs/resources/ssh_host_certificate.md
+++ b/docs/resources/ssh_host_certificate.md
@@ -21,8 +21,8 @@ resource "ngrok_ssh_host_certificate" "example" {
description = "personal server"
principals = [ "inconshreveable.com", "10.2.42.9" ]
public_key = "ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBI3oSgxrOEJ+tIJ/n6VYtxQIFvynqlOHpfOAJ4x4OfmMYDkbf8dr6RAuUSf+ZC2HMCujta7EjZ9t+6v08Ue+Cgk= inconshreveable.com"
- ssh_certificate_authority_id = "sshca_1rV5GiTaiBQg8AtJiyiVeNKzYiR"
- valid_until = "2021-07-20T23:38:42Z"
+ ssh_certificate_authority_id = "sshca_25auH7sr0BYJFNyfJUwXPzyyFAz"
+ valid_until = "2022-05-26T08:23:47Z"
}
```
diff --git a/docs/resources/ssh_user_certificate.md b/docs/resources/ssh_user_certificate.md
index 1c1bdef..4821fd1 100644
--- a/docs/resources/ssh_user_certificate.md
+++ b/docs/resources/ssh_user_certificate.md
@@ -21,8 +21,8 @@ resource "ngrok_ssh_user_certificate" "example" {
description = "temporary access to staging machine"
principals = [ "ec2-user", "root" ]
public_key = "ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBK58lFzmWlDimDtBz78wVT4oauA8PjY0CiXTCEIsBNC6UwOJvZ0jdSaYNhDaa7dRV84DfBb/gKzqlXC7cVMZjl0= alan@work-laptop"
- ssh_certificate_authority_id = "sshca_1rV5G33U0TV5AFqiEfKcjOi8W4t"
- valid_until = "2021-07-20T23:38:37Z"
+ ssh_certificate_authority_id = "sshca_25auH5JtiUPW9eMiXYzujvcpkGW"
+ valid_until = "2022-05-26T08:23:47Z"
}
```
diff --git a/examples/resources/ngrok_agent_ingress/resource.tf b/examples/resources/ngrok_agent_ingress/resource.tf
new file mode 100644
index 0000000..1a1b48c
--- /dev/null
+++ b/examples/resources/ngrok_agent_ingress/resource.tf
@@ -0,0 +1,6 @@
+
+resource "ngrok_agent_ingress" "example" {
+ description = "acme devices"
+ domain = "connect.acme.com"
+}
+
diff --git a/examples/resources/ngrok_event_subscription/resource.tf b/examples/resources/ngrok_event_subscription/resource.tf
index bb1e2aa..6ada278 100644
--- a/examples/resources/ngrok_event_subscription/resource.tf
+++ b/examples/resources/ngrok_event_subscription/resource.tf
@@ -1,10 +1,10 @@
resource "ngrok_event_subscription" "example" {
- description = "low sampling, basic HTTP logs"
- destination_ids = [ "ed_1ro7aylyqQ1LLMWNWrOISvlfveQ" ]
+ description = "ip policy creations"
+ destination_ids = [ "ed_25auH2H0JNlDGXUH01Z3sZdgFFM" ]
metadata = "{\"environment\": \"staging\"}"
sources [ {
- type = "http_request_complete"
+ type = "ip_policy_created.v0"
} ]
}
diff --git a/examples/resources/ngrok_ip_policy_rule/resource.tf b/examples/resources/ngrok_ip_policy_rule/resource.tf
index 4e654aa..a103dd3 100644
--- a/examples/resources/ngrok_ip_policy_rule/resource.tf
+++ b/examples/resources/ngrok_ip_policy_rule/resource.tf
@@ -2,6 +2,6 @@
resource "ngrok_ip_policy_rule" "example" {
cidr = "212.3.14.0/24"
description = "nyc office"
- ip_policy_id = "ipp_1rV56VrAxesFteoj4XZxaaYyvXo"
+ ip_policy_id = "ipp_25auGv9R7vPmi6NKs5Cxcyzc2Cm"
}
diff --git a/examples/resources/ngrok_ip_restriction/resource.tf b/examples/resources/ngrok_ip_restriction/resource.tf
index 23c2685..0350716 100644
--- a/examples/resources/ngrok_ip_restriction/resource.tf
+++ b/examples/resources/ngrok_ip_restriction/resource.tf
@@ -1,6 +1,6 @@
resource "ngrok_ip_restriction" "example" {
- ip_policy_ids = [ "ipp_1rV5CMI1Aw8MiqWtjlQCyDDEWnQ" ]
+ ip_policy_ids = [ "ipp_25auGwa4eEWUeCOBfCZkwtwqFey" ]
type = "dashboard"
}
diff --git a/examples/resources/ngrok_ip_whitelist_entry/resource.tf b/examples/resources/ngrok_ip_whitelist_entry/resource.tf
deleted file mode 100644
index eab4c3d..0000000
--- a/examples/resources/ngrok_ip_whitelist_entry/resource.tf
+++ /dev/null
@@ -1,6 +0,0 @@
-
-resource "ngrok_ip_whitelist_entry" "example" {
- description = "outbound proxy servers"
- ip_net = "10.1.1.0/24"
-}
-
diff --git a/examples/resources/ngrok_reserved_domain/resource.tf b/examples/resources/ngrok_reserved_domain/resource.tf
index 014560d..8bac6cb 100644
--- a/examples/resources/ngrok_reserved_domain/resource.tf
+++ b/examples/resources/ngrok_reserved_domain/resource.tf
@@ -1,6 +1,6 @@
resource "ngrok_reserved_domain" "example" {
- certificate_id = "cert_1rV51OQetZPK9V6vTWUVy3Onjir"
+ certificate_id = "cert_25auGELSEngiae3wzmLLesiZn8h"
name = "myapp.mydomain.com"
region = "us"
}
diff --git a/examples/resources/ngrok_ssh_host_certificate/resource.tf b/examples/resources/ngrok_ssh_host_certificate/resource.tf
index 45d36c2..34f901e 100644
--- a/examples/resources/ngrok_ssh_host_certificate/resource.tf
+++ b/examples/resources/ngrok_ssh_host_certificate/resource.tf
@@ -3,7 +3,7 @@ resource "ngrok_ssh_host_certificate" "example" {
description = "personal server"
principals = [ "inconshreveable.com", "10.2.42.9" ]
public_key = "ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBI3oSgxrOEJ+tIJ/n6VYtxQIFvynqlOHpfOAJ4x4OfmMYDkbf8dr6RAuUSf+ZC2HMCujta7EjZ9t+6v08Ue+Cgk= inconshreveable.com"
- ssh_certificate_authority_id = "sshca_1rV5GiTaiBQg8AtJiyiVeNKzYiR"
- valid_until = "2021-07-20T23:38:42Z"
+ ssh_certificate_authority_id = "sshca_25auH7sr0BYJFNyfJUwXPzyyFAz"
+ valid_until = "2022-05-26T08:23:47Z"
}
diff --git a/examples/resources/ngrok_ssh_user_certificate/resource.tf b/examples/resources/ngrok_ssh_user_certificate/resource.tf
index 0b49db7..8bff3b3 100644
--- a/examples/resources/ngrok_ssh_user_certificate/resource.tf
+++ b/examples/resources/ngrok_ssh_user_certificate/resource.tf
@@ -3,7 +3,7 @@ resource "ngrok_ssh_user_certificate" "example" {
description = "temporary access to staging machine"
principals = [ "ec2-user", "root" ]
public_key = "ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBK58lFzmWlDimDtBz78wVT4oauA8PjY0CiXTCEIsBNC6UwOJvZ0jdSaYNhDaa7dRV84DfBb/gKzqlXC7cVMZjl0= alan@work-laptop"
- ssh_certificate_authority_id = "sshca_1rV5G33U0TV5AFqiEfKcjOi8W4t"
- valid_until = "2021-07-20T23:38:37Z"
+ ssh_certificate_authority_id = "sshca_25auH5JtiUPW9eMiXYzujvcpkGW"
+ valid_until = "2022-05-26T08:23:47Z"
}
diff --git a/go.mod b/go.mod
index ad89521..0451796 100644
--- a/go.mod
+++ b/go.mod
@@ -1,9 +1,82 @@
module github.com/ngrok/terraform-provider-ngrok
-go 1.16
+go 1.17
require (
- github.com/hashicorp/terraform-plugin-docs v0.4.0
- github.com/hashicorp/terraform-plugin-sdk/v2 v2.6.1
- github.com/spf13/pflag v1.0.5
+ github.com/hashicorp/terraform-plugin-docs v0.4.0
+ github.com/hashicorp/terraform-plugin-sdk/v2 v2.6.1
+ github.com/spf13/pflag v1.0.5
+)
+
+require (
+ cloud.google.com/go v0.61.0 // indirect
+ cloud.google.com/go/storage v1.10.0 // indirect
+ github.com/Masterminds/goutils v1.1.0 // indirect
+ github.com/Masterminds/semver v1.5.0 // indirect
+ github.com/Masterminds/sprig v2.22.0+incompatible // indirect
+ github.com/agext/levenshtein v1.2.2 // indirect
+ github.com/apparentlymart/go-textseg v1.0.0 // indirect
+ github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect
+ github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310 // indirect
+ github.com/aws/aws-sdk-go v1.25.3 // indirect
+ github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d // indirect
+ github.com/bgentry/speakeasy v0.1.0 // indirect
+ github.com/davecgh/go-spew v1.1.1 // indirect
+ github.com/fatih/color v1.7.0 // indirect
+ github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e // indirect
+ github.com/golang/protobuf v1.4.2 // indirect
+ github.com/google/uuid v1.1.2 // indirect
+ github.com/googleapis/gax-go/v2 v2.0.5 // indirect
+ github.com/hashicorp/errwrap v1.0.0 // indirect
+ github.com/hashicorp/go-checkpoint v0.5.0 // indirect
+ github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
+ github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320 // indirect
+ github.com/hashicorp/go-getter v1.5.3 // indirect
+ github.com/hashicorp/go-hclog v0.15.0 // indirect
+ github.com/hashicorp/go-multierror v1.0.0 // indirect
+ github.com/hashicorp/go-plugin v1.4.0 // indirect
+ github.com/hashicorp/go-safetemp v1.0.0 // indirect
+ github.com/hashicorp/go-uuid v1.0.1 // indirect
+ github.com/hashicorp/go-version v1.3.0 // indirect
+ github.com/hashicorp/hcl/v2 v2.3.0 // indirect
+ github.com/hashicorp/logutils v1.0.0 // indirect
+ github.com/hashicorp/terraform-exec v0.13.3 // indirect
+ github.com/hashicorp/terraform-json v0.10.0 // indirect
+ github.com/hashicorp/terraform-plugin-go v0.3.0 // indirect
+ github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d // indirect
+ github.com/huandu/xstrings v1.3.2 // indirect
+ github.com/imdario/mergo v0.3.12 // indirect
+ github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af // indirect
+ github.com/jstemmer/go-junit-report v0.9.1 // indirect
+ github.com/klauspost/compress v1.11.2 // indirect
+ github.com/mattn/go-colorable v0.1.8 // indirect
+ github.com/mattn/go-isatty v0.0.12 // indirect
+ github.com/mitchellh/cli v1.1.2 // indirect
+ github.com/mitchellh/copystructure v1.0.0 // indirect
+ github.com/mitchellh/go-homedir v1.1.0 // indirect
+ github.com/mitchellh/go-testing-interface v1.0.4 // indirect
+ github.com/mitchellh/go-wordwrap v1.0.0 // indirect
+ github.com/mitchellh/mapstructure v1.1.2 // indirect
+ github.com/mitchellh/reflectwalk v1.0.1 // indirect
+ github.com/oklog/run v1.0.0 // indirect
+ github.com/posener/complete v1.1.1 // indirect
+ github.com/russross/blackfriday v1.6.0 // indirect
+ github.com/ulikunitz/xz v0.5.8 // indirect
+ github.com/vmihailenco/msgpack v4.0.4+incompatible // indirect
+ github.com/zclconf/go-cty v1.8.2 // indirect
+ go.opencensus.io v0.22.4 // indirect
+ golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2 // indirect
+ golang.org/x/lint v0.0.0-20200302205851-738671d3881b // indirect
+ golang.org/x/mod v0.3.0 // indirect
+ golang.org/x/net v0.0.0-20210326060303-6b1517762897 // indirect
+ golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d // indirect
+ golang.org/x/sys v0.0.0-20210324051608-47abb6519492 // indirect
+ golang.org/x/text v0.3.5 // indirect
+ golang.org/x/tools v0.0.0-20200713011307-fd294ab11aed // indirect
+ golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 // indirect
+ google.golang.org/api v0.29.0 // indirect
+ google.golang.org/appengine v1.6.6 // indirect
+ google.golang.org/genproto v0.0.0-20200711021454-869866162049 // indirect
+ google.golang.org/grpc v1.32.0 // indirect
+ google.golang.org/protobuf v1.25.0 // indirect
)
diff --git a/ngrok/flatten_expand.go b/ngrok/flatten_expand.go
index 6dc081b..ee06105 100644
--- a/ngrok/flatten_expand.go
+++ b/ngrok/flatten_expand.go
@@ -432,7 +432,7 @@ func expandAbuseReportCreateSlice(in interface{}) *[]restapi.AbuseReportCreate {
return &out
}
-func flattenAPIKeyCreate(obj *restapi.APIKeyCreate) interface{} {
+func flattenAgentIngressCreate(obj *restapi.AgentIngressCreate) interface{} {
if obj == nil {
return nil
}
@@ -440,22 +440,23 @@ func flattenAPIKeyCreate(obj *restapi.APIKeyCreate) interface{} {
m := make(map[string]interface{})
m["description"] = obj.Description
m["metadata"] = obj.Metadata
+ m["domain"] = obj.Domain
return []interface{}{m}
}
-func flattenAPIKeyCreateSlice(objs *[]restapi.APIKeyCreate) (sl []interface{}) {
+func flattenAgentIngressCreateSlice(objs *[]restapi.AgentIngressCreate) (sl []interface{}) {
if objs == nil {
return nil
}
for _, v := range *objs {
- sl = append(sl, flattenAPIKeyCreate(&v))
+ sl = append(sl, flattenAgentIngressCreate(&v))
}
return sl
}
-func expandAPIKeyCreate(in interface{}) *restapi.APIKeyCreate {
+func expandAgentIngressCreate(in interface{}) *restapi.AgentIngressCreate {
if in == nil {
return nil
}
@@ -466,25 +467,28 @@ func expandAPIKeyCreate(in interface{}) *restapi.APIKeyCreate {
}
m := v.List()[0].(map[string]interface{})
- var obj restapi.APIKeyCreate
+ var obj restapi.AgentIngressCreate
if v, ok := m["description"]; ok {
obj.Description = *expandString(v)
}
if v, ok := m["metadata"]; ok {
obj.Metadata = *expandString(v)
}
+ if v, ok := m["domain"]; ok {
+ obj.Domain = *expandString(v)
+ }
return &obj
}
-func expandAPIKeyCreateSlice(in interface{}) *[]restapi.APIKeyCreate {
- var out []restapi.APIKeyCreate
+func expandAgentIngressCreateSlice(in interface{}) *[]restapi.AgentIngressCreate {
+ var out []restapi.AgentIngressCreate
for _, v := range in.([]interface{}) {
- out = append(out, *expandAPIKeyCreate(v))
+ out = append(out, *expandAgentIngressCreate(v))
}
return &out
}
-func flattenAPIKeyUpdate(obj *restapi.APIKeyUpdate) interface{} {
+func flattenAgentIngressUpdate(obj *restapi.AgentIngressUpdate) interface{} {
if obj == nil {
return nil
}
@@ -497,18 +501,18 @@ func flattenAPIKeyUpdate(obj *restapi.APIKeyUpdate) interface{} {
return []interface{}{m}
}
-func flattenAPIKeyUpdateSlice(objs *[]restapi.APIKeyUpdate) (sl []interface{}) {
+func flattenAgentIngressUpdateSlice(objs *[]restapi.AgentIngressUpdate) (sl []interface{}) {
if objs == nil {
return nil
}
for _, v := range *objs {
- sl = append(sl, flattenAPIKeyUpdate(&v))
+ sl = append(sl, flattenAgentIngressUpdate(&v))
}
return sl
}
-func expandAPIKeyUpdate(in interface{}) *restapi.APIKeyUpdate {
+func expandAgentIngressUpdate(in interface{}) *restapi.AgentIngressUpdate {
if in == nil {
return nil
}
@@ -519,7 +523,7 @@ func expandAPIKeyUpdate(in interface{}) *restapi.APIKeyUpdate {
}
m := v.List()[0].(map[string]interface{})
- var obj restapi.APIKeyUpdate
+ var obj restapi.AgentIngressUpdate
if v, ok := m["id"]; ok {
obj.ID = *expandString(v)
}
@@ -532,15 +536,15 @@ func expandAPIKeyUpdate(in interface{}) *restapi.APIKeyUpdate {
return &obj
}
-func expandAPIKeyUpdateSlice(in interface{}) *[]restapi.APIKeyUpdate {
- var out []restapi.APIKeyUpdate
+func expandAgentIngressUpdateSlice(in interface{}) *[]restapi.AgentIngressUpdate {
+ var out []restapi.AgentIngressUpdate
for _, v := range in.([]interface{}) {
- out = append(out, *expandAPIKeyUpdate(v))
+ out = append(out, *expandAgentIngressUpdate(v))
}
return &out
}
-func flattenAPIKey(obj *restapi.APIKey) interface{} {
+func flattenAgentIngress(obj *restapi.AgentIngress) interface{} {
if obj == nil {
return nil
}
@@ -550,24 +554,26 @@ func flattenAPIKey(obj *restapi.APIKey) interface{} {
m["uri"] = obj.URI
m["description"] = obj.Description
m["metadata"] = obj.Metadata
+ m["domain"] = obj.Domain
+ m["ns_targets"] = obj.NSTargets
+ m["region_domains"] = obj.RegionDomains
m["created_at"] = obj.CreatedAt
- m["token"] = obj.Token
return []interface{}{m}
}
-func flattenAPIKeySlice(objs *[]restapi.APIKey) (sl []interface{}) {
+func flattenAgentIngressSlice(objs *[]restapi.AgentIngress) (sl []interface{}) {
if objs == nil {
return nil
}
for _, v := range *objs {
- sl = append(sl, flattenAPIKey(&v))
+ sl = append(sl, flattenAgentIngress(&v))
}
return sl
}
-func expandAPIKey(in interface{}) *restapi.APIKey {
+func expandAgentIngress(in interface{}) *restapi.AgentIngress {
if in == nil {
return nil
}
@@ -578,7 +584,7 @@ func expandAPIKey(in interface{}) *restapi.APIKey {
}
m := v.List()[0].(map[string]interface{})
- var obj restapi.APIKey
+ var obj restapi.AgentIngress
if v, ok := m["id"]; ok {
obj.ID = *expandString(v)
}
@@ -591,48 +597,54 @@ func expandAPIKey(in interface{}) *restapi.APIKey {
if v, ok := m["metadata"]; ok {
obj.Metadata = *expandString(v)
}
+ if v, ok := m["domain"]; ok {
+ obj.Domain = *expandString(v)
+ }
+ if v, ok := m["ns_targets"]; ok {
+ obj.NSTargets = *expandStringSlice(v)
+ }
+ if v, ok := m["region_domains"]; ok {
+ obj.RegionDomains = *expandStringSlice(v)
+ }
if v, ok := m["created_at"]; ok {
obj.CreatedAt = *expandString(v)
}
- if v, ok := m["token"]; ok {
- obj.Token = expandString(v)
- }
return &obj
}
-func expandAPIKeySlice(in interface{}) *[]restapi.APIKey {
- var out []restapi.APIKey
+func expandAgentIngressSlice(in interface{}) *[]restapi.AgentIngress {
+ var out []restapi.AgentIngress
for _, v := range in.([]interface{}) {
- out = append(out, *expandAPIKey(v))
+ out = append(out, *expandAgentIngress(v))
}
return &out
}
-func flattenAPIKeyList(obj *restapi.APIKeyList) interface{} {
+func flattenAgentIngressList(obj *restapi.AgentIngressList) interface{} {
if obj == nil {
return nil
}
m := make(map[string]interface{})
- m["keys"] = flattenAPIKeySlice(&obj.Keys)
+ m["ingresses"] = flattenAgentIngressSlice(&obj.Ingresses)
m["uri"] = obj.URI
m["next_page_uri"] = obj.NextPageURI
return []interface{}{m}
}
-func flattenAPIKeyListSlice(objs *[]restapi.APIKeyList) (sl []interface{}) {
+func flattenAgentIngressListSlice(objs *[]restapi.AgentIngressList) (sl []interface{}) {
if objs == nil {
return nil
}
for _, v := range *objs {
- sl = append(sl, flattenAPIKeyList(&v))
+ sl = append(sl, flattenAgentIngressList(&v))
}
return sl
}
-func expandAPIKeyList(in interface{}) *restapi.APIKeyList {
+func expandAgentIngressList(in interface{}) *restapi.AgentIngressList {
if in == nil {
return nil
}
@@ -643,9 +655,9 @@ func expandAPIKeyList(in interface{}) *restapi.APIKeyList {
}
m := v.List()[0].(map[string]interface{})
- var obj restapi.APIKeyList
- if v, ok := m["keys"]; ok {
- obj.Keys = *expandAPIKeySlice(v)
+ var obj restapi.AgentIngressList
+ if v, ok := m["ingresses"]; ok {
+ obj.Ingresses = *expandAgentIngressSlice(v)
}
if v, ok := m["uri"]; ok {
obj.URI = *expandString(v)
@@ -656,41 +668,38 @@ func expandAPIKeyList(in interface{}) *restapi.APIKeyList {
return &obj
}
-func expandAPIKeyListSlice(in interface{}) *[]restapi.APIKeyList {
- var out []restapi.APIKeyList
+func expandAgentIngressListSlice(in interface{}) *[]restapi.AgentIngressList {
+ var out []restapi.AgentIngressList
for _, v := range in.([]interface{}) {
- out = append(out, *expandAPIKeyList(v))
+ out = append(out, *expandAgentIngressList(v))
}
return &out
}
-func flattenPriorityBackend(obj *restapi.PriorityBackend) interface{} {
+func flattenAPIKeyCreate(obj *restapi.APIKeyCreate) interface{} {
if obj == nil {
return nil
}
m := make(map[string]interface{})
- m["id"] = obj.ID
- m["created_at"] = obj.CreatedAt
m["description"] = obj.Description
m["metadata"] = obj.Metadata
- m["backends"] = obj.Backends
return []interface{}{m}
}
-func flattenPriorityBackendSlice(objs *[]restapi.PriorityBackend) (sl []interface{}) {
+func flattenAPIKeyCreateSlice(objs *[]restapi.APIKeyCreate) (sl []interface{}) {
if objs == nil {
return nil
}
for _, v := range *objs {
- sl = append(sl, flattenPriorityBackend(&v))
+ sl = append(sl, flattenAPIKeyCreate(&v))
}
return sl
}
-func expandPriorityBackend(in interface{}) *restapi.PriorityBackend {
+func expandAPIKeyCreate(in interface{}) *restapi.APIKeyCreate {
if in == nil {
return nil
}
@@ -701,58 +710,49 @@ func expandPriorityBackend(in interface{}) *restapi.PriorityBackend {
}
m := v.List()[0].(map[string]interface{})
- var obj restapi.PriorityBackend
- if v, ok := m["id"]; ok {
- obj.ID = *expandString(v)
- }
- if v, ok := m["created_at"]; ok {
- obj.CreatedAt = *expandString(v)
- }
+ var obj restapi.APIKeyCreate
if v, ok := m["description"]; ok {
obj.Description = *expandString(v)
}
if v, ok := m["metadata"]; ok {
obj.Metadata = *expandString(v)
}
- if v, ok := m["backends"]; ok {
- obj.Backends = *expandStringSlice(v)
- }
return &obj
}
-func expandPriorityBackendSlice(in interface{}) *[]restapi.PriorityBackend {
- var out []restapi.PriorityBackend
+func expandAPIKeyCreateSlice(in interface{}) *[]restapi.APIKeyCreate {
+ var out []restapi.APIKeyCreate
for _, v := range in.([]interface{}) {
- out = append(out, *expandPriorityBackend(v))
+ out = append(out, *expandAPIKeyCreate(v))
}
return &out
}
-func flattenPriorityBackendCreate(obj *restapi.PriorityBackendCreate) interface{} {
+func flattenAPIKeyUpdate(obj *restapi.APIKeyUpdate) interface{} {
if obj == nil {
return nil
}
m := make(map[string]interface{})
+ m["id"] = obj.ID
m["description"] = obj.Description
m["metadata"] = obj.Metadata
- m["backends"] = obj.Backends
return []interface{}{m}
}
-func flattenPriorityBackendCreateSlice(objs *[]restapi.PriorityBackendCreate) (sl []interface{}) {
+func flattenAPIKeyUpdateSlice(objs *[]restapi.APIKeyUpdate) (sl []interface{}) {
if objs == nil {
return nil
}
for _, v := range *objs {
- sl = append(sl, flattenPriorityBackendCreate(&v))
+ sl = append(sl, flattenAPIKeyUpdate(&v))
}
return sl
}
-func expandPriorityBackendCreate(in interface{}) *restapi.PriorityBackendCreate {
+func expandAPIKeyUpdate(in interface{}) *restapi.APIKeyUpdate {
if in == nil {
return nil
}
@@ -763,53 +763,55 @@ func expandPriorityBackendCreate(in interface{}) *restapi.PriorityBackendCreate
}
m := v.List()[0].(map[string]interface{})
- var obj restapi.PriorityBackendCreate
+ var obj restapi.APIKeyUpdate
+ if v, ok := m["id"]; ok {
+ obj.ID = *expandString(v)
+ }
if v, ok := m["description"]; ok {
- obj.Description = *expandString(v)
+ obj.Description = expandString(v)
}
if v, ok := m["metadata"]; ok {
- obj.Metadata = *expandString(v)
- }
- if v, ok := m["backends"]; ok {
- obj.Backends = *expandStringSlice(v)
+ obj.Metadata = expandString(v)
}
return &obj
}
-func expandPriorityBackendCreateSlice(in interface{}) *[]restapi.PriorityBackendCreate {
- var out []restapi.PriorityBackendCreate
+func expandAPIKeyUpdateSlice(in interface{}) *[]restapi.APIKeyUpdate {
+ var out []restapi.APIKeyUpdate
for _, v := range in.([]interface{}) {
- out = append(out, *expandPriorityBackendCreate(v))
+ out = append(out, *expandAPIKeyUpdate(v))
}
return &out
}
-func flattenPriorityBackendUpdate(obj *restapi.PriorityBackendUpdate) interface{} {
+func flattenAPIKey(obj *restapi.APIKey) interface{} {
if obj == nil {
return nil
}
m := make(map[string]interface{})
m["id"] = obj.ID
+ m["uri"] = obj.URI
m["description"] = obj.Description
m["metadata"] = obj.Metadata
- m["backends"] = obj.Backends
+ m["created_at"] = obj.CreatedAt
+ m["token"] = obj.Token
return []interface{}{m}
}
-func flattenPriorityBackendUpdateSlice(objs *[]restapi.PriorityBackendUpdate) (sl []interface{}) {
+func flattenAPIKeySlice(objs *[]restapi.APIKey) (sl []interface{}) {
if objs == nil {
return nil
}
for _, v := range *objs {
- sl = append(sl, flattenPriorityBackendUpdate(&v))
+ sl = append(sl, flattenAPIKey(&v))
}
return sl
}
-func expandPriorityBackendUpdate(in interface{}) *restapi.PriorityBackendUpdate {
+func expandAPIKey(in interface{}) *restapi.APIKey {
if in == nil {
return nil
}
@@ -820,55 +822,61 @@ func expandPriorityBackendUpdate(in interface{}) *restapi.PriorityBackendUpdate
}
m := v.List()[0].(map[string]interface{})
- var obj restapi.PriorityBackendUpdate
+ var obj restapi.APIKey
if v, ok := m["id"]; ok {
obj.ID = *expandString(v)
}
+ if v, ok := m["uri"]; ok {
+ obj.URI = *expandString(v)
+ }
if v, ok := m["description"]; ok {
- obj.Description = expandString(v)
+ obj.Description = *expandString(v)
}
if v, ok := m["metadata"]; ok {
- obj.Metadata = expandString(v)
+ obj.Metadata = *expandString(v)
}
- if v, ok := m["backends"]; ok {
- obj.Backends = *expandStringSlice(v)
+ if v, ok := m["created_at"]; ok {
+ obj.CreatedAt = *expandString(v)
+ }
+ if v, ok := m["token"]; ok {
+ obj.Token = expandString(v)
}
return &obj
}
-func expandPriorityBackendUpdateSlice(in interface{}) *[]restapi.PriorityBackendUpdate {
- var out []restapi.PriorityBackendUpdate
+func expandAPIKeySlice(in interface{}) *[]restapi.APIKey {
+ var out []restapi.APIKey
for _, v := range in.([]interface{}) {
- out = append(out, *expandPriorityBackendUpdate(v))
+ out = append(out, *expandAPIKey(v))
}
return &out
}
-func flattenPriorityBackendList(obj *restapi.PriorityBackendList) interface{} {
+func flattenAPIKeyList(obj *restapi.APIKeyList) interface{} {
if obj == nil {
return nil
}
m := make(map[string]interface{})
- m["backends"] = flattenPriorityBackendSlice(&obj.Backends)
+ m["keys"] = flattenAPIKeySlice(&obj.Keys)
m["uri"] = obj.URI
m["next_page_uri"] = obj.NextPageURI
return []interface{}{m}
}
-func flattenPriorityBackendListSlice(objs *[]restapi.PriorityBackendList) (sl []interface{}) {
+func flattenAPIKeyListSlice(objs *[]restapi.APIKeyList) (sl []interface{}) {
if objs == nil {
return nil
}
for _, v := range *objs {
- sl = append(sl, flattenPriorityBackendList(&v))
+ sl = append(sl, flattenAPIKeyList(&v))
}
return sl
}
-func expandPriorityBackendList(in interface{}) *restapi.PriorityBackendList {
+func expandAPIKeyList(in interface{}) *restapi.APIKeyList {
if in == nil {
return nil
}
@@ -879,9 +887,9 @@ func expandPriorityBackendList(in interface{}) *restapi.PriorityBackendList {
}
m := v.List()[0].(map[string]interface{})
- var obj restapi.PriorityBackendList
- if v, ok := m["backends"]; ok {
- obj.Backends = *expandPriorityBackendSlice(v)
+ var obj restapi.APIKeyList
+ if v, ok := m["keys"]; ok {
+ obj.Keys = *expandAPIKeySlice(v)
}
if v, ok := m["uri"]; ok {
obj.URI = *expandString(v)
@@ -892,42 +900,42 @@ func expandPriorityBackendList(in interface{}) *restapi.PriorityBackendList {
return &obj
}
-func expandPriorityBackendListSlice(in interface{}) *[]restapi.PriorityBackendList {
- var out []restapi.PriorityBackendList
+func expandAPIKeyListSlice(in interface{}) *[]restapi.APIKeyList {
+ var out []restapi.APIKeyList
for _, v := range in.([]interface{}) {
- out = append(out, *expandPriorityBackendList(v))
+ out = append(out, *expandAPIKeyList(v))
}
return &out
}
-func flattenStaticBackend(obj *restapi.StaticBackend) interface{} {
+func flattenFailoverBackend(obj *restapi.FailoverBackend) interface{} {
if obj == nil {
return nil
}
m := make(map[string]interface{})
m["id"] = obj.ID
+ m["uri"] = obj.URI
m["created_at"] = obj.CreatedAt
m["description"] = obj.Description
m["metadata"] = obj.Metadata
- m["address"] = obj.Address
- m["tls"] = flattenStaticBackendTLS(&obj.TLS)
+ m["backends"] = obj.Backends
return []interface{}{m}
}
-func flattenStaticBackendSlice(objs *[]restapi.StaticBackend) (sl []interface{}) {
+func flattenFailoverBackendSlice(objs *[]restapi.FailoverBackend) (sl []interface{}) {
if objs == nil {
return nil
}
for _, v := range *objs {
- sl = append(sl, flattenStaticBackend(&v))
+ sl = append(sl, flattenFailoverBackend(&v))
}
return sl
}
-func expandStaticBackend(in interface{}) *restapi.StaticBackend {
+func expandFailoverBackend(in interface{}) *restapi.FailoverBackend {
if in == nil {
return nil
}
@@ -938,10 +946,13 @@ func expandStaticBackend(in interface{}) *restapi.StaticBackend {
}
m := v.List()[0].(map[string]interface{})
- var obj restapi.StaticBackend
+ var obj restapi.FailoverBackend
if v, ok := m["id"]; ok {
obj.ID = *expandString(v)
}
+ if v, ok := m["uri"]; ok {
+ obj.URI = *expandString(v)
+ }
if v, ok := m["created_at"]; ok {
obj.CreatedAt = *expandString(v)
}
@@ -951,72 +962,21 @@ func expandStaticBackend(in interface{}) *restapi.StaticBackend {
if v, ok := m["metadata"]; ok {
obj.Metadata = *expandString(v)
}
- if v, ok := m["address"]; ok {
- obj.Address = *expandString(v)
- }
- if v, ok := m["tls"]; ok {
- obj.TLS = *expandStaticBackendTLS(v)
- }
- return &obj
-}
-
-func expandStaticBackendSlice(in interface{}) *[]restapi.StaticBackend {
- var out []restapi.StaticBackend
- for _, v := range in.([]interface{}) {
- out = append(out, *expandStaticBackend(v))
- }
- return &out
-}
-
-func flattenStaticBackendTLS(obj *restapi.StaticBackendTLS) interface{} {
- if obj == nil {
- return nil
- }
-
- m := make(map[string]interface{})
- m["enabled"] = obj.Enabled
-
- return []interface{}{m}
-}
-
-func flattenStaticBackendTLSSlice(objs *[]restapi.StaticBackendTLS) (sl []interface{}) {
- if objs == nil {
- return nil
- }
-
- for _, v := range *objs {
- sl = append(sl, flattenStaticBackendTLS(&v))
- }
- return sl
-}
-
-func expandStaticBackendTLS(in interface{}) *restapi.StaticBackendTLS {
- if in == nil {
- return nil
- }
- v := in.(*schema.Set)
-
- if v.Len() == 0 {
- return nil
- }
-
- m := v.List()[0].(map[string]interface{})
- var obj restapi.StaticBackendTLS
- if v, ok := m["enabled"]; ok {
- obj.Enabled = *expandBool(v)
+ if v, ok := m["backends"]; ok {
+ obj.Backends = *expandStringSlice(v)
}
return &obj
}
-func expandStaticBackendTLSSlice(in interface{}) *[]restapi.StaticBackendTLS {
- var out []restapi.StaticBackendTLS
+func expandFailoverBackendSlice(in interface{}) *[]restapi.FailoverBackend {
+ var out []restapi.FailoverBackend
for _, v := range in.([]interface{}) {
- out = append(out, *expandStaticBackendTLS(v))
+ out = append(out, *expandFailoverBackend(v))
}
return &out
}
-func flattenStaticBackendCreate(obj *restapi.StaticBackendCreate) interface{} {
+func flattenFailoverBackendCreate(obj *restapi.FailoverBackendCreate) interface{} {
if obj == nil {
return nil
}
@@ -1024,24 +984,23 @@ func flattenStaticBackendCreate(obj *restapi.StaticBackendCreate) interface{} {
m := make(map[string]interface{})
m["description"] = obj.Description
m["metadata"] = obj.Metadata
- m["address"] = obj.Address
- m["tls"] = flattenStaticBackendTLS(&obj.TLS)
+ m["backends"] = obj.Backends
return []interface{}{m}
}
-func flattenStaticBackendCreateSlice(objs *[]restapi.StaticBackendCreate) (sl []interface{}) {
+func flattenFailoverBackendCreateSlice(objs *[]restapi.FailoverBackendCreate) (sl []interface{}) {
if objs == nil {
return nil
}
for _, v := range *objs {
- sl = append(sl, flattenStaticBackendCreate(&v))
+ sl = append(sl, flattenFailoverBackendCreate(&v))
}
return sl
}
-func expandStaticBackendCreate(in interface{}) *restapi.StaticBackendCreate {
+func expandFailoverBackendCreate(in interface{}) *restapi.FailoverBackendCreate {
if in == nil {
return nil
}
@@ -1052,31 +1011,28 @@ func expandStaticBackendCreate(in interface{}) *restapi.StaticBackendCreate {
}
m := v.List()[0].(map[string]interface{})
- var obj restapi.StaticBackendCreate
+ var obj restapi.FailoverBackendCreate
if v, ok := m["description"]; ok {
obj.Description = *expandString(v)
}
if v, ok := m["metadata"]; ok {
obj.Metadata = *expandString(v)
}
- if v, ok := m["address"]; ok {
- obj.Address = *expandString(v)
- }
- if v, ok := m["tls"]; ok {
- obj.TLS = *expandStaticBackendTLS(v)
+ if v, ok := m["backends"]; ok {
+ obj.Backends = *expandStringSlice(v)
}
return &obj
}
-func expandStaticBackendCreateSlice(in interface{}) *[]restapi.StaticBackendCreate {
- var out []restapi.StaticBackendCreate
+func expandFailoverBackendCreateSlice(in interface{}) *[]restapi.FailoverBackendCreate {
+ var out []restapi.FailoverBackendCreate
for _, v := range in.([]interface{}) {
- out = append(out, *expandStaticBackendCreate(v))
+ out = append(out, *expandFailoverBackendCreate(v))
}
return &out
}
-func flattenStaticBackendUpdate(obj *restapi.StaticBackendUpdate) interface{} {
+func flattenFailoverBackendUpdate(obj *restapi.FailoverBackendUpdate) interface{} {
if obj == nil {
return nil
}
@@ -1085,24 +1041,23 @@ func flattenStaticBackendUpdate(obj *restapi.StaticBackendUpdate) interface{} {
m["id"] = obj.ID
m["description"] = obj.Description
m["metadata"] = obj.Metadata
- m["address"] = obj.Address
- m["tls"] = flattenStaticBackendTLS(&obj.TLS)
+ m["backends"] = obj.Backends
return []interface{}{m}
}
-func flattenStaticBackendUpdateSlice(objs *[]restapi.StaticBackendUpdate) (sl []interface{}) {
+func flattenFailoverBackendUpdateSlice(objs *[]restapi.FailoverBackendUpdate) (sl []interface{}) {
if objs == nil {
return nil
}
for _, v := range *objs {
- sl = append(sl, flattenStaticBackendUpdate(&v))
+ sl = append(sl, flattenFailoverBackendUpdate(&v))
}
return sl
}
-func expandStaticBackendUpdate(in interface{}) *restapi.StaticBackendUpdate {
+func expandFailoverBackendUpdate(in interface{}) *restapi.FailoverBackendUpdate {
if in == nil {
return nil
}
@@ -1113,7 +1068,7 @@ func expandStaticBackendUpdate(in interface{}) *restapi.StaticBackendUpdate {
}
m := v.List()[0].(map[string]interface{})
- var obj restapi.StaticBackendUpdate
+ var obj restapi.FailoverBackendUpdate
if v, ok := m["id"]; ok {
obj.ID = *expandString(v)
}
@@ -1123,48 +1078,45 @@ func expandStaticBackendUpdate(in interface{}) *restapi.StaticBackendUpdate {
if v, ok := m["metadata"]; ok {
obj.Metadata = expandString(v)
}
- if v, ok := m["address"]; ok {
- obj.Address = *expandString(v)
- }
- if v, ok := m["tls"]; ok {
- obj.TLS = *expandStaticBackendTLS(v)
+ if v, ok := m["backends"]; ok {
+ obj.Backends = *expandStringSlice(v)
}
return &obj
}
-func expandStaticBackendUpdateSlice(in interface{}) *[]restapi.StaticBackendUpdate {
- var out []restapi.StaticBackendUpdate
+func expandFailoverBackendUpdateSlice(in interface{}) *[]restapi.FailoverBackendUpdate {
+ var out []restapi.FailoverBackendUpdate
for _, v := range in.([]interface{}) {
- out = append(out, *expandStaticBackendUpdate(v))
+ out = append(out, *expandFailoverBackendUpdate(v))
}
return &out
}
-func flattenStaticBackendList(obj *restapi.StaticBackendList) interface{} {
+func flattenFailoverBackendList(obj *restapi.FailoverBackendList) interface{} {
if obj == nil {
return nil
}
m := make(map[string]interface{})
- m["backends"] = flattenStaticBackendSlice(&obj.Backends)
+ m["backends"] = flattenFailoverBackendSlice(&obj.Backends)
m["uri"] = obj.URI
m["next_page_uri"] = obj.NextPageURI
return []interface{}{m}
}
-func flattenStaticBackendListSlice(objs *[]restapi.StaticBackendList) (sl []interface{}) {
+func flattenFailoverBackendListSlice(objs *[]restapi.FailoverBackendList) (sl []interface{}) {
if objs == nil {
return nil
}
for _, v := range *objs {
- sl = append(sl, flattenStaticBackendList(&v))
+ sl = append(sl, flattenFailoverBackendList(&v))
}
return sl
}
-func expandStaticBackendList(in interface{}) *restapi.StaticBackendList {
+func expandFailoverBackendList(in interface{}) *restapi.FailoverBackendList {
if in == nil {
return nil
}
@@ -1175,9 +1127,9 @@ func expandStaticBackendList(in interface{}) *restapi.StaticBackendList {
}
m := v.List()[0].(map[string]interface{})
- var obj restapi.StaticBackendList
+ var obj restapi.FailoverBackendList
if v, ok := m["backends"]; ok {
- obj.Backends = *expandStaticBackendSlice(v)
+ obj.Backends = *expandFailoverBackendSlice(v)
}
if v, ok := m["uri"]; ok {
obj.URI = *expandString(v)
@@ -1188,41 +1140,44 @@ func expandStaticBackendList(in interface{}) *restapi.StaticBackendList {
return &obj
}
-func expandStaticBackendListSlice(in interface{}) *[]restapi.StaticBackendList {
- var out []restapi.StaticBackendList
+func expandFailoverBackendListSlice(in interface{}) *[]restapi.FailoverBackendList {
+ var out []restapi.FailoverBackendList
for _, v := range in.([]interface{}) {
- out = append(out, *expandStaticBackendList(v))
+ out = append(out, *expandFailoverBackendList(v))
}
return &out
}
-func flattenTunnelGroupBackend(obj *restapi.TunnelGroupBackend) interface{} {
+func flattenHTTPResponseBackend(obj *restapi.HTTPResponseBackend) interface{} {
if obj == nil {
return nil
}
m := make(map[string]interface{})
m["id"] = obj.ID
+ m["uri"] = obj.URI
m["created_at"] = obj.CreatedAt
m["description"] = obj.Description
m["metadata"] = obj.Metadata
- m["labels"] = obj.Labels
+ m["body"] = obj.Body
+ m["headers"] = obj.Headers
+ m["status_code"] = obj.StatusCode
return []interface{}{m}
}
-func flattenTunnelGroupBackendSlice(objs *[]restapi.TunnelGroupBackend) (sl []interface{}) {
+func flattenHTTPResponseBackendSlice(objs *[]restapi.HTTPResponseBackend) (sl []interface{}) {
if objs == nil {
return nil
}
for _, v := range *objs {
- sl = append(sl, flattenTunnelGroupBackend(&v))
+ sl = append(sl, flattenHTTPResponseBackend(&v))
}
return sl
}
-func expandTunnelGroupBackend(in interface{}) *restapi.TunnelGroupBackend {
+func expandHTTPResponseBackend(in interface{}) *restapi.HTTPResponseBackend {
if in == nil {
return nil
}
@@ -1233,10 +1188,13 @@ func expandTunnelGroupBackend(in interface{}) *restapi.TunnelGroupBackend {
}
m := v.List()[0].(map[string]interface{})
- var obj restapi.TunnelGroupBackend
+ var obj restapi.HTTPResponseBackend
if v, ok := m["id"]; ok {
obj.ID = *expandString(v)
}
+ if v, ok := m["uri"]; ok {
+ obj.URI = *expandString(v)
+ }
if v, ok := m["created_at"]; ok {
obj.CreatedAt = *expandString(v)
}
@@ -1246,21 +1204,27 @@ func expandTunnelGroupBackend(in interface{}) *restapi.TunnelGroupBackend {
if v, ok := m["metadata"]; ok {
obj.Metadata = *expandString(v)
}
- if v, ok := m["labels"]; ok {
- obj.Labels = *expandStringMap(v)
+ if v, ok := m["body"]; ok {
+ obj.Body = *expandString(v)
+ }
+ if v, ok := m["headers"]; ok {
+ obj.Headers = *expandStringMap(v)
+ }
+ if v, ok := m["status_code"]; ok {
+ obj.StatusCode = *expandInt32(v)
}
return &obj
}
-func expandTunnelGroupBackendSlice(in interface{}) *[]restapi.TunnelGroupBackend {
- var out []restapi.TunnelGroupBackend
+func expandHTTPResponseBackendSlice(in interface{}) *[]restapi.HTTPResponseBackend {
+ var out []restapi.HTTPResponseBackend
for _, v := range in.([]interface{}) {
- out = append(out, *expandTunnelGroupBackend(v))
+ out = append(out, *expandHTTPResponseBackend(v))
}
return &out
}
-func flattenTunnelGroupBackendCreate(obj *restapi.TunnelGroupBackendCreate) interface{} {
+func flattenHTTPResponseBackendCreate(obj *restapi.HTTPResponseBackendCreate) interface{} {
if obj == nil {
return nil
}
@@ -1268,23 +1232,25 @@ func flattenTunnelGroupBackendCreate(obj *restapi.TunnelGroupBackendCreate) inte
m := make(map[string]interface{})
m["description"] = obj.Description
m["metadata"] = obj.Metadata
- m["labels"] = obj.Labels
+ m["body"] = obj.Body
+ m["headers"] = obj.Headers
+ m["status_code"] = obj.StatusCode
return []interface{}{m}
}
-func flattenTunnelGroupBackendCreateSlice(objs *[]restapi.TunnelGroupBackendCreate) (sl []interface{}) {
+func flattenHTTPResponseBackendCreateSlice(objs *[]restapi.HTTPResponseBackendCreate) (sl []interface{}) {
if objs == nil {
return nil
}
for _, v := range *objs {
- sl = append(sl, flattenTunnelGroupBackendCreate(&v))
+ sl = append(sl, flattenHTTPResponseBackendCreate(&v))
}
return sl
}
-func expandTunnelGroupBackendCreate(in interface{}) *restapi.TunnelGroupBackendCreate {
+func expandHTTPResponseBackendCreate(in interface{}) *restapi.HTTPResponseBackendCreate {
if in == nil {
return nil
}
@@ -1295,28 +1261,34 @@ func expandTunnelGroupBackendCreate(in interface{}) *restapi.TunnelGroupBackendC
}
m := v.List()[0].(map[string]interface{})
- var obj restapi.TunnelGroupBackendCreate
+ var obj restapi.HTTPResponseBackendCreate
if v, ok := m["description"]; ok {
obj.Description = *expandString(v)
}
if v, ok := m["metadata"]; ok {
obj.Metadata = *expandString(v)
}
- if v, ok := m["labels"]; ok {
- obj.Labels = *expandStringMap(v)
+ if v, ok := m["body"]; ok {
+ obj.Body = *expandString(v)
+ }
+ if v, ok := m["headers"]; ok {
+ obj.Headers = *expandStringMap(v)
+ }
+ if v, ok := m["status_code"]; ok {
+ obj.StatusCode = expandInt32(v)
}
return &obj
}
-func expandTunnelGroupBackendCreateSlice(in interface{}) *[]restapi.TunnelGroupBackendCreate {
- var out []restapi.TunnelGroupBackendCreate
+func expandHTTPResponseBackendCreateSlice(in interface{}) *[]restapi.HTTPResponseBackendCreate {
+ var out []restapi.HTTPResponseBackendCreate
for _, v := range in.([]interface{}) {
- out = append(out, *expandTunnelGroupBackendCreate(v))
+ out = append(out, *expandHTTPResponseBackendCreate(v))
}
return &out
}
-func flattenTunnelGroupBackendUpdate(obj *restapi.TunnelGroupBackendUpdate) interface{} {
+func flattenHTTPResponseBackendUpdate(obj *restapi.HTTPResponseBackendUpdate) interface{} {
if obj == nil {
return nil
}
@@ -1325,23 +1297,25 @@ func flattenTunnelGroupBackendUpdate(obj *restapi.TunnelGroupBackendUpdate) inte
m["id"] = obj.ID
m["description"] = obj.Description
m["metadata"] = obj.Metadata
- m["labels"] = obj.Labels
+ m["body"] = obj.Body
+ m["headers"] = obj.Headers
+ m["status_code"] = obj.StatusCode
return []interface{}{m}
}
-func flattenTunnelGroupBackendUpdateSlice(objs *[]restapi.TunnelGroupBackendUpdate) (sl []interface{}) {
+func flattenHTTPResponseBackendUpdateSlice(objs *[]restapi.HTTPResponseBackendUpdate) (sl []interface{}) {
if objs == nil {
return nil
}
for _, v := range *objs {
- sl = append(sl, flattenTunnelGroupBackendUpdate(&v))
+ sl = append(sl, flattenHTTPResponseBackendUpdate(&v))
}
return sl
}
-func expandTunnelGroupBackendUpdate(in interface{}) *restapi.TunnelGroupBackendUpdate {
+func expandHTTPResponseBackendUpdate(in interface{}) *restapi.HTTPResponseBackendUpdate {
if in == nil {
return nil
}
@@ -1352,7 +1326,7 @@ func expandTunnelGroupBackendUpdate(in interface{}) *restapi.TunnelGroupBackendU
}
m := v.List()[0].(map[string]interface{})
- var obj restapi.TunnelGroupBackendUpdate
+ var obj restapi.HTTPResponseBackendUpdate
if v, ok := m["id"]; ok {
obj.ID = *expandString(v)
}
@@ -1362,45 +1336,51 @@ func expandTunnelGroupBackendUpdate(in interface{}) *restapi.TunnelGroupBackendU
if v, ok := m["metadata"]; ok {
obj.Metadata = expandString(v)
}
- if v, ok := m["labels"]; ok {
- obj.Labels = *expandStringMap(v)
+ if v, ok := m["body"]; ok {
+ obj.Body = expandString(v)
+ }
+ if v, ok := m["headers"]; ok {
+ obj.Headers = expandStringMap(v)
+ }
+ if v, ok := m["status_code"]; ok {
+ obj.StatusCode = expandInt32(v)
}
return &obj
}
-func expandTunnelGroupBackendUpdateSlice(in interface{}) *[]restapi.TunnelGroupBackendUpdate {
- var out []restapi.TunnelGroupBackendUpdate
+func expandHTTPResponseBackendUpdateSlice(in interface{}) *[]restapi.HTTPResponseBackendUpdate {
+ var out []restapi.HTTPResponseBackendUpdate
for _, v := range in.([]interface{}) {
- out = append(out, *expandTunnelGroupBackendUpdate(v))
+ out = append(out, *expandHTTPResponseBackendUpdate(v))
}
return &out
}
-func flattenTunnelGroupBackendList(obj *restapi.TunnelGroupBackendList) interface{} {
+func flattenHTTPResponseBackendList(obj *restapi.HTTPResponseBackendList) interface{} {
if obj == nil {
return nil
}
m := make(map[string]interface{})
- m["backends"] = flattenTunnelGroupBackendSlice(&obj.Backends)
+ m["backends"] = flattenHTTPResponseBackendSlice(&obj.Backends)
m["uri"] = obj.URI
m["next_page_uri"] = obj.NextPageURI
return []interface{}{m}
}
-func flattenTunnelGroupBackendListSlice(objs *[]restapi.TunnelGroupBackendList) (sl []interface{}) {
+func flattenHTTPResponseBackendListSlice(objs *[]restapi.HTTPResponseBackendList) (sl []interface{}) {
if objs == nil {
return nil
}
for _, v := range *objs {
- sl = append(sl, flattenTunnelGroupBackendList(&v))
+ sl = append(sl, flattenHTTPResponseBackendList(&v))
}
return sl
}
-func expandTunnelGroupBackendList(in interface{}) *restapi.TunnelGroupBackendList {
+func expandHTTPResponseBackendList(in interface{}) *restapi.HTTPResponseBackendList {
if in == nil {
return nil
}
@@ -1411,9 +1391,9 @@ func expandTunnelGroupBackendList(in interface{}) *restapi.TunnelGroupBackendLis
}
m := v.List()[0].(map[string]interface{})
- var obj restapi.TunnelGroupBackendList
+ var obj restapi.HTTPResponseBackendList
if v, ok := m["backends"]; ok {
- obj.Backends = *expandTunnelGroupBackendSlice(v)
+ obj.Backends = *expandHTTPResponseBackendSlice(v)
}
if v, ok := m["uri"]; ok {
obj.URI = *expandString(v)
@@ -1424,41 +1404,43 @@ func expandTunnelGroupBackendList(in interface{}) *restapi.TunnelGroupBackendLis
return &obj
}
-func expandTunnelGroupBackendListSlice(in interface{}) *[]restapi.TunnelGroupBackendList {
- var out []restapi.TunnelGroupBackendList
+func expandHTTPResponseBackendListSlice(in interface{}) *[]restapi.HTTPResponseBackendList {
+ var out []restapi.HTTPResponseBackendList
for _, v := range in.([]interface{}) {
- out = append(out, *expandTunnelGroupBackendList(v))
+ out = append(out, *expandHTTPResponseBackendList(v))
}
return &out
}
-func flattenWeightedBackend(obj *restapi.WeightedBackend) interface{} {
+func flattenStaticBackend(obj *restapi.StaticBackend) interface{} {
if obj == nil {
return nil
}
m := make(map[string]interface{})
m["id"] = obj.ID
+ m["uri"] = obj.URI
m["created_at"] = obj.CreatedAt
m["description"] = obj.Description
m["metadata"] = obj.Metadata
- m["backends"] = obj.Backends
+ m["address"] = obj.Address
+ m["tls"] = flattenStaticBackendTLS(&obj.TLS)
return []interface{}{m}
}
-func flattenWeightedBackendSlice(objs *[]restapi.WeightedBackend) (sl []interface{}) {
+func flattenStaticBackendSlice(objs *[]restapi.StaticBackend) (sl []interface{}) {
if objs == nil {
return nil
}
for _, v := range *objs {
- sl = append(sl, flattenWeightedBackend(&v))
+ sl = append(sl, flattenStaticBackend(&v))
}
return sl
}
-func expandWeightedBackend(in interface{}) *restapi.WeightedBackend {
+func expandStaticBackend(in interface{}) *restapi.StaticBackend {
if in == nil {
return nil
}
@@ -1469,10 +1451,13 @@ func expandWeightedBackend(in interface{}) *restapi.WeightedBackend {
}
m := v.List()[0].(map[string]interface{})
- var obj restapi.WeightedBackend
+ var obj restapi.StaticBackend
if v, ok := m["id"]; ok {
obj.ID = *expandString(v)
}
+ if v, ok := m["uri"]; ok {
+ obj.URI = *expandString(v)
+ }
if v, ok := m["created_at"]; ok {
obj.CreatedAt = *expandString(v)
}
@@ -1482,21 +1467,72 @@ func expandWeightedBackend(in interface{}) *restapi.WeightedBackend {
if v, ok := m["metadata"]; ok {
obj.Metadata = *expandString(v)
}
- if v, ok := m["backends"]; ok {
- obj.Backends = *expandInt64Map(v)
+ if v, ok := m["address"]; ok {
+ obj.Address = *expandString(v)
+ }
+ if v, ok := m["tls"]; ok {
+ obj.TLS = *expandStaticBackendTLS(v)
}
return &obj
}
-func expandWeightedBackendSlice(in interface{}) *[]restapi.WeightedBackend {
- var out []restapi.WeightedBackend
+func expandStaticBackendSlice(in interface{}) *[]restapi.StaticBackend {
+ var out []restapi.StaticBackend
for _, v := range in.([]interface{}) {
- out = append(out, *expandWeightedBackend(v))
+ out = append(out, *expandStaticBackend(v))
}
return &out
}
-func flattenWeightedBackendCreate(obj *restapi.WeightedBackendCreate) interface{} {
+func flattenStaticBackendTLS(obj *restapi.StaticBackendTLS) interface{} {
+ if obj == nil {
+ return nil
+ }
+
+ m := make(map[string]interface{})
+ m["enabled"] = obj.Enabled
+
+ return []interface{}{m}
+}
+
+func flattenStaticBackendTLSSlice(objs *[]restapi.StaticBackendTLS) (sl []interface{}) {
+ if objs == nil {
+ return nil
+ }
+
+ for _, v := range *objs {
+ sl = append(sl, flattenStaticBackendTLS(&v))
+ }
+ return sl
+}
+
+func expandStaticBackendTLS(in interface{}) *restapi.StaticBackendTLS {
+ if in == nil {
+ return nil
+ }
+ v := in.(*schema.Set)
+
+ if v.Len() == 0 {
+ return nil
+ }
+
+ m := v.List()[0].(map[string]interface{})
+ var obj restapi.StaticBackendTLS
+ if v, ok := m["enabled"]; ok {
+ obj.Enabled = *expandBool(v)
+ }
+ return &obj
+}
+
+func expandStaticBackendTLSSlice(in interface{}) *[]restapi.StaticBackendTLS {
+ var out []restapi.StaticBackendTLS
+ for _, v := range in.([]interface{}) {
+ out = append(out, *expandStaticBackendTLS(v))
+ }
+ return &out
+}
+
+func flattenStaticBackendCreate(obj *restapi.StaticBackendCreate) interface{} {
if obj == nil {
return nil
}
@@ -1504,23 +1540,24 @@ func flattenWeightedBackendCreate(obj *restapi.WeightedBackendCreate) interface{
m := make(map[string]interface{})
m["description"] = obj.Description
m["metadata"] = obj.Metadata
- m["backends"] = obj.Backends
+ m["address"] = obj.Address
+ m["tls"] = flattenStaticBackendTLS(&obj.TLS)
return []interface{}{m}
}
-func flattenWeightedBackendCreateSlice(objs *[]restapi.WeightedBackendCreate) (sl []interface{}) {
+func flattenStaticBackendCreateSlice(objs *[]restapi.StaticBackendCreate) (sl []interface{}) {
if objs == nil {
return nil
}
for _, v := range *objs {
- sl = append(sl, flattenWeightedBackendCreate(&v))
+ sl = append(sl, flattenStaticBackendCreate(&v))
}
return sl
}
-func expandWeightedBackendCreate(in interface{}) *restapi.WeightedBackendCreate {
+func expandStaticBackendCreate(in interface{}) *restapi.StaticBackendCreate {
if in == nil {
return nil
}
@@ -1531,28 +1568,31 @@ func expandWeightedBackendCreate(in interface{}) *restapi.WeightedBackendCreate
}
m := v.List()[0].(map[string]interface{})
- var obj restapi.WeightedBackendCreate
+ var obj restapi.StaticBackendCreate
if v, ok := m["description"]; ok {
obj.Description = *expandString(v)
}
if v, ok := m["metadata"]; ok {
obj.Metadata = *expandString(v)
}
- if v, ok := m["backends"]; ok {
- obj.Backends = *expandInt64Map(v)
+ if v, ok := m["address"]; ok {
+ obj.Address = *expandString(v)
+ }
+ if v, ok := m["tls"]; ok {
+ obj.TLS = *expandStaticBackendTLS(v)
}
return &obj
}
-func expandWeightedBackendCreateSlice(in interface{}) *[]restapi.WeightedBackendCreate {
- var out []restapi.WeightedBackendCreate
+func expandStaticBackendCreateSlice(in interface{}) *[]restapi.StaticBackendCreate {
+ var out []restapi.StaticBackendCreate
for _, v := range in.([]interface{}) {
- out = append(out, *expandWeightedBackendCreate(v))
+ out = append(out, *expandStaticBackendCreate(v))
}
return &out
}
-func flattenWeightedBackendUpdate(obj *restapi.WeightedBackendUpdate) interface{} {
+func flattenStaticBackendUpdate(obj *restapi.StaticBackendUpdate) interface{} {
if obj == nil {
return nil
}
@@ -1561,23 +1601,24 @@ func flattenWeightedBackendUpdate(obj *restapi.WeightedBackendUpdate) interface{
m["id"] = obj.ID
m["description"] = obj.Description
m["metadata"] = obj.Metadata
- m["backends"] = obj.Backends
+ m["address"] = obj.Address
+ m["tls"] = flattenStaticBackendTLS(&obj.TLS)
return []interface{}{m}
}
-func flattenWeightedBackendUpdateSlice(objs *[]restapi.WeightedBackendUpdate) (sl []interface{}) {
+func flattenStaticBackendUpdateSlice(objs *[]restapi.StaticBackendUpdate) (sl []interface{}) {
if objs == nil {
return nil
}
for _, v := range *objs {
- sl = append(sl, flattenWeightedBackendUpdate(&v))
+ sl = append(sl, flattenStaticBackendUpdate(&v))
}
return sl
}
-func expandWeightedBackendUpdate(in interface{}) *restapi.WeightedBackendUpdate {
+func expandStaticBackendUpdate(in interface{}) *restapi.StaticBackendUpdate {
if in == nil {
return nil
}
@@ -1588,7 +1629,7 @@ func expandWeightedBackendUpdate(in interface{}) *restapi.WeightedBackendUpdate
}
m := v.List()[0].(map[string]interface{})
- var obj restapi.WeightedBackendUpdate
+ var obj restapi.StaticBackendUpdate
if v, ok := m["id"]; ok {
obj.ID = *expandString(v)
}
@@ -1598,45 +1639,48 @@ func expandWeightedBackendUpdate(in interface{}) *restapi.WeightedBackendUpdate
if v, ok := m["metadata"]; ok {
obj.Metadata = expandString(v)
}
- if v, ok := m["backends"]; ok {
- obj.Backends = *expandInt64Map(v)
+ if v, ok := m["address"]; ok {
+ obj.Address = *expandString(v)
+ }
+ if v, ok := m["tls"]; ok {
+ obj.TLS = *expandStaticBackendTLS(v)
}
return &obj
}
-func expandWeightedBackendUpdateSlice(in interface{}) *[]restapi.WeightedBackendUpdate {
- var out []restapi.WeightedBackendUpdate
+func expandStaticBackendUpdateSlice(in interface{}) *[]restapi.StaticBackendUpdate {
+ var out []restapi.StaticBackendUpdate
for _, v := range in.([]interface{}) {
- out = append(out, *expandWeightedBackendUpdate(v))
+ out = append(out, *expandStaticBackendUpdate(v))
}
return &out
}
-func flattenWeightedBackendList(obj *restapi.WeightedBackendList) interface{} {
+func flattenStaticBackendList(obj *restapi.StaticBackendList) interface{} {
if obj == nil {
return nil
}
m := make(map[string]interface{})
- m["backends"] = flattenWeightedBackendSlice(&obj.Backends)
+ m["backends"] = flattenStaticBackendSlice(&obj.Backends)
m["uri"] = obj.URI
m["next_page_uri"] = obj.NextPageURI
return []interface{}{m}
}
-func flattenWeightedBackendListSlice(objs *[]restapi.WeightedBackendList) (sl []interface{}) {
+func flattenStaticBackendListSlice(objs *[]restapi.StaticBackendList) (sl []interface{}) {
if objs == nil {
return nil
}
for _, v := range *objs {
- sl = append(sl, flattenWeightedBackendList(&v))
+ sl = append(sl, flattenStaticBackendList(&v))
}
return sl
}
-func expandWeightedBackendList(in interface{}) *restapi.WeightedBackendList {
+func expandStaticBackendList(in interface{}) *restapi.StaticBackendList {
if in == nil {
return nil
}
@@ -1647,9 +1691,9 @@ func expandWeightedBackendList(in interface{}) *restapi.WeightedBackendList {
}
m := v.List()[0].(map[string]interface{})
- var obj restapi.WeightedBackendList
+ var obj restapi.StaticBackendList
if v, ok := m["backends"]; ok {
- obj.Backends = *expandWeightedBackendSlice(v)
+ obj.Backends = *expandStaticBackendSlice(v)
}
if v, ok := m["uri"]; ok {
obj.URI = *expandString(v)
@@ -1660,39 +1704,43 @@ func expandWeightedBackendList(in interface{}) *restapi.WeightedBackendList {
return &obj
}
-func expandWeightedBackendListSlice(in interface{}) *[]restapi.WeightedBackendList {
- var out []restapi.WeightedBackendList
+func expandStaticBackendListSlice(in interface{}) *[]restapi.StaticBackendList {
+ var out []restapi.StaticBackendList
for _, v := range in.([]interface{}) {
- out = append(out, *expandWeightedBackendList(v))
+ out = append(out, *expandStaticBackendList(v))
}
return &out
}
-func flattenCertificateAuthorityCreate(obj *restapi.CertificateAuthorityCreate) interface{} {
+func flattenTunnelGroupBackend(obj *restapi.TunnelGroupBackend) interface{} {
if obj == nil {
return nil
}
m := make(map[string]interface{})
+ m["id"] = obj.ID
+ m["uri"] = obj.URI
+ m["created_at"] = obj.CreatedAt
m["description"] = obj.Description
m["metadata"] = obj.Metadata
- m["ca_pem"] = obj.CAPEM
+ m["labels"] = obj.Labels
+ m["tunnels"] = flattenRefSlice(&obj.Tunnels)
return []interface{}{m}
}
-func flattenCertificateAuthorityCreateSlice(objs *[]restapi.CertificateAuthorityCreate) (sl []interface{}) {
+func flattenTunnelGroupBackendSlice(objs *[]restapi.TunnelGroupBackend) (sl []interface{}) {
if objs == nil {
return nil
}
for _, v := range *objs {
- sl = append(sl, flattenCertificateAuthorityCreate(&v))
+ sl = append(sl, flattenTunnelGroupBackend(&v))
}
return sl
}
-func expandCertificateAuthorityCreate(in interface{}) *restapi.CertificateAuthorityCreate {
+func expandTunnelGroupBackend(in interface{}) *restapi.TunnelGroupBackend {
if in == nil {
return nil
}
@@ -1703,52 +1751,64 @@ func expandCertificateAuthorityCreate(in interface{}) *restapi.CertificateAuthor
}
m := v.List()[0].(map[string]interface{})
- var obj restapi.CertificateAuthorityCreate
+ var obj restapi.TunnelGroupBackend
+ if v, ok := m["id"]; ok {
+ obj.ID = *expandString(v)
+ }
+ if v, ok := m["uri"]; ok {
+ obj.URI = *expandString(v)
+ }
+ if v, ok := m["created_at"]; ok {
+ obj.CreatedAt = *expandString(v)
+ }
if v, ok := m["description"]; ok {
obj.Description = *expandString(v)
}
if v, ok := m["metadata"]; ok {
obj.Metadata = *expandString(v)
}
- if v, ok := m["ca_pem"]; ok {
- obj.CAPEM = *expandString(v)
+ if v, ok := m["labels"]; ok {
+ obj.Labels = *expandStringMap(v)
+ }
+ if v, ok := m["tunnels"]; ok {
+ obj.Tunnels = *expandRefSlice(v)
}
return &obj
}
-func expandCertificateAuthorityCreateSlice(in interface{}) *[]restapi.CertificateAuthorityCreate {
- var out []restapi.CertificateAuthorityCreate
+func expandTunnelGroupBackendSlice(in interface{}) *[]restapi.TunnelGroupBackend {
+ var out []restapi.TunnelGroupBackend
for _, v := range in.([]interface{}) {
- out = append(out, *expandCertificateAuthorityCreate(v))
+ out = append(out, *expandTunnelGroupBackend(v))
}
return &out
}
-func flattenCertificateAuthorityUpdate(obj *restapi.CertificateAuthorityUpdate) interface{} {
+func flattenTunnelGroupBackendCreate(obj *restapi.TunnelGroupBackendCreate) interface{} {
if obj == nil {
return nil
}
m := make(map[string]interface{})
- m["id"] = obj.ID
m["description"] = obj.Description
m["metadata"] = obj.Metadata
+ m["labels"] = obj.Labels
return []interface{}{m}
}
-func flattenCertificateAuthorityUpdateSlice(objs *[]restapi.CertificateAuthorityUpdate) (sl []interface{}) {
+func flattenTunnelGroupBackendCreateSlice(objs *[]restapi.TunnelGroupBackendCreate) (sl []interface{}) {
if objs == nil {
return nil
}
for _, v := range *objs {
- sl = append(sl, flattenCertificateAuthorityUpdate(&v))
+ sl = append(sl, flattenTunnelGroupBackendCreate(&v))
}
return sl
}
-func expandCertificateAuthorityUpdate(in interface{}) *restapi.CertificateAuthorityUpdate {
+func expandTunnelGroupBackendCreate(in interface{}) *restapi.TunnelGroupBackendCreate {
if in == nil {
return nil
}
@@ -1759,60 +1819,53 @@ func expandCertificateAuthorityUpdate(in interface{}) *restapi.CertificateAuthor
}
m := v.List()[0].(map[string]interface{})
- var obj restapi.CertificateAuthorityUpdate
- if v, ok := m["id"]; ok {
- obj.ID = *expandString(v)
- }
+ var obj restapi.TunnelGroupBackendCreate
if v, ok := m["description"]; ok {
- obj.Description = expandString(v)
+ obj.Description = *expandString(v)
}
if v, ok := m["metadata"]; ok {
- obj.Metadata = expandString(v)
+ obj.Metadata = *expandString(v)
+ }
+ if v, ok := m["labels"]; ok {
+ obj.Labels = *expandStringMap(v)
}
return &obj
}
-func expandCertificateAuthorityUpdateSlice(in interface{}) *[]restapi.CertificateAuthorityUpdate {
- var out []restapi.CertificateAuthorityUpdate
+func expandTunnelGroupBackendCreateSlice(in interface{}) *[]restapi.TunnelGroupBackendCreate {
+ var out []restapi.TunnelGroupBackendCreate
for _, v := range in.([]interface{}) {
- out = append(out, *expandCertificateAuthorityUpdate(v))
+ out = append(out, *expandTunnelGroupBackendCreate(v))
}
return &out
}
-func flattenCertificateAuthority(obj *restapi.CertificateAuthority) interface{} {
+func flattenTunnelGroupBackendUpdate(obj *restapi.TunnelGroupBackendUpdate) interface{} {
if obj == nil {
return nil
}
m := make(map[string]interface{})
m["id"] = obj.ID
- m["uri"] = obj.URI
- m["created_at"] = obj.CreatedAt
m["description"] = obj.Description
m["metadata"] = obj.Metadata
- m["ca_pem"] = obj.CAPEM
- m["subject_common_name"] = obj.SubjectCommonName
- m["not_before"] = obj.NotBefore
- m["not_after"] = obj.NotAfter
- m["key_usages"] = obj.KeyUsages
- m["extended_key_usages"] = obj.ExtendedKeyUsages
+ m["labels"] = obj.Labels
return []interface{}{m}
}
-func flattenCertificateAuthoritySlice(objs *[]restapi.CertificateAuthority) (sl []interface{}) {
+func flattenTunnelGroupBackendUpdateSlice(objs *[]restapi.TunnelGroupBackendUpdate) (sl []interface{}) {
if objs == nil {
return nil
}
for _, v := range *objs {
- sl = append(sl, flattenCertificateAuthority(&v))
+ sl = append(sl, flattenTunnelGroupBackendUpdate(&v))
}
return sl
}
-func expandCertificateAuthority(in interface{}) *restapi.CertificateAuthority {
+func expandTunnelGroupBackendUpdate(in interface{}) *restapi.TunnelGroupBackendUpdate {
if in == nil {
return nil
}
@@ -1823,76 +1876,55 @@ func expandCertificateAuthority(in interface{}) *restapi.CertificateAuthority {
}
m := v.List()[0].(map[string]interface{})
- var obj restapi.CertificateAuthority
+ var obj restapi.TunnelGroupBackendUpdate
if v, ok := m["id"]; ok {
obj.ID = *expandString(v)
}
- if v, ok := m["uri"]; ok {
- obj.URI = *expandString(v)
- }
- if v, ok := m["created_at"]; ok {
- obj.CreatedAt = *expandString(v)
- }
if v, ok := m["description"]; ok {
- obj.Description = *expandString(v)
+ obj.Description = expandString(v)
}
if v, ok := m["metadata"]; ok {
- obj.Metadata = *expandString(v)
- }
- if v, ok := m["ca_pem"]; ok {
- obj.CAPEM = *expandString(v)
- }
- if v, ok := m["subject_common_name"]; ok {
- obj.SubjectCommonName = *expandString(v)
- }
- if v, ok := m["not_before"]; ok {
- obj.NotBefore = *expandString(v)
- }
- if v, ok := m["not_after"]; ok {
- obj.NotAfter = *expandString(v)
- }
- if v, ok := m["key_usages"]; ok {
- obj.KeyUsages = *expandStringSlice(v)
+ obj.Metadata = expandString(v)
}
- if v, ok := m["extended_key_usages"]; ok {
- obj.ExtendedKeyUsages = *expandStringSlice(v)
+ if v, ok := m["labels"]; ok {
+ obj.Labels = *expandStringMap(v)
}
return &obj
}
-func expandCertificateAuthoritySlice(in interface{}) *[]restapi.CertificateAuthority {
- var out []restapi.CertificateAuthority
+func expandTunnelGroupBackendUpdateSlice(in interface{}) *[]restapi.TunnelGroupBackendUpdate {
+ var out []restapi.TunnelGroupBackendUpdate
for _, v := range in.([]interface{}) {
- out = append(out, *expandCertificateAuthority(v))
+ out = append(out, *expandTunnelGroupBackendUpdate(v))
}
return &out
}
-func flattenCertificateAuthorityList(obj *restapi.CertificateAuthorityList) interface{} {
+func flattenTunnelGroupBackendList(obj *restapi.TunnelGroupBackendList) interface{} {
if obj == nil {
return nil
}
m := make(map[string]interface{})
- m["certificate_authorities"] = flattenCertificateAuthoritySlice(&obj.CertificateAuthorities)
+ m["backends"] = flattenTunnelGroupBackendSlice(&obj.Backends)
m["uri"] = obj.URI
m["next_page_uri"] = obj.NextPageURI
return []interface{}{m}
}
-func flattenCertificateAuthorityListSlice(objs *[]restapi.CertificateAuthorityList) (sl []interface{}) {
+func flattenTunnelGroupBackendListSlice(objs *[]restapi.TunnelGroupBackendList) (sl []interface{}) {
if objs == nil {
return nil
}
for _, v := range *objs {
- sl = append(sl, flattenCertificateAuthorityList(&v))
+ sl = append(sl, flattenTunnelGroupBackendList(&v))
}
return sl
}
-func expandCertificateAuthorityList(in interface{}) *restapi.CertificateAuthorityList {
+func expandTunnelGroupBackendList(in interface{}) *restapi.TunnelGroupBackendList {
if in == nil {
return nil
}
@@ -1903,9 +1935,9 @@ func expandCertificateAuthorityList(in interface{}) *restapi.CertificateAuthorit
}
m := v.List()[0].(map[string]interface{})
- var obj restapi.CertificateAuthorityList
- if v, ok := m["certificate_authorities"]; ok {
- obj.CertificateAuthorities = *expandCertificateAuthoritySlice(v)
+ var obj restapi.TunnelGroupBackendList
+ if v, ok := m["backends"]; ok {
+ obj.Backends = *expandTunnelGroupBackendSlice(v)
}
if v, ok := m["uri"]; ok {
obj.URI = *expandString(v)
@@ -1916,39 +1948,42 @@ func expandCertificateAuthorityList(in interface{}) *restapi.CertificateAuthorit
return &obj
}
-func expandCertificateAuthorityListSlice(in interface{}) *[]restapi.CertificateAuthorityList {
- var out []restapi.CertificateAuthorityList
+func expandTunnelGroupBackendListSlice(in interface{}) *[]restapi.TunnelGroupBackendList {
+ var out []restapi.TunnelGroupBackendList
for _, v := range in.([]interface{}) {
- out = append(out, *expandCertificateAuthorityList(v))
+ out = append(out, *expandTunnelGroupBackendList(v))
}
return &out
}
-func flattenCredentialCreate(obj *restapi.CredentialCreate) interface{} {
+func flattenWeightedBackend(obj *restapi.WeightedBackend) interface{} {
if obj == nil {
return nil
}
m := make(map[string]interface{})
+ m["id"] = obj.ID
+ m["uri"] = obj.URI
+ m["created_at"] = obj.CreatedAt
m["description"] = obj.Description
m["metadata"] = obj.Metadata
- m["acl"] = obj.ACL
+ m["backends"] = obj.Backends
return []interface{}{m}
}
-func flattenCredentialCreateSlice(objs *[]restapi.CredentialCreate) (sl []interface{}) {
+func flattenWeightedBackendSlice(objs *[]restapi.WeightedBackend) (sl []interface{}) {
if objs == nil {
return nil
}
for _, v := range *objs {
- sl = append(sl, flattenCredentialCreate(&v))
+ sl = append(sl, flattenWeightedBackend(&v))
}
return sl
}
-func expandCredentialCreate(in interface{}) *restapi.CredentialCreate {
+func expandWeightedBackend(in interface{}) *restapi.WeightedBackend {
if in == nil {
return nil
}
@@ -1959,53 +1994,61 @@ func expandCredentialCreate(in interface{}) *restapi.CredentialCreate {
}
m := v.List()[0].(map[string]interface{})
- var obj restapi.CredentialCreate
+ var obj restapi.WeightedBackend
+ if v, ok := m["id"]; ok {
+ obj.ID = *expandString(v)
+ }
+ if v, ok := m["uri"]; ok {
+ obj.URI = *expandString(v)
+ }
+ if v, ok := m["created_at"]; ok {
+ obj.CreatedAt = *expandString(v)
+ }
if v, ok := m["description"]; ok {
obj.Description = *expandString(v)
}
if v, ok := m["metadata"]; ok {
obj.Metadata = *expandString(v)
}
- if v, ok := m["acl"]; ok {
- obj.ACL = *expandStringSlice(v)
+ if v, ok := m["backends"]; ok {
+ obj.Backends = *expandInt64Map(v)
}
return &obj
}
-func expandCredentialCreateSlice(in interface{}) *[]restapi.CredentialCreate {
- var out []restapi.CredentialCreate
+func expandWeightedBackendSlice(in interface{}) *[]restapi.WeightedBackend {
+ var out []restapi.WeightedBackend
for _, v := range in.([]interface{}) {
- out = append(out, *expandCredentialCreate(v))
+ out = append(out, *expandWeightedBackend(v))
}
return &out
}
-func flattenCredentialUpdate(obj *restapi.CredentialUpdate) interface{} {
+func flattenWeightedBackendCreate(obj *restapi.WeightedBackendCreate) interface{} {
if obj == nil {
return nil
}
m := make(map[string]interface{})
- m["id"] = obj.ID
m["description"] = obj.Description
m["metadata"] = obj.Metadata
- m["acl"] = obj.ACL
+ m["backends"] = obj.Backends
return []interface{}{m}
}
-func flattenCredentialUpdateSlice(objs *[]restapi.CredentialUpdate) (sl []interface{}) {
+func flattenWeightedBackendCreateSlice(objs *[]restapi.WeightedBackendCreate) (sl []interface{}) {
if objs == nil {
return nil
}
for _, v := range *objs {
- sl = append(sl, flattenCredentialUpdate(&v))
+ sl = append(sl, flattenWeightedBackendCreate(&v))
}
return sl
}
-func expandCredentialUpdate(in interface{}) *restapi.CredentialUpdate {
+func expandWeightedBackendCreate(in interface{}) *restapi.WeightedBackendCreate {
if in == nil {
return nil
}
@@ -2016,59 +2059,53 @@ func expandCredentialUpdate(in interface{}) *restapi.CredentialUpdate {
}
m := v.List()[0].(map[string]interface{})
- var obj restapi.CredentialUpdate
- if v, ok := m["id"]; ok {
- obj.ID = *expandString(v)
- }
+ var obj restapi.WeightedBackendCreate
if v, ok := m["description"]; ok {
- obj.Description = expandString(v)
+ obj.Description = *expandString(v)
}
if v, ok := m["metadata"]; ok {
- obj.Metadata = expandString(v)
+ obj.Metadata = *expandString(v)
}
- if v, ok := m["acl"]; ok {
- obj.ACL = expandStringSlice(v)
+ if v, ok := m["backends"]; ok {
+ obj.Backends = *expandInt64Map(v)
}
return &obj
}
-func expandCredentialUpdateSlice(in interface{}) *[]restapi.CredentialUpdate {
- var out []restapi.CredentialUpdate
+func expandWeightedBackendCreateSlice(in interface{}) *[]restapi.WeightedBackendCreate {
+ var out []restapi.WeightedBackendCreate
for _, v := range in.([]interface{}) {
- out = append(out, *expandCredentialUpdate(v))
+ out = append(out, *expandWeightedBackendCreate(v))
}
return &out
}
-func flattenCredential(obj *restapi.Credential) interface{} {
+func flattenWeightedBackendUpdate(obj *restapi.WeightedBackendUpdate) interface{} {
if obj == nil {
return nil
}
m := make(map[string]interface{})
m["id"] = obj.ID
- m["uri"] = obj.URI
- m["created_at"] = obj.CreatedAt
m["description"] = obj.Description
m["metadata"] = obj.Metadata
- m["token"] = obj.Token
- m["acl"] = obj.ACL
+ m["backends"] = obj.Backends
return []interface{}{m}
}
-func flattenCredentialSlice(objs *[]restapi.Credential) (sl []interface{}) {
+func flattenWeightedBackendUpdateSlice(objs *[]restapi.WeightedBackendUpdate) (sl []interface{}) {
if objs == nil {
return nil
}
for _, v := range *objs {
- sl = append(sl, flattenCredential(&v))
+ sl = append(sl, flattenWeightedBackendUpdate(&v))
}
return sl
}
-func expandCredential(in interface{}) *restapi.Credential {
+func expandWeightedBackendUpdate(in interface{}) *restapi.WeightedBackendUpdate {
if in == nil {
return nil
}
@@ -2079,64 +2116,55 @@ func expandCredential(in interface{}) *restapi.Credential {
}
m := v.List()[0].(map[string]interface{})
- var obj restapi.Credential
+ var obj restapi.WeightedBackendUpdate
if v, ok := m["id"]; ok {
obj.ID = *expandString(v)
}
- if v, ok := m["uri"]; ok {
- obj.URI = *expandString(v)
- }
- if v, ok := m["created_at"]; ok {
- obj.CreatedAt = *expandString(v)
- }
if v, ok := m["description"]; ok {
- obj.Description = *expandString(v)
+ obj.Description = expandString(v)
}
if v, ok := m["metadata"]; ok {
- obj.Metadata = *expandString(v)
- }
- if v, ok := m["token"]; ok {
- obj.Token = expandString(v)
+ obj.Metadata = expandString(v)
}
- if v, ok := m["acl"]; ok {
- obj.ACL = *expandStringSlice(v)
+ if v, ok := m["backends"]; ok {
+ obj.Backends = *expandInt64Map(v)
}
return &obj
}
-func expandCredentialSlice(in interface{}) *[]restapi.Credential {
- var out []restapi.Credential
+func expandWeightedBackendUpdateSlice(in interface{}) *[]restapi.WeightedBackendUpdate {
+ var out []restapi.WeightedBackendUpdate
for _, v := range in.([]interface{}) {
- out = append(out, *expandCredential(v))
+ out = append(out, *expandWeightedBackendUpdate(v))
}
return &out
}
-func flattenCredentialList(obj *restapi.CredentialList) interface{} {
+func flattenWeightedBackendList(obj *restapi.WeightedBackendList) interface{} {
if obj == nil {
return nil
}
m := make(map[string]interface{})
- m["credentials"] = flattenCredentialSlice(&obj.Credentials)
+ m["backends"] = flattenWeightedBackendSlice(&obj.Backends)
m["uri"] = obj.URI
m["next_page_uri"] = obj.NextPageURI
return []interface{}{m}
}
-func flattenCredentialListSlice(objs *[]restapi.CredentialList) (sl []interface{}) {
+func flattenWeightedBackendListSlice(objs *[]restapi.WeightedBackendList) (sl []interface{}) {
if objs == nil {
return nil
}
for _, v := range *objs {
- sl = append(sl, flattenCredentialList(&v))
+ sl = append(sl, flattenWeightedBackendList(&v))
}
return sl
}
-func expandCredentialList(in interface{}) *restapi.CredentialList {
+func expandWeightedBackendList(in interface{}) *restapi.WeightedBackendList {
if in == nil {
return nil
}
@@ -2147,9 +2175,9 @@ func expandCredentialList(in interface{}) *restapi.CredentialList {
}
m := v.List()[0].(map[string]interface{})
- var obj restapi.CredentialList
- if v, ok := m["credentials"]; ok {
- obj.Credentials = *expandCredentialSlice(v)
+ var obj restapi.WeightedBackendList
+ if v, ok := m["backends"]; ok {
+ obj.Backends = *expandWeightedBackendSlice(v)
}
if v, ok := m["uri"]; ok {
obj.URI = *expandString(v)
@@ -2160,56 +2188,39 @@ func expandCredentialList(in interface{}) *restapi.CredentialList {
return &obj
}
-func expandCredentialListSlice(in interface{}) *[]restapi.CredentialList {
- var out []restapi.CredentialList
+func expandWeightedBackendListSlice(in interface{}) *[]restapi.WeightedBackendList {
+ var out []restapi.WeightedBackendList
for _, v := range in.([]interface{}) {
- out = append(out, *expandCredentialList(v))
+ out = append(out, *expandWeightedBackendList(v))
}
return &out
}
-func flattenEndpointConfiguration(obj *restapi.EndpointConfiguration) interface{} {
+func flattenCertificateAuthorityCreate(obj *restapi.CertificateAuthorityCreate) interface{} {
if obj == nil {
return nil
}
m := make(map[string]interface{})
- m["id"] = obj.ID
- m["type"] = obj.Type
m["description"] = obj.Description
m["metadata"] = obj.Metadata
- m["created_at"] = obj.CreatedAt
- m["uri"] = obj.URI
- m["basic_auth"] = flattenEndpointBasicAuth(obj.BasicAuth)
- m["circuit_breaker"] = flattenEndpointCircuitBreaker(obj.CircuitBreaker)
- m["compression"] = flattenEndpointCompression(obj.Compression)
- m["request_headers"] = flattenEndpointRequestHeaders(obj.RequestHeaders)
- m["response_headers"] = flattenEndpointResponseHeaders(obj.ResponseHeaders)
- m["ip_policy"] = flattenEndpointIPPolicy(obj.IPPolicy)
- m["mutual_tls"] = flattenEndpointMutualTLS(obj.MutualTLS)
- m["tls_termination"] = flattenEndpointTLSTermination(obj.TLSTermination)
- m["webhook_validation"] = flattenEndpointWebhookValidation(obj.WebhookValidation)
- m["oauth"] = flattenEndpointOAuth(obj.OAuth)
- m["logging"] = flattenEndpointLogging(obj.Logging)
- m["saml"] = flattenEndpointSAML(obj.SAML)
- m["oidc"] = flattenEndpointOIDC(obj.OIDC)
- m["backend"] = flattenEndpointBackend(obj.Backend)
+ m["ca_pem"] = obj.CAPEM
return []interface{}{m}
}
-func flattenEndpointConfigurationSlice(objs *[]restapi.EndpointConfiguration) (sl []interface{}) {
+func flattenCertificateAuthorityCreateSlice(objs *[]restapi.CertificateAuthorityCreate) (sl []interface{}) {
if objs == nil {
return nil
}
for _, v := range *objs {
- sl = append(sl, flattenEndpointConfiguration(&v))
+ sl = append(sl, flattenCertificateAuthorityCreate(&v))
}
return sl
}
-func expandEndpointConfiguration(in interface{}) *restapi.EndpointConfiguration {
+func expandCertificateAuthorityCreate(in interface{}) *restapi.CertificateAuthorityCreate {
if in == nil {
return nil
}
@@ -2220,103 +2231,52 @@ func expandEndpointConfiguration(in interface{}) *restapi.EndpointConfiguration
}
m := v.List()[0].(map[string]interface{})
- var obj restapi.EndpointConfiguration
- if v, ok := m["id"]; ok {
- obj.ID = *expandString(v)
- }
- if v, ok := m["type"]; ok {
- obj.Type = *expandString(v)
- }
+ var obj restapi.CertificateAuthorityCreate
if v, ok := m["description"]; ok {
obj.Description = *expandString(v)
}
if v, ok := m["metadata"]; ok {
obj.Metadata = *expandString(v)
}
- if v, ok := m["created_at"]; ok {
- obj.CreatedAt = *expandString(v)
+ if v, ok := m["ca_pem"]; ok {
+ obj.CAPEM = *expandString(v)
}
- if v, ok := m["uri"]; ok {
- obj.URI = *expandString(v)
- }
- if v, ok := m["basic_auth"]; ok {
- obj.BasicAuth = expandEndpointBasicAuth(v)
- }
- if v, ok := m["circuit_breaker"]; ok {
- obj.CircuitBreaker = expandEndpointCircuitBreaker(v)
- }
- if v, ok := m["compression"]; ok {
- obj.Compression = expandEndpointCompression(v)
- }
- if v, ok := m["request_headers"]; ok {
- obj.RequestHeaders = expandEndpointRequestHeaders(v)
- }
- if v, ok := m["response_headers"]; ok {
- obj.ResponseHeaders = expandEndpointResponseHeaders(v)
- }
- if v, ok := m["ip_policy"]; ok {
- obj.IPPolicy = expandEndpointIPPolicy(v)
- }
- if v, ok := m["mutual_tls"]; ok {
- obj.MutualTLS = expandEndpointMutualTLS(v)
- }
- if v, ok := m["tls_termination"]; ok {
- obj.TLSTermination = expandEndpointTLSTermination(v)
- }
- if v, ok := m["webhook_validation"]; ok {
- obj.WebhookValidation = expandEndpointWebhookValidation(v)
- }
- if v, ok := m["oauth"]; ok {
- obj.OAuth = expandEndpointOAuth(v)
- }
- if v, ok := m["logging"]; ok {
- obj.Logging = expandEndpointLogging(v)
- }
- if v, ok := m["saml"]; ok {
- obj.SAML = expandEndpointSAML(v)
- }
- if v, ok := m["oidc"]; ok {
- obj.OIDC = expandEndpointOIDC(v)
- }
- if v, ok := m["backend"]; ok {
- obj.Backend = expandEndpointBackend(v)
- }
- return &obj
-}
-
-func expandEndpointConfigurationSlice(in interface{}) *[]restapi.EndpointConfiguration {
- var out []restapi.EndpointConfiguration
- for _, v := range in.([]interface{}) {
- out = append(out, *expandEndpointConfiguration(v))
+ return &obj
+}
+
+func expandCertificateAuthorityCreateSlice(in interface{}) *[]restapi.CertificateAuthorityCreate {
+ var out []restapi.CertificateAuthorityCreate
+ for _, v := range in.([]interface{}) {
+ out = append(out, *expandCertificateAuthorityCreate(v))
}
return &out
}
-func flattenEndpointConfigurationList(obj *restapi.EndpointConfigurationList) interface{} {
+func flattenCertificateAuthorityUpdate(obj *restapi.CertificateAuthorityUpdate) interface{} {
if obj == nil {
return nil
}
m := make(map[string]interface{})
- m["endpoint_configurations"] = flattenEndpointConfigurationSlice(&obj.EndpointConfigurations)
- m["uri"] = obj.URI
- m["next_page_uri"] = obj.NextPageURI
+ m["id"] = obj.ID
+ m["description"] = obj.Description
+ m["metadata"] = obj.Metadata
return []interface{}{m}
}
-func flattenEndpointConfigurationListSlice(objs *[]restapi.EndpointConfigurationList) (sl []interface{}) {
+func flattenCertificateAuthorityUpdateSlice(objs *[]restapi.CertificateAuthorityUpdate) (sl []interface{}) {
if objs == nil {
return nil
}
for _, v := range *objs {
- sl = append(sl, flattenEndpointConfigurationList(&v))
+ sl = append(sl, flattenCertificateAuthorityUpdate(&v))
}
return sl
}
-func expandEndpointConfigurationList(in interface{}) *restapi.EndpointConfigurationList {
+func expandCertificateAuthorityUpdate(in interface{}) *restapi.CertificateAuthorityUpdate {
if in == nil {
return nil
}
@@ -2327,66 +2287,60 @@ func expandEndpointConfigurationList(in interface{}) *restapi.EndpointConfigurat
}
m := v.List()[0].(map[string]interface{})
- var obj restapi.EndpointConfigurationList
- if v, ok := m["endpoint_configurations"]; ok {
- obj.EndpointConfigurations = *expandEndpointConfigurationSlice(v)
+ var obj restapi.CertificateAuthorityUpdate
+ if v, ok := m["id"]; ok {
+ obj.ID = *expandString(v)
}
- if v, ok := m["uri"]; ok {
- obj.URI = *expandString(v)
+ if v, ok := m["description"]; ok {
+ obj.Description = expandString(v)
}
- if v, ok := m["next_page_uri"]; ok {
- obj.NextPageURI = expandString(v)
+ if v, ok := m["metadata"]; ok {
+ obj.Metadata = expandString(v)
}
return &obj
}
-func expandEndpointConfigurationListSlice(in interface{}) *[]restapi.EndpointConfigurationList {
- var out []restapi.EndpointConfigurationList
+func expandCertificateAuthorityUpdateSlice(in interface{}) *[]restapi.CertificateAuthorityUpdate {
+ var out []restapi.CertificateAuthorityUpdate
for _, v := range in.([]interface{}) {
- out = append(out, *expandEndpointConfigurationList(v))
+ out = append(out, *expandCertificateAuthorityUpdate(v))
}
return &out
}
-func flattenEndpointConfigurationUpdate(obj *restapi.EndpointConfigurationUpdate) interface{} {
+func flattenCertificateAuthority(obj *restapi.CertificateAuthority) interface{} {
if obj == nil {
return nil
}
m := make(map[string]interface{})
m["id"] = obj.ID
+ m["uri"] = obj.URI
+ m["created_at"] = obj.CreatedAt
m["description"] = obj.Description
m["metadata"] = obj.Metadata
- m["basic_auth"] = flattenEndpointBasicAuth(obj.BasicAuth)
- m["circuit_breaker"] = flattenEndpointCircuitBreaker(obj.CircuitBreaker)
- m["compression"] = flattenEndpointCompression(obj.Compression)
- m["request_headers"] = flattenEndpointRequestHeaders(obj.RequestHeaders)
- m["response_headers"] = flattenEndpointResponseHeaders(obj.ResponseHeaders)
- m["ip_policy"] = flattenEndpointIPPolicyMutate(obj.IPPolicy)
- m["mutual_tls"] = flattenEndpointMutualTLSMutate(obj.MutualTLS)
- m["tls_termination"] = flattenEndpointTLSTermination(obj.TLSTermination)
- m["webhook_validation"] = flattenEndpointWebhookValidation(obj.WebhookValidation)
- m["oauth"] = flattenEndpointOAuth(obj.OAuth)
- m["logging"] = flattenEndpointLoggingMutate(obj.Logging)
- m["saml"] = flattenEndpointSAMLMutate(obj.SAML)
- m["oidc"] = flattenEndpointOIDC(obj.OIDC)
- m["backend"] = flattenEndpointBackendMutate(obj.Backend)
+ m["ca_pem"] = obj.CAPEM
+ m["subject_common_name"] = obj.SubjectCommonName
+ m["not_before"] = obj.NotBefore
+ m["not_after"] = obj.NotAfter
+ m["key_usages"] = obj.KeyUsages
+ m["extended_key_usages"] = obj.ExtendedKeyUsages
return []interface{}{m}
}
-func flattenEndpointConfigurationUpdateSlice(objs *[]restapi.EndpointConfigurationUpdate) (sl []interface{}) {
+func flattenCertificateAuthoritySlice(objs *[]restapi.CertificateAuthority) (sl []interface{}) {
if objs == nil {
return nil
}
for _, v := range *objs {
- sl = append(sl, flattenEndpointConfigurationUpdate(&v))
+ sl = append(sl, flattenCertificateAuthority(&v))
}
return sl
}
-func expandEndpointConfigurationUpdate(in interface{}) *restapi.EndpointConfigurationUpdate {
+func expandCertificateAuthority(in interface{}) *restapi.CertificateAuthority {
if in == nil {
return nil
}
@@ -2397,108 +2351,132 @@ func expandEndpointConfigurationUpdate(in interface{}) *restapi.EndpointConfigur
}
m := v.List()[0].(map[string]interface{})
- var obj restapi.EndpointConfigurationUpdate
+ var obj restapi.CertificateAuthority
if v, ok := m["id"]; ok {
obj.ID = *expandString(v)
}
+ if v, ok := m["uri"]; ok {
+ obj.URI = *expandString(v)
+ }
+ if v, ok := m["created_at"]; ok {
+ obj.CreatedAt = *expandString(v)
+ }
if v, ok := m["description"]; ok {
- obj.Description = expandString(v)
+ obj.Description = *expandString(v)
}
if v, ok := m["metadata"]; ok {
- obj.Metadata = expandString(v)
+ obj.Metadata = *expandString(v)
}
- if v, ok := m["basic_auth"]; ok {
- obj.BasicAuth = expandEndpointBasicAuth(v)
+ if v, ok := m["ca_pem"]; ok {
+ obj.CAPEM = *expandString(v)
}
- if v, ok := m["circuit_breaker"]; ok {
- obj.CircuitBreaker = expandEndpointCircuitBreaker(v)
+ if v, ok := m["subject_common_name"]; ok {
+ obj.SubjectCommonName = *expandString(v)
}
- if v, ok := m["compression"]; ok {
- obj.Compression = expandEndpointCompression(v)
+ if v, ok := m["not_before"]; ok {
+ obj.NotBefore = *expandString(v)
}
- if v, ok := m["request_headers"]; ok {
- obj.RequestHeaders = expandEndpointRequestHeaders(v)
+ if v, ok := m["not_after"]; ok {
+ obj.NotAfter = *expandString(v)
}
- if v, ok := m["response_headers"]; ok {
- obj.ResponseHeaders = expandEndpointResponseHeaders(v)
+ if v, ok := m["key_usages"]; ok {
+ obj.KeyUsages = *expandStringSlice(v)
}
- if v, ok := m["ip_policy"]; ok {
- obj.IPPolicy = expandEndpointIPPolicyMutate(v)
+ if v, ok := m["extended_key_usages"]; ok {
+ obj.ExtendedKeyUsages = *expandStringSlice(v)
}
- if v, ok := m["mutual_tls"]; ok {
- obj.MutualTLS = expandEndpointMutualTLSMutate(v)
+ return &obj
+}
+
+func expandCertificateAuthoritySlice(in interface{}) *[]restapi.CertificateAuthority {
+ var out []restapi.CertificateAuthority
+ for _, v := range in.([]interface{}) {
+ out = append(out, *expandCertificateAuthority(v))
}
- if v, ok := m["tls_termination"]; ok {
- obj.TLSTermination = expandEndpointTLSTermination(v)
+ return &out
+}
+
+func flattenCertificateAuthorityList(obj *restapi.CertificateAuthorityList) interface{} {
+ if obj == nil {
+ return nil
}
- if v, ok := m["webhook_validation"]; ok {
- obj.WebhookValidation = expandEndpointWebhookValidation(v)
+
+ m := make(map[string]interface{})
+ m["certificate_authorities"] = flattenCertificateAuthoritySlice(&obj.CertificateAuthorities)
+ m["uri"] = obj.URI
+ m["next_page_uri"] = obj.NextPageURI
+
+ return []interface{}{m}
+}
+
+func flattenCertificateAuthorityListSlice(objs *[]restapi.CertificateAuthorityList) (sl []interface{}) {
+ if objs == nil {
+ return nil
}
- if v, ok := m["oauth"]; ok {
- obj.OAuth = expandEndpointOAuth(v)
+
+ for _, v := range *objs {
+ sl = append(sl, flattenCertificateAuthorityList(&v))
}
- if v, ok := m["logging"]; ok {
- obj.Logging = expandEndpointLoggingMutate(v)
+ return sl
+}
+
+func expandCertificateAuthorityList(in interface{}) *restapi.CertificateAuthorityList {
+ if in == nil {
+ return nil
}
- if v, ok := m["saml"]; ok {
- obj.SAML = expandEndpointSAMLMutate(v)
+ v := in.(*schema.Set)
+
+ if v.Len() == 0 {
+ return nil
}
- if v, ok := m["oidc"]; ok {
- obj.OIDC = expandEndpointOIDC(v)
+
+ m := v.List()[0].(map[string]interface{})
+ var obj restapi.CertificateAuthorityList
+ if v, ok := m["certificate_authorities"]; ok {
+ obj.CertificateAuthorities = *expandCertificateAuthoritySlice(v)
}
- if v, ok := m["backend"]; ok {
- obj.Backend = expandEndpointBackendMutate(v)
+ if v, ok := m["uri"]; ok {
+ obj.URI = *expandString(v)
+ }
+ if v, ok := m["next_page_uri"]; ok {
+ obj.NextPageURI = expandString(v)
}
return &obj
}
-func expandEndpointConfigurationUpdateSlice(in interface{}) *[]restapi.EndpointConfigurationUpdate {
- var out []restapi.EndpointConfigurationUpdate
+func expandCertificateAuthorityListSlice(in interface{}) *[]restapi.CertificateAuthorityList {
+ var out []restapi.CertificateAuthorityList
for _, v := range in.([]interface{}) {
- out = append(out, *expandEndpointConfigurationUpdate(v))
+ out = append(out, *expandCertificateAuthorityList(v))
}
return &out
}
-func flattenEndpointConfigurationCreate(obj *restapi.EndpointConfigurationCreate) interface{} {
+func flattenCredentialCreate(obj *restapi.CredentialCreate) interface{} {
if obj == nil {
return nil
}
m := make(map[string]interface{})
- m["type"] = obj.Type
m["description"] = obj.Description
m["metadata"] = obj.Metadata
- m["basic_auth"] = flattenEndpointBasicAuth(obj.BasicAuth)
- m["circuit_breaker"] = flattenEndpointCircuitBreaker(obj.CircuitBreaker)
- m["compression"] = flattenEndpointCompression(obj.Compression)
- m["request_headers"] = flattenEndpointRequestHeaders(obj.RequestHeaders)
- m["response_headers"] = flattenEndpointResponseHeaders(obj.ResponseHeaders)
- m["ip_policy"] = flattenEndpointIPPolicyMutate(obj.IPPolicy)
- m["mutual_tls"] = flattenEndpointMutualTLSMutate(obj.MutualTLS)
- m["tls_termination"] = flattenEndpointTLSTermination(obj.TLSTermination)
- m["webhook_validation"] = flattenEndpointWebhookValidation(obj.WebhookValidation)
- m["oauth"] = flattenEndpointOAuth(obj.OAuth)
- m["logging"] = flattenEndpointLoggingMutate(obj.Logging)
- m["saml"] = flattenEndpointSAMLMutate(obj.SAML)
- m["oidc"] = flattenEndpointOIDC(obj.OIDC)
- m["backend"] = flattenEndpointBackendMutate(obj.Backend)
+ m["acl"] = obj.ACL
return []interface{}{m}
}
-func flattenEndpointConfigurationCreateSlice(objs *[]restapi.EndpointConfigurationCreate) (sl []interface{}) {
+func flattenCredentialCreateSlice(objs *[]restapi.CredentialCreate) (sl []interface{}) {
if objs == nil {
return nil
}
for _, v := range *objs {
- sl = append(sl, flattenEndpointConfigurationCreate(&v))
+ sl = append(sl, flattenCredentialCreate(&v))
}
return sl
}
-func expandEndpointConfigurationCreate(in interface{}) *restapi.EndpointConfigurationCreate {
+func expandCredentialCreate(in interface{}) *restapi.CredentialCreate {
if in == nil {
return nil
}
@@ -2509,94 +2487,2231 @@ func expandEndpointConfigurationCreate(in interface{}) *restapi.EndpointConfigur
}
m := v.List()[0].(map[string]interface{})
- var obj restapi.EndpointConfigurationCreate
- if v, ok := m["type"]; ok {
- obj.Type = *expandString(v)
- }
+ var obj restapi.CredentialCreate
if v, ok := m["description"]; ok {
obj.Description = *expandString(v)
}
if v, ok := m["metadata"]; ok {
obj.Metadata = *expandString(v)
}
- if v, ok := m["basic_auth"]; ok {
- obj.BasicAuth = expandEndpointBasicAuth(v)
- }
- if v, ok := m["circuit_breaker"]; ok {
- obj.CircuitBreaker = expandEndpointCircuitBreaker(v)
+ if v, ok := m["acl"]; ok {
+ obj.ACL = *expandStringSlice(v)
}
- if v, ok := m["compression"]; ok {
- obj.Compression = expandEndpointCompression(v)
+ return &obj
+}
+
+func expandCredentialCreateSlice(in interface{}) *[]restapi.CredentialCreate {
+ var out []restapi.CredentialCreate
+ for _, v := range in.([]interface{}) {
+ out = append(out, *expandCredentialCreate(v))
+ }
+ return &out
+}
+
+func flattenCredentialUpdate(obj *restapi.CredentialUpdate) interface{} {
+ if obj == nil {
+ return nil
+ }
+
+ m := make(map[string]interface{})
+ m["id"] = obj.ID
+ m["description"] = obj.Description
+ m["metadata"] = obj.Metadata
+ m["acl"] = obj.ACL
+
+ return []interface{}{m}
+}
+
+func flattenCredentialUpdateSlice(objs *[]restapi.CredentialUpdate) (sl []interface{}) {
+ if objs == nil {
+ return nil
+ }
+
+ for _, v := range *objs {
+ sl = append(sl, flattenCredentialUpdate(&v))
+ }
+ return sl
+}
+
+func expandCredentialUpdate(in interface{}) *restapi.CredentialUpdate {
+ if in == nil {
+ return nil
+ }
+ v := in.(*schema.Set)
+
+ if v.Len() == 0 {
+ return nil
+ }
+
+ m := v.List()[0].(map[string]interface{})
+ var obj restapi.CredentialUpdate
+ if v, ok := m["id"]; ok {
+ obj.ID = *expandString(v)
+ }
+ if v, ok := m["description"]; ok {
+ obj.Description = expandString(v)
+ }
+ if v, ok := m["metadata"]; ok {
+ obj.Metadata = expandString(v)
+ }
+ if v, ok := m["acl"]; ok {
+ obj.ACL = expandStringSlice(v)
+ }
+ return &obj
+}
+
+func expandCredentialUpdateSlice(in interface{}) *[]restapi.CredentialUpdate {
+ var out []restapi.CredentialUpdate
+ for _, v := range in.([]interface{}) {
+ out = append(out, *expandCredentialUpdate(v))
+ }
+ return &out
+}
+
+func flattenCredential(obj *restapi.Credential) interface{} {
+ if obj == nil {
+ return nil
+ }
+
+ m := make(map[string]interface{})
+ m["id"] = obj.ID
+ m["uri"] = obj.URI
+ m["created_at"] = obj.CreatedAt
+ m["description"] = obj.Description
+ m["metadata"] = obj.Metadata
+ m["token"] = obj.Token
+ m["acl"] = obj.ACL
+
+ return []interface{}{m}
+}
+
+func flattenCredentialSlice(objs *[]restapi.Credential) (sl []interface{}) {
+ if objs == nil {
+ return nil
+ }
+
+ for _, v := range *objs {
+ sl = append(sl, flattenCredential(&v))
+ }
+ return sl
+}
+
+func expandCredential(in interface{}) *restapi.Credential {
+ if in == nil {
+ return nil
+ }
+ v := in.(*schema.Set)
+
+ if v.Len() == 0 {
+ return nil
+ }
+
+ m := v.List()[0].(map[string]interface{})
+ var obj restapi.Credential
+ if v, ok := m["id"]; ok {
+ obj.ID = *expandString(v)
+ }
+ if v, ok := m["uri"]; ok {
+ obj.URI = *expandString(v)
+ }
+ if v, ok := m["created_at"]; ok {
+ obj.CreatedAt = *expandString(v)
+ }
+ if v, ok := m["description"]; ok {
+ obj.Description = *expandString(v)
+ }
+ if v, ok := m["metadata"]; ok {
+ obj.Metadata = *expandString(v)
+ }
+ if v, ok := m["token"]; ok {
+ obj.Token = expandString(v)
+ }
+ if v, ok := m["acl"]; ok {
+ obj.ACL = *expandStringSlice(v)
+ }
+ return &obj
+}
+
+func expandCredentialSlice(in interface{}) *[]restapi.Credential {
+ var out []restapi.Credential
+ for _, v := range in.([]interface{}) {
+ out = append(out, *expandCredential(v))
+ }
+ return &out
+}
+
+func flattenCredentialList(obj *restapi.CredentialList) interface{} {
+ if obj == nil {
+ return nil
+ }
+
+ m := make(map[string]interface{})
+ m["credentials"] = flattenCredentialSlice(&obj.Credentials)
+ m["uri"] = obj.URI
+ m["next_page_uri"] = obj.NextPageURI
+
+ return []interface{}{m}
+}
+
+func flattenCredentialListSlice(objs *[]restapi.CredentialList) (sl []interface{}) {
+ if objs == nil {
+ return nil
+ }
+
+ for _, v := range *objs {
+ sl = append(sl, flattenCredentialList(&v))
+ }
+ return sl
+}
+
+func expandCredentialList(in interface{}) *restapi.CredentialList {
+ if in == nil {
+ return nil
+ }
+ v := in.(*schema.Set)
+
+ if v.Len() == 0 {
+ return nil
+ }
+
+ m := v.List()[0].(map[string]interface{})
+ var obj restapi.CredentialList
+ if v, ok := m["credentials"]; ok {
+ obj.Credentials = *expandCredentialSlice(v)
+ }
+ if v, ok := m["uri"]; ok {
+ obj.URI = *expandString(v)
+ }
+ if v, ok := m["next_page_uri"]; ok {
+ obj.NextPageURI = expandString(v)
+ }
+ return &obj
+}
+
+func expandCredentialListSlice(in interface{}) *[]restapi.CredentialList {
+ var out []restapi.CredentialList
+ for _, v := range in.([]interface{}) {
+ out = append(out, *expandCredentialList(v))
+ }
+ return &out
+}
+
+func flattenEndpointConfiguration(obj *restapi.EndpointConfiguration) interface{} {
+ if obj == nil {
+ return nil
+ }
+
+ m := make(map[string]interface{})
+ m["id"] = obj.ID
+ m["type"] = obj.Type
+ m["description"] = obj.Description
+ m["metadata"] = obj.Metadata
+ m["created_at"] = obj.CreatedAt
+ m["uri"] = obj.URI
+ m["basic_auth"] = flattenEndpointBasicAuth(obj.BasicAuth)
+ m["circuit_breaker"] = flattenEndpointCircuitBreaker(obj.CircuitBreaker)
+ m["compression"] = flattenEndpointCompression(obj.Compression)
+ m["request_headers"] = flattenEndpointRequestHeaders(obj.RequestHeaders)
+ m["response_headers"] = flattenEndpointResponseHeaders(obj.ResponseHeaders)
+ m["ip_policy"] = flattenEndpointIPPolicy(obj.IPPolicy)
+ m["mutual_tls"] = flattenEndpointMutualTLS(obj.MutualTLS)
+ m["tls_termination"] = flattenEndpointTLSTermination(obj.TLSTermination)
+ m["webhook_validation"] = flattenEndpointWebhookValidation(obj.WebhookValidation)
+ m["oauth"] = flattenEndpointOAuth(obj.OAuth)
+ m["logging"] = flattenEndpointLogging(obj.Logging)
+ m["saml"] = flattenEndpointSAML(obj.SAML)
+ m["oidc"] = flattenEndpointOIDC(obj.OIDC)
+ m["backend"] = flattenEndpointBackend(obj.Backend)
+
+ return []interface{}{m}
+}
+
+func flattenEndpointConfigurationSlice(objs *[]restapi.EndpointConfiguration) (sl []interface{}) {
+ if objs == nil {
+ return nil
+ }
+
+ for _, v := range *objs {
+ sl = append(sl, flattenEndpointConfiguration(&v))
+ }
+ return sl
+}
+
+func expandEndpointConfiguration(in interface{}) *restapi.EndpointConfiguration {
+ if in == nil {
+ return nil
+ }
+ v := in.(*schema.Set)
+
+ if v.Len() == 0 {
+ return nil
+ }
+
+ m := v.List()[0].(map[string]interface{})
+ var obj restapi.EndpointConfiguration
+ if v, ok := m["id"]; ok {
+ obj.ID = *expandString(v)
+ }
+ if v, ok := m["type"]; ok {
+ obj.Type = *expandString(v)
+ }
+ if v, ok := m["description"]; ok {
+ obj.Description = *expandString(v)
+ }
+ if v, ok := m["metadata"]; ok {
+ obj.Metadata = *expandString(v)
+ }
+ if v, ok := m["created_at"]; ok {
+ obj.CreatedAt = *expandString(v)
+ }
+ if v, ok := m["uri"]; ok {
+ obj.URI = *expandString(v)
+ }
+ if v, ok := m["basic_auth"]; ok {
+ obj.BasicAuth = expandEndpointBasicAuth(v)
+ }
+ if v, ok := m["circuit_breaker"]; ok {
+ obj.CircuitBreaker = expandEndpointCircuitBreaker(v)
+ }
+ if v, ok := m["compression"]; ok {
+ obj.Compression = expandEndpointCompression(v)
+ }
+ if v, ok := m["request_headers"]; ok {
+ obj.RequestHeaders = expandEndpointRequestHeaders(v)
+ }
+ if v, ok := m["response_headers"]; ok {
+ obj.ResponseHeaders = expandEndpointResponseHeaders(v)
+ }
+ if v, ok := m["ip_policy"]; ok {
+ obj.IPPolicy = expandEndpointIPPolicy(v)
+ }
+ if v, ok := m["mutual_tls"]; ok {
+ obj.MutualTLS = expandEndpointMutualTLS(v)
+ }
+ if v, ok := m["tls_termination"]; ok {
+ obj.TLSTermination = expandEndpointTLSTermination(v)
+ }
+ if v, ok := m["webhook_validation"]; ok {
+ obj.WebhookValidation = expandEndpointWebhookValidation(v)
+ }
+ if v, ok := m["oauth"]; ok {
+ obj.OAuth = expandEndpointOAuth(v)
+ }
+ if v, ok := m["logging"]; ok {
+ obj.Logging = expandEndpointLogging(v)
+ }
+ if v, ok := m["saml"]; ok {
+ obj.SAML = expandEndpointSAML(v)
+ }
+ if v, ok := m["oidc"]; ok {
+ obj.OIDC = expandEndpointOIDC(v)
+ }
+ if v, ok := m["backend"]; ok {
+ obj.Backend = expandEndpointBackend(v)
+ }
+ return &obj
+}
+
+func expandEndpointConfigurationSlice(in interface{}) *[]restapi.EndpointConfiguration {
+ var out []restapi.EndpointConfiguration
+ for _, v := range in.([]interface{}) {
+ out = append(out, *expandEndpointConfiguration(v))
+ }
+ return &out
+}
+
+func flattenEndpointConfigurationList(obj *restapi.EndpointConfigurationList) interface{} {
+ if obj == nil {
+ return nil
+ }
+
+ m := make(map[string]interface{})
+ m["endpoint_configurations"] = flattenEndpointConfigurationSlice(&obj.EndpointConfigurations)
+ m["uri"] = obj.URI
+ m["next_page_uri"] = obj.NextPageURI
+
+ return []interface{}{m}
+}
+
+func flattenEndpointConfigurationListSlice(objs *[]restapi.EndpointConfigurationList) (sl []interface{}) {
+ if objs == nil {
+ return nil
+ }
+
+ for _, v := range *objs {
+ sl = append(sl, flattenEndpointConfigurationList(&v))
+ }
+ return sl
+}
+
+func expandEndpointConfigurationList(in interface{}) *restapi.EndpointConfigurationList {
+ if in == nil {
+ return nil
+ }
+ v := in.(*schema.Set)
+
+ if v.Len() == 0 {
+ return nil
+ }
+
+ m := v.List()[0].(map[string]interface{})
+ var obj restapi.EndpointConfigurationList
+ if v, ok := m["endpoint_configurations"]; ok {
+ obj.EndpointConfigurations = *expandEndpointConfigurationSlice(v)
+ }
+ if v, ok := m["uri"]; ok {
+ obj.URI = *expandString(v)
+ }
+ if v, ok := m["next_page_uri"]; ok {
+ obj.NextPageURI = expandString(v)
+ }
+ return &obj
+}
+
+func expandEndpointConfigurationListSlice(in interface{}) *[]restapi.EndpointConfigurationList {
+ var out []restapi.EndpointConfigurationList
+ for _, v := range in.([]interface{}) {
+ out = append(out, *expandEndpointConfigurationList(v))
+ }
+ return &out
+}
+
+func flattenEndpointConfigurationUpdate(obj *restapi.EndpointConfigurationUpdate) interface{} {
+ if obj == nil {
+ return nil
+ }
+
+ m := make(map[string]interface{})
+ m["id"] = obj.ID
+ m["description"] = obj.Description
+ m["metadata"] = obj.Metadata
+ m["basic_auth"] = flattenEndpointBasicAuth(obj.BasicAuth)
+ m["circuit_breaker"] = flattenEndpointCircuitBreaker(obj.CircuitBreaker)
+ m["compression"] = flattenEndpointCompression(obj.Compression)
+ m["request_headers"] = flattenEndpointRequestHeaders(obj.RequestHeaders)
+ m["response_headers"] = flattenEndpointResponseHeaders(obj.ResponseHeaders)
+ m["ip_policy"] = flattenEndpointIPPolicyMutate(obj.IPPolicy)
+ m["mutual_tls"] = flattenEndpointMutualTLSMutate(obj.MutualTLS)
+ m["tls_termination"] = flattenEndpointTLSTermination(obj.TLSTermination)
+ m["webhook_validation"] = flattenEndpointWebhookValidation(obj.WebhookValidation)
+ m["oauth"] = flattenEndpointOAuth(obj.OAuth)
+ m["logging"] = flattenEndpointLoggingMutate(obj.Logging)
+ m["saml"] = flattenEndpointSAMLMutate(obj.SAML)
+ m["oidc"] = flattenEndpointOIDC(obj.OIDC)
+ m["backend"] = flattenEndpointBackendMutate(obj.Backend)
+
+ return []interface{}{m}
+}
+
+func flattenEndpointConfigurationUpdateSlice(objs *[]restapi.EndpointConfigurationUpdate) (sl []interface{}) {
+ if objs == nil {
+ return nil
+ }
+
+ for _, v := range *objs {
+ sl = append(sl, flattenEndpointConfigurationUpdate(&v))
+ }
+ return sl
+}
+
+func expandEndpointConfigurationUpdate(in interface{}) *restapi.EndpointConfigurationUpdate {
+ if in == nil {
+ return nil
+ }
+ v := in.(*schema.Set)
+
+ if v.Len() == 0 {
+ return nil
+ }
+
+ m := v.List()[0].(map[string]interface{})
+ var obj restapi.EndpointConfigurationUpdate
+ if v, ok := m["id"]; ok {
+ obj.ID = *expandString(v)
+ }
+ if v, ok := m["description"]; ok {
+ obj.Description = expandString(v)
+ }
+ if v, ok := m["metadata"]; ok {
+ obj.Metadata = expandString(v)
+ }
+ if v, ok := m["basic_auth"]; ok {
+ obj.BasicAuth = expandEndpointBasicAuth(v)
+ }
+ if v, ok := m["circuit_breaker"]; ok {
+ obj.CircuitBreaker = expandEndpointCircuitBreaker(v)
+ }
+ if v, ok := m["compression"]; ok {
+ obj.Compression = expandEndpointCompression(v)
+ }
+ if v, ok := m["request_headers"]; ok {
+ obj.RequestHeaders = expandEndpointRequestHeaders(v)
+ }
+ if v, ok := m["response_headers"]; ok {
+ obj.ResponseHeaders = expandEndpointResponseHeaders(v)
+ }
+ if v, ok := m["ip_policy"]; ok {
+ obj.IPPolicy = expandEndpointIPPolicyMutate(v)
+ }
+ if v, ok := m["mutual_tls"]; ok {
+ obj.MutualTLS = expandEndpointMutualTLSMutate(v)
+ }
+ if v, ok := m["tls_termination"]; ok {
+ obj.TLSTermination = expandEndpointTLSTermination(v)
+ }
+ if v, ok := m["webhook_validation"]; ok {
+ obj.WebhookValidation = expandEndpointWebhookValidation(v)
+ }
+ if v, ok := m["oauth"]; ok {
+ obj.OAuth = expandEndpointOAuth(v)
+ }
+ if v, ok := m["logging"]; ok {
+ obj.Logging = expandEndpointLoggingMutate(v)
+ }
+ if v, ok := m["saml"]; ok {
+ obj.SAML = expandEndpointSAMLMutate(v)
+ }
+ if v, ok := m["oidc"]; ok {
+ obj.OIDC = expandEndpointOIDC(v)
+ }
+ if v, ok := m["backend"]; ok {
+ obj.Backend = expandEndpointBackendMutate(v)
+ }
+ return &obj
+}
+
+func expandEndpointConfigurationUpdateSlice(in interface{}) *[]restapi.EndpointConfigurationUpdate {
+ var out []restapi.EndpointConfigurationUpdate
+ for _, v := range in.([]interface{}) {
+ out = append(out, *expandEndpointConfigurationUpdate(v))
+ }
+ return &out
+}
+
+func flattenEndpointConfigurationCreate(obj *restapi.EndpointConfigurationCreate) interface{} {
+ if obj == nil {
+ return nil
+ }
+
+ m := make(map[string]interface{})
+ m["type"] = obj.Type
+ m["description"] = obj.Description
+ m["metadata"] = obj.Metadata
+ m["basic_auth"] = flattenEndpointBasicAuth(obj.BasicAuth)
+ m["circuit_breaker"] = flattenEndpointCircuitBreaker(obj.CircuitBreaker)
+ m["compression"] = flattenEndpointCompression(obj.Compression)
+ m["request_headers"] = flattenEndpointRequestHeaders(obj.RequestHeaders)
+ m["response_headers"] = flattenEndpointResponseHeaders(obj.ResponseHeaders)
+ m["ip_policy"] = flattenEndpointIPPolicyMutate(obj.IPPolicy)
+ m["mutual_tls"] = flattenEndpointMutualTLSMutate(obj.MutualTLS)
+ m["tls_termination"] = flattenEndpointTLSTermination(obj.TLSTermination)
+ m["webhook_validation"] = flattenEndpointWebhookValidation(obj.WebhookValidation)
+ m["oauth"] = flattenEndpointOAuth(obj.OAuth)
+ m["logging"] = flattenEndpointLoggingMutate(obj.Logging)
+ m["saml"] = flattenEndpointSAMLMutate(obj.SAML)
+ m["oidc"] = flattenEndpointOIDC(obj.OIDC)
+ m["backend"] = flattenEndpointBackendMutate(obj.Backend)
+
+ return []interface{}{m}
+}
+
+func flattenEndpointConfigurationCreateSlice(objs *[]restapi.EndpointConfigurationCreate) (sl []interface{}) {
+ if objs == nil {
+ return nil
+ }
+
+ for _, v := range *objs {
+ sl = append(sl, flattenEndpointConfigurationCreate(&v))
+ }
+ return sl
+}
+
+func expandEndpointConfigurationCreate(in interface{}) *restapi.EndpointConfigurationCreate {
+ if in == nil {
+ return nil
+ }
+ v := in.(*schema.Set)
+
+ if v.Len() == 0 {
+ return nil
+ }
+
+ m := v.List()[0].(map[string]interface{})
+ var obj restapi.EndpointConfigurationCreate
+ if v, ok := m["type"]; ok {
+ obj.Type = *expandString(v)
+ }
+ if v, ok := m["description"]; ok {
+ obj.Description = *expandString(v)
+ }
+ if v, ok := m["metadata"]; ok {
+ obj.Metadata = *expandString(v)
+ }
+ if v, ok := m["basic_auth"]; ok {
+ obj.BasicAuth = expandEndpointBasicAuth(v)
+ }
+ if v, ok := m["circuit_breaker"]; ok {
+ obj.CircuitBreaker = expandEndpointCircuitBreaker(v)
+ }
+ if v, ok := m["compression"]; ok {
+ obj.Compression = expandEndpointCompression(v)
+ }
+ if v, ok := m["request_headers"]; ok {
+ obj.RequestHeaders = expandEndpointRequestHeaders(v)
+ }
+ if v, ok := m["response_headers"]; ok {
+ obj.ResponseHeaders = expandEndpointResponseHeaders(v)
+ }
+ if v, ok := m["ip_policy"]; ok {
+ obj.IPPolicy = expandEndpointIPPolicyMutate(v)
+ }
+ if v, ok := m["mutual_tls"]; ok {
+ obj.MutualTLS = expandEndpointMutualTLSMutate(v)
+ }
+ if v, ok := m["tls_termination"]; ok {
+ obj.TLSTermination = expandEndpointTLSTermination(v)
+ }
+ if v, ok := m["webhook_validation"]; ok {
+ obj.WebhookValidation = expandEndpointWebhookValidation(v)
+ }
+ if v, ok := m["oauth"]; ok {
+ obj.OAuth = expandEndpointOAuth(v)
+ }
+ if v, ok := m["logging"]; ok {
+ obj.Logging = expandEndpointLoggingMutate(v)
+ }
+ if v, ok := m["saml"]; ok {
+ obj.SAML = expandEndpointSAMLMutate(v)
+ }
+ if v, ok := m["oidc"]; ok {
+ obj.OIDC = expandEndpointOIDC(v)
+ }
+ if v, ok := m["backend"]; ok {
+ obj.Backend = expandEndpointBackendMutate(v)
+ }
+ return &obj
+}
+
+func expandEndpointConfigurationCreateSlice(in interface{}) *[]restapi.EndpointConfigurationCreate {
+ var out []restapi.EndpointConfigurationCreate
+ for _, v := range in.([]interface{}) {
+ out = append(out, *expandEndpointConfigurationCreate(v))
+ }
+ return &out
+}
+
+func flattenEndpointWebhookValidation(obj *restapi.EndpointWebhookValidation) interface{} {
+ if obj == nil {
+ return nil
+ }
+
+ m := make(map[string]interface{})
+ m["enabled"] = obj.Enabled
+ m["provider"] = obj.Provider
+ m["secret"] = obj.Secret
+
+ return []interface{}{m}
+}
+
+func flattenEndpointWebhookValidationSlice(objs *[]restapi.EndpointWebhookValidation) (sl []interface{}) {
+ if objs == nil {
+ return nil
+ }
+
+ for _, v := range *objs {
+ sl = append(sl, flattenEndpointWebhookValidation(&v))
+ }
+ return sl
+}
+
+func expandEndpointWebhookValidation(in interface{}) *restapi.EndpointWebhookValidation {
+ if in == nil {
+ return nil
+ }
+ v := in.(*schema.Set)
+
+ if v.Len() == 0 {
+ return nil
+ }
+
+ m := v.List()[0].(map[string]interface{})
+ var obj restapi.EndpointWebhookValidation
+ if v, ok := m["enabled"]; ok {
+ obj.Enabled = expandBool(v)
+ }
+ if v, ok := m["provider"]; ok {
+ obj.Provider = *expandString(v)
+ }
+ if v, ok := m["secret"]; ok {
+ obj.Secret = *expandString(v)
+ }
+ return &obj
+}
+
+func expandEndpointWebhookValidationSlice(in interface{}) *[]restapi.EndpointWebhookValidation {
+ var out []restapi.EndpointWebhookValidation
+ for _, v := range in.([]interface{}) {
+ out = append(out, *expandEndpointWebhookValidation(v))
+ }
+ return &out
+}
+
+func flattenEndpointCompression(obj *restapi.EndpointCompression) interface{} {
+ if obj == nil {
+ return nil
+ }
+
+ m := make(map[string]interface{})
+ m["enabled"] = obj.Enabled
+
+ return []interface{}{m}
+}
+
+func flattenEndpointCompressionSlice(objs *[]restapi.EndpointCompression) (sl []interface{}) {
+ if objs == nil {
+ return nil
+ }
+
+ for _, v := range *objs {
+ sl = append(sl, flattenEndpointCompression(&v))
+ }
+ return sl
+}
+
+func expandEndpointCompression(in interface{}) *restapi.EndpointCompression {
+ if in == nil {
+ return nil
+ }
+ v := in.(*schema.Set)
+
+ if v.Len() == 0 {
+ return nil
+ }
+
+ m := v.List()[0].(map[string]interface{})
+ var obj restapi.EndpointCompression
+ if v, ok := m["enabled"]; ok {
+ obj.Enabled = expandBool(v)
+ }
+ return &obj
+}
+
+func expandEndpointCompressionSlice(in interface{}) *[]restapi.EndpointCompression {
+ var out []restapi.EndpointCompression
+ for _, v := range in.([]interface{}) {
+ out = append(out, *expandEndpointCompression(v))
+ }
+ return &out
+}
+
+func flattenEndpointMutualTLS(obj *restapi.EndpointMutualTLS) interface{} {
+ if obj == nil {
+ return nil
+ }
+
+ m := make(map[string]interface{})
+ m["enabled"] = obj.Enabled
+ m["certificate_authorities"] = flattenRefSlice(&obj.CertificateAuthorities)
+
+ return []interface{}{m}
+}
+
+func flattenEndpointMutualTLSSlice(objs *[]restapi.EndpointMutualTLS) (sl []interface{}) {
+ if objs == nil {
+ return nil
+ }
+
+ for _, v := range *objs {
+ sl = append(sl, flattenEndpointMutualTLS(&v))
+ }
+ return sl
+}
+
+func expandEndpointMutualTLS(in interface{}) *restapi.EndpointMutualTLS {
+ if in == nil {
+ return nil
+ }
+ v := in.(*schema.Set)
+
+ if v.Len() == 0 {
+ return nil
+ }
+
+ m := v.List()[0].(map[string]interface{})
+ var obj restapi.EndpointMutualTLS
+ if v, ok := m["enabled"]; ok {
+ obj.Enabled = expandBool(v)
+ }
+ if v, ok := m["certificate_authorities"]; ok {
+ obj.CertificateAuthorities = *expandRefSlice(v)
+ }
+ return &obj
+}
+
+func expandEndpointMutualTLSSlice(in interface{}) *[]restapi.EndpointMutualTLS {
+ var out []restapi.EndpointMutualTLS
+ for _, v := range in.([]interface{}) {
+ out = append(out, *expandEndpointMutualTLS(v))
+ }
+ return &out
+}
+
+func flattenEndpointMutualTLSMutate(obj *restapi.EndpointMutualTLSMutate) interface{} {
+ if obj == nil {
+ return nil
+ }
+
+ m := make(map[string]interface{})
+ m["enabled"] = obj.Enabled
+ m["certificate_authority_ids"] = obj.CertificateAuthorityIDs
+
+ return []interface{}{m}
+}
+
+func flattenEndpointMutualTLSMutateSlice(objs *[]restapi.EndpointMutualTLSMutate) (sl []interface{}) {
+ if objs == nil {
+ return nil
+ }
+
+ for _, v := range *objs {
+ sl = append(sl, flattenEndpointMutualTLSMutate(&v))
+ }
+ return sl
+}
+
+func expandEndpointMutualTLSMutate(in interface{}) *restapi.EndpointMutualTLSMutate {
+ if in == nil {
+ return nil
+ }
+ v := in.(*schema.Set)
+
+ if v.Len() == 0 {
+ return nil
+ }
+
+ m := v.List()[0].(map[string]interface{})
+ var obj restapi.EndpointMutualTLSMutate
+ if v, ok := m["enabled"]; ok {
+ obj.Enabled = expandBool(v)
+ }
+ if v, ok := m["certificate_authority_ids"]; ok {
+ obj.CertificateAuthorityIDs = *expandStringSlice(v)
+ }
+ return &obj
+}
+
+func expandEndpointMutualTLSMutateSlice(in interface{}) *[]restapi.EndpointMutualTLSMutate {
+ var out []restapi.EndpointMutualTLSMutate
+ for _, v := range in.([]interface{}) {
+ out = append(out, *expandEndpointMutualTLSMutate(v))
+ }
+ return &out
+}
+
+func flattenEndpointTLSTermination(obj *restapi.EndpointTLSTermination) interface{} {
+ if obj == nil {
+ return nil
+ }
+
+ m := make(map[string]interface{})
+ m["enabled"] = obj.Enabled
+ m["terminate_at"] = obj.TerminateAt
+ m["min_version"] = obj.MinVersion
+
+ return []interface{}{m}
+}
+
+func flattenEndpointTLSTerminationSlice(objs *[]restapi.EndpointTLSTermination) (sl []interface{}) {
+ if objs == nil {
+ return nil
+ }
+
+ for _, v := range *objs {
+ sl = append(sl, flattenEndpointTLSTermination(&v))
+ }
+ return sl
+}
+
+func expandEndpointTLSTermination(in interface{}) *restapi.EndpointTLSTermination {
+ if in == nil {
+ return nil
+ }
+ v := in.(*schema.Set)
+
+ if v.Len() == 0 {
+ return nil
+ }
+
+ m := v.List()[0].(map[string]interface{})
+ var obj restapi.EndpointTLSTermination
+ if v, ok := m["enabled"]; ok {
+ obj.Enabled = expandBool(v)
+ }
+ if v, ok := m["terminate_at"]; ok {
+ obj.TerminateAt = *expandString(v)
+ }
+ if v, ok := m["min_version"]; ok {
+ obj.MinVersion = expandString(v)
+ }
+ return &obj
+}
+
+func expandEndpointTLSTerminationSlice(in interface{}) *[]restapi.EndpointTLSTermination {
+ var out []restapi.EndpointTLSTermination
+ for _, v := range in.([]interface{}) {
+ out = append(out, *expandEndpointTLSTermination(v))
+ }
+ return &out
+}
+
+func flattenEndpointTLSTerminationAtEdge(obj *restapi.EndpointTLSTerminationAtEdge) interface{} {
+ if obj == nil {
+ return nil
+ }
+
+ m := make(map[string]interface{})
+ m["enabled"] = obj.Enabled
+ m["min_version"] = obj.MinVersion
+
+ return []interface{}{m}
+}
+
+func flattenEndpointTLSTerminationAtEdgeSlice(objs *[]restapi.EndpointTLSTerminationAtEdge) (sl []interface{}) {
+ if objs == nil {
+ return nil
+ }
+
+ for _, v := range *objs {
+ sl = append(sl, flattenEndpointTLSTerminationAtEdge(&v))
+ }
+ return sl
+}
+
+func expandEndpointTLSTerminationAtEdge(in interface{}) *restapi.EndpointTLSTerminationAtEdge {
+ if in == nil {
+ return nil
+ }
+ v := in.(*schema.Set)
+
+ if v.Len() == 0 {
+ return nil
+ }
+
+ m := v.List()[0].(map[string]interface{})
+ var obj restapi.EndpointTLSTerminationAtEdge
+ if v, ok := m["enabled"]; ok {
+ obj.Enabled = expandBool(v)
+ }
+ if v, ok := m["min_version"]; ok {
+ obj.MinVersion = expandString(v)
+ }
+ return &obj
+}
+
+func expandEndpointTLSTerminationAtEdgeSlice(in interface{}) *[]restapi.EndpointTLSTerminationAtEdge {
+ var out []restapi.EndpointTLSTerminationAtEdge
+ for _, v := range in.([]interface{}) {
+ out = append(out, *expandEndpointTLSTerminationAtEdge(v))
+ }
+ return &out
+}
+
+func flattenEndpointBasicAuth(obj *restapi.EndpointBasicAuth) interface{} {
+ if obj == nil {
+ return nil
+ }
+
+ m := make(map[string]interface{})
+ m["enabled"] = obj.Enabled
+ m["auth_provider_id"] = obj.AuthProviderID
+ m["realm"] = obj.Realm
+ m["allow_options"] = obj.AllowOptions
+
+ return []interface{}{m}
+}
+
+func flattenEndpointBasicAuthSlice(objs *[]restapi.EndpointBasicAuth) (sl []interface{}) {
+ if objs == nil {
+ return nil
+ }
+
+ for _, v := range *objs {
+ sl = append(sl, flattenEndpointBasicAuth(&v))
+ }
+ return sl
+}
+
+func expandEndpointBasicAuth(in interface{}) *restapi.EndpointBasicAuth {
+ if in == nil {
+ return nil
+ }
+ v := in.(*schema.Set)
+
+ if v.Len() == 0 {
+ return nil
+ }
+
+ m := v.List()[0].(map[string]interface{})
+ var obj restapi.EndpointBasicAuth
+ if v, ok := m["enabled"]; ok {
+ obj.Enabled = expandBool(v)
+ }
+ if v, ok := m["auth_provider_id"]; ok {
+ obj.AuthProviderID = *expandString(v)
+ }
+ if v, ok := m["realm"]; ok {
+ obj.Realm = *expandString(v)
+ }
+ if v, ok := m["allow_options"]; ok {
+ obj.AllowOptions = *expandBool(v)
+ }
+ return &obj
+}
+
+func expandEndpointBasicAuthSlice(in interface{}) *[]restapi.EndpointBasicAuth {
+ var out []restapi.EndpointBasicAuth
+ for _, v := range in.([]interface{}) {
+ out = append(out, *expandEndpointBasicAuth(v))
+ }
+ return &out
+}
+
+func flattenEndpointLogging(obj *restapi.EndpointLogging) interface{} {
+ if obj == nil {
+ return nil
+ }
+
+ m := make(map[string]interface{})
+ m["enabled"] = obj.Enabled
+ m["event_streams"] = flattenRefSlice(&obj.EventStreams)
+
+ return []interface{}{m}
+}
+
+func flattenEndpointLoggingSlice(objs *[]restapi.EndpointLogging) (sl []interface{}) {
+ if objs == nil {
+ return nil
+ }
+
+ for _, v := range *objs {
+ sl = append(sl, flattenEndpointLogging(&v))
+ }
+ return sl
+}
+
+func expandEndpointLogging(in interface{}) *restapi.EndpointLogging {
+ if in == nil {
+ return nil
+ }
+ v := in.(*schema.Set)
+
+ if v.Len() == 0 {
+ return nil
+ }
+
+ m := v.List()[0].(map[string]interface{})
+ var obj restapi.EndpointLogging
+ if v, ok := m["enabled"]; ok {
+ obj.Enabled = expandBool(v)
+ }
+ if v, ok := m["event_streams"]; ok {
+ obj.EventStreams = *expandRefSlice(v)
+ }
+ return &obj
+}
+
+func expandEndpointLoggingSlice(in interface{}) *[]restapi.EndpointLogging {
+ var out []restapi.EndpointLogging
+ for _, v := range in.([]interface{}) {
+ out = append(out, *expandEndpointLogging(v))
+ }
+ return &out
+}
+
+func flattenEndpointLoggingMutate(obj *restapi.EndpointLoggingMutate) interface{} {
+ if obj == nil {
+ return nil
+ }
+
+ m := make(map[string]interface{})
+ m["enabled"] = obj.Enabled
+ m["event_stream_ids"] = obj.EventStreamIDs
+
+ return []interface{}{m}
+}
+
+func flattenEndpointLoggingMutateSlice(objs *[]restapi.EndpointLoggingMutate) (sl []interface{}) {
+ if objs == nil {
+ return nil
+ }
+
+ for _, v := range *objs {
+ sl = append(sl, flattenEndpointLoggingMutate(&v))
+ }
+ return sl
+}
+
+func expandEndpointLoggingMutate(in interface{}) *restapi.EndpointLoggingMutate {
+ if in == nil {
+ return nil
+ }
+ v := in.(*schema.Set)
+
+ if v.Len() == 0 {
+ return nil
+ }
+
+ m := v.List()[0].(map[string]interface{})
+ var obj restapi.EndpointLoggingMutate
+ if v, ok := m["enabled"]; ok {
+ obj.Enabled = expandBool(v)
+ }
+ if v, ok := m["event_stream_ids"]; ok {
+ obj.EventStreamIDs = *expandStringSlice(v)
+ }
+ return &obj
+}
+
+func expandEndpointLoggingMutateSlice(in interface{}) *[]restapi.EndpointLoggingMutate {
+ var out []restapi.EndpointLoggingMutate
+ for _, v := range in.([]interface{}) {
+ out = append(out, *expandEndpointLoggingMutate(v))
+ }
+ return &out
+}
+
+func flattenEndpointRequestHeaders(obj *restapi.EndpointRequestHeaders) interface{} {
+ if obj == nil {
+ return nil
+ }
+
+ m := make(map[string]interface{})
+ m["enabled"] = obj.Enabled
+ m["add"] = obj.Add
+ m["remove"] = obj.Remove
+
+ return []interface{}{m}
+}
+
+func flattenEndpointRequestHeadersSlice(objs *[]restapi.EndpointRequestHeaders) (sl []interface{}) {
+ if objs == nil {
+ return nil
+ }
+
+ for _, v := range *objs {
+ sl = append(sl, flattenEndpointRequestHeaders(&v))
+ }
+ return sl
+}
+
+func expandEndpointRequestHeaders(in interface{}) *restapi.EndpointRequestHeaders {
+ if in == nil {
+ return nil
+ }
+ v := in.(*schema.Set)
+
+ if v.Len() == 0 {
+ return nil
+ }
+
+ m := v.List()[0].(map[string]interface{})
+ var obj restapi.EndpointRequestHeaders
+ if v, ok := m["enabled"]; ok {
+ obj.Enabled = expandBool(v)
+ }
+ if v, ok := m["add"]; ok {
+ obj.Add = *expandStringMap(v)
+ }
+ if v, ok := m["remove"]; ok {
+ obj.Remove = *expandStringSlice(v)
+ }
+ return &obj
+}
+
+func expandEndpointRequestHeadersSlice(in interface{}) *[]restapi.EndpointRequestHeaders {
+ var out []restapi.EndpointRequestHeaders
+ for _, v := range in.([]interface{}) {
+ out = append(out, *expandEndpointRequestHeaders(v))
+ }
+ return &out
+}
+
+func flattenEndpointResponseHeaders(obj *restapi.EndpointResponseHeaders) interface{} {
+ if obj == nil {
+ return nil
+ }
+
+ m := make(map[string]interface{})
+ m["enabled"] = obj.Enabled
+ m["add"] = obj.Add
+ m["remove"] = obj.Remove
+
+ return []interface{}{m}
+}
+
+func flattenEndpointResponseHeadersSlice(objs *[]restapi.EndpointResponseHeaders) (sl []interface{}) {
+ if objs == nil {
+ return nil
+ }
+
+ for _, v := range *objs {
+ sl = append(sl, flattenEndpointResponseHeaders(&v))
+ }
+ return sl
+}
+
+func expandEndpointResponseHeaders(in interface{}) *restapi.EndpointResponseHeaders {
+ if in == nil {
+ return nil
+ }
+ v := in.(*schema.Set)
+
+ if v.Len() == 0 {
+ return nil
+ }
+
+ m := v.List()[0].(map[string]interface{})
+ var obj restapi.EndpointResponseHeaders
+ if v, ok := m["enabled"]; ok {
+ obj.Enabled = expandBool(v)
+ }
+ if v, ok := m["add"]; ok {
+ obj.Add = *expandStringMap(v)
+ }
+ if v, ok := m["remove"]; ok {
+ obj.Remove = *expandStringSlice(v)
+ }
+ return &obj
+}
+
+func expandEndpointResponseHeadersSlice(in interface{}) *[]restapi.EndpointResponseHeaders {
+ var out []restapi.EndpointResponseHeaders
+ for _, v := range in.([]interface{}) {
+ out = append(out, *expandEndpointResponseHeaders(v))
+ }
+ return &out
+}
+
+func flattenEndpointIPPolicy(obj *restapi.EndpointIPPolicy) interface{} {
+ if obj == nil {
+ return nil
+ }
+
+ m := make(map[string]interface{})
+ m["enabled"] = obj.Enabled
+ m["ip_policies"] = flattenRefSlice(&obj.IPPolicies)
+
+ return []interface{}{m}
+}
+
+func flattenEndpointIPPolicySlice(objs *[]restapi.EndpointIPPolicy) (sl []interface{}) {
+ if objs == nil {
+ return nil
+ }
+
+ for _, v := range *objs {
+ sl = append(sl, flattenEndpointIPPolicy(&v))
+ }
+ return sl
+}
+
+func expandEndpointIPPolicy(in interface{}) *restapi.EndpointIPPolicy {
+ if in == nil {
+ return nil
+ }
+ v := in.(*schema.Set)
+
+ if v.Len() == 0 {
+ return nil
+ }
+
+ m := v.List()[0].(map[string]interface{})
+ var obj restapi.EndpointIPPolicy
+ if v, ok := m["enabled"]; ok {
+ obj.Enabled = expandBool(v)
+ }
+ if v, ok := m["ip_policies"]; ok {
+ obj.IPPolicies = *expandRefSlice(v)
+ }
+ return &obj
+}
+
+func expandEndpointIPPolicySlice(in interface{}) *[]restapi.EndpointIPPolicy {
+ var out []restapi.EndpointIPPolicy
+ for _, v := range in.([]interface{}) {
+ out = append(out, *expandEndpointIPPolicy(v))
+ }
+ return &out
+}
+
+func flattenEndpointIPPolicyMutate(obj *restapi.EndpointIPPolicyMutate) interface{} {
+ if obj == nil {
+ return nil
+ }
+
+ m := make(map[string]interface{})
+ m["enabled"] = obj.Enabled
+ m["ip_policy_ids"] = obj.IPPolicyIDs
+
+ return []interface{}{m}
+}
+
+func flattenEndpointIPPolicyMutateSlice(objs *[]restapi.EndpointIPPolicyMutate) (sl []interface{}) {
+ if objs == nil {
+ return nil
+ }
+
+ for _, v := range *objs {
+ sl = append(sl, flattenEndpointIPPolicyMutate(&v))
+ }
+ return sl
+}
+
+func expandEndpointIPPolicyMutate(in interface{}) *restapi.EndpointIPPolicyMutate {
+ if in == nil {
+ return nil
+ }
+ v := in.(*schema.Set)
+
+ if v.Len() == 0 {
+ return nil
+ }
+
+ m := v.List()[0].(map[string]interface{})
+ var obj restapi.EndpointIPPolicyMutate
+ if v, ok := m["enabled"]; ok {
+ obj.Enabled = expandBool(v)
+ }
+ if v, ok := m["ip_policy_ids"]; ok {
+ obj.IPPolicyIDs = *expandStringSlice(v)
+ }
+ return &obj
+}
+
+func expandEndpointIPPolicyMutateSlice(in interface{}) *[]restapi.EndpointIPPolicyMutate {
+ var out []restapi.EndpointIPPolicyMutate
+ for _, v := range in.([]interface{}) {
+ out = append(out, *expandEndpointIPPolicyMutate(v))
+ }
+ return &out
+}
+
+func flattenEndpointCircuitBreaker(obj *restapi.EndpointCircuitBreaker) interface{} {
+ if obj == nil {
+ return nil
+ }
+
+ m := make(map[string]interface{})
+ m["enabled"] = obj.Enabled
+ m["tripped_duration"] = obj.TrippedDuration
+ m["rolling_window"] = obj.RollingWindow
+ m["num_buckets"] = obj.NumBuckets
+ m["volume_threshold"] = obj.VolumeThreshold
+ m["error_threshold_percentage"] = obj.ErrorThresholdPercentage
+
+ return []interface{}{m}
+}
+
+func flattenEndpointCircuitBreakerSlice(objs *[]restapi.EndpointCircuitBreaker) (sl []interface{}) {
+ if objs == nil {
+ return nil
+ }
+
+ for _, v := range *objs {
+ sl = append(sl, flattenEndpointCircuitBreaker(&v))
+ }
+ return sl
+}
+
+func expandEndpointCircuitBreaker(in interface{}) *restapi.EndpointCircuitBreaker {
+ if in == nil {
+ return nil
+ }
+ v := in.(*schema.Set)
+
+ if v.Len() == 0 {
+ return nil
+ }
+
+ m := v.List()[0].(map[string]interface{})
+ var obj restapi.EndpointCircuitBreaker
+ if v, ok := m["enabled"]; ok {
+ obj.Enabled = expandBool(v)
+ }
+ if v, ok := m["tripped_duration"]; ok {
+ obj.TrippedDuration = *expandUint32(v)
+ }
+ if v, ok := m["rolling_window"]; ok {
+ obj.RollingWindow = *expandUint32(v)
+ }
+ if v, ok := m["num_buckets"]; ok {
+ obj.NumBuckets = *expandUint32(v)
+ }
+ if v, ok := m["volume_threshold"]; ok {
+ obj.VolumeThreshold = *expandUint32(v)
+ }
+ if v, ok := m["error_threshold_percentage"]; ok {
+ obj.ErrorThresholdPercentage = *expandFloat64(v)
+ }
+ return &obj
+}
+
+func expandEndpointCircuitBreakerSlice(in interface{}) *[]restapi.EndpointCircuitBreaker {
+ var out []restapi.EndpointCircuitBreaker
+ for _, v := range in.([]interface{}) {
+ out = append(out, *expandEndpointCircuitBreaker(v))
+ }
+ return &out
+}
+
+func flattenEndpointOAuth(obj *restapi.EndpointOAuth) interface{} {
+ if obj == nil {
+ return nil
+ }
+
+ m := make(map[string]interface{})
+ m["enabled"] = obj.Enabled
+ m["provider"] = flattenEndpointOAuthProvider(&obj.Provider)
+ m["options_passthrough"] = obj.OptionsPassthrough
+ m["cookie_prefix"] = obj.CookiePrefix
+ m["inactivity_timeout"] = obj.InactivityTimeout
+ m["maximum_duration"] = obj.MaximumDuration
+ m["auth_check_interval"] = obj.AuthCheckInterval
+
+ return []interface{}{m}
+}
+
+func flattenEndpointOAuthSlice(objs *[]restapi.EndpointOAuth) (sl []interface{}) {
+ if objs == nil {
+ return nil
+ }
+
+ for _, v := range *objs {
+ sl = append(sl, flattenEndpointOAuth(&v))
+ }
+ return sl
+}
+
+func expandEndpointOAuth(in interface{}) *restapi.EndpointOAuth {
+ if in == nil {
+ return nil
+ }
+ v := in.(*schema.Set)
+
+ if v.Len() == 0 {
+ return nil
+ }
+
+ m := v.List()[0].(map[string]interface{})
+ var obj restapi.EndpointOAuth
+ if v, ok := m["enabled"]; ok {
+ obj.Enabled = expandBool(v)
+ }
+ if v, ok := m["provider"]; ok {
+ obj.Provider = *expandEndpointOAuthProvider(v)
+ }
+ if v, ok := m["options_passthrough"]; ok {
+ obj.OptionsPassthrough = *expandBool(v)
+ }
+ if v, ok := m["cookie_prefix"]; ok {
+ obj.CookiePrefix = *expandString(v)
+ }
+ if v, ok := m["inactivity_timeout"]; ok {
+ obj.InactivityTimeout = *expandUint32(v)
+ }
+ if v, ok := m["maximum_duration"]; ok {
+ obj.MaximumDuration = *expandUint32(v)
+ }
+ if v, ok := m["auth_check_interval"]; ok {
+ obj.AuthCheckInterval = *expandUint32(v)
+ }
+ return &obj
+}
+
+func expandEndpointOAuthSlice(in interface{}) *[]restapi.EndpointOAuth {
+ var out []restapi.EndpointOAuth
+ for _, v := range in.([]interface{}) {
+ out = append(out, *expandEndpointOAuth(v))
+ }
+ return &out
+}
+
+func flattenEndpointOAuthProvider(obj *restapi.EndpointOAuthProvider) interface{} {
+ if obj == nil {
+ return nil
+ }
+
+ m := make(map[string]interface{})
+ m["github"] = flattenEndpointOAuthGitHub(obj.Github)
+ m["facebook"] = flattenEndpointOAuthFacebook(obj.Facebook)
+ m["microsoft"] = flattenEndpointOAuthMicrosoft(obj.Microsoft)
+ m["google"] = flattenEndpointOAuthGoogle(obj.Google)
+
+ return []interface{}{m}
+}
+
+func flattenEndpointOAuthProviderSlice(objs *[]restapi.EndpointOAuthProvider) (sl []interface{}) {
+ if objs == nil {
+ return nil
+ }
+
+ for _, v := range *objs {
+ sl = append(sl, flattenEndpointOAuthProvider(&v))
+ }
+ return sl
+}
+
+func expandEndpointOAuthProvider(in interface{}) *restapi.EndpointOAuthProvider {
+ if in == nil {
+ return nil
+ }
+ v := in.(*schema.Set)
+
+ if v.Len() == 0 {
+ return nil
+ }
+
+ m := v.List()[0].(map[string]interface{})
+ var obj restapi.EndpointOAuthProvider
+ if v, ok := m["github"]; ok {
+ obj.Github = expandEndpointOAuthGitHub(v)
+ }
+ if v, ok := m["facebook"]; ok {
+ obj.Facebook = expandEndpointOAuthFacebook(v)
+ }
+ if v, ok := m["microsoft"]; ok {
+ obj.Microsoft = expandEndpointOAuthMicrosoft(v)
+ }
+ if v, ok := m["google"]; ok {
+ obj.Google = expandEndpointOAuthGoogle(v)
+ }
+ return &obj
+}
+
+func expandEndpointOAuthProviderSlice(in interface{}) *[]restapi.EndpointOAuthProvider {
+ var out []restapi.EndpointOAuthProvider
+ for _, v := range in.([]interface{}) {
+ out = append(out, *expandEndpointOAuthProvider(v))
+ }
+ return &out
+}
+
+func flattenEndpointOAuthGitHub(obj *restapi.EndpointOAuthGitHub) interface{} {
+ if obj == nil {
+ return nil
+ }
+
+ m := make(map[string]interface{})
+ m["client_id"] = obj.ClientID
+ m["client_secret"] = obj.ClientSecret
+ m["scopes"] = obj.Scopes
+ m["email_addresses"] = obj.EmailAddresses
+ m["email_domains"] = obj.EmailDomains
+ m["teams"] = obj.Teams
+ m["organizations"] = obj.Organizations
+
+ return []interface{}{m}
+}
+
+func flattenEndpointOAuthGitHubSlice(objs *[]restapi.EndpointOAuthGitHub) (sl []interface{}) {
+ if objs == nil {
+ return nil
+ }
+
+ for _, v := range *objs {
+ sl = append(sl, flattenEndpointOAuthGitHub(&v))
+ }
+ return sl
+}
+
+func expandEndpointOAuthGitHub(in interface{}) *restapi.EndpointOAuthGitHub {
+ if in == nil {
+ return nil
+ }
+ v := in.(*schema.Set)
+
+ if v.Len() == 0 {
+ return nil
+ }
+
+ m := v.List()[0].(map[string]interface{})
+ var obj restapi.EndpointOAuthGitHub
+ if v, ok := m["client_id"]; ok {
+ obj.ClientID = expandString(v)
+ }
+ if v, ok := m["client_secret"]; ok {
+ obj.ClientSecret = expandString(v)
+ }
+ if v, ok := m["scopes"]; ok {
+ obj.Scopes = *expandStringSlice(v)
+ }
+ if v, ok := m["email_addresses"]; ok {
+ obj.EmailAddresses = *expandStringSlice(v)
+ }
+ if v, ok := m["email_domains"]; ok {
+ obj.EmailDomains = *expandStringSlice(v)
+ }
+ if v, ok := m["teams"]; ok {
+ obj.Teams = *expandStringSlice(v)
+ }
+ if v, ok := m["organizations"]; ok {
+ obj.Organizations = *expandStringSlice(v)
+ }
+ return &obj
+}
+
+func expandEndpointOAuthGitHubSlice(in interface{}) *[]restapi.EndpointOAuthGitHub {
+ var out []restapi.EndpointOAuthGitHub
+ for _, v := range in.([]interface{}) {
+ out = append(out, *expandEndpointOAuthGitHub(v))
+ }
+ return &out
+}
+
+func flattenEndpointOAuthFacebook(obj *restapi.EndpointOAuthFacebook) interface{} {
+ if obj == nil {
+ return nil
+ }
+
+ m := make(map[string]interface{})
+ m["client_id"] = obj.ClientID
+ m["client_secret"] = obj.ClientSecret
+ m["scopes"] = obj.Scopes
+ m["email_addresses"] = obj.EmailAddresses
+ m["email_domains"] = obj.EmailDomains
+
+ return []interface{}{m}
+}
+
+func flattenEndpointOAuthFacebookSlice(objs *[]restapi.EndpointOAuthFacebook) (sl []interface{}) {
+ if objs == nil {
+ return nil
+ }
+
+ for _, v := range *objs {
+ sl = append(sl, flattenEndpointOAuthFacebook(&v))
+ }
+ return sl
+}
+
+func expandEndpointOAuthFacebook(in interface{}) *restapi.EndpointOAuthFacebook {
+ if in == nil {
+ return nil
+ }
+ v := in.(*schema.Set)
+
+ if v.Len() == 0 {
+ return nil
+ }
+
+ m := v.List()[0].(map[string]interface{})
+ var obj restapi.EndpointOAuthFacebook
+ if v, ok := m["client_id"]; ok {
+ obj.ClientID = expandString(v)
+ }
+ if v, ok := m["client_secret"]; ok {
+ obj.ClientSecret = expandString(v)
+ }
+ if v, ok := m["scopes"]; ok {
+ obj.Scopes = *expandStringSlice(v)
+ }
+ if v, ok := m["email_addresses"]; ok {
+ obj.EmailAddresses = *expandStringSlice(v)
+ }
+ if v, ok := m["email_domains"]; ok {
+ obj.EmailDomains = *expandStringSlice(v)
+ }
+ return &obj
+}
+
+func expandEndpointOAuthFacebookSlice(in interface{}) *[]restapi.EndpointOAuthFacebook {
+ var out []restapi.EndpointOAuthFacebook
+ for _, v := range in.([]interface{}) {
+ out = append(out, *expandEndpointOAuthFacebook(v))
+ }
+ return &out
+}
+
+func flattenEndpointOAuthMicrosoft(obj *restapi.EndpointOAuthMicrosoft) interface{} {
+ if obj == nil {
+ return nil
+ }
+
+ m := make(map[string]interface{})
+ m["client_id"] = obj.ClientID
+ m["client_secret"] = obj.ClientSecret
+ m["scopes"] = obj.Scopes
+ m["email_addresses"] = obj.EmailAddresses
+ m["email_domains"] = obj.EmailDomains
+
+ return []interface{}{m}
+}
+
+func flattenEndpointOAuthMicrosoftSlice(objs *[]restapi.EndpointOAuthMicrosoft) (sl []interface{}) {
+ if objs == nil {
+ return nil
+ }
+
+ for _, v := range *objs {
+ sl = append(sl, flattenEndpointOAuthMicrosoft(&v))
+ }
+ return sl
+}
+
+func expandEndpointOAuthMicrosoft(in interface{}) *restapi.EndpointOAuthMicrosoft {
+ if in == nil {
+ return nil
+ }
+ v := in.(*schema.Set)
+
+ if v.Len() == 0 {
+ return nil
+ }
+
+ m := v.List()[0].(map[string]interface{})
+ var obj restapi.EndpointOAuthMicrosoft
+ if v, ok := m["client_id"]; ok {
+ obj.ClientID = expandString(v)
+ }
+ if v, ok := m["client_secret"]; ok {
+ obj.ClientSecret = expandString(v)
+ }
+ if v, ok := m["scopes"]; ok {
+ obj.Scopes = *expandStringSlice(v)
+ }
+ if v, ok := m["email_addresses"]; ok {
+ obj.EmailAddresses = *expandStringSlice(v)
+ }
+ if v, ok := m["email_domains"]; ok {
+ obj.EmailDomains = *expandStringSlice(v)
+ }
+ return &obj
+}
+
+func expandEndpointOAuthMicrosoftSlice(in interface{}) *[]restapi.EndpointOAuthMicrosoft {
+ var out []restapi.EndpointOAuthMicrosoft
+ for _, v := range in.([]interface{}) {
+ out = append(out, *expandEndpointOAuthMicrosoft(v))
+ }
+ return &out
+}
+
+func flattenEndpointOAuthGoogle(obj *restapi.EndpointOAuthGoogle) interface{} {
+ if obj == nil {
+ return nil
+ }
+
+ m := make(map[string]interface{})
+ m["client_id"] = obj.ClientID
+ m["client_secret"] = obj.ClientSecret
+ m["scopes"] = obj.Scopes
+ m["email_addresses"] = obj.EmailAddresses
+ m["email_domains"] = obj.EmailDomains
+
+ return []interface{}{m}
+}
+
+func flattenEndpointOAuthGoogleSlice(objs *[]restapi.EndpointOAuthGoogle) (sl []interface{}) {
+ if objs == nil {
+ return nil
+ }
+
+ for _, v := range *objs {
+ sl = append(sl, flattenEndpointOAuthGoogle(&v))
+ }
+ return sl
+}
+
+func expandEndpointOAuthGoogle(in interface{}) *restapi.EndpointOAuthGoogle {
+ if in == nil {
+ return nil
+ }
+ v := in.(*schema.Set)
+
+ if v.Len() == 0 {
+ return nil
+ }
+
+ m := v.List()[0].(map[string]interface{})
+ var obj restapi.EndpointOAuthGoogle
+ if v, ok := m["client_id"]; ok {
+ obj.ClientID = expandString(v)
+ }
+ if v, ok := m["client_secret"]; ok {
+ obj.ClientSecret = expandString(v)
+ }
+ if v, ok := m["scopes"]; ok {
+ obj.Scopes = *expandStringSlice(v)
+ }
+ if v, ok := m["email_addresses"]; ok {
+ obj.EmailAddresses = *expandStringSlice(v)
+ }
+ if v, ok := m["email_domains"]; ok {
+ obj.EmailDomains = *expandStringSlice(v)
+ }
+ return &obj
+}
+
+func expandEndpointOAuthGoogleSlice(in interface{}) *[]restapi.EndpointOAuthGoogle {
+ var out []restapi.EndpointOAuthGoogle
+ for _, v := range in.([]interface{}) {
+ out = append(out, *expandEndpointOAuthGoogle(v))
+ }
+ return &out
+}
+
+func flattenEndpointSAML(obj *restapi.EndpointSAML) interface{} {
+ if obj == nil {
+ return nil
+ }
+
+ m := make(map[string]interface{})
+ m["enabled"] = obj.Enabled
+ m["options_passthrough"] = obj.OptionsPassthrough
+ m["cookie_prefix"] = obj.CookiePrefix
+ m["inactivity_timeout"] = obj.InactivityTimeout
+ m["maximum_duration"] = obj.MaximumDuration
+ m["idp_metadata_url"] = obj.IdPMetadataURL
+ m["idp_metadata"] = obj.IdPMetadata
+ m["force_authn"] = obj.ForceAuthn
+ m["allow_idp_initiated"] = obj.AllowIdPInitiated
+ m["authorized_groups"] = obj.AuthorizedGroups
+ m["entity_id"] = obj.EntityID
+ m["assertion_consumer_service_url"] = obj.AssertionConsumerServiceURL
+ m["single_logout_url"] = obj.SingleLogoutURL
+ m["request_signing_certificate_pem"] = obj.RequestSigningCertificatePEM
+ m["metadata_url"] = obj.MetadataURL
+ m["nameid_format"] = obj.NameIDFormat
+
+ return []interface{}{m}
+}
+
+func flattenEndpointSAMLSlice(objs *[]restapi.EndpointSAML) (sl []interface{}) {
+ if objs == nil {
+ return nil
+ }
+
+ for _, v := range *objs {
+ sl = append(sl, flattenEndpointSAML(&v))
+ }
+ return sl
+}
+
+func expandEndpointSAML(in interface{}) *restapi.EndpointSAML {
+ if in == nil {
+ return nil
+ }
+ v := in.(*schema.Set)
+
+ if v.Len() == 0 {
+ return nil
+ }
+
+ m := v.List()[0].(map[string]interface{})
+ var obj restapi.EndpointSAML
+ if v, ok := m["enabled"]; ok {
+ obj.Enabled = expandBool(v)
+ }
+ if v, ok := m["options_passthrough"]; ok {
+ obj.OptionsPassthrough = *expandBool(v)
+ }
+ if v, ok := m["cookie_prefix"]; ok {
+ obj.CookiePrefix = *expandString(v)
+ }
+ if v, ok := m["inactivity_timeout"]; ok {
+ obj.InactivityTimeout = *expandUint32(v)
+ }
+ if v, ok := m["maximum_duration"]; ok {
+ obj.MaximumDuration = *expandUint32(v)
+ }
+ if v, ok := m["idp_metadata_url"]; ok {
+ obj.IdPMetadataURL = *expandString(v)
+ }
+ if v, ok := m["idp_metadata"]; ok {
+ obj.IdPMetadata = *expandString(v)
+ }
+ if v, ok := m["force_authn"]; ok {
+ obj.ForceAuthn = *expandBool(v)
+ }
+ if v, ok := m["allow_idp_initiated"]; ok {
+ obj.AllowIdPInitiated = expandBool(v)
+ }
+ if v, ok := m["authorized_groups"]; ok {
+ obj.AuthorizedGroups = *expandStringSlice(v)
+ }
+ if v, ok := m["entity_id"]; ok {
+ obj.EntityID = *expandString(v)
+ }
+ if v, ok := m["assertion_consumer_service_url"]; ok {
+ obj.AssertionConsumerServiceURL = *expandString(v)
+ }
+ if v, ok := m["single_logout_url"]; ok {
+ obj.SingleLogoutURL = *expandString(v)
+ }
+ if v, ok := m["request_signing_certificate_pem"]; ok {
+ obj.RequestSigningCertificatePEM = *expandString(v)
+ }
+ if v, ok := m["metadata_url"]; ok {
+ obj.MetadataURL = *expandString(v)
+ }
+ if v, ok := m["nameid_format"]; ok {
+ obj.NameIDFormat = *expandString(v)
+ }
+ return &obj
+}
+
+func expandEndpointSAMLSlice(in interface{}) *[]restapi.EndpointSAML {
+ var out []restapi.EndpointSAML
+ for _, v := range in.([]interface{}) {
+ out = append(out, *expandEndpointSAML(v))
+ }
+ return &out
+}
+
+func flattenEndpointSAMLMutate(obj *restapi.EndpointSAMLMutate) interface{} {
+ if obj == nil {
+ return nil
+ }
+
+ m := make(map[string]interface{})
+ m["enabled"] = obj.Enabled
+ m["options_passthrough"] = obj.OptionsPassthrough
+ m["cookie_prefix"] = obj.CookiePrefix
+ m["inactivity_timeout"] = obj.InactivityTimeout
+ m["maximum_duration"] = obj.MaximumDuration
+ m["idp_metadata_url"] = obj.IdPMetadataURL
+ m["idp_metadata"] = obj.IdPMetadata
+ m["force_authn"] = obj.ForceAuthn
+ m["allow_idp_initiated"] = obj.AllowIdPInitiated
+ m["authorized_groups"] = obj.AuthorizedGroups
+ m["nameid_format"] = obj.NameIDFormat
+
+ return []interface{}{m}
+}
+
+func flattenEndpointSAMLMutateSlice(objs *[]restapi.EndpointSAMLMutate) (sl []interface{}) {
+ if objs == nil {
+ return nil
+ }
+
+ for _, v := range *objs {
+ sl = append(sl, flattenEndpointSAMLMutate(&v))
+ }
+ return sl
+}
+
+func expandEndpointSAMLMutate(in interface{}) *restapi.EndpointSAMLMutate {
+ if in == nil {
+ return nil
+ }
+ v := in.(*schema.Set)
+
+ if v.Len() == 0 {
+ return nil
+ }
+
+ m := v.List()[0].(map[string]interface{})
+ var obj restapi.EndpointSAMLMutate
+ if v, ok := m["enabled"]; ok {
+ obj.Enabled = expandBool(v)
}
- if v, ok := m["request_headers"]; ok {
- obj.RequestHeaders = expandEndpointRequestHeaders(v)
+ if v, ok := m["options_passthrough"]; ok {
+ obj.OptionsPassthrough = *expandBool(v)
}
- if v, ok := m["response_headers"]; ok {
- obj.ResponseHeaders = expandEndpointResponseHeaders(v)
+ if v, ok := m["cookie_prefix"]; ok {
+ obj.CookiePrefix = *expandString(v)
}
- if v, ok := m["ip_policy"]; ok {
- obj.IPPolicy = expandEndpointIPPolicyMutate(v)
+ if v, ok := m["inactivity_timeout"]; ok {
+ obj.InactivityTimeout = *expandUint32(v)
}
- if v, ok := m["mutual_tls"]; ok {
- obj.MutualTLS = expandEndpointMutualTLSMutate(v)
+ if v, ok := m["maximum_duration"]; ok {
+ obj.MaximumDuration = *expandUint32(v)
}
- if v, ok := m["tls_termination"]; ok {
- obj.TLSTermination = expandEndpointTLSTermination(v)
+ if v, ok := m["idp_metadata_url"]; ok {
+ obj.IdPMetadataURL = *expandString(v)
}
- if v, ok := m["webhook_validation"]; ok {
- obj.WebhookValidation = expandEndpointWebhookValidation(v)
+ if v, ok := m["idp_metadata"]; ok {
+ obj.IdPMetadata = *expandString(v)
}
- if v, ok := m["oauth"]; ok {
- obj.OAuth = expandEndpointOAuth(v)
+ if v, ok := m["force_authn"]; ok {
+ obj.ForceAuthn = *expandBool(v)
}
- if v, ok := m["logging"]; ok {
- obj.Logging = expandEndpointLoggingMutate(v)
+ if v, ok := m["allow_idp_initiated"]; ok {
+ obj.AllowIdPInitiated = expandBool(v)
}
- if v, ok := m["saml"]; ok {
- obj.SAML = expandEndpointSAMLMutate(v)
+ if v, ok := m["authorized_groups"]; ok {
+ obj.AuthorizedGroups = *expandStringSlice(v)
}
- if v, ok := m["oidc"]; ok {
- obj.OIDC = expandEndpointOIDC(v)
+ if v, ok := m["nameid_format"]; ok {
+ obj.NameIDFormat = *expandString(v)
+ }
+ return &obj
+}
+
+func expandEndpointSAMLMutateSlice(in interface{}) *[]restapi.EndpointSAMLMutate {
+ var out []restapi.EndpointSAMLMutate
+ for _, v := range in.([]interface{}) {
+ out = append(out, *expandEndpointSAMLMutate(v))
+ }
+ return &out
+}
+
+func flattenEndpointOIDC(obj *restapi.EndpointOIDC) interface{} {
+ if obj == nil {
+ return nil
+ }
+
+ m := make(map[string]interface{})
+ m["enabled"] = obj.Enabled
+ m["options_passthrough"] = obj.OptionsPassthrough
+ m["cookie_prefix"] = obj.CookiePrefix
+ m["inactivity_timeout"] = obj.InactivityTimeout
+ m["maximum_duration"] = obj.MaximumDuration
+ m["issuer"] = obj.Issuer
+ m["client_id"] = obj.ClientID
+ m["client_secret"] = obj.ClientSecret
+ m["scopes"] = obj.Scopes
+
+ return []interface{}{m}
+}
+
+func flattenEndpointOIDCSlice(objs *[]restapi.EndpointOIDC) (sl []interface{}) {
+ if objs == nil {
+ return nil
+ }
+
+ for _, v := range *objs {
+ sl = append(sl, flattenEndpointOIDC(&v))
+ }
+ return sl
+}
+
+func expandEndpointOIDC(in interface{}) *restapi.EndpointOIDC {
+ if in == nil {
+ return nil
+ }
+ v := in.(*schema.Set)
+
+ if v.Len() == 0 {
+ return nil
+ }
+
+ m := v.List()[0].(map[string]interface{})
+ var obj restapi.EndpointOIDC
+ if v, ok := m["enabled"]; ok {
+ obj.Enabled = expandBool(v)
+ }
+ if v, ok := m["options_passthrough"]; ok {
+ obj.OptionsPassthrough = *expandBool(v)
+ }
+ if v, ok := m["cookie_prefix"]; ok {
+ obj.CookiePrefix = *expandString(v)
+ }
+ if v, ok := m["inactivity_timeout"]; ok {
+ obj.InactivityTimeout = *expandUint32(v)
+ }
+ if v, ok := m["maximum_duration"]; ok {
+ obj.MaximumDuration = *expandUint32(v)
+ }
+ if v, ok := m["issuer"]; ok {
+ obj.Issuer = *expandString(v)
+ }
+ if v, ok := m["client_id"]; ok {
+ obj.ClientID = *expandString(v)
+ }
+ if v, ok := m["client_secret"]; ok {
+ obj.ClientSecret = *expandString(v)
+ }
+ if v, ok := m["scopes"]; ok {
+ obj.Scopes = *expandStringSlice(v)
+ }
+ return &obj
+}
+
+func expandEndpointOIDCSlice(in interface{}) *[]restapi.EndpointOIDC {
+ var out []restapi.EndpointOIDC
+ for _, v := range in.([]interface{}) {
+ out = append(out, *expandEndpointOIDC(v))
+ }
+ return &out
+}
+
+func flattenEndpointBackend(obj *restapi.EndpointBackend) interface{} {
+ if obj == nil {
+ return nil
+ }
+
+ m := make(map[string]interface{})
+ m["enabled"] = obj.Enabled
+ m["backend"] = flattenRef(&obj.Backend)
+
+ return []interface{}{m}
+}
+
+func flattenEndpointBackendSlice(objs *[]restapi.EndpointBackend) (sl []interface{}) {
+ if objs == nil {
+ return nil
+ }
+
+ for _, v := range *objs {
+ sl = append(sl, flattenEndpointBackend(&v))
+ }
+ return sl
+}
+
+func expandEndpointBackend(in interface{}) *restapi.EndpointBackend {
+ if in == nil {
+ return nil
+ }
+ v := in.(*schema.Set)
+
+ if v.Len() == 0 {
+ return nil
+ }
+
+ m := v.List()[0].(map[string]interface{})
+ var obj restapi.EndpointBackend
+ if v, ok := m["enabled"]; ok {
+ obj.Enabled = expandBool(v)
+ }
+ if v, ok := m["backend"]; ok {
+ obj.Backend = *expandRef(v)
+ }
+ return &obj
+}
+
+func expandEndpointBackendSlice(in interface{}) *[]restapi.EndpointBackend {
+ var out []restapi.EndpointBackend
+ for _, v := range in.([]interface{}) {
+ out = append(out, *expandEndpointBackend(v))
+ }
+ return &out
+}
+
+func flattenEndpointBackendMutate(obj *restapi.EndpointBackendMutate) interface{} {
+ if obj == nil {
+ return nil
+ }
+
+ m := make(map[string]interface{})
+ m["enabled"] = obj.Enabled
+ m["backend_id"] = obj.BackendID
+
+ return []interface{}{m}
+}
+
+func flattenEndpointBackendMutateSlice(objs *[]restapi.EndpointBackendMutate) (sl []interface{}) {
+ if objs == nil {
+ return nil
+ }
+
+ for _, v := range *objs {
+ sl = append(sl, flattenEndpointBackendMutate(&v))
+ }
+ return sl
+}
+
+func expandEndpointBackendMutate(in interface{}) *restapi.EndpointBackendMutate {
+ if in == nil {
+ return nil
+ }
+ v := in.(*schema.Set)
+
+ if v.Len() == 0 {
+ return nil
+ }
+
+ m := v.List()[0].(map[string]interface{})
+ var obj restapi.EndpointBackendMutate
+ if v, ok := m["enabled"]; ok {
+ obj.Enabled = expandBool(v)
+ }
+ if v, ok := m["backend_id"]; ok {
+ obj.BackendID = *expandString(v)
+ }
+ return &obj
+}
+
+func expandEndpointBackendMutateSlice(in interface{}) *[]restapi.EndpointBackendMutate {
+ var out []restapi.EndpointBackendMutate
+ for _, v := range in.([]interface{}) {
+ out = append(out, *expandEndpointBackendMutate(v))
+ }
+ return &out
+}
+
+func flattenEndpointWebsocketTCPConverter(obj *restapi.EndpointWebsocketTCPConverter) interface{} {
+ if obj == nil {
+ return nil
+ }
+
+ m := make(map[string]interface{})
+ m["enabled"] = obj.Enabled
+
+ return []interface{}{m}
+}
+
+func flattenEndpointWebsocketTCPConverterSlice(objs *[]restapi.EndpointWebsocketTCPConverter) (sl []interface{}) {
+ if objs == nil {
+ return nil
+ }
+
+ for _, v := range *objs {
+ sl = append(sl, flattenEndpointWebsocketTCPConverter(&v))
+ }
+ return sl
+}
+
+func expandEndpointWebsocketTCPConverter(in interface{}) *restapi.EndpointWebsocketTCPConverter {
+ if in == nil {
+ return nil
}
- if v, ok := m["backend"]; ok {
- obj.Backend = expandEndpointBackendMutate(v)
+ v := in.(*schema.Set)
+
+ if v.Len() == 0 {
+ return nil
+ }
+
+ m := v.List()[0].(map[string]interface{})
+ var obj restapi.EndpointWebsocketTCPConverter
+ if v, ok := m["enabled"]; ok {
+ obj.Enabled = expandBool(v)
}
return &obj
}
-func expandEndpointConfigurationCreateSlice(in interface{}) *[]restapi.EndpointConfigurationCreate {
- var out []restapi.EndpointConfigurationCreate
+func expandEndpointWebsocketTCPConverterSlice(in interface{}) *[]restapi.EndpointWebsocketTCPConverter {
+ var out []restapi.EndpointWebsocketTCPConverter
for _, v := range in.([]interface{}) {
- out = append(out, *expandEndpointConfigurationCreate(v))
+ out = append(out, *expandEndpointWebsocketTCPConverter(v))
}
return &out
}
-func flattenEndpointWebhookValidation(obj *restapi.EndpointWebhookValidation) interface{} {
+func flattenEdgeRouteItem(obj *restapi.EdgeRouteItem) interface{} {
if obj == nil {
return nil
}
m := make(map[string]interface{})
- m["enabled"] = obj.Enabled
- m["provider"] = obj.Provider
- m["secret"] = obj.Secret
+ m["edge_id"] = obj.EdgeID
+ m["id"] = obj.ID
return []interface{}{m}
}
-func flattenEndpointWebhookValidationSlice(objs *[]restapi.EndpointWebhookValidation) (sl []interface{}) {
+func flattenEdgeRouteItemSlice(objs *[]restapi.EdgeRouteItem) (sl []interface{}) {
if objs == nil {
return nil
}
for _, v := range *objs {
- sl = append(sl, flattenEndpointWebhookValidation(&v))
+ sl = append(sl, flattenEdgeRouteItem(&v))
}
return sl
}
-func expandEndpointWebhookValidation(in interface{}) *restapi.EndpointWebhookValidation {
+func expandEdgeRouteItem(in interface{}) *restapi.EdgeRouteItem {
if in == nil {
return nil
}
@@ -2607,50 +4722,62 @@ func expandEndpointWebhookValidation(in interface{}) *restapi.EndpointWebhookVal
}
m := v.List()[0].(map[string]interface{})
- var obj restapi.EndpointWebhookValidation
- if v, ok := m["enabled"]; ok {
- obj.Enabled = expandBool(v)
- }
- if v, ok := m["provider"]; ok {
- obj.Provider = *expandString(v)
+ var obj restapi.EdgeRouteItem
+ if v, ok := m["edge_id"]; ok {
+ obj.EdgeID = *expandString(v)
}
- if v, ok := m["secret"]; ok {
- obj.Secret = *expandString(v)
+ if v, ok := m["id"]; ok {
+ obj.ID = *expandString(v)
}
return &obj
}
-func expandEndpointWebhookValidationSlice(in interface{}) *[]restapi.EndpointWebhookValidation {
- var out []restapi.EndpointWebhookValidation
+func expandEdgeRouteItemSlice(in interface{}) *[]restapi.EdgeRouteItem {
+ var out []restapi.EdgeRouteItem
for _, v := range in.([]interface{}) {
- out = append(out, *expandEndpointWebhookValidation(v))
+ out = append(out, *expandEdgeRouteItem(v))
}
return &out
}
-func flattenEndpointCompression(obj *restapi.EndpointCompression) interface{} {
+func flattenHTTPSEdgeRouteCreate(obj *restapi.HTTPSEdgeRouteCreate) interface{} {
if obj == nil {
return nil
}
m := make(map[string]interface{})
- m["enabled"] = obj.Enabled
+ m["edge_id"] = obj.EdgeID
+ m["match_type"] = obj.MatchType
+ m["match"] = obj.Match
+ m["description"] = obj.Description
+ m["metadata"] = obj.Metadata
+ m["backend"] = flattenEndpointBackendMutate(obj.Backend)
+ m["ip_restriction"] = flattenEndpointIPPolicyMutate(obj.IPRestriction)
+ m["circuit_breaker"] = flattenEndpointCircuitBreaker(obj.CircuitBreaker)
+ m["compression"] = flattenEndpointCompression(obj.Compression)
+ m["request_headers"] = flattenEndpointRequestHeaders(obj.RequestHeaders)
+ m["response_headers"] = flattenEndpointResponseHeaders(obj.ResponseHeaders)
+ m["webhook_verification"] = flattenEndpointWebhookValidation(obj.WebhookVerification)
+ m["oauth"] = flattenEndpointOAuth(obj.OAuth)
+ m["saml"] = flattenEndpointSAMLMutate(obj.SAML)
+ m["oidc"] = flattenEndpointOIDC(obj.OIDC)
+ m["websocket_tcp_converter"] = flattenEndpointWebsocketTCPConverter(obj.WebsocketTCPConverter)
return []interface{}{m}
}
-func flattenEndpointCompressionSlice(objs *[]restapi.EndpointCompression) (sl []interface{}) {
+func flattenHTTPSEdgeRouteCreateSlice(objs *[]restapi.HTTPSEdgeRouteCreate) (sl []interface{}) {
if objs == nil {
return nil
}
for _, v := range *objs {
- sl = append(sl, flattenEndpointCompression(&v))
+ sl = append(sl, flattenHTTPSEdgeRouteCreate(&v))
}
return sl
}
-func expandEndpointCompression(in interface{}) *restapi.EndpointCompression {
+func expandHTTPSEdgeRouteCreate(in interface{}) *restapi.HTTPSEdgeRouteCreate {
if in == nil {
return nil
}
@@ -2661,45 +4788,105 @@ func expandEndpointCompression(in interface{}) *restapi.EndpointCompression {
}
m := v.List()[0].(map[string]interface{})
- var obj restapi.EndpointCompression
- if v, ok := m["enabled"]; ok {
- obj.Enabled = expandBool(v)
+ var obj restapi.HTTPSEdgeRouteCreate
+ if v, ok := m["edge_id"]; ok {
+ obj.EdgeID = *expandString(v)
+ }
+ if v, ok := m["match_type"]; ok {
+ obj.MatchType = *expandString(v)
+ }
+ if v, ok := m["match"]; ok {
+ obj.Match = *expandString(v)
+ }
+ if v, ok := m["description"]; ok {
+ obj.Description = *expandString(v)
+ }
+ if v, ok := m["metadata"]; ok {
+ obj.Metadata = *expandString(v)
+ }
+ if v, ok := m["backend"]; ok {
+ obj.Backend = expandEndpointBackendMutate(v)
+ }
+ if v, ok := m["ip_restriction"]; ok {
+ obj.IPRestriction = expandEndpointIPPolicyMutate(v)
+ }
+ if v, ok := m["circuit_breaker"]; ok {
+ obj.CircuitBreaker = expandEndpointCircuitBreaker(v)
+ }
+ if v, ok := m["compression"]; ok {
+ obj.Compression = expandEndpointCompression(v)
+ }
+ if v, ok := m["request_headers"]; ok {
+ obj.RequestHeaders = expandEndpointRequestHeaders(v)
+ }
+ if v, ok := m["response_headers"]; ok {
+ obj.ResponseHeaders = expandEndpointResponseHeaders(v)
+ }
+ if v, ok := m["webhook_verification"]; ok {
+ obj.WebhookVerification = expandEndpointWebhookValidation(v)
+ }
+ if v, ok := m["oauth"]; ok {
+ obj.OAuth = expandEndpointOAuth(v)
+ }
+ if v, ok := m["saml"]; ok {
+ obj.SAML = expandEndpointSAMLMutate(v)
+ }
+ if v, ok := m["oidc"]; ok {
+ obj.OIDC = expandEndpointOIDC(v)
+ }
+ if v, ok := m["websocket_tcp_converter"]; ok {
+ obj.WebsocketTCPConverter = expandEndpointWebsocketTCPConverter(v)
}
return &obj
}
-func expandEndpointCompressionSlice(in interface{}) *[]restapi.EndpointCompression {
- var out []restapi.EndpointCompression
+func expandHTTPSEdgeRouteCreateSlice(in interface{}) *[]restapi.HTTPSEdgeRouteCreate {
+ var out []restapi.HTTPSEdgeRouteCreate
for _, v := range in.([]interface{}) {
- out = append(out, *expandEndpointCompression(v))
+ out = append(out, *expandHTTPSEdgeRouteCreate(v))
}
return &out
}
-func flattenEndpointMutualTLS(obj *restapi.EndpointMutualTLS) interface{} {
+func flattenHTTPSEdgeRouteUpdate(obj *restapi.HTTPSEdgeRouteUpdate) interface{} {
if obj == nil {
return nil
}
m := make(map[string]interface{})
- m["enabled"] = obj.Enabled
- m["certificate_authorities"] = flattenRefSlice(&obj.CertificateAuthorities)
+ m["edge_id"] = obj.EdgeID
+ m["id"] = obj.ID
+ m["match_type"] = obj.MatchType
+ m["match"] = obj.Match
+ m["description"] = obj.Description
+ m["metadata"] = obj.Metadata
+ m["backend"] = flattenEndpointBackendMutate(obj.Backend)
+ m["ip_restriction"] = flattenEndpointIPPolicyMutate(obj.IPRestriction)
+ m["circuit_breaker"] = flattenEndpointCircuitBreaker(obj.CircuitBreaker)
+ m["compression"] = flattenEndpointCompression(obj.Compression)
+ m["request_headers"] = flattenEndpointRequestHeaders(obj.RequestHeaders)
+ m["response_headers"] = flattenEndpointResponseHeaders(obj.ResponseHeaders)
+ m["webhook_verification"] = flattenEndpointWebhookValidation(obj.WebhookVerification)
+ m["oauth"] = flattenEndpointOAuth(obj.OAuth)
+ m["saml"] = flattenEndpointSAMLMutate(obj.SAML)
+ m["oidc"] = flattenEndpointOIDC(obj.OIDC)
+ m["websocket_tcp_converter"] = flattenEndpointWebsocketTCPConverter(obj.WebsocketTCPConverter)
return []interface{}{m}
}
-func flattenEndpointMutualTLSSlice(objs *[]restapi.EndpointMutualTLS) (sl []interface{}) {
+func flattenHTTPSEdgeRouteUpdateSlice(objs *[]restapi.HTTPSEdgeRouteUpdate) (sl []interface{}) {
if objs == nil {
return nil
}
for _, v := range *objs {
- sl = append(sl, flattenEndpointMutualTLS(&v))
+ sl = append(sl, flattenHTTPSEdgeRouteUpdate(&v))
}
return sl
}
-func expandEndpointMutualTLS(in interface{}) *restapi.EndpointMutualTLS {
+func expandHTTPSEdgeRouteUpdate(in interface{}) *restapi.HTTPSEdgeRouteUpdate {
if in == nil {
return nil
}
@@ -2710,48 +4897,110 @@ func expandEndpointMutualTLS(in interface{}) *restapi.EndpointMutualTLS {
}
m := v.List()[0].(map[string]interface{})
- var obj restapi.EndpointMutualTLS
- if v, ok := m["enabled"]; ok {
- obj.Enabled = expandBool(v)
+ var obj restapi.HTTPSEdgeRouteUpdate
+ if v, ok := m["edge_id"]; ok {
+ obj.EdgeID = *expandString(v)
}
- if v, ok := m["certificate_authorities"]; ok {
- obj.CertificateAuthorities = *expandRefSlice(v)
+ if v, ok := m["id"]; ok {
+ obj.ID = *expandString(v)
+ }
+ if v, ok := m["match_type"]; ok {
+ obj.MatchType = *expandString(v)
+ }
+ if v, ok := m["match"]; ok {
+ obj.Match = *expandString(v)
+ }
+ if v, ok := m["description"]; ok {
+ obj.Description = *expandString(v)
+ }
+ if v, ok := m["metadata"]; ok {
+ obj.Metadata = *expandString(v)
+ }
+ if v, ok := m["backend"]; ok {
+ obj.Backend = expandEndpointBackendMutate(v)
+ }
+ if v, ok := m["ip_restriction"]; ok {
+ obj.IPRestriction = expandEndpointIPPolicyMutate(v)
+ }
+ if v, ok := m["circuit_breaker"]; ok {
+ obj.CircuitBreaker = expandEndpointCircuitBreaker(v)
+ }
+ if v, ok := m["compression"]; ok {
+ obj.Compression = expandEndpointCompression(v)
+ }
+ if v, ok := m["request_headers"]; ok {
+ obj.RequestHeaders = expandEndpointRequestHeaders(v)
+ }
+ if v, ok := m["response_headers"]; ok {
+ obj.ResponseHeaders = expandEndpointResponseHeaders(v)
+ }
+ if v, ok := m["webhook_verification"]; ok {
+ obj.WebhookVerification = expandEndpointWebhookValidation(v)
+ }
+ if v, ok := m["oauth"]; ok {
+ obj.OAuth = expandEndpointOAuth(v)
+ }
+ if v, ok := m["saml"]; ok {
+ obj.SAML = expandEndpointSAMLMutate(v)
+ }
+ if v, ok := m["oidc"]; ok {
+ obj.OIDC = expandEndpointOIDC(v)
+ }
+ if v, ok := m["websocket_tcp_converter"]; ok {
+ obj.WebsocketTCPConverter = expandEndpointWebsocketTCPConverter(v)
}
return &obj
}
-func expandEndpointMutualTLSSlice(in interface{}) *[]restapi.EndpointMutualTLS {
- var out []restapi.EndpointMutualTLS
+func expandHTTPSEdgeRouteUpdateSlice(in interface{}) *[]restapi.HTTPSEdgeRouteUpdate {
+ var out []restapi.HTTPSEdgeRouteUpdate
for _, v := range in.([]interface{}) {
- out = append(out, *expandEndpointMutualTLS(v))
+ out = append(out, *expandHTTPSEdgeRouteUpdate(v))
}
return &out
}
-func flattenEndpointMutualTLSMutate(obj *restapi.EndpointMutualTLSMutate) interface{} {
+func flattenHTTPSEdgeRoute(obj *restapi.HTTPSEdgeRoute) interface{} {
if obj == nil {
return nil
}
m := make(map[string]interface{})
- m["enabled"] = obj.Enabled
- m["certificate_authority_ids"] = obj.CertificateAuthorityIDs
+ m["edge_id"] = obj.EdgeID
+ m["id"] = obj.ID
+ m["created_at"] = obj.CreatedAt
+ m["match_type"] = obj.MatchType
+ m["match"] = obj.Match
+ m["uri"] = obj.URI
+ m["description"] = obj.Description
+ m["metadata"] = obj.Metadata
+ m["backend"] = flattenEndpointBackend(obj.Backend)
+ m["ip_restriction"] = flattenEndpointIPPolicy(obj.IpRestriction)
+ m["circuit_breaker"] = flattenEndpointCircuitBreaker(obj.CircuitBreaker)
+ m["compression"] = flattenEndpointCompression(obj.Compression)
+ m["request_headers"] = flattenEndpointRequestHeaders(obj.RequestHeaders)
+ m["response_headers"] = flattenEndpointResponseHeaders(obj.ResponseHeaders)
+ m["webhook_verification"] = flattenEndpointWebhookValidation(obj.WebhookVerification)
+ m["oauth"] = flattenEndpointOAuth(obj.OAuth)
+ m["saml"] = flattenEndpointSAML(obj.SAML)
+ m["oidc"] = flattenEndpointOIDC(obj.OIDC)
+ m["websocket_tcp_converter"] = flattenEndpointWebsocketTCPConverter(obj.WebsocketTCPConverter)
return []interface{}{m}
}
-func flattenEndpointMutualTLSMutateSlice(objs *[]restapi.EndpointMutualTLSMutate) (sl []interface{}) {
+func flattenHTTPSEdgeRouteSlice(objs *[]restapi.HTTPSEdgeRoute) (sl []interface{}) {
if objs == nil {
return nil
}
for _, v := range *objs {
- sl = append(sl, flattenEndpointMutualTLSMutate(&v))
+ sl = append(sl, flattenHTTPSEdgeRoute(&v))
}
return sl
}
-func expandEndpointMutualTLSMutate(in interface{}) *restapi.EndpointMutualTLSMutate {
+func expandHTTPSEdgeRoute(in interface{}) *restapi.HTTPSEdgeRoute {
if in == nil {
return nil
}
@@ -2762,49 +5011,100 @@ func expandEndpointMutualTLSMutate(in interface{}) *restapi.EndpointMutualTLSMut
}
m := v.List()[0].(map[string]interface{})
- var obj restapi.EndpointMutualTLSMutate
- if v, ok := m["enabled"]; ok {
- obj.Enabled = expandBool(v)
+ var obj restapi.HTTPSEdgeRoute
+ if v, ok := m["edge_id"]; ok {
+ obj.EdgeID = *expandString(v)
}
- if v, ok := m["certificate_authority_ids"]; ok {
- obj.CertificateAuthorityIDs = *expandStringSlice(v)
+ if v, ok := m["id"]; ok {
+ obj.ID = *expandString(v)
+ }
+ if v, ok := m["created_at"]; ok {
+ obj.CreatedAt = *expandString(v)
+ }
+ if v, ok := m["match_type"]; ok {
+ obj.MatchType = *expandString(v)
+ }
+ if v, ok := m["match"]; ok {
+ obj.Match = *expandString(v)
+ }
+ if v, ok := m["uri"]; ok {
+ obj.URI = *expandString(v)
+ }
+ if v, ok := m["description"]; ok {
+ obj.Description = *expandString(v)
+ }
+ if v, ok := m["metadata"]; ok {
+ obj.Metadata = *expandString(v)
+ }
+ if v, ok := m["backend"]; ok {
+ obj.Backend = expandEndpointBackend(v)
+ }
+ if v, ok := m["ip_restriction"]; ok {
+ obj.IpRestriction = expandEndpointIPPolicy(v)
+ }
+ if v, ok := m["circuit_breaker"]; ok {
+ obj.CircuitBreaker = expandEndpointCircuitBreaker(v)
+ }
+ if v, ok := m["compression"]; ok {
+ obj.Compression = expandEndpointCompression(v)
+ }
+ if v, ok := m["request_headers"]; ok {
+ obj.RequestHeaders = expandEndpointRequestHeaders(v)
+ }
+ if v, ok := m["response_headers"]; ok {
+ obj.ResponseHeaders = expandEndpointResponseHeaders(v)
+ }
+ if v, ok := m["webhook_verification"]; ok {
+ obj.WebhookVerification = expandEndpointWebhookValidation(v)
+ }
+ if v, ok := m["oauth"]; ok {
+ obj.OAuth = expandEndpointOAuth(v)
+ }
+ if v, ok := m["saml"]; ok {
+ obj.SAML = expandEndpointSAML(v)
+ }
+ if v, ok := m["oidc"]; ok {
+ obj.OIDC = expandEndpointOIDC(v)
+ }
+ if v, ok := m["websocket_tcp_converter"]; ok {
+ obj.WebsocketTCPConverter = expandEndpointWebsocketTCPConverter(v)
}
return &obj
}
-func expandEndpointMutualTLSMutateSlice(in interface{}) *[]restapi.EndpointMutualTLSMutate {
- var out []restapi.EndpointMutualTLSMutate
+func expandHTTPSEdgeRouteSlice(in interface{}) *[]restapi.HTTPSEdgeRoute {
+ var out []restapi.HTTPSEdgeRoute
for _, v := range in.([]interface{}) {
- out = append(out, *expandEndpointMutualTLSMutate(v))
+ out = append(out, *expandHTTPSEdgeRoute(v))
}
return &out
}
-func flattenEndpointTLSTermination(obj *restapi.EndpointTLSTermination) interface{} {
+func flattenHTTPSEdgeList(obj *restapi.HTTPSEdgeList) interface{} {
if obj == nil {
return nil
}
m := make(map[string]interface{})
- m["enabled"] = obj.Enabled
- m["terminate_at"] = obj.TerminateAt
- m["min_version"] = obj.MinVersion
+ m["https_edges"] = flattenHTTPSEdgeSlice(&obj.HTTPSEdges)
+ m["uri"] = obj.URI
+ m["next_page_uri"] = obj.NextPageURI
return []interface{}{m}
}
-func flattenEndpointTLSTerminationSlice(objs *[]restapi.EndpointTLSTermination) (sl []interface{}) {
+func flattenHTTPSEdgeListSlice(objs *[]restapi.HTTPSEdgeList) (sl []interface{}) {
if objs == nil {
return nil
}
for _, v := range *objs {
- sl = append(sl, flattenEndpointTLSTermination(&v))
+ sl = append(sl, flattenHTTPSEdgeList(&v))
}
return sl
}
-func expandEndpointTLSTermination(in interface{}) *restapi.EndpointTLSTermination {
+func expandHTTPSEdgeList(in interface{}) *restapi.HTTPSEdgeList {
if in == nil {
return nil
}
@@ -2815,53 +5115,54 @@ func expandEndpointTLSTermination(in interface{}) *restapi.EndpointTLSTerminatio
}
m := v.List()[0].(map[string]interface{})
- var obj restapi.EndpointTLSTermination
- if v, ok := m["enabled"]; ok {
- obj.Enabled = expandBool(v)
+ var obj restapi.HTTPSEdgeList
+ if v, ok := m["https_edges"]; ok {
+ obj.HTTPSEdges = *expandHTTPSEdgeSlice(v)
}
- if v, ok := m["terminate_at"]; ok {
- obj.TerminateAt = *expandString(v)
+ if v, ok := m["uri"]; ok {
+ obj.URI = *expandString(v)
}
- if v, ok := m["min_version"]; ok {
- obj.MinVersion = expandString(v)
+ if v, ok := m["next_page_uri"]; ok {
+ obj.NextPageURI = expandString(v)
}
return &obj
}
-func expandEndpointTLSTerminationSlice(in interface{}) *[]restapi.EndpointTLSTermination {
- var out []restapi.EndpointTLSTermination
+func expandHTTPSEdgeListSlice(in interface{}) *[]restapi.HTTPSEdgeList {
+ var out []restapi.HTTPSEdgeList
for _, v := range in.([]interface{}) {
- out = append(out, *expandEndpointTLSTermination(v))
+ out = append(out, *expandHTTPSEdgeList(v))
}
return &out
}
-func flattenEndpointBasicAuth(obj *restapi.EndpointBasicAuth) interface{} {
+func flattenHTTPSEdgeCreate(obj *restapi.HTTPSEdgeCreate) interface{} {
if obj == nil {
return nil
}
m := make(map[string]interface{})
- m["enabled"] = obj.Enabled
- m["auth_provider_id"] = obj.AuthProviderID
- m["realm"] = obj.Realm
- m["allow_options"] = obj.AllowOptions
+ m["description"] = obj.Description
+ m["metadata"] = obj.Metadata
+ m["hostports"] = obj.Hostports
+ m["mutual_tls"] = flattenEndpointMutualTLSMutate(obj.MutualTLS)
+ m["tls_termination"] = flattenEndpointTLSTerminationAtEdge(obj.TLSTermination)
return []interface{}{m}
}
-func flattenEndpointBasicAuthSlice(objs *[]restapi.EndpointBasicAuth) (sl []interface{}) {
+func flattenHTTPSEdgeCreateSlice(objs *[]restapi.HTTPSEdgeCreate) (sl []interface{}) {
if objs == nil {
return nil
}
for _, v := range *objs {
- sl = append(sl, flattenEndpointBasicAuth(&v))
+ sl = append(sl, flattenHTTPSEdgeCreate(&v))
}
return sl
}
-func expandEndpointBasicAuth(in interface{}) *restapi.EndpointBasicAuth {
+func expandHTTPSEdgeCreate(in interface{}) *restapi.HTTPSEdgeCreate {
if in == nil {
return nil
}
@@ -2872,54 +5173,61 @@ func expandEndpointBasicAuth(in interface{}) *restapi.EndpointBasicAuth {
}
m := v.List()[0].(map[string]interface{})
- var obj restapi.EndpointBasicAuth
- if v, ok := m["enabled"]; ok {
- obj.Enabled = expandBool(v)
+ var obj restapi.HTTPSEdgeCreate
+ if v, ok := m["description"]; ok {
+ obj.Description = *expandString(v)
}
- if v, ok := m["auth_provider_id"]; ok {
- obj.AuthProviderID = *expandString(v)
+ if v, ok := m["metadata"]; ok {
+ obj.Metadata = *expandString(v)
}
- if v, ok := m["realm"]; ok {
- obj.Realm = *expandString(v)
+ if v, ok := m["hostports"]; ok {
+ obj.Hostports = expandStringSlice(v)
}
- if v, ok := m["allow_options"]; ok {
- obj.AllowOptions = *expandBool(v)
+ if v, ok := m["mutual_tls"]; ok {
+ obj.MutualTLS = expandEndpointMutualTLSMutate(v)
+ }
+ if v, ok := m["tls_termination"]; ok {
+ obj.TLSTermination = expandEndpointTLSTerminationAtEdge(v)
}
return &obj
}
-func expandEndpointBasicAuthSlice(in interface{}) *[]restapi.EndpointBasicAuth {
- var out []restapi.EndpointBasicAuth
+func expandHTTPSEdgeCreateSlice(in interface{}) *[]restapi.HTTPSEdgeCreate {
+ var out []restapi.HTTPSEdgeCreate
for _, v := range in.([]interface{}) {
- out = append(out, *expandEndpointBasicAuth(v))
+ out = append(out, *expandHTTPSEdgeCreate(v))
}
return &out
}
-func flattenEndpointLogging(obj *restapi.EndpointLogging) interface{} {
+func flattenHTTPSEdgeUpdate(obj *restapi.HTTPSEdgeUpdate) interface{} {
if obj == nil {
return nil
}
m := make(map[string]interface{})
- m["enabled"] = obj.Enabled
- m["event_streams"] = flattenRefSlice(&obj.EventStreams)
+ m["id"] = obj.ID
+ m["description"] = obj.Description
+ m["metadata"] = obj.Metadata
+ m["hostports"] = obj.Hostports
+ m["mutual_tls"] = flattenEndpointMutualTLSMutate(obj.MutualTLS)
+ m["tls_termination"] = flattenEndpointTLSTerminationAtEdge(obj.TLSTermination)
return []interface{}{m}
}
-func flattenEndpointLoggingSlice(objs *[]restapi.EndpointLogging) (sl []interface{}) {
+func flattenHTTPSEdgeUpdateSlice(objs *[]restapi.HTTPSEdgeUpdate) (sl []interface{}) {
if objs == nil {
return nil
}
for _, v := range *objs {
- sl = append(sl, flattenEndpointLogging(&v))
+ sl = append(sl, flattenHTTPSEdgeUpdate(&v))
}
return sl
}
-func expandEndpointLogging(in interface{}) *restapi.EndpointLogging {
+func expandHTTPSEdgeUpdate(in interface{}) *restapi.HTTPSEdgeUpdate {
if in == nil {
return nil
}
@@ -2930,48 +5238,67 @@ func expandEndpointLogging(in interface{}) *restapi.EndpointLogging {
}
m := v.List()[0].(map[string]interface{})
- var obj restapi.EndpointLogging
- if v, ok := m["enabled"]; ok {
- obj.Enabled = expandBool(v)
+ var obj restapi.HTTPSEdgeUpdate
+ if v, ok := m["id"]; ok {
+ obj.ID = *expandString(v)
}
- if v, ok := m["event_streams"]; ok {
- obj.EventStreams = *expandRefSlice(v)
+ if v, ok := m["description"]; ok {
+ obj.Description = expandString(v)
+ }
+ if v, ok := m["metadata"]; ok {
+ obj.Metadata = expandString(v)
+ }
+ if v, ok := m["hostports"]; ok {
+ obj.Hostports = expandStringSlice(v)
+ }
+ if v, ok := m["mutual_tls"]; ok {
+ obj.MutualTLS = expandEndpointMutualTLSMutate(v)
+ }
+ if v, ok := m["tls_termination"]; ok {
+ obj.TLSTermination = expandEndpointTLSTerminationAtEdge(v)
}
return &obj
}
-func expandEndpointLoggingSlice(in interface{}) *[]restapi.EndpointLogging {
- var out []restapi.EndpointLogging
+func expandHTTPSEdgeUpdateSlice(in interface{}) *[]restapi.HTTPSEdgeUpdate {
+ var out []restapi.HTTPSEdgeUpdate
for _, v := range in.([]interface{}) {
- out = append(out, *expandEndpointLogging(v))
+ out = append(out, *expandHTTPSEdgeUpdate(v))
}
return &out
}
-func flattenEndpointLoggingMutate(obj *restapi.EndpointLoggingMutate) interface{} {
+func flattenHTTPSEdge(obj *restapi.HTTPSEdge) interface{} {
if obj == nil {
return nil
}
m := make(map[string]interface{})
- m["enabled"] = obj.Enabled
- m["event_stream_ids"] = obj.EventStreamIDs
+ m["id"] = obj.ID
+ m["description"] = obj.Description
+ m["metadata"] = obj.Metadata
+ m["created_at"] = obj.CreatedAt
+ m["uri"] = obj.URI
+ m["hostports"] = obj.Hostports
+ m["mutual_tls"] = flattenEndpointMutualTLS(obj.MutualTls)
+ m["tls_termination"] = flattenEndpointTLSTermination(obj.TlsTermination)
+ m["routes"] = flattenHTTPSEdgeRouteSlice(&obj.Routes)
return []interface{}{m}
}
-func flattenEndpointLoggingMutateSlice(objs *[]restapi.EndpointLoggingMutate) (sl []interface{}) {
+func flattenHTTPSEdgeSlice(objs *[]restapi.HTTPSEdge) (sl []interface{}) {
if objs == nil {
return nil
}
for _, v := range *objs {
- sl = append(sl, flattenEndpointLoggingMutate(&v))
+ sl = append(sl, flattenHTTPSEdge(&v))
}
return sl
}
-func expandEndpointLoggingMutate(in interface{}) *restapi.EndpointLoggingMutate {
+func expandHTTPSEdge(in interface{}) *restapi.HTTPSEdge {
if in == nil {
return nil
}
@@ -2982,49 +5309,69 @@ func expandEndpointLoggingMutate(in interface{}) *restapi.EndpointLoggingMutate
}
m := v.List()[0].(map[string]interface{})
- var obj restapi.EndpointLoggingMutate
- if v, ok := m["enabled"]; ok {
- obj.Enabled = expandBool(v)
+ var obj restapi.HTTPSEdge
+ if v, ok := m["id"]; ok {
+ obj.ID = *expandString(v)
}
- if v, ok := m["event_stream_ids"]; ok {
- obj.EventStreamIDs = *expandStringSlice(v)
+ if v, ok := m["description"]; ok {
+ obj.Description = *expandString(v)
+ }
+ if v, ok := m["metadata"]; ok {
+ obj.Metadata = *expandString(v)
+ }
+ if v, ok := m["created_at"]; ok {
+ obj.CreatedAt = *expandString(v)
+ }
+ if v, ok := m["uri"]; ok {
+ obj.URI = *expandString(v)
+ }
+ if v, ok := m["hostports"]; ok {
+ obj.Hostports = expandStringSlice(v)
+ }
+ if v, ok := m["mutual_tls"]; ok {
+ obj.MutualTls = expandEndpointMutualTLS(v)
+ }
+ if v, ok := m["tls_termination"]; ok {
+ obj.TlsTermination = expandEndpointTLSTermination(v)
+ }
+ if v, ok := m["routes"]; ok {
+ obj.Routes = *expandHTTPSEdgeRouteSlice(v)
}
return &obj
}
-func expandEndpointLoggingMutateSlice(in interface{}) *[]restapi.EndpointLoggingMutate {
- var out []restapi.EndpointLoggingMutate
+func expandHTTPSEdgeSlice(in interface{}) *[]restapi.HTTPSEdge {
+ var out []restapi.HTTPSEdge
for _, v := range in.([]interface{}) {
- out = append(out, *expandEndpointLoggingMutate(v))
+ out = append(out, *expandHTTPSEdge(v))
}
return &out
}
-func flattenEndpointRequestHeaders(obj *restapi.EndpointRequestHeaders) interface{} {
+func flattenEdgeBackendReplace(obj *restapi.EdgeBackendReplace) interface{} {
if obj == nil {
return nil
}
m := make(map[string]interface{})
- m["enabled"] = obj.Enabled
- m["add"] = obj.Add
- m["remove"] = obj.Remove
+ m["id"] = obj.ID
+ m["module"] = flattenEndpointBackendMutate(&obj.Module)
return []interface{}{m}
}
-func flattenEndpointRequestHeadersSlice(objs *[]restapi.EndpointRequestHeaders) (sl []interface{}) {
+func flattenEdgeBackendReplaceSlice(objs *[]restapi.EdgeBackendReplace) (sl []interface{}) {
if objs == nil {
return nil
}
for _, v := range *objs {
- sl = append(sl, flattenEndpointRequestHeaders(&v))
+ sl = append(sl, flattenEdgeBackendReplace(&v))
}
return sl
}
-func expandEndpointRequestHeaders(in interface{}) *restapi.EndpointRequestHeaders {
+func expandEdgeBackendReplace(in interface{}) *restapi.EdgeBackendReplace {
if in == nil {
return nil
}
@@ -3035,52 +5382,48 @@ func expandEndpointRequestHeaders(in interface{}) *restapi.EndpointRequestHeader
}
m := v.List()[0].(map[string]interface{})
- var obj restapi.EndpointRequestHeaders
- if v, ok := m["enabled"]; ok {
- obj.Enabled = expandBool(v)
- }
- if v, ok := m["add"]; ok {
- obj.Add = *expandStringMap(v)
+ var obj restapi.EdgeBackendReplace
+ if v, ok := m["id"]; ok {
+ obj.ID = *expandString(v)
}
- if v, ok := m["remove"]; ok {
- obj.Remove = *expandStringSlice(v)
+ if v, ok := m["module"]; ok {
+ obj.Module = *expandEndpointBackendMutate(v)
}
return &obj
}
-func expandEndpointRequestHeadersSlice(in interface{}) *[]restapi.EndpointRequestHeaders {
- var out []restapi.EndpointRequestHeaders
+func expandEdgeBackendReplaceSlice(in interface{}) *[]restapi.EdgeBackendReplace {
+ var out []restapi.EdgeBackendReplace
for _, v := range in.([]interface{}) {
- out = append(out, *expandEndpointRequestHeaders(v))
+ out = append(out, *expandEdgeBackendReplace(v))
}
return &out
}
-func flattenEndpointResponseHeaders(obj *restapi.EndpointResponseHeaders) interface{} {
+func flattenEdgeIPRestrictionReplace(obj *restapi.EdgeIPRestrictionReplace) interface{} {
if obj == nil {
return nil
}
m := make(map[string]interface{})
- m["enabled"] = obj.Enabled
- m["add"] = obj.Add
- m["remove"] = obj.Remove
+ m["id"] = obj.ID
+ m["module"] = flattenEndpointIPPolicyMutate(&obj.Module)
return []interface{}{m}
}
-func flattenEndpointResponseHeadersSlice(objs *[]restapi.EndpointResponseHeaders) (sl []interface{}) {
+func flattenEdgeIPRestrictionReplaceSlice(objs *[]restapi.EdgeIPRestrictionReplace) (sl []interface{}) {
if objs == nil {
return nil
}
for _, v := range *objs {
- sl = append(sl, flattenEndpointResponseHeaders(&v))
+ sl = append(sl, flattenEdgeIPRestrictionReplace(&v))
}
return sl
}
-func expandEndpointResponseHeaders(in interface{}) *restapi.EndpointResponseHeaders {
+func expandEdgeIPRestrictionReplace(in interface{}) *restapi.EdgeIPRestrictionReplace {
if in == nil {
return nil
}
@@ -3091,51 +5434,48 @@ func expandEndpointResponseHeaders(in interface{}) *restapi.EndpointResponseHead
}
m := v.List()[0].(map[string]interface{})
- var obj restapi.EndpointResponseHeaders
- if v, ok := m["enabled"]; ok {
- obj.Enabled = expandBool(v)
- }
- if v, ok := m["add"]; ok {
- obj.Add = *expandStringMap(v)
+ var obj restapi.EdgeIPRestrictionReplace
+ if v, ok := m["id"]; ok {
+ obj.ID = *expandString(v)
}
- if v, ok := m["remove"]; ok {
- obj.Remove = *expandStringSlice(v)
+ if v, ok := m["module"]; ok {
+ obj.Module = *expandEndpointIPPolicyMutate(v)
}
return &obj
}
-func expandEndpointResponseHeadersSlice(in interface{}) *[]restapi.EndpointResponseHeaders {
- var out []restapi.EndpointResponseHeaders
+func expandEdgeIPRestrictionReplaceSlice(in interface{}) *[]restapi.EdgeIPRestrictionReplace {
+ var out []restapi.EdgeIPRestrictionReplace
for _, v := range in.([]interface{}) {
- out = append(out, *expandEndpointResponseHeaders(v))
+ out = append(out, *expandEdgeIPRestrictionReplace(v))
}
return &out
}
-func flattenEndpointIPPolicy(obj *restapi.EndpointIPPolicy) interface{} {
+func flattenEdgeMutualTLSReplace(obj *restapi.EdgeMutualTLSReplace) interface{} {
if obj == nil {
return nil
}
m := make(map[string]interface{})
- m["enabled"] = obj.Enabled
- m["ip_policies"] = flattenRefSlice(&obj.IPPolicies)
+ m["id"] = obj.ID
+ m["module"] = flattenEndpointMutualTLSMutate(&obj.Module)
return []interface{}{m}
}
-func flattenEndpointIPPolicySlice(objs *[]restapi.EndpointIPPolicy) (sl []interface{}) {
+func flattenEdgeMutualTLSReplaceSlice(objs *[]restapi.EdgeMutualTLSReplace) (sl []interface{}) {
if objs == nil {
return nil
}
for _, v := range *objs {
- sl = append(sl, flattenEndpointIPPolicy(&v))
+ sl = append(sl, flattenEdgeMutualTLSReplace(&v))
}
return sl
}
-func expandEndpointIPPolicy(in interface{}) *restapi.EndpointIPPolicy {
+func expandEdgeMutualTLSReplace(in interface{}) *restapi.EdgeMutualTLSReplace {
if in == nil {
return nil
}
@@ -3146,48 +5486,48 @@ func expandEndpointIPPolicy(in interface{}) *restapi.EndpointIPPolicy {
}
m := v.List()[0].(map[string]interface{})
- var obj restapi.EndpointIPPolicy
- if v, ok := m["enabled"]; ok {
- obj.Enabled = expandBool(v)
+ var obj restapi.EdgeMutualTLSReplace
+ if v, ok := m["id"]; ok {
+ obj.ID = *expandString(v)
}
- if v, ok := m["ip_policies"]; ok {
- obj.IPPolicies = *expandRefSlice(v)
+ if v, ok := m["module"]; ok {
+ obj.Module = *expandEndpointMutualTLSMutate(v)
}
return &obj
}
-func expandEndpointIPPolicySlice(in interface{}) *[]restapi.EndpointIPPolicy {
- var out []restapi.EndpointIPPolicy
+func expandEdgeMutualTLSReplaceSlice(in interface{}) *[]restapi.EdgeMutualTLSReplace {
+ var out []restapi.EdgeMutualTLSReplace
for _, v := range in.([]interface{}) {
- out = append(out, *expandEndpointIPPolicy(v))
+ out = append(out, *expandEdgeMutualTLSReplace(v))
}
return &out
}
-func flattenEndpointIPPolicyMutate(obj *restapi.EndpointIPPolicyMutate) interface{} {
+func flattenEdgeTLSTerminationReplace(obj *restapi.EdgeTLSTerminationReplace) interface{} {
if obj == nil {
return nil
}
m := make(map[string]interface{})
- m["enabled"] = obj.Enabled
- m["ip_policy_ids"] = obj.IPPolicyIDs
+ m["id"] = obj.ID
+ m["module"] = flattenEndpointTLSTermination(&obj.Module)
return []interface{}{m}
}
-func flattenEndpointIPPolicyMutateSlice(objs *[]restapi.EndpointIPPolicyMutate) (sl []interface{}) {
+func flattenEdgeTLSTerminationReplaceSlice(objs *[]restapi.EdgeTLSTerminationReplace) (sl []interface{}) {
if objs == nil {
return nil
}
for _, v := range *objs {
- sl = append(sl, flattenEndpointIPPolicyMutate(&v))
+ sl = append(sl, flattenEdgeTLSTerminationReplace(&v))
}
return sl
}
-func expandEndpointIPPolicyMutate(in interface{}) *restapi.EndpointIPPolicyMutate {
+func expandEdgeTLSTerminationReplace(in interface{}) *restapi.EdgeTLSTerminationReplace {
if in == nil {
return nil
}
@@ -3198,52 +5538,48 @@ func expandEndpointIPPolicyMutate(in interface{}) *restapi.EndpointIPPolicyMutat
}
m := v.List()[0].(map[string]interface{})
- var obj restapi.EndpointIPPolicyMutate
- if v, ok := m["enabled"]; ok {
- obj.Enabled = expandBool(v)
+ var obj restapi.EdgeTLSTerminationReplace
+ if v, ok := m["id"]; ok {
+ obj.ID = *expandString(v)
}
- if v, ok := m["ip_policy_ids"]; ok {
- obj.IPPolicyIDs = *expandStringSlice(v)
+ if v, ok := m["module"]; ok {
+ obj.Module = *expandEndpointTLSTermination(v)
}
return &obj
}
-func expandEndpointIPPolicyMutateSlice(in interface{}) *[]restapi.EndpointIPPolicyMutate {
- var out []restapi.EndpointIPPolicyMutate
+func expandEdgeTLSTerminationReplaceSlice(in interface{}) *[]restapi.EdgeTLSTerminationReplace {
+ var out []restapi.EdgeTLSTerminationReplace
for _, v := range in.([]interface{}) {
- out = append(out, *expandEndpointIPPolicyMutate(v))
+ out = append(out, *expandEdgeTLSTerminationReplace(v))
}
return &out
}
-func flattenEndpointCircuitBreaker(obj *restapi.EndpointCircuitBreaker) interface{} {
+func flattenEdgeTLSTerminationAtEdgeReplace(obj *restapi.EdgeTLSTerminationAtEdgeReplace) interface{} {
if obj == nil {
return nil
}
m := make(map[string]interface{})
- m["enabled"] = obj.Enabled
- m["tripped_duration"] = obj.TrippedDuration
- m["rolling_window"] = obj.RollingWindow
- m["num_buckets"] = obj.NumBuckets
- m["volume_threshold"] = obj.VolumeThreshold
- m["error_threshold_percentage"] = obj.ErrorThresholdPercentage
+ m["id"] = obj.ID
+ m["module"] = flattenEndpointTLSTerminationAtEdge(&obj.Module)
return []interface{}{m}
}
-func flattenEndpointCircuitBreakerSlice(objs *[]restapi.EndpointCircuitBreaker) (sl []interface{}) {
+func flattenEdgeTLSTerminationAtEdgeReplaceSlice(objs *[]restapi.EdgeTLSTerminationAtEdgeReplace) (sl []interface{}) {
if objs == nil {
return nil
}
for _, v := range *objs {
- sl = append(sl, flattenEndpointCircuitBreaker(&v))
+ sl = append(sl, flattenEdgeTLSTerminationAtEdgeReplace(&v))
}
return sl
}
-func expandEndpointCircuitBreaker(in interface{}) *restapi.EndpointCircuitBreaker {
+func expandEdgeTLSTerminationAtEdgeReplace(in interface{}) *restapi.EdgeTLSTerminationAtEdgeReplace {
if in == nil {
return nil
}
@@ -3254,65 +5590,49 @@ func expandEndpointCircuitBreaker(in interface{}) *restapi.EndpointCircuitBreake
}
m := v.List()[0].(map[string]interface{})
- var obj restapi.EndpointCircuitBreaker
- if v, ok := m["enabled"]; ok {
- obj.Enabled = expandBool(v)
- }
- if v, ok := m["tripped_duration"]; ok {
- obj.TrippedDuration = *expandUint32(v)
- }
- if v, ok := m["rolling_window"]; ok {
- obj.RollingWindow = *expandUint32(v)
- }
- if v, ok := m["num_buckets"]; ok {
- obj.NumBuckets = *expandUint32(v)
- }
- if v, ok := m["volume_threshold"]; ok {
- obj.VolumeThreshold = *expandUint32(v)
+ var obj restapi.EdgeTLSTerminationAtEdgeReplace
+ if v, ok := m["id"]; ok {
+ obj.ID = *expandString(v)
}
- if v, ok := m["error_threshold_percentage"]; ok {
- obj.ErrorThresholdPercentage = *expandFloat64(v)
+ if v, ok := m["module"]; ok {
+ obj.Module = *expandEndpointTLSTerminationAtEdge(v)
}
return &obj
}
-func expandEndpointCircuitBreakerSlice(in interface{}) *[]restapi.EndpointCircuitBreaker {
- var out []restapi.EndpointCircuitBreaker
+func expandEdgeTLSTerminationAtEdgeReplaceSlice(in interface{}) *[]restapi.EdgeTLSTerminationAtEdgeReplace {
+ var out []restapi.EdgeTLSTerminationAtEdgeReplace
for _, v := range in.([]interface{}) {
- out = append(out, *expandEndpointCircuitBreaker(v))
+ out = append(out, *expandEdgeTLSTerminationAtEdgeReplace(v))
}
return &out
}
-func flattenEndpointOAuth(obj *restapi.EndpointOAuth) interface{} {
+func flattenEdgeRouteBackendReplace(obj *restapi.EdgeRouteBackendReplace) interface{} {
if obj == nil {
return nil
}
m := make(map[string]interface{})
- m["enabled"] = obj.Enabled
- m["provider"] = flattenEndpointOAuthProvider(&obj.Provider)
- m["options_passthrough"] = obj.OptionsPassthrough
- m["cookie_prefix"] = obj.CookiePrefix
- m["inactivity_timeout"] = obj.InactivityTimeout
- m["maximum_duration"] = obj.MaximumDuration
- m["auth_check_interval"] = obj.AuthCheckInterval
+ m["edge_id"] = obj.EdgeID
+ m["id"] = obj.ID
+ m["module"] = flattenEndpointBackendMutate(&obj.Module)
return []interface{}{m}
}
-func flattenEndpointOAuthSlice(objs *[]restapi.EndpointOAuth) (sl []interface{}) {
+func flattenEdgeRouteBackendReplaceSlice(objs *[]restapi.EdgeRouteBackendReplace) (sl []interface{}) {
if objs == nil {
return nil
}
for _, v := range *objs {
- sl = append(sl, flattenEndpointOAuth(&v))
+ sl = append(sl, flattenEdgeRouteBackendReplace(&v))
}
return sl
}
-func expandEndpointOAuth(in interface{}) *restapi.EndpointOAuth {
+func expandEdgeRouteBackendReplace(in interface{}) *restapi.EdgeRouteBackendReplace {
if in == nil {
return nil
}
@@ -3323,65 +5643,52 @@ func expandEndpointOAuth(in interface{}) *restapi.EndpointOAuth {
}
m := v.List()[0].(map[string]interface{})
- var obj restapi.EndpointOAuth
- if v, ok := m["enabled"]; ok {
- obj.Enabled = expandBool(v)
- }
- if v, ok := m["provider"]; ok {
- obj.Provider = *expandEndpointOAuthProvider(v)
- }
- if v, ok := m["options_passthrough"]; ok {
- obj.OptionsPassthrough = *expandBool(v)
- }
- if v, ok := m["cookie_prefix"]; ok {
- obj.CookiePrefix = *expandString(v)
- }
- if v, ok := m["inactivity_timeout"]; ok {
- obj.InactivityTimeout = *expandUint32(v)
+ var obj restapi.EdgeRouteBackendReplace
+ if v, ok := m["edge_id"]; ok {
+ obj.EdgeID = *expandString(v)
}
- if v, ok := m["maximum_duration"]; ok {
- obj.MaximumDuration = *expandUint32(v)
+ if v, ok := m["id"]; ok {
+ obj.ID = *expandString(v)
}
- if v, ok := m["auth_check_interval"]; ok {
- obj.AuthCheckInterval = *expandUint32(v)
+ if v, ok := m["module"]; ok {
+ obj.Module = *expandEndpointBackendMutate(v)
}
return &obj
}
-func expandEndpointOAuthSlice(in interface{}) *[]restapi.EndpointOAuth {
- var out []restapi.EndpointOAuth
+func expandEdgeRouteBackendReplaceSlice(in interface{}) *[]restapi.EdgeRouteBackendReplace {
+ var out []restapi.EdgeRouteBackendReplace
for _, v := range in.([]interface{}) {
- out = append(out, *expandEndpointOAuth(v))
+ out = append(out, *expandEdgeRouteBackendReplace(v))
}
return &out
}
-func flattenEndpointOAuthProvider(obj *restapi.EndpointOAuthProvider) interface{} {
+func flattenEdgeRouteIPRestrictionReplace(obj *restapi.EdgeRouteIPRestrictionReplace) interface{} {
if obj == nil {
return nil
}
m := make(map[string]interface{})
- m["github"] = flattenEndpointOAuthGitHub(obj.Github)
- m["facebook"] = flattenEndpointOAuthFacebook(obj.Facebook)
- m["microsoft"] = flattenEndpointOAuthMicrosoft(obj.Microsoft)
- m["google"] = flattenEndpointOAuthGoogle(obj.Google)
+ m["edge_id"] = obj.EdgeID
+ m["id"] = obj.ID
+ m["module"] = flattenEndpointIPPolicyMutate(&obj.Module)
return []interface{}{m}
}
-func flattenEndpointOAuthProviderSlice(objs *[]restapi.EndpointOAuthProvider) (sl []interface{}) {
+func flattenEdgeRouteIPRestrictionReplaceSlice(objs *[]restapi.EdgeRouteIPRestrictionReplace) (sl []interface{}) {
if objs == nil {
return nil
}
for _, v := range *objs {
- sl = append(sl, flattenEndpointOAuthProvider(&v))
+ sl = append(sl, flattenEdgeRouteIPRestrictionReplace(&v))
}
return sl
}
-func expandEndpointOAuthProvider(in interface{}) *restapi.EndpointOAuthProvider {
+func expandEdgeRouteIPRestrictionReplace(in interface{}) *restapi.EdgeRouteIPRestrictionReplace {
if in == nil {
return nil
}
@@ -3392,59 +5699,52 @@ func expandEndpointOAuthProvider(in interface{}) *restapi.EndpointOAuthProvider
}
m := v.List()[0].(map[string]interface{})
- var obj restapi.EndpointOAuthProvider
- if v, ok := m["github"]; ok {
- obj.Github = expandEndpointOAuthGitHub(v)
- }
- if v, ok := m["facebook"]; ok {
- obj.Facebook = expandEndpointOAuthFacebook(v)
+ var obj restapi.EdgeRouteIPRestrictionReplace
+ if v, ok := m["edge_id"]; ok {
+ obj.EdgeID = *expandString(v)
}
- if v, ok := m["microsoft"]; ok {
- obj.Microsoft = expandEndpointOAuthMicrosoft(v)
+ if v, ok := m["id"]; ok {
+ obj.ID = *expandString(v)
}
- if v, ok := m["google"]; ok {
- obj.Google = expandEndpointOAuthGoogle(v)
+ if v, ok := m["module"]; ok {
+ obj.Module = *expandEndpointIPPolicyMutate(v)
}
return &obj
}
-func expandEndpointOAuthProviderSlice(in interface{}) *[]restapi.EndpointOAuthProvider {
- var out []restapi.EndpointOAuthProvider
+func expandEdgeRouteIPRestrictionReplaceSlice(in interface{}) *[]restapi.EdgeRouteIPRestrictionReplace {
+ var out []restapi.EdgeRouteIPRestrictionReplace
for _, v := range in.([]interface{}) {
- out = append(out, *expandEndpointOAuthProvider(v))
+ out = append(out, *expandEdgeRouteIPRestrictionReplace(v))
}
return &out
}
-func flattenEndpointOAuthGitHub(obj *restapi.EndpointOAuthGitHub) interface{} {
+func flattenEdgeRouteRequestHeadersReplace(obj *restapi.EdgeRouteRequestHeadersReplace) interface{} {
if obj == nil {
return nil
}
m := make(map[string]interface{})
- m["client_id"] = obj.ClientID
- m["client_secret"] = obj.ClientSecret
- m["scopes"] = obj.Scopes
- m["email_addresses"] = obj.EmailAddresses
- m["email_domains"] = obj.EmailDomains
- m["teams"] = obj.Teams
- m["organizations"] = obj.Organizations
+ m["edge_id"] = obj.EdgeID
+ m["id"] = obj.ID
+ m["module"] = flattenEndpointRequestHeaders(&obj.Module)
return []interface{}{m}
}
-func flattenEndpointOAuthGitHubSlice(objs *[]restapi.EndpointOAuthGitHub) (sl []interface{}) {
+func flattenEdgeRouteRequestHeadersReplaceSlice(objs *[]restapi.EdgeRouteRequestHeadersReplace) (sl []interface{}) {
if objs == nil {
return nil
}
for _, v := range *objs {
- sl = append(sl, flattenEndpointOAuthGitHub(&v))
+ sl = append(sl, flattenEdgeRouteRequestHeadersReplace(&v))
}
return sl
}
-func expandEndpointOAuthGitHub(in interface{}) *restapi.EndpointOAuthGitHub {
+func expandEdgeRouteRequestHeadersReplace(in interface{}) *restapi.EdgeRouteRequestHeadersReplace {
if in == nil {
return nil
}
@@ -3455,66 +5755,52 @@ func expandEndpointOAuthGitHub(in interface{}) *restapi.EndpointOAuthGitHub {
}
m := v.List()[0].(map[string]interface{})
- var obj restapi.EndpointOAuthGitHub
- if v, ok := m["client_id"]; ok {
- obj.ClientID = expandString(v)
- }
- if v, ok := m["client_secret"]; ok {
- obj.ClientSecret = expandString(v)
- }
- if v, ok := m["scopes"]; ok {
- obj.Scopes = *expandStringSlice(v)
- }
- if v, ok := m["email_addresses"]; ok {
- obj.EmailAddresses = *expandStringSlice(v)
+ var obj restapi.EdgeRouteRequestHeadersReplace
+ if v, ok := m["edge_id"]; ok {
+ obj.EdgeID = *expandString(v)
}
- if v, ok := m["email_domains"]; ok {
- obj.EmailDomains = *expandStringSlice(v)
- }
- if v, ok := m["teams"]; ok {
- obj.Teams = *expandStringSlice(v)
+ if v, ok := m["id"]; ok {
+ obj.ID = *expandString(v)
}
- if v, ok := m["organizations"]; ok {
- obj.Organizations = *expandStringSlice(v)
+ if v, ok := m["module"]; ok {
+ obj.Module = *expandEndpointRequestHeaders(v)
}
return &obj
}
-func expandEndpointOAuthGitHubSlice(in interface{}) *[]restapi.EndpointOAuthGitHub {
- var out []restapi.EndpointOAuthGitHub
+func expandEdgeRouteRequestHeadersReplaceSlice(in interface{}) *[]restapi.EdgeRouteRequestHeadersReplace {
+ var out []restapi.EdgeRouteRequestHeadersReplace
for _, v := range in.([]interface{}) {
- out = append(out, *expandEndpointOAuthGitHub(v))
+ out = append(out, *expandEdgeRouteRequestHeadersReplace(v))
}
return &out
}
-func flattenEndpointOAuthFacebook(obj *restapi.EndpointOAuthFacebook) interface{} {
+func flattenEdgeRouteResponseHeadersReplace(obj *restapi.EdgeRouteResponseHeadersReplace) interface{} {
if obj == nil {
return nil
}
m := make(map[string]interface{})
- m["client_id"] = obj.ClientID
- m["client_secret"] = obj.ClientSecret
- m["scopes"] = obj.Scopes
- m["email_addresses"] = obj.EmailAddresses
- m["email_domains"] = obj.EmailDomains
+ m["edge_id"] = obj.EdgeID
+ m["id"] = obj.ID
+ m["module"] = flattenEndpointResponseHeaders(&obj.Module)
return []interface{}{m}
}
-func flattenEndpointOAuthFacebookSlice(objs *[]restapi.EndpointOAuthFacebook) (sl []interface{}) {
+func flattenEdgeRouteResponseHeadersReplaceSlice(objs *[]restapi.EdgeRouteResponseHeadersReplace) (sl []interface{}) {
if objs == nil {
return nil
}
for _, v := range *objs {
- sl = append(sl, flattenEndpointOAuthFacebook(&v))
+ sl = append(sl, flattenEdgeRouteResponseHeadersReplace(&v))
}
return sl
}
-func expandEndpointOAuthFacebook(in interface{}) *restapi.EndpointOAuthFacebook {
+func expandEdgeRouteResponseHeadersReplace(in interface{}) *restapi.EdgeRouteResponseHeadersReplace {
if in == nil {
return nil
}
@@ -3525,60 +5811,52 @@ func expandEndpointOAuthFacebook(in interface{}) *restapi.EndpointOAuthFacebook
}
m := v.List()[0].(map[string]interface{})
- var obj restapi.EndpointOAuthFacebook
- if v, ok := m["client_id"]; ok {
- obj.ClientID = expandString(v)
+ var obj restapi.EdgeRouteResponseHeadersReplace
+ if v, ok := m["edge_id"]; ok {
+ obj.EdgeID = *expandString(v)
}
- if v, ok := m["client_secret"]; ok {
- obj.ClientSecret = expandString(v)
- }
- if v, ok := m["scopes"]; ok {
- obj.Scopes = *expandStringSlice(v)
- }
- if v, ok := m["email_addresses"]; ok {
- obj.EmailAddresses = *expandStringSlice(v)
+ if v, ok := m["id"]; ok {
+ obj.ID = *expandString(v)
}
- if v, ok := m["email_domains"]; ok {
- obj.EmailDomains = *expandStringSlice(v)
+ if v, ok := m["module"]; ok {
+ obj.Module = *expandEndpointResponseHeaders(v)
}
return &obj
}
-func expandEndpointOAuthFacebookSlice(in interface{}) *[]restapi.EndpointOAuthFacebook {
- var out []restapi.EndpointOAuthFacebook
+func expandEdgeRouteResponseHeadersReplaceSlice(in interface{}) *[]restapi.EdgeRouteResponseHeadersReplace {
+ var out []restapi.EdgeRouteResponseHeadersReplace
for _, v := range in.([]interface{}) {
- out = append(out, *expandEndpointOAuthFacebook(v))
+ out = append(out, *expandEdgeRouteResponseHeadersReplace(v))
}
return &out
}
-func flattenEndpointOAuthMicrosoft(obj *restapi.EndpointOAuthMicrosoft) interface{} {
+func flattenEdgeRouteCompressionReplace(obj *restapi.EdgeRouteCompressionReplace) interface{} {
if obj == nil {
return nil
}
m := make(map[string]interface{})
- m["client_id"] = obj.ClientID
- m["client_secret"] = obj.ClientSecret
- m["scopes"] = obj.Scopes
- m["email_addresses"] = obj.EmailAddresses
- m["email_domains"] = obj.EmailDomains
+ m["edge_id"] = obj.EdgeID
+ m["id"] = obj.ID
+ m["module"] = flattenEndpointCompression(&obj.Module)
return []interface{}{m}
}
-func flattenEndpointOAuthMicrosoftSlice(objs *[]restapi.EndpointOAuthMicrosoft) (sl []interface{}) {
+func flattenEdgeRouteCompressionReplaceSlice(objs *[]restapi.EdgeRouteCompressionReplace) (sl []interface{}) {
if objs == nil {
return nil
}
for _, v := range *objs {
- sl = append(sl, flattenEndpointOAuthMicrosoft(&v))
+ sl = append(sl, flattenEdgeRouteCompressionReplace(&v))
}
return sl
}
-func expandEndpointOAuthMicrosoft(in interface{}) *restapi.EndpointOAuthMicrosoft {
+func expandEdgeRouteCompressionReplace(in interface{}) *restapi.EdgeRouteCompressionReplace {
if in == nil {
return nil
}
@@ -3589,60 +5867,52 @@ func expandEndpointOAuthMicrosoft(in interface{}) *restapi.EndpointOAuthMicrosof
}
m := v.List()[0].(map[string]interface{})
- var obj restapi.EndpointOAuthMicrosoft
- if v, ok := m["client_id"]; ok {
- obj.ClientID = expandString(v)
- }
- if v, ok := m["client_secret"]; ok {
- obj.ClientSecret = expandString(v)
- }
- if v, ok := m["scopes"]; ok {
- obj.Scopes = *expandStringSlice(v)
+ var obj restapi.EdgeRouteCompressionReplace
+ if v, ok := m["edge_id"]; ok {
+ obj.EdgeID = *expandString(v)
}
- if v, ok := m["email_addresses"]; ok {
- obj.EmailAddresses = *expandStringSlice(v)
+ if v, ok := m["id"]; ok {
+ obj.ID = *expandString(v)
}
- if v, ok := m["email_domains"]; ok {
- obj.EmailDomains = *expandStringSlice(v)
+ if v, ok := m["module"]; ok {
+ obj.Module = *expandEndpointCompression(v)
}
return &obj
}
-func expandEndpointOAuthMicrosoftSlice(in interface{}) *[]restapi.EndpointOAuthMicrosoft {
- var out []restapi.EndpointOAuthMicrosoft
+func expandEdgeRouteCompressionReplaceSlice(in interface{}) *[]restapi.EdgeRouteCompressionReplace {
+ var out []restapi.EdgeRouteCompressionReplace
for _, v := range in.([]interface{}) {
- out = append(out, *expandEndpointOAuthMicrosoft(v))
+ out = append(out, *expandEdgeRouteCompressionReplace(v))
}
return &out
}
-func flattenEndpointOAuthGoogle(obj *restapi.EndpointOAuthGoogle) interface{} {
+func flattenEdgeRouteCircuitBreakerReplace(obj *restapi.EdgeRouteCircuitBreakerReplace) interface{} {
if obj == nil {
return nil
}
m := make(map[string]interface{})
- m["client_id"] = obj.ClientID
- m["client_secret"] = obj.ClientSecret
- m["scopes"] = obj.Scopes
- m["email_addresses"] = obj.EmailAddresses
- m["email_domains"] = obj.EmailDomains
+ m["edge_id"] = obj.EdgeID
+ m["id"] = obj.ID
+ m["module"] = flattenEndpointCircuitBreaker(&obj.Module)
return []interface{}{m}
}
-func flattenEndpointOAuthGoogleSlice(objs *[]restapi.EndpointOAuthGoogle) (sl []interface{}) {
+func flattenEdgeRouteCircuitBreakerReplaceSlice(objs *[]restapi.EdgeRouteCircuitBreakerReplace) (sl []interface{}) {
if objs == nil {
return nil
}
for _, v := range *objs {
- sl = append(sl, flattenEndpointOAuthGoogle(&v))
+ sl = append(sl, flattenEdgeRouteCircuitBreakerReplace(&v))
}
return sl
}
-func expandEndpointOAuthGoogle(in interface{}) *restapi.EndpointOAuthGoogle {
+func expandEdgeRouteCircuitBreakerReplace(in interface{}) *restapi.EdgeRouteCircuitBreakerReplace {
if in == nil {
return nil
}
@@ -3653,70 +5923,52 @@ func expandEndpointOAuthGoogle(in interface{}) *restapi.EndpointOAuthGoogle {
}
m := v.List()[0].(map[string]interface{})
- var obj restapi.EndpointOAuthGoogle
- if v, ok := m["client_id"]; ok {
- obj.ClientID = expandString(v)
- }
- if v, ok := m["client_secret"]; ok {
- obj.ClientSecret = expandString(v)
- }
- if v, ok := m["scopes"]; ok {
- obj.Scopes = *expandStringSlice(v)
+ var obj restapi.EdgeRouteCircuitBreakerReplace
+ if v, ok := m["edge_id"]; ok {
+ obj.EdgeID = *expandString(v)
}
- if v, ok := m["email_addresses"]; ok {
- obj.EmailAddresses = *expandStringSlice(v)
+ if v, ok := m["id"]; ok {
+ obj.ID = *expandString(v)
}
- if v, ok := m["email_domains"]; ok {
- obj.EmailDomains = *expandStringSlice(v)
+ if v, ok := m["module"]; ok {
+ obj.Module = *expandEndpointCircuitBreaker(v)
}
return &obj
}
-func expandEndpointOAuthGoogleSlice(in interface{}) *[]restapi.EndpointOAuthGoogle {
- var out []restapi.EndpointOAuthGoogle
+func expandEdgeRouteCircuitBreakerReplaceSlice(in interface{}) *[]restapi.EdgeRouteCircuitBreakerReplace {
+ var out []restapi.EdgeRouteCircuitBreakerReplace
for _, v := range in.([]interface{}) {
- out = append(out, *expandEndpointOAuthGoogle(v))
+ out = append(out, *expandEdgeRouteCircuitBreakerReplace(v))
}
return &out
}
-func flattenEndpointSAML(obj *restapi.EndpointSAML) interface{} {
+func flattenEdgeRouteWebhookVerificationReplace(obj *restapi.EdgeRouteWebhookVerificationReplace) interface{} {
if obj == nil {
return nil
}
m := make(map[string]interface{})
- m["enabled"] = obj.Enabled
- m["options_passthrough"] = obj.OptionsPassthrough
- m["cookie_prefix"] = obj.CookiePrefix
- m["inactivity_timeout"] = obj.InactivityTimeout
- m["maximum_duration"] = obj.MaximumDuration
- m["idp_metadata_url"] = obj.IdPMetadataURL
- m["idp_metadata"] = obj.IdPMetadata
- m["force_authn"] = obj.ForceAuthn
- m["allow_idp_initiated"] = obj.AllowIdPInitiated
- m["authorized_groups"] = obj.AuthorizedGroups
- m["entity_id"] = obj.EntityID
- m["assertion_consumer_service_url"] = obj.AssertionConsumerServiceURL
- m["single_logout_url"] = obj.SingleLogoutURL
- m["request_signing_certificate_pem"] = obj.RequestSigningCertificatePEM
- m["metadata_url"] = obj.MetadataURL
+ m["edge_id"] = obj.EdgeID
+ m["id"] = obj.ID
+ m["module"] = flattenEndpointWebhookValidation(&obj.Module)
return []interface{}{m}
}
-func flattenEndpointSAMLSlice(objs *[]restapi.EndpointSAML) (sl []interface{}) {
+func flattenEdgeRouteWebhookVerificationReplaceSlice(objs *[]restapi.EdgeRouteWebhookVerificationReplace) (sl []interface{}) {
if objs == nil {
return nil
}
for _, v := range *objs {
- sl = append(sl, flattenEndpointSAML(&v))
+ sl = append(sl, flattenEdgeRouteWebhookVerificationReplace(&v))
}
return sl
}
-func expandEndpointSAML(in interface{}) *restapi.EndpointSAML {
+func expandEdgeRouteWebhookVerificationReplace(in interface{}) *restapi.EdgeRouteWebhookVerificationReplace {
if in == nil {
return nil
}
@@ -3727,95 +5979,52 @@ func expandEndpointSAML(in interface{}) *restapi.EndpointSAML {
}
m := v.List()[0].(map[string]interface{})
- var obj restapi.EndpointSAML
- if v, ok := m["enabled"]; ok {
- obj.Enabled = expandBool(v)
- }
- if v, ok := m["options_passthrough"]; ok {
- obj.OptionsPassthrough = *expandBool(v)
- }
- if v, ok := m["cookie_prefix"]; ok {
- obj.CookiePrefix = *expandString(v)
- }
- if v, ok := m["inactivity_timeout"]; ok {
- obj.InactivityTimeout = *expandUint32(v)
- }
- if v, ok := m["maximum_duration"]; ok {
- obj.MaximumDuration = *expandUint32(v)
- }
- if v, ok := m["idp_metadata_url"]; ok {
- obj.IdPMetadataURL = *expandString(v)
- }
- if v, ok := m["idp_metadata"]; ok {
- obj.IdPMetadata = *expandString(v)
- }
- if v, ok := m["force_authn"]; ok {
- obj.ForceAuthn = *expandBool(v)
- }
- if v, ok := m["allow_idp_initiated"]; ok {
- obj.AllowIdPInitiated = expandBool(v)
- }
- if v, ok := m["authorized_groups"]; ok {
- obj.AuthorizedGroups = *expandStringSlice(v)
- }
- if v, ok := m["entity_id"]; ok {
- obj.EntityID = *expandString(v)
- }
- if v, ok := m["assertion_consumer_service_url"]; ok {
- obj.AssertionConsumerServiceURL = *expandString(v)
+ var obj restapi.EdgeRouteWebhookVerificationReplace
+ if v, ok := m["edge_id"]; ok {
+ obj.EdgeID = *expandString(v)
}
- if v, ok := m["single_logout_url"]; ok {
- obj.SingleLogoutURL = *expandString(v)
- }
- if v, ok := m["request_signing_certificate_pem"]; ok {
- obj.RequestSigningCertificatePEM = *expandString(v)
+ if v, ok := m["id"]; ok {
+ obj.ID = *expandString(v)
}
- if v, ok := m["metadata_url"]; ok {
- obj.MetadataURL = *expandString(v)
+ if v, ok := m["module"]; ok {
+ obj.Module = *expandEndpointWebhookValidation(v)
}
return &obj
}
-func expandEndpointSAMLSlice(in interface{}) *[]restapi.EndpointSAML {
- var out []restapi.EndpointSAML
+func expandEdgeRouteWebhookVerificationReplaceSlice(in interface{}) *[]restapi.EdgeRouteWebhookVerificationReplace {
+ var out []restapi.EdgeRouteWebhookVerificationReplace
for _, v := range in.([]interface{}) {
- out = append(out, *expandEndpointSAML(v))
+ out = append(out, *expandEdgeRouteWebhookVerificationReplace(v))
}
return &out
-}
-
-func flattenEndpointSAMLMutate(obj *restapi.EndpointSAMLMutate) interface{} {
- if obj == nil {
- return nil
- }
-
- m := make(map[string]interface{})
- m["enabled"] = obj.Enabled
- m["options_passthrough"] = obj.OptionsPassthrough
- m["cookie_prefix"] = obj.CookiePrefix
- m["inactivity_timeout"] = obj.InactivityTimeout
- m["maximum_duration"] = obj.MaximumDuration
- m["idp_metadata_url"] = obj.IdPMetadataURL
- m["idp_metadata"] = obj.IdPMetadata
- m["force_authn"] = obj.ForceAuthn
- m["allow_idp_initiated"] = obj.AllowIdPInitiated
- m["authorized_groups"] = obj.AuthorizedGroups
+}
+
+func flattenEdgeRouteOAuthReplace(obj *restapi.EdgeRouteOAuthReplace) interface{} {
+ if obj == nil {
+ return nil
+ }
+
+ m := make(map[string]interface{})
+ m["edge_id"] = obj.EdgeID
+ m["id"] = obj.ID
+ m["module"] = flattenEndpointOAuth(&obj.Module)
return []interface{}{m}
}
-func flattenEndpointSAMLMutateSlice(objs *[]restapi.EndpointSAMLMutate) (sl []interface{}) {
+func flattenEdgeRouteOAuthReplaceSlice(objs *[]restapi.EdgeRouteOAuthReplace) (sl []interface{}) {
if objs == nil {
return nil
}
for _, v := range *objs {
- sl = append(sl, flattenEndpointSAMLMutate(&v))
+ sl = append(sl, flattenEdgeRouteOAuthReplace(&v))
}
return sl
}
-func expandEndpointSAMLMutate(in interface{}) *restapi.EndpointSAMLMutate {
+func expandEdgeRouteOAuthReplace(in interface{}) *restapi.EdgeRouteOAuthReplace {
if in == nil {
return nil
}
@@ -3826,79 +6035,52 @@ func expandEndpointSAMLMutate(in interface{}) *restapi.EndpointSAMLMutate {
}
m := v.List()[0].(map[string]interface{})
- var obj restapi.EndpointSAMLMutate
- if v, ok := m["enabled"]; ok {
- obj.Enabled = expandBool(v)
- }
- if v, ok := m["options_passthrough"]; ok {
- obj.OptionsPassthrough = *expandBool(v)
- }
- if v, ok := m["cookie_prefix"]; ok {
- obj.CookiePrefix = *expandString(v)
- }
- if v, ok := m["inactivity_timeout"]; ok {
- obj.InactivityTimeout = *expandUint32(v)
- }
- if v, ok := m["maximum_duration"]; ok {
- obj.MaximumDuration = *expandUint32(v)
- }
- if v, ok := m["idp_metadata_url"]; ok {
- obj.IdPMetadataURL = *expandString(v)
- }
- if v, ok := m["idp_metadata"]; ok {
- obj.IdPMetadata = *expandString(v)
- }
- if v, ok := m["force_authn"]; ok {
- obj.ForceAuthn = *expandBool(v)
+ var obj restapi.EdgeRouteOAuthReplace
+ if v, ok := m["edge_id"]; ok {
+ obj.EdgeID = *expandString(v)
}
- if v, ok := m["allow_idp_initiated"]; ok {
- obj.AllowIdPInitiated = expandBool(v)
+ if v, ok := m["id"]; ok {
+ obj.ID = *expandString(v)
}
- if v, ok := m["authorized_groups"]; ok {
- obj.AuthorizedGroups = *expandStringSlice(v)
+ if v, ok := m["module"]; ok {
+ obj.Module = *expandEndpointOAuth(v)
}
return &obj
}
-func expandEndpointSAMLMutateSlice(in interface{}) *[]restapi.EndpointSAMLMutate {
- var out []restapi.EndpointSAMLMutate
+func expandEdgeRouteOAuthReplaceSlice(in interface{}) *[]restapi.EdgeRouteOAuthReplace {
+ var out []restapi.EdgeRouteOAuthReplace
for _, v := range in.([]interface{}) {
- out = append(out, *expandEndpointSAMLMutate(v))
+ out = append(out, *expandEdgeRouteOAuthReplace(v))
}
return &out
}
-func flattenEndpointOIDC(obj *restapi.EndpointOIDC) interface{} {
+func flattenEdgeRouteSAMLReplace(obj *restapi.EdgeRouteSAMLReplace) interface{} {
if obj == nil {
return nil
}
m := make(map[string]interface{})
- m["enabled"] = obj.Enabled
- m["options_passthrough"] = obj.OptionsPassthrough
- m["cookie_prefix"] = obj.CookiePrefix
- m["inactivity_timeout"] = obj.InactivityTimeout
- m["maximum_duration"] = obj.MaximumDuration
- m["issuer"] = obj.Issuer
- m["client_id"] = obj.ClientID
- m["client_secret"] = obj.ClientSecret
- m["scopes"] = obj.Scopes
+ m["edge_id"] = obj.EdgeID
+ m["id"] = obj.ID
+ m["module"] = flattenEndpointSAMLMutate(&obj.Module)
return []interface{}{m}
}
-func flattenEndpointOIDCSlice(objs *[]restapi.EndpointOIDC) (sl []interface{}) {
+func flattenEdgeRouteSAMLReplaceSlice(objs *[]restapi.EdgeRouteSAMLReplace) (sl []interface{}) {
if objs == nil {
return nil
}
for _, v := range *objs {
- sl = append(sl, flattenEndpointOIDC(&v))
+ sl = append(sl, flattenEdgeRouteSAMLReplace(&v))
}
return sl
}
-func expandEndpointOIDC(in interface{}) *restapi.EndpointOIDC {
+func expandEdgeRouteSAMLReplace(in interface{}) *restapi.EdgeRouteSAMLReplace {
if in == nil {
return nil
}
@@ -3909,69 +6091,52 @@ func expandEndpointOIDC(in interface{}) *restapi.EndpointOIDC {
}
m := v.List()[0].(map[string]interface{})
- var obj restapi.EndpointOIDC
- if v, ok := m["enabled"]; ok {
- obj.Enabled = expandBool(v)
- }
- if v, ok := m["options_passthrough"]; ok {
- obj.OptionsPassthrough = *expandBool(v)
- }
- if v, ok := m["cookie_prefix"]; ok {
- obj.CookiePrefix = *expandString(v)
- }
- if v, ok := m["inactivity_timeout"]; ok {
- obj.InactivityTimeout = *expandUint32(v)
- }
- if v, ok := m["maximum_duration"]; ok {
- obj.MaximumDuration = *expandUint32(v)
- }
- if v, ok := m["issuer"]; ok {
- obj.Issuer = *expandString(v)
+ var obj restapi.EdgeRouteSAMLReplace
+ if v, ok := m["edge_id"]; ok {
+ obj.EdgeID = *expandString(v)
}
- if v, ok := m["client_id"]; ok {
- obj.ClientID = *expandString(v)
- }
- if v, ok := m["client_secret"]; ok {
- obj.ClientSecret = *expandString(v)
+ if v, ok := m["id"]; ok {
+ obj.ID = *expandString(v)
}
- if v, ok := m["scopes"]; ok {
- obj.Scopes = *expandStringSlice(v)
+ if v, ok := m["module"]; ok {
+ obj.Module = *expandEndpointSAMLMutate(v)
}
return &obj
}
-func expandEndpointOIDCSlice(in interface{}) *[]restapi.EndpointOIDC {
- var out []restapi.EndpointOIDC
+func expandEdgeRouteSAMLReplaceSlice(in interface{}) *[]restapi.EdgeRouteSAMLReplace {
+ var out []restapi.EdgeRouteSAMLReplace
for _, v := range in.([]interface{}) {
- out = append(out, *expandEndpointOIDC(v))
+ out = append(out, *expandEdgeRouteSAMLReplace(v))
}
return &out
}
-func flattenEndpointBackend(obj *restapi.EndpointBackend) interface{} {
+func flattenEdgeRouteOIDCReplace(obj *restapi.EdgeRouteOIDCReplace) interface{} {
if obj == nil {
return nil
}
m := make(map[string]interface{})
- m["enabled"] = obj.Enabled
- m["backend"] = flattenRef(&obj.Backend)
+ m["edge_id"] = obj.EdgeID
+ m["id"] = obj.ID
+ m["module"] = flattenEndpointOIDC(&obj.Module)
return []interface{}{m}
}
-func flattenEndpointBackendSlice(objs *[]restapi.EndpointBackend) (sl []interface{}) {
+func flattenEdgeRouteOIDCReplaceSlice(objs *[]restapi.EdgeRouteOIDCReplace) (sl []interface{}) {
if objs == nil {
return nil
}
for _, v := range *objs {
- sl = append(sl, flattenEndpointBackend(&v))
+ sl = append(sl, flattenEdgeRouteOIDCReplace(&v))
}
return sl
}
-func expandEndpointBackend(in interface{}) *restapi.EndpointBackend {
+func expandEdgeRouteOIDCReplace(in interface{}) *restapi.EdgeRouteOIDCReplace {
if in == nil {
return nil
}
@@ -3982,48 +6147,52 @@ func expandEndpointBackend(in interface{}) *restapi.EndpointBackend {
}
m := v.List()[0].(map[string]interface{})
- var obj restapi.EndpointBackend
- if v, ok := m["enabled"]; ok {
- obj.Enabled = expandBool(v)
+ var obj restapi.EdgeRouteOIDCReplace
+ if v, ok := m["edge_id"]; ok {
+ obj.EdgeID = *expandString(v)
}
- if v, ok := m["backend"]; ok {
- obj.Backend = *expandRef(v)
+ if v, ok := m["id"]; ok {
+ obj.ID = *expandString(v)
+ }
+ if v, ok := m["module"]; ok {
+ obj.Module = *expandEndpointOIDC(v)
}
return &obj
}
-func expandEndpointBackendSlice(in interface{}) *[]restapi.EndpointBackend {
- var out []restapi.EndpointBackend
+func expandEdgeRouteOIDCReplaceSlice(in interface{}) *[]restapi.EdgeRouteOIDCReplace {
+ var out []restapi.EdgeRouteOIDCReplace
for _, v := range in.([]interface{}) {
- out = append(out, *expandEndpointBackend(v))
+ out = append(out, *expandEdgeRouteOIDCReplace(v))
}
return &out
}
-func flattenEndpointBackendMutate(obj *restapi.EndpointBackendMutate) interface{} {
+func flattenEdgeRouteWebsocketTCPConverterReplace(obj *restapi.EdgeRouteWebsocketTCPConverterReplace) interface{} {
if obj == nil {
return nil
}
m := make(map[string]interface{})
- m["enabled"] = obj.Enabled
- m["backend_id"] = obj.BackendID
+ m["edge_id"] = obj.EdgeID
+ m["id"] = obj.ID
+ m["module"] = flattenEndpointWebsocketTCPConverter(&obj.Module)
return []interface{}{m}
}
-func flattenEndpointBackendMutateSlice(objs *[]restapi.EndpointBackendMutate) (sl []interface{}) {
+func flattenEdgeRouteWebsocketTCPConverterReplaceSlice(objs *[]restapi.EdgeRouteWebsocketTCPConverterReplace) (sl []interface{}) {
if objs == nil {
return nil
}
for _, v := range *objs {
- sl = append(sl, flattenEndpointBackendMutate(&v))
+ sl = append(sl, flattenEdgeRouteWebsocketTCPConverterReplace(&v))
}
return sl
}
-func expandEndpointBackendMutate(in interface{}) *restapi.EndpointBackendMutate {
+func expandEdgeRouteWebsocketTCPConverterReplace(in interface{}) *restapi.EdgeRouteWebsocketTCPConverterReplace {
if in == nil {
return nil
}
@@ -4034,20 +6203,23 @@ func expandEndpointBackendMutate(in interface{}) *restapi.EndpointBackendMutate
}
m := v.List()[0].(map[string]interface{})
- var obj restapi.EndpointBackendMutate
- if v, ok := m["enabled"]; ok {
- obj.Enabled = expandBool(v)
+ var obj restapi.EdgeRouteWebsocketTCPConverterReplace
+ if v, ok := m["edge_id"]; ok {
+ obj.EdgeID = *expandString(v)
}
- if v, ok := m["backend_id"]; ok {
- obj.BackendID = *expandString(v)
+ if v, ok := m["id"]; ok {
+ obj.ID = *expandString(v)
+ }
+ if v, ok := m["module"]; ok {
+ obj.Module = *expandEndpointWebsocketTCPConverter(v)
}
return &obj
}
-func expandEndpointBackendMutateSlice(in interface{}) *[]restapi.EndpointBackendMutate {
- var out []restapi.EndpointBackendMutate
+func expandEdgeRouteWebsocketTCPConverterReplaceSlice(in interface{}) *[]restapi.EdgeRouteWebsocketTCPConverterReplace {
+ var out []restapi.EdgeRouteWebsocketTCPConverterReplace
for _, v := range in.([]interface{}) {
- out = append(out, *expandEndpointBackendMutate(v))
+ out = append(out, *expandEdgeRouteWebsocketTCPConverterReplace(v))
}
return &out
}
@@ -4116,6 +6288,7 @@ func flattenTCPEdgeCreate(obj *restapi.TCPEdgeCreate) interface{} {
m := make(map[string]interface{})
m["description"] = obj.Description
m["metadata"] = obj.Metadata
+ m["hostports"] = obj.Hostports
m["backend"] = flattenEndpointBackendMutate(obj.Backend)
m["ip_restriction"] = flattenEndpointIPPolicyMutate(obj.IPRestriction)
@@ -4151,6 +6324,9 @@ func expandTCPEdgeCreate(in interface{}) *restapi.TCPEdgeCreate {
if v, ok := m["metadata"]; ok {
obj.Metadata = *expandString(v)
}
+ if v, ok := m["hostports"]; ok {
+ obj.Hostports = expandStringSlice(v)
+ }
if v, ok := m["backend"]; ok {
obj.Backend = expandEndpointBackendMutate(v)
}
@@ -4177,6 +6353,7 @@ func flattenTCPEdgeUpdate(obj *restapi.TCPEdgeUpdate) interface{} {
m["id"] = obj.ID
m["description"] = obj.Description
m["metadata"] = obj.Metadata
+ m["hostports"] = obj.Hostports
m["backend"] = flattenEndpointBackendMutate(obj.Backend)
m["ip_restriction"] = flattenEndpointIPPolicyMutate(obj.IPRestriction)
@@ -4215,6 +6392,9 @@ func expandTCPEdgeUpdate(in interface{}) *restapi.TCPEdgeUpdate {
if v, ok := m["metadata"]; ok {
obj.Metadata = expandString(v)
}
+ if v, ok := m["hostports"]; ok {
+ obj.Hostports = expandStringSlice(v)
+ }
if v, ok := m["backend"]; ok {
obj.Backend = expandEndpointBackendMutate(v)
}
@@ -4243,6 +6423,7 @@ func flattenTCPEdge(obj *restapi.TCPEdge) interface{} {
m["metadata"] = obj.Metadata
m["created_at"] = obj.CreatedAt
m["uri"] = obj.URI
+ m["hostports"] = obj.Hostports
m["backend"] = flattenEndpointBackend(obj.Backend)
m["ip_restriction"] = flattenEndpointIPPolicy(obj.IpRestriction)
@@ -4287,6 +6468,9 @@ func expandTCPEdge(in interface{}) *restapi.TCPEdge {
if v, ok := m["uri"]; ok {
obj.URI = *expandString(v)
}
+ if v, ok := m["hostports"]; ok {
+ obj.Hostports = expandStringSlice(v)
+ }
if v, ok := m["backend"]; ok {
obj.Backend = expandEndpointBackend(v)
}
@@ -4368,6 +6552,7 @@ func flattenTLSEdgeCreate(obj *restapi.TLSEdgeCreate) interface{} {
m := make(map[string]interface{})
m["description"] = obj.Description
m["metadata"] = obj.Metadata
+ m["hostports"] = obj.Hostports
m["backend"] = flattenEndpointBackendMutate(obj.Backend)
m["ip_restriction"] = flattenEndpointIPPolicyMutate(obj.IPRestriction)
m["mutual_tls"] = flattenEndpointMutualTLSMutate(obj.MutualTLS)
@@ -4405,6 +6590,9 @@ func expandTLSEdgeCreate(in interface{}) *restapi.TLSEdgeCreate {
if v, ok := m["metadata"]; ok {
obj.Metadata = *expandString(v)
}
+ if v, ok := m["hostports"]; ok {
+ obj.Hostports = expandStringSlice(v)
+ }
if v, ok := m["backend"]; ok {
obj.Backend = expandEndpointBackendMutate(v)
}
@@ -4437,6 +6625,7 @@ func flattenTLSEdgeUpdate(obj *restapi.TLSEdgeUpdate) interface{} {
m["id"] = obj.ID
m["description"] = obj.Description
m["metadata"] = obj.Metadata
+ m["hostports"] = obj.Hostports
m["backend"] = flattenEndpointBackendMutate(obj.Backend)
m["ip_restriction"] = flattenEndpointIPPolicyMutate(obj.IPRestriction)
m["mutual_tls"] = flattenEndpointMutualTLSMutate(obj.MutualTLS)
@@ -4477,6 +6666,9 @@ func expandTLSEdgeUpdate(in interface{}) *restapi.TLSEdgeUpdate {
if v, ok := m["metadata"]; ok {
obj.Metadata = expandString(v)
}
+ if v, ok := m["hostports"]; ok {
+ obj.Hostports = expandStringSlice(v)
+ }
if v, ok := m["backend"]; ok {
obj.Backend = expandEndpointBackendMutate(v)
}
@@ -4511,6 +6703,7 @@ func flattenTLSEdge(obj *restapi.TLSEdge) interface{} {
m["metadata"] = obj.Metadata
m["created_at"] = obj.CreatedAt
m["uri"] = obj.URI
+ m["hostports"] = obj.Hostports
m["backend"] = flattenEndpointBackend(obj.Backend)
m["ip_restriction"] = flattenEndpointIPPolicy(obj.IpRestriction)
m["mutual_tls"] = flattenEndpointMutualTLS(obj.MutualTls)
@@ -4557,6 +6750,9 @@ func expandTLSEdge(in interface{}) *restapi.TLSEdge {
if v, ok := m["uri"]; ok {
obj.URI = *expandString(v)
}
+ if v, ok := m["hostports"]; ok {
+ obj.Hostports = expandStringSlice(v)
+ }
if v, ok := m["backend"]; ok {
obj.Backend = expandEndpointBackend(v)
}
@@ -4575,7 +6771,159 @@ func expandTLSEdge(in interface{}) *restapi.TLSEdge {
func expandTLSEdgeSlice(in interface{}) *[]restapi.TLSEdge {
var out []restapi.TLSEdge
for _, v := range in.([]interface{}) {
- out = append(out, *expandTLSEdge(v))
+ out = append(out, *expandTLSEdge(v))
+ }
+ return &out
+}
+
+func flattenEndpoint(obj *restapi.Endpoint) interface{} {
+ if obj == nil {
+ return nil
+ }
+
+ m := make(map[string]interface{})
+ m["id"] = obj.ID
+ m["region"] = obj.Region
+ m["created_at"] = obj.CreatedAt
+ m["updated_at"] = obj.UpdatedAt
+ m["public_url"] = obj.PublicURL
+ m["proto"] = obj.Proto
+ m["hostport"] = obj.Hostport
+ m["type"] = obj.Type
+ m["metadata"] = obj.Metadata
+ m["domain"] = flattenRef(obj.Domain)
+ m["tcp_addr"] = flattenRef(obj.TCPAddr)
+ m["tunnel"] = flattenRef(obj.Tunnel)
+ m["edge"] = flattenRef(obj.Edge)
+
+ return []interface{}{m}
+}
+
+func flattenEndpointSlice(objs *[]restapi.Endpoint) (sl []interface{}) {
+ if objs == nil {
+ return nil
+ }
+
+ for _, v := range *objs {
+ sl = append(sl, flattenEndpoint(&v))
+ }
+ return sl
+}
+
+func expandEndpoint(in interface{}) *restapi.Endpoint {
+ if in == nil {
+ return nil
+ }
+ v := in.(*schema.Set)
+
+ if v.Len() == 0 {
+ return nil
+ }
+
+ m := v.List()[0].(map[string]interface{})
+ var obj restapi.Endpoint
+ if v, ok := m["id"]; ok {
+ obj.ID = *expandString(v)
+ }
+ if v, ok := m["region"]; ok {
+ obj.Region = *expandString(v)
+ }
+ if v, ok := m["created_at"]; ok {
+ obj.CreatedAt = *expandString(v)
+ }
+ if v, ok := m["updated_at"]; ok {
+ obj.UpdatedAt = *expandString(v)
+ }
+ if v, ok := m["public_url"]; ok {
+ obj.PublicURL = *expandString(v)
+ }
+ if v, ok := m["proto"]; ok {
+ obj.Proto = *expandString(v)
+ }
+ if v, ok := m["hostport"]; ok {
+ obj.Hostport = *expandString(v)
+ }
+ if v, ok := m["type"]; ok {
+ obj.Type = *expandString(v)
+ }
+ if v, ok := m["metadata"]; ok {
+ obj.Metadata = *expandString(v)
+ }
+ if v, ok := m["domain"]; ok {
+ obj.Domain = expandRef(v)
+ }
+ if v, ok := m["tcp_addr"]; ok {
+ obj.TCPAddr = expandRef(v)
+ }
+ if v, ok := m["tunnel"]; ok {
+ obj.Tunnel = expandRef(v)
+ }
+ if v, ok := m["edge"]; ok {
+ obj.Edge = expandRef(v)
+ }
+ return &obj
+}
+
+func expandEndpointSlice(in interface{}) *[]restapi.Endpoint {
+ var out []restapi.Endpoint
+ for _, v := range in.([]interface{}) {
+ out = append(out, *expandEndpoint(v))
+ }
+ return &out
+}
+
+func flattenEndpointList(obj *restapi.EndpointList) interface{} {
+ if obj == nil {
+ return nil
+ }
+
+ m := make(map[string]interface{})
+ m["endpoints"] = flattenEndpointSlice(&obj.Endpoints)
+ m["uri"] = obj.URI
+ m["next_page_uri"] = obj.NextPageURI
+
+ return []interface{}{m}
+}
+
+func flattenEndpointListSlice(objs *[]restapi.EndpointList) (sl []interface{}) {
+ if objs == nil {
+ return nil
+ }
+
+ for _, v := range *objs {
+ sl = append(sl, flattenEndpointList(&v))
+ }
+ return sl
+}
+
+func expandEndpointList(in interface{}) *restapi.EndpointList {
+ if in == nil {
+ return nil
+ }
+ v := in.(*schema.Set)
+
+ if v.Len() == 0 {
+ return nil
+ }
+
+ m := v.List()[0].(map[string]interface{})
+ var obj restapi.EndpointList
+ if v, ok := m["endpoints"]; ok {
+ obj.Endpoints = *expandEndpointSlice(v)
+ }
+ if v, ok := m["uri"]; ok {
+ obj.URI = *expandString(v)
+ }
+ if v, ok := m["next_page_uri"]; ok {
+ obj.NextPageURI = expandString(v)
+ }
+ return &obj
+}
+
+func expandEndpointListSlice(in interface{}) *[]restapi.EndpointList {
+ var out []restapi.EndpointList
+ for _, v := range in.([]interface{}) {
+ out = append(out, *expandEndpointList(v))
}
return &out
}
@@ -6331,7 +8679,7 @@ func expandIPPolicyCreate(in interface{}) *restapi.IPPolicyCreate {
obj.Metadata = *expandString(v)
}
if v, ok := m["action"]; ok {
- obj.Action = *expandString(v)
+ obj.Action = expandString(v)
}
return &obj
}
@@ -6455,7 +8803,7 @@ func expandIPPolicy(in interface{}) *restapi.IPPolicy {
obj.Metadata = *expandString(v)
}
if v, ok := m["action"]; ok {
- obj.Action = *expandString(v)
+ obj.Action = expandString(v)
}
return &obj
}
@@ -6534,6 +8882,7 @@ func flattenIPPolicyRuleCreate(obj *restapi.IPPolicyRuleCreate) interface{} {
m["metadata"] = obj.Metadata
m["cidr"] = obj.CIDR
m["ip_policy_id"] = obj.IPPolicyID
+ m["action"] = obj.Action
return []interface{}{m}
}
@@ -6573,6 +8922,9 @@ func expandIPPolicyRuleCreate(in interface{}) *restapi.IPPolicyRuleCreate {
if v, ok := m["ip_policy_id"]; ok {
obj.IPPolicyID = *expandString(v)
}
+ if v, ok := m["action"]; ok {
+ obj.Action = expandString(v)
+ }
return &obj
}
@@ -6657,6 +9009,7 @@ func flattenIPPolicyRule(obj *restapi.IPPolicyRule) interface{} {
m["metadata"] = obj.Metadata
m["cidr"] = obj.CIDR
m["ip_policy"] = flattenRef(&obj.IPPolicy)
+ m["action"] = obj.Action
return []interface{}{m}
}
@@ -6705,6 +9058,9 @@ func expandIPPolicyRule(in interface{}) *restapi.IPPolicyRule {
if v, ok := m["ip_policy"]; ok {
obj.IPPolicy = *expandRef(v)
}
+ if v, ok := m["action"]; ok {
+ obj.Action = *expandString(v)
+ }
return &obj
}
@@ -7032,242 +9388,6 @@ func expandIPRestrictionListSlice(in interface{}) *[]restapi.IPRestrictionList {
return &out
}
-func flattenIPWhitelistEntryCreate(obj *restapi.IPWhitelistEntryCreate) interface{} {
- if obj == nil {
- return nil
- }
-
- m := make(map[string]interface{})
- m["description"] = obj.Description
- m["metadata"] = obj.Metadata
- m["ip_net"] = obj.IPNet
-
- return []interface{}{m}
-}
-
-func flattenIPWhitelistEntryCreateSlice(objs *[]restapi.IPWhitelistEntryCreate) (sl []interface{}) {
- if objs == nil {
- return nil
- }
-
- for _, v := range *objs {
- sl = append(sl, flattenIPWhitelistEntryCreate(&v))
- }
- return sl
-}
-
-func expandIPWhitelistEntryCreate(in interface{}) *restapi.IPWhitelistEntryCreate {
- if in == nil {
- return nil
- }
- v := in.(*schema.Set)
-
- if v.Len() == 0 {
- return nil
- }
-
- m := v.List()[0].(map[string]interface{})
- var obj restapi.IPWhitelistEntryCreate
- if v, ok := m["description"]; ok {
- obj.Description = *expandString(v)
- }
- if v, ok := m["metadata"]; ok {
- obj.Metadata = *expandString(v)
- }
- if v, ok := m["ip_net"]; ok {
- obj.IPNet = *expandString(v)
- }
- return &obj
-}
-
-func expandIPWhitelistEntryCreateSlice(in interface{}) *[]restapi.IPWhitelistEntryCreate {
- var out []restapi.IPWhitelistEntryCreate
- for _, v := range in.([]interface{}) {
- out = append(out, *expandIPWhitelistEntryCreate(v))
- }
- return &out
-}
-
-func flattenIPWhitelistEntryUpdate(obj *restapi.IPWhitelistEntryUpdate) interface{} {
- if obj == nil {
- return nil
- }
-
- m := make(map[string]interface{})
- m["id"] = obj.ID
- m["description"] = obj.Description
- m["metadata"] = obj.Metadata
-
- return []interface{}{m}
-}
-
-func flattenIPWhitelistEntryUpdateSlice(objs *[]restapi.IPWhitelistEntryUpdate) (sl []interface{}) {
- if objs == nil {
- return nil
- }
-
- for _, v := range *objs {
- sl = append(sl, flattenIPWhitelistEntryUpdate(&v))
- }
- return sl
-}
-
-func expandIPWhitelistEntryUpdate(in interface{}) *restapi.IPWhitelistEntryUpdate {
- if in == nil {
- return nil
- }
- v := in.(*schema.Set)
-
- if v.Len() == 0 {
- return nil
- }
-
- m := v.List()[0].(map[string]interface{})
- var obj restapi.IPWhitelistEntryUpdate
- if v, ok := m["id"]; ok {
- obj.ID = *expandString(v)
- }
- if v, ok := m["description"]; ok {
- obj.Description = expandString(v)
- }
- if v, ok := m["metadata"]; ok {
- obj.Metadata = expandString(v)
- }
- return &obj
-}
-
-func expandIPWhitelistEntryUpdateSlice(in interface{}) *[]restapi.IPWhitelistEntryUpdate {
- var out []restapi.IPWhitelistEntryUpdate
- for _, v := range in.([]interface{}) {
- out = append(out, *expandIPWhitelistEntryUpdate(v))
- }
- return &out
-}
-
-func flattenIPWhitelistEntry(obj *restapi.IPWhitelistEntry) interface{} {
- if obj == nil {
- return nil
- }
-
- m := make(map[string]interface{})
- m["id"] = obj.ID
- m["uri"] = obj.URI
- m["created_at"] = obj.CreatedAt
- m["description"] = obj.Description
- m["metadata"] = obj.Metadata
- m["ip_net"] = obj.IPNet
-
- return []interface{}{m}
-}
-
-func flattenIPWhitelistEntrySlice(objs *[]restapi.IPWhitelistEntry) (sl []interface{}) {
- if objs == nil {
- return nil
- }
-
- for _, v := range *objs {
- sl = append(sl, flattenIPWhitelistEntry(&v))
- }
- return sl
-}
-
-func expandIPWhitelistEntry(in interface{}) *restapi.IPWhitelistEntry {
- if in == nil {
- return nil
- }
- v := in.(*schema.Set)
-
- if v.Len() == 0 {
- return nil
- }
-
- m := v.List()[0].(map[string]interface{})
- var obj restapi.IPWhitelistEntry
- if v, ok := m["id"]; ok {
- obj.ID = *expandString(v)
- }
- if v, ok := m["uri"]; ok {
- obj.URI = *expandString(v)
- }
- if v, ok := m["created_at"]; ok {
- obj.CreatedAt = *expandString(v)
- }
- if v, ok := m["description"]; ok {
- obj.Description = *expandString(v)
- }
- if v, ok := m["metadata"]; ok {
- obj.Metadata = *expandString(v)
- }
- if v, ok := m["ip_net"]; ok {
- obj.IPNet = *expandString(v)
- }
- return &obj
-}
-
-func expandIPWhitelistEntrySlice(in interface{}) *[]restapi.IPWhitelistEntry {
- var out []restapi.IPWhitelistEntry
- for _, v := range in.([]interface{}) {
- out = append(out, *expandIPWhitelistEntry(v))
- }
- return &out
-}
-
-func flattenIPWhitelistEntryList(obj *restapi.IPWhitelistEntryList) interface{} {
- if obj == nil {
- return nil
- }
-
- m := make(map[string]interface{})
- m["whitelist"] = flattenIPWhitelistEntrySlice(&obj.Whitelist)
- m["uri"] = obj.URI
- m["next_page_uri"] = obj.NextPageURI
-
- return []interface{}{m}
-}
-
-func flattenIPWhitelistEntryListSlice(objs *[]restapi.IPWhitelistEntryList) (sl []interface{}) {
- if objs == nil {
- return nil
- }
-
- for _, v := range *objs {
- sl = append(sl, flattenIPWhitelistEntryList(&v))
- }
- return sl
-}
-
-func expandIPWhitelistEntryList(in interface{}) *restapi.IPWhitelistEntryList {
- if in == nil {
- return nil
- }
- v := in.(*schema.Set)
-
- if v.Len() == 0 {
- return nil
- }
-
- m := v.List()[0].(map[string]interface{})
- var obj restapi.IPWhitelistEntryList
- if v, ok := m["whitelist"]; ok {
- obj.Whitelist = *expandIPWhitelistEntrySlice(v)
- }
- if v, ok := m["uri"]; ok {
- obj.URI = *expandString(v)
- }
- if v, ok := m["next_page_uri"]; ok {
- obj.NextPageURI = expandString(v)
- }
- return &obj
-}
-
-func expandIPWhitelistEntryListSlice(in interface{}) *[]restapi.IPWhitelistEntryList {
- var out []restapi.IPWhitelistEntryList
- for _, v := range in.([]interface{}) {
- out = append(out, *expandIPWhitelistEntryList(v))
- }
- return &out
-}
-
func flattenEndpointLoggingReplace(obj *restapi.EndpointLoggingReplace) interface{} {
if obj == nil {
return nil
@@ -8043,7 +10163,7 @@ func expandReservedAddrCreate(in interface{}) *restapi.ReservedAddrCreate {
obj.Region = *expandString(v)
}
if v, ok := m["endpoint_configuration_id"]; ok {
- obj.EndpointConfigurationID = *expandString(v)
+ obj.EndpointConfigurationID = expandString(v)
}
return &obj
}
@@ -8415,6 +10535,7 @@ func flattenReservedDomain(obj *restapi.ReservedDomain) interface{} {
m["certificate"] = flattenRef(obj.Certificate)
m["certificate_management_policy"] = flattenReservedDomainCertPolicy(obj.CertificateManagementPolicy)
m["certificate_management_status"] = flattenReservedDomainCertStatus(obj.CertificateManagementStatus)
+ m["acme_challenge_cname_target"] = obj.ACMEChallengeCNAMETarget
return []interface{}{m}
}
@@ -8481,6 +10602,9 @@ func expandReservedDomain(in interface{}) *restapi.ReservedDomain {
if v, ok := m["certificate_management_status"]; ok {
obj.CertificateManagementStatus = expandReservedDomainCertStatus(v)
}
+ if v, ok := m["acme_challenge_cname_target"]; ok {
+ obj.ACMEChallengeCNAMETarget = expandString(v)
+ }
return &obj
}
@@ -8652,58 +10776,6 @@ func expandReservedDomainCertStatusSlice(in interface{}) *[]restapi.ReservedDoma
return &out
}
-func flattenReservedDomainCertNSTarget(obj *restapi.ReservedDomainCertNSTarget) interface{} {
- if obj == nil {
- return nil
- }
-
- m := make(map[string]interface{})
- m["zone"] = obj.Zone
- m["nameservers"] = obj.Nameservers
-
- return []interface{}{m}
-}
-
-func flattenReservedDomainCertNSTargetSlice(objs *[]restapi.ReservedDomainCertNSTarget) (sl []interface{}) {
- if objs == nil {
- return nil
- }
-
- for _, v := range *objs {
- sl = append(sl, flattenReservedDomainCertNSTarget(&v))
- }
- return sl
-}
-
-func expandReservedDomainCertNSTarget(in interface{}) *restapi.ReservedDomainCertNSTarget {
- if in == nil {
- return nil
- }
- v := in.(*schema.Set)
-
- if v.Len() == 0 {
- return nil
- }
-
- m := v.List()[0].(map[string]interface{})
- var obj restapi.ReservedDomainCertNSTarget
- if v, ok := m["zone"]; ok {
- obj.Zone = *expandString(v)
- }
- if v, ok := m["nameservers"]; ok {
- obj.Nameservers = *expandStringSlice(v)
- }
- return &obj
-}
-
-func expandReservedDomainCertNSTargetSlice(in interface{}) *[]restapi.ReservedDomainCertNSTarget {
- var out []restapi.ReservedDomainCertNSTarget
- for _, v := range in.([]interface{}) {
- out = append(out, *expandReservedDomainCertNSTarget(v))
- }
- return &out
-}
-
func flattenReservedDomainCertJob(obj *restapi.ReservedDomainCertJob) interface{} {
if obj == nil {
return nil
@@ -8714,7 +10786,6 @@ func flattenReservedDomainCertJob(obj *restapi.ReservedDomainCertJob) interface{
m["msg"] = obj.Msg
m["started_at"] = obj.StartedAt
m["retries_at"] = obj.RetriesAt
- m["ns_targets"] = flattenReservedDomainCertNSTargetSlice(&obj.NSTargets)
return []interface{}{m}
}
@@ -8754,9 +10825,6 @@ func expandReservedDomainCertJob(in interface{}) *restapi.ReservedDomainCertJob
if v, ok := m["retries_at"]; ok {
obj.RetriesAt = expandString(v)
}
- if v, ok := m["ns_targets"]; ok {
- obj.NSTargets = *expandReservedDomainCertNSTargetSlice(v)
- }
return &obj
}
@@ -10441,6 +12509,10 @@ func flattenTunnel(obj *restapi.Tunnel) interface{} {
m["proto"] = obj.Proto
m["region"] = obj.Region
m["tunnel_session"] = flattenRef(&obj.TunnelSession)
+ m["endpoint"] = flattenRef(obj.Endpoint)
+ m["labels"] = obj.Labels
+ m["backends"] = flattenRefSlice(obj.Backends)
+ m["forwards_to"] = obj.ForwardsTo
return []interface{}{m}
}
@@ -10489,6 +12561,18 @@ func expandTunnel(in interface{}) *restapi.Tunnel {
if v, ok := m["tunnel_session"]; ok {
obj.TunnelSession = *expandRef(v)
}
+ if v, ok := m["endpoint"]; ok {
+ obj.Endpoint = expandRef(v)
+ }
+ if v, ok := m["labels"]; ok {
+ obj.Labels = *expandStringMap(v)
+ }
+ if v, ok := m["backends"]; ok {
+ obj.Backends = expandRefSlice(v)
+ }
+ if v, ok := m["forwards_to"]; ok {
+ obj.ForwardsTo = *expandString(v)
+ }
return &obj
}
diff --git a/ngrok/provider.go b/ngrok/provider.go
index 519c46e..bfaf772 100644
--- a/ngrok/provider.go
+++ b/ngrok/provider.go
@@ -26,6 +26,7 @@ func Provider() *schema.Provider {
},
},
ResourcesMap: map[string]*schema.Resource{
+ "ngrok_agent_ingress": resourceAgentIngresses(),
"ngrok_api_key": resourceAPIKeys(),
"ngrok_certificate_authority": resourceCertificateAuthorities(),
"ngrok_credential": resourceCredentials(),
@@ -35,7 +36,6 @@ func Provider() *schema.Provider {
"ngrok_ip_policy": resourceIPPolicies(),
"ngrok_ip_policy_rule": resourceIPPolicyRules(),
"ngrok_ip_restriction": resourceIPRestrictions(),
- "ngrok_ip_whitelist_entry": resourceIPWhitelist(),
"ngrok_reserved_addr": resourceReservedAddrs(),
"ngrok_reserved_domain": resourceReservedDomains(),
"ngrok_ssh_certificate_authority": resourceSSHCertificateAuthorities(),
diff --git a/ngrok/resource_agent_ingress.go b/ngrok/resource_agent_ingress.go
new file mode 100644
index 0000000..16b418e
--- /dev/null
+++ b/ngrok/resource_agent_ingress.go
@@ -0,0 +1,185 @@
+// Code generated by apic. DO NOT EDIT.
+
+package ngrok
+
+import (
+ "context"
+ "log"
+ "net/http"
+
+ "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
+ restapi "github.com/ngrok/terraform-provider-ngrok/restapi"
+)
+
+func resourceAgentIngresses() *schema.Resource {
+ return &schema.Resource{
+ Create: resourceAgentIngressesCreate,
+ Read: resourceAgentIngressesGet,
+ Update: resourceAgentIngressesUpdate,
+ Delete: resourceAgentIngressesDelete,
+
+ Schema: map[string]*schema.Schema{
+ "created_at": {
+ Type: schema.TypeString,
+ Required: false,
+ Computed: true,
+ Optional: false,
+ Sensitive: false,
+ ForceNew: true,
+ Description: "timestamp when the Agent Ingress was created, RFC 3339 format",
+ },
+ "description": {
+ Type: schema.TypeString,
+ Required: false,
+ Computed: false,
+ Optional: true,
+ Sensitive: false,
+ ForceNew: false,
+ Description: "human-readable description of the use of this Agent Ingress. optional, max 255 bytes.",
+ },
+ "domain": {
+ Type: schema.TypeString,
+ Required: true,
+ Computed: false,
+ Optional: false,
+ Sensitive: false,
+ ForceNew: true,
+ Description: "the domain that you own to be used as the base domain name to generate regional agent ingress domains.",
+ },
+ "id": {
+ Type: schema.TypeString,
+ Required: false,
+ Computed: true,
+ Optional: false,
+ Sensitive: false,
+ ForceNew: false,
+ Description: "unique Agent Ingress resource identifier",
+ },
+ "metadata": {
+ Type: schema.TypeString,
+ Required: false,
+ Computed: false,
+ Optional: true,
+ Sensitive: false,
+ ForceNew: false,
+ Description: "arbitrary user-defined machine-readable data of this Agent Ingress. optional, max 4096 bytes",
+ },
+ "ns_targets": {
+ Type: schema.TypeList,
+ Required: false,
+ Computed: true,
+ Optional: false,
+ Sensitive: false,
+ ForceNew: true,
+ Description: "a list of target values to use as the values of NS records for the domain property these values will delegate control over the domain to ngrok",
+ Elem: &schema.Schema{Type: schema.TypeString},
+ },
+ "region_domains": {
+ Type: schema.TypeList,
+ Required: false,
+ Computed: true,
+ Optional: false,
+ Sensitive: false,
+ ForceNew: true,
+ Description: "a list of regional agent ingress domains that are subdomains of the value of domain this value may increase over time as ngrok adds more regions",
+ Elem: &schema.Schema{Type: schema.TypeString},
+ },
+ "uri": {
+ Type: schema.TypeString,
+ Required: false,
+ Computed: true,
+ Optional: true,
+ Sensitive: false,
+ ForceNew: true,
+ Description: "URI to the API resource of this Agent ingress",
+ },
+ },
+ }
+}
+
+func resourceAgentIngressesCreate(d *schema.ResourceData, m interface{}) (err error) {
+ b := m.(*base)
+
+ var arg restapi.AgentIngressCreate
+ if v, ok := d.GetOk("description"); ok {
+ arg.Description = *expandString(v)
+ }
+ if v, ok := d.GetOk("metadata"); ok {
+ arg.Metadata = *expandString(v)
+ }
+ if v, ok := d.GetOk("domain"); ok {
+ arg.Domain = *expandString(v)
+ }
+
+ res, _, err := b.client.AgentIngressesCreate(context.Background(), &arg)
+ if err != nil {
+ log.Printf("[ERROR] AgentIngressesCreate: %s", err)
+ return err
+ }
+ d.SetId(res.ID)
+
+ return resourceAgentIngressesGet(d, m)
+}
+
+func resourceAgentIngressesGet(d *schema.ResourceData, m interface{}) (err error) {
+ b := m.(*base)
+
+ res, resp, err := b.client.AgentIngressesGet(context.Background(), &restapi.Item{
+ ID: d.Id(),
+ })
+ return resourceAgentIngressesGetDecode(d, res, resp, err)
+}
+
+func resourceAgentIngressesGetDecode(d *schema.ResourceData, res *restapi.AgentIngress, resp *http.Response, err error) error {
+ switch {
+ case resp != nil && resp.StatusCode == 404:
+ d.SetId("")
+ case err != nil:
+ log.Printf("[ERROR] AgentIngressesGet: %s", err)
+ return err
+ default:
+ d.Set("created_at", res.CreatedAt)
+ d.Set("description", res.Description)
+ d.Set("domain", res.Domain)
+ d.Set("id", res.ID)
+ d.Set("metadata", res.Metadata)
+ d.Set("ns_targets", res.NSTargets)
+ d.Set("region_domains", res.RegionDomains)
+ d.Set("uri", res.URI)
+ }
+ return nil
+}
+
+func resourceAgentIngressesUpdate(d *schema.ResourceData, m interface{}) (err error) {
+ b := m.(*base)
+
+ var arg restapi.AgentIngressUpdate
+ arg.ID = d.Id()
+ if v, ok := d.GetOk("id"); ok {
+ arg.ID = *expandString(v)
+ }
+ if v, ok := d.GetOk("description"); ok {
+ arg.Description = expandString(v)
+ }
+ if v, ok := d.GetOk("metadata"); ok {
+ arg.Metadata = expandString(v)
+ }
+
+ res, _, err := b.client.AgentIngressesUpdate(context.Background(), &arg)
+ if err != nil {
+ log.Printf("[ERROR] AgentIngressesUpdate: %s", err)
+ return err
+ }
+ d.SetId(res.ID)
+
+ return resourceAgentIngressesGet(d, m)
+}
+
+func resourceAgentIngressesDelete(d *schema.ResourceData, m interface{}) (err error) {
+ b := m.(*base)
+ _, _, err = b.client.AgentIngressesDelete(context.Background(), &restapi.Item{ID: d.Id()})
+ if err != nil {
+ log.Printf("[ERROR] AgentIngressesDelete: %s", err)
+ }
+ return err
+}
diff --git a/ngrok/resource_ip_whitelist_entry_test.go b/ngrok/resource_agent_ingress_test.go
similarity index 56%
rename from ngrok/resource_ip_whitelist_entry_test.go
rename to ngrok/resource_agent_ingress_test.go
index 42759cc..e48b58b 100644
--- a/ngrok/resource_ip_whitelist_entry_test.go
+++ b/ngrok/resource_agent_ingress_test.go
@@ -14,19 +14,19 @@ import (
)
var (
- resourceIPWhitelist_createConfig = `resource "ngrok_ip_whitelist_entry" "example" {
- description = "outbound proxy servers"
- ip_net = "10.1.1.0/24"
+ resourceAgentIngresses_createConfig = `resource "ngrok_agent_ingress" "example" {
+ description = "acme devices"
+ domain = "connect.acme.com"
}`
- resourceIPWhitelist_updateConfig = `resource "ngrok_ip_whitelist_entry" "example" {
- description = "home office for alan"
- metadata = "{\"type\": \"home office\", \"employee_name\": \"alan\"}"
+ resourceAgentIngresses_updateConfig = `resource "ngrok_agent_ingress" "example" {
+ description = "ACME Co. Device Ingress"
+ metadata = "{\"device_sku\": \"824JS4RZ1F8X\"}"
}`
)
func init() {
- resource.AddTestSweepers("ip_whitelist", &resource.Sweeper{
- Name: "ip_whitelist",
+ resource.AddTestSweepers("agent_ingresses", &resource.Sweeper{
+ Name: "agent_ingresses",
F: func(region string) error {
ctx := context.Background()
client, err := sharedClientForRegion(region)
@@ -35,15 +35,15 @@ func init() {
}
conn := client.(*restapi.Client)
- list, _, err := conn.IPWhitelistList(ctx, nil)
+ list, _, err := conn.AgentIngressesList(ctx, &restapi.Paging{})
if err != nil {
return fmt.Errorf("Error getting list of items: %s", err)
}
- for _, item := range list.Whitelist {
+ for _, item := range list.Ingresses {
// Assume items with empty Description and Metadata are system defined (i.e. API Keys)
if item.Description != "" && item.Metadata != "" {
- _, _, err := conn.IPWhitelistDelete(ctx, &restapi.Item{ID: item.ID})
+ _, _, err := conn.AgentIngressesDelete(ctx, &restapi.Item{ID: item.ID})
if err != nil {
log.Printf("Error destroying id %s during sweep: %s", item.ID, err)
@@ -56,28 +56,28 @@ func init() {
})
}
-func TestAccResourceIPWhitelist(t *testing.T) {
+func TestAccResourceAgentIngresses(t *testing.T) {
resource.Test(t, resource.TestCase{
Providers: testAccProviders,
PreCheck: func() { testAccPreCheck(t) },
- CheckDestroy: testAccCheckDestroyIPWhitelist,
+ CheckDestroy: testAccCheckDestroyAgentIngresses,
Steps: []resource.TestStep{
{
- Config: resourceIPWhitelist_createConfig,
+ Config: resourceAgentIngresses_createConfig,
// Check: resource.ComposeAggregateTestCheckFunc(
- // testAccCheckCreateIPWhitelist,
+ // testAccCheckCreateAgentIngresses,
// ),
},
},
})
}
-func testAccCheckDestroyIPWhitelist(s *terraform.State) (err error) {
+func testAccCheckDestroyAgentIngresses(s *terraform.State) (err error) {
return err
}
-func testAccCheckCreateIPWhitelist(s *terraform.State) (err error) {
+func testAccCheckCreateAgentIngresses(s *terraform.State) (err error) {
fmt.Sprintf("state=%#v", s)
return err
}
diff --git a/ngrok/resource_api_key_test.go b/ngrok/resource_api_key_test.go
index 2945595..b963983 100644
--- a/ngrok/resource_api_key_test.go
+++ b/ngrok/resource_api_key_test.go
@@ -34,7 +34,7 @@ func init() {
}
conn := client.(*restapi.Client)
- list, _, err := conn.APIKeysList(ctx, nil)
+ list, _, err := conn.APIKeysList(ctx, &restapi.Paging{})
if err != nil {
return fmt.Errorf("Error getting list of items: %s", err)
}
diff --git a/ngrok/resource_certificate_authority_test.go b/ngrok/resource_certificate_authority_test.go
index a18293a..11701f2 100644
--- a/ngrok/resource_certificate_authority_test.go
+++ b/ngrok/resource_certificate_authority_test.go
@@ -35,7 +35,7 @@ func init() {
}
conn := client.(*restapi.Client)
- list, _, err := conn.CertificateAuthoritiesList(ctx, nil)
+ list, _, err := conn.CertificateAuthoritiesList(ctx, &restapi.Paging{})
if err != nil {
return fmt.Errorf("Error getting list of items: %s", err)
}
diff --git a/ngrok/resource_credential_test.go b/ngrok/resource_credential_test.go
index 8703521..29237ca 100644
--- a/ngrok/resource_credential_test.go
+++ b/ngrok/resource_credential_test.go
@@ -34,7 +34,7 @@ func init() {
}
conn := client.(*restapi.Client)
- list, _, err := conn.CredentialsList(ctx, nil)
+ list, _, err := conn.CredentialsList(ctx, &restapi.Paging{})
if err != nil {
return fmt.Errorf("Error getting list of items: %s", err)
}
diff --git a/ngrok/resource_endpoint_configuration.go b/ngrok/resource_endpoint_configuration.go
index df65dea..6c808c9 100644
--- a/ngrok/resource_endpoint_configuration.go
+++ b/ngrok/resource_endpoint_configuration.go
@@ -101,7 +101,7 @@ func resourceEndpointConfigurations() *schema.Resource {
Optional: true,
Sensitive: false,
ForceNew: false,
- Description: "determines how the basic auth credentials are validated. Currently only the value `agent` is supported which means that credentials will be validated against the username and password specified by the ngrok agent's `-auth` flag, if any.",
+ Description: "determines how the basic auth credentials are validated. Currently only the value `agent` is supported which means that credentials will be validated against the username and password specified by the ngrok agent's `--basic-auth` flag, if any.",
},
"realm": {
Type: schema.TypeString,
@@ -1084,6 +1084,15 @@ func resourceEndpointConfigurations() *schema.Resource {
ForceNew: true,
Description: "A public URL where the SP's metadata is hosted. If an IdP supports dynamic configuration, this is the URL it can use to retrieve the SP metadata.",
},
+ "nameid_format": {
+ Type: schema.TypeString,
+ Required: false,
+ Computed: false,
+ Optional: true,
+ Sensitive: false,
+ ForceNew: false,
+ Description: "Defines the name identifier format the SP expects the IdP to use in its assertions to identify subjects. If unspecified, a default value of `urn:oasis:names:tc:SAML:2.0:nameid-format:persistent` will be used. A subset of the allowed values enumerated by the SAML specification are supported.",
+ },
},
},
},
@@ -1164,7 +1173,7 @@ func resourceEndpointConfigurations() *schema.Resource {
Optional: true,
Sensitive: false,
ForceNew: false,
- Description: "a string indicating which webhook provider will be sending webhooks to this endpoint. Value must be one of the supported providers: `SLACK`, `SNS`, `STRIPE`, `GITHUB`, `TWILIO`, `SHOPIFY`, `GITLAB`, `INTERCOM`.",
+ Description: "a string indicating which webhook provider will be sending webhooks to this endpoint. Value must be one of the supported providers: `SLACK`, `SNS`, `STRIPE`, `GITHUB`, `TWILIO`, `SHOPIFY`, `GITLAB`, `INTERCOM`, `SENDGRID`, `XERO`, `PAGERDUTY`.",
DiffSuppressFunc: transform.DiffSuppressCase,
},
"secret": {
diff --git a/ngrok/resource_endpoint_configuration_test.go b/ngrok/resource_endpoint_configuration_test.go
index f71062f..8ee00d6 100644
--- a/ngrok/resource_endpoint_configuration_test.go
+++ b/ngrok/resource_endpoint_configuration_test.go
@@ -41,7 +41,7 @@ func init() {
}
conn := client.(*restapi.Client)
- list, _, err := conn.EndpointConfigurationsList(ctx, nil)
+ list, _, err := conn.EndpointConfigurationsList(ctx, &restapi.Paging{})
if err != nil {
return fmt.Errorf("Error getting list of items: %s", err)
}
diff --git a/ngrok/resource_event_destination.go b/ngrok/resource_event_destination.go
index 29865df..8317ba7 100644
--- a/ngrok/resource_event_destination.go
+++ b/ngrok/resource_event_destination.go
@@ -97,9 +97,9 @@ func resourceEventDestinations() *schema.Resource {
Schema: map[string]*schema.Schema{
"role_arn": {
Type: schema.TypeString,
- Required: false,
+ Required: true,
Computed: false,
- Optional: true,
+ Optional: false,
Sensitive: false,
ForceNew: false,
Description: "An ARN that specifies the role that ngrok should use to deliver to the configured target.",
@@ -119,18 +119,18 @@ func resourceEventDestinations() *schema.Resource {
Schema: map[string]*schema.Schema{
"aws_access_key_id": {
Type: schema.TypeString,
- Required: false,
+ Required: true,
Computed: false,
- Optional: true,
+ Optional: false,
Sensitive: false,
ForceNew: false,
Description: "The ID portion of an AWS access key.",
},
"aws_secret_access_key": {
Type: schema.TypeString,
- Required: false,
+ Required: true,
Computed: false,
- Optional: true,
+ Optional: false,
Sensitive: false,
ForceNew: false,
Description: "The secret portion of an AWS access key.",
@@ -185,9 +185,9 @@ func resourceEventDestinations() *schema.Resource {
Schema: map[string]*schema.Schema{
"role_arn": {
Type: schema.TypeString,
- Required: false,
+ Required: true,
Computed: false,
- Optional: true,
+ Optional: false,
Sensitive: false,
ForceNew: false,
Description: "An ARN that specifies the role that ngrok should use to deliver to the configured target.",
@@ -207,18 +207,18 @@ func resourceEventDestinations() *schema.Resource {
Schema: map[string]*schema.Schema{
"aws_access_key_id": {
Type: schema.TypeString,
- Required: false,
+ Required: true,
Computed: false,
- Optional: true,
+ Optional: false,
Sensitive: false,
ForceNew: false,
Description: "The ID portion of an AWS access key.",
},
"aws_secret_access_key": {
Type: schema.TypeString,
- Required: false,
+ Required: true,
Computed: false,
- Optional: true,
+ Optional: false,
Sensitive: false,
ForceNew: false,
Description: "The secret portion of an AWS access key.",
@@ -273,9 +273,9 @@ func resourceEventDestinations() *schema.Resource {
Schema: map[string]*schema.Schema{
"role_arn": {
Type: schema.TypeString,
- Required: false,
+ Required: true,
Computed: false,
- Optional: true,
+ Optional: false,
Sensitive: false,
ForceNew: false,
Description: "An ARN that specifies the role that ngrok should use to deliver to the configured target.",
@@ -295,18 +295,18 @@ func resourceEventDestinations() *schema.Resource {
Schema: map[string]*schema.Schema{
"aws_access_key_id": {
Type: schema.TypeString,
- Required: false,
+ Required: true,
Computed: false,
- Optional: true,
+ Optional: false,
Sensitive: false,
ForceNew: false,
Description: "The ID portion of an AWS access key.",
},
"aws_secret_access_key": {
Type: schema.TypeString,
- Required: false,
+ Required: true,
Computed: false,
- Optional: true,
+ Optional: false,
Sensitive: false,
ForceNew: false,
Description: "The secret portion of an AWS access key.",
diff --git a/ngrok/resource_event_destination_test.go b/ngrok/resource_event_destination_test.go
index f9eb14f..32cfa24 100644
--- a/ngrok/resource_event_destination_test.go
+++ b/ngrok/resource_event_destination_test.go
@@ -46,7 +46,7 @@ func init() {
}
conn := client.(*restapi.Client)
- list, _, err := conn.EventDestinationsList(ctx, nil)
+ list, _, err := conn.EventDestinationsList(ctx, &restapi.Paging{})
if err != nil {
return fmt.Errorf("Error getting list of items: %s", err)
}
diff --git a/ngrok/resource_event_subscription.go b/ngrok/resource_event_subscription.go
index 878994f..35a9241 100644
--- a/ngrok/resource_event_subscription.go
+++ b/ngrok/resource_event_subscription.go
@@ -35,7 +35,7 @@ func resourceEventSubscriptions() *schema.Resource {
Optional: true,
Sensitive: false,
ForceNew: false,
- Description: "A list of Event Destination IDs which should be used for this Event Stream. Event Streams are required to have at least one Event Destination.",
+ Description: "A list of Event Destination IDs which should be used for this Event Subscription.",
Elem: &schema.Schema{Type: schema.TypeString},
},
"id": {
diff --git a/ngrok/resource_event_subscription_test.go b/ngrok/resource_event_subscription_test.go
index 4368c45..fed5f53 100644
--- a/ngrok/resource_event_subscription_test.go
+++ b/ngrok/resource_event_subscription_test.go
@@ -15,15 +15,15 @@ import (
var (
resourceEventSubscriptions_createConfig = `resource "ngrok_event_subscription" "example" {
- description = "low sampling, basic HTTP logs"
- destination_ids = [ "ed_1ro7aylyqQ1LLMWNWrOISvlfveQ" ]
+ description = "ip policy creations"
+ destination_ids = [ "ed_25auH2H0JNlDGXUH01Z3sZdgFFM" ]
metadata = "{\"environment\": \"staging\"}"
sources [ {
- type = "http_request_complete"
+ type = "ip_policy_created.v0"
} ]
}`
resourceEventSubscriptions_updateConfig = `resource "ngrok_event_subscription" "example" {
- description = "medium sampling, basic HTTP logs"
+ description = "IP Policy Creations"
}`
)
@@ -38,7 +38,7 @@ func init() {
}
conn := client.(*restapi.Client)
- list, _, err := conn.EventSubscriptionsList(ctx, nil)
+ list, _, err := conn.EventSubscriptionsList(ctx, &restapi.Paging{})
if err != nil {
return fmt.Errorf("Error getting list of items: %s", err)
}
diff --git a/ngrok/resource_ip_policy.go b/ngrok/resource_ip_policy.go
index 41f2566..795d41a 100644
--- a/ngrok/resource_ip_policy.go
+++ b/ngrok/resource_ip_policy.go
@@ -21,12 +21,12 @@ func resourceIPPolicies() *schema.Resource {
Schema: map[string]*schema.Schema{
"action": {
Type: schema.TypeString,
- Required: true,
+ Required: false,
Computed: false,
- Optional: false,
+ Optional: true,
Sensitive: false,
ForceNew: true,
- Description: "the IP policy action. Supported values are `allow` or `deny`",
+ Description: "this field is deprecated. Please leave it empty and use the ip policy rule object's \"action\" field instead. It is temporarily retained for backwards compatibility reasons.",
},
"description": {
Type: schema.TypeString,
@@ -70,7 +70,7 @@ func resourceIPPoliciesCreate(d *schema.ResourceData, m interface{}) (err error)
arg.Metadata = *expandString(v)
}
if v, ok := d.GetOk("action"); ok {
- arg.Action = *expandString(v)
+ arg.Action = expandString(v)
}
res, _, err := b.client.IPPoliciesCreate(context.Background(), &arg)
diff --git a/ngrok/resource_ip_policy_rule.go b/ngrok/resource_ip_policy_rule.go
index 30f9229..7989aff 100644
--- a/ngrok/resource_ip_policy_rule.go
+++ b/ngrok/resource_ip_policy_rule.go
@@ -19,6 +19,15 @@ func resourceIPPolicyRules() *schema.Resource {
Delete: resourceIPPolicyRulesDelete,
Description: "IP Policy Rules are the IPv4 or IPv6 CIDRs entries that\n make up an IP Policy.",
Schema: map[string]*schema.Schema{
+ "action": {
+ Type: schema.TypeString,
+ Required: false,
+ Computed: false,
+ Optional: true,
+ Sensitive: false,
+ ForceNew: true,
+ Description: "the action to apply to the policy rule, either `allow` or `deny`",
+ },
"cidr": {
Type: schema.TypeString,
Required: true,
@@ -84,6 +93,9 @@ func resourceIPPolicyRulesCreate(d *schema.ResourceData, m interface{}) (err err
if v, ok := d.GetOk("ip_policy_id"); ok {
arg.IPPolicyID = *expandString(v)
}
+ if v, ok := d.GetOk("action"); ok {
+ arg.Action = expandString(v)
+ }
res, _, err := b.client.IPPolicyRulesCreate(context.Background(), &arg)
if err != nil {
@@ -112,6 +124,7 @@ func resourceIPPolicyRulesGetDecode(d *schema.ResourceData, res *restapi.IPPolic
log.Printf("[ERROR] IPPolicyRulesGet: %s", err)
return err
default:
+ d.Set("action", res.Action)
d.Set("cidr", res.CIDR)
d.Set("description", res.Description)
d.Set("id", res.ID)
diff --git a/ngrok/resource_ip_policy_rule_test.go b/ngrok/resource_ip_policy_rule_test.go
index 389b6b3..21f0a14 100644
--- a/ngrok/resource_ip_policy_rule_test.go
+++ b/ngrok/resource_ip_policy_rule_test.go
@@ -17,7 +17,7 @@ var (
resourceIPPolicyRules_createConfig = `resource "ngrok_ip_policy_rule" "example" {
cidr = "212.3.14.0/24"
description = "nyc office"
- ip_policy_id = "ipp_1rV56VrAxesFteoj4XZxaaYyvXo"
+ ip_policy_id = "ipp_25auGv9R7vPmi6NKs5Cxcyzc2Cm"
}`
resourceIPPolicyRules_updateConfig = `resource "ngrok_ip_policy_rule" "example" {
cidr = "212.3.15.0/24"
@@ -35,7 +35,7 @@ func init() {
}
conn := client.(*restapi.Client)
- list, _, err := conn.IPPolicyRulesList(ctx, nil)
+ list, _, err := conn.IPPolicyRulesList(ctx, &restapi.Paging{})
if err != nil {
return fmt.Errorf("Error getting list of items: %s", err)
}
diff --git a/ngrok/resource_ip_policy_test.go b/ngrok/resource_ip_policy_test.go
index 37a0768..a56c112 100644
--- a/ngrok/resource_ip_policy_test.go
+++ b/ngrok/resource_ip_policy_test.go
@@ -34,7 +34,7 @@ func init() {
}
conn := client.(*restapi.Client)
- list, _, err := conn.IPPoliciesList(ctx, nil)
+ list, _, err := conn.IPPoliciesList(ctx, &restapi.Paging{})
if err != nil {
return fmt.Errorf("Error getting list of items: %s", err)
}
diff --git a/ngrok/resource_ip_restriction.go b/ngrok/resource_ip_restriction.go
index 27e2bd5..48a7cf8 100644
--- a/ngrok/resource_ip_restriction.go
+++ b/ngrok/resource_ip_restriction.go
@@ -17,7 +17,7 @@ func resourceIPRestrictions() *schema.Resource {
Read: resourceIPRestrictionsGet,
Update: resourceIPRestrictionsUpdate,
Delete: resourceIPRestrictionsDelete,
- Description: "An IP restriction is a restriction placed on the CIDRs that are allowed to\n initate traffic to a specific aspect of your ngrok account. An IP\n restriction has a type which defines the ingress it applies to. IP\n restrictions can be used to enforce the source IPs that can make API\n requests, log in to the dashboard, start ngrok agents, and connect to your\n public-facing endpoints.",
+ Description: "An IP restriction is a restriction placed on the CIDRs that are allowed to\n initiate traffic to a specific aspect of your ngrok account. An IP\n restriction has a type which defines the ingress it applies to. IP\n restrictions can be used to enforce the source IPs that can make API\n requests, log in to the dashboard, start ngrok agents, and connect to your\n public-facing endpoints.",
Schema: map[string]*schema.Schema{
"description": {
Type: schema.TypeString,
diff --git a/ngrok/resource_ip_restriction_test.go b/ngrok/resource_ip_restriction_test.go
index 07923f3..34ec260 100644
--- a/ngrok/resource_ip_restriction_test.go
+++ b/ngrok/resource_ip_restriction_test.go
@@ -15,11 +15,11 @@ import (
var (
resourceIPRestrictions_createConfig = `resource "ngrok_ip_restriction" "example" {
- ip_policy_ids = [ "ipp_1rV5CMI1Aw8MiqWtjlQCyDDEWnQ" ]
+ ip_policy_ids = [ "ipp_25auGwa4eEWUeCOBfCZkwtwqFey" ]
type = "dashboard"
}`
resourceIPRestrictions_updateConfig = `resource "ngrok_ip_restriction" "example" {
- ip_policy_ids = [ "ipp_1rV5CMI1Aw8MiqWtjlQCyDDEWnQ", "ipp_1rV5COeFhKWjXHrEfCGNBXCA4ka" ]
+ ip_policy_ids = [ "ipp_25auGwa4eEWUeCOBfCZkwtwqFey", "ipp_25auH2BpgoNpNLfKedwIJjEqwrm" ]
}`
)
@@ -34,7 +34,7 @@ func init() {
}
conn := client.(*restapi.Client)
- list, _, err := conn.IPRestrictionsList(ctx, nil)
+ list, _, err := conn.IPRestrictionsList(ctx, &restapi.Paging{})
if err != nil {
return fmt.Errorf("Error getting list of items: %s", err)
}
diff --git a/ngrok/resource_ip_whitelist_entry.go b/ngrok/resource_ip_whitelist_entry.go
deleted file mode 100644
index 64a5b3b..0000000
--- a/ngrok/resource_ip_whitelist_entry.go
+++ /dev/null
@@ -1,143 +0,0 @@
-// Code generated by apic. DO NOT EDIT.
-
-package ngrok
-
-import (
- "context"
- "log"
- "net/http"
-
- "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
- restapi "github.com/ngrok/terraform-provider-ngrok/restapi"
-)
-
-func resourceIPWhitelist() *schema.Resource {
- return &schema.Resource{
- Create: resourceIPWhitelistCreate,
- Read: resourceIPWhitelistGet,
- Update: resourceIPWhitelistUpdate,
- Delete: resourceIPWhitelistDelete,
- Description: "The IP Whitelist is deprecated and will be removed. Use an IP Restriction\n with an `endpoints` type instead.",
- Schema: map[string]*schema.Schema{
- "description": {
- Type: schema.TypeString,
- Required: false,
- Computed: false,
- Optional: true,
- Sensitive: false,
- ForceNew: false,
- Description: "human-readable description of the source IPs for this IP whitelist entry. optional, max 255 bytes.",
- },
- "id": {
- Type: schema.TypeString,
- Required: false,
- Computed: true,
- Optional: true,
- Sensitive: false,
- ForceNew: false,
- Description: "unique identifier for this IP whitelist entry",
- },
- "ip_net": {
- Type: schema.TypeString,
- Required: false,
- Computed: false,
- Optional: true,
- Sensitive: false,
- ForceNew: true,
- Description: "an IP address or IP network range in CIDR notation (e.g. 10.1.1.1 or 10.1.0.0/16) of addresses that will be whitelisted to communicate with your tunnel endpoints",
- },
- "metadata": {
- Type: schema.TypeString,
- Required: false,
- Computed: false,
- Optional: true,
- Sensitive: false,
- ForceNew: false,
- Description: "arbitrary user-defined machine-readable data of this IP whitelist entry. optional, max 4096 bytes.",
- },
- },
- }
-}
-
-func resourceIPWhitelistCreate(d *schema.ResourceData, m interface{}) (err error) {
- b := m.(*base)
-
- var arg restapi.IPWhitelistEntryCreate
- if v, ok := d.GetOk("description"); ok {
- arg.Description = *expandString(v)
- }
- if v, ok := d.GetOk("metadata"); ok {
- arg.Metadata = *expandString(v)
- }
- if v, ok := d.GetOk("ip_net"); ok {
- arg.IPNet = *expandString(v)
- }
-
- res, _, err := b.client.IPWhitelistCreate(context.Background(), &arg)
- if err != nil {
- log.Printf("[ERROR] IPWhitelistCreate: %s", err)
- return err
- }
- d.SetId(res.ID)
-
- return resourceIPWhitelistGet(d, m)
-}
-
-func resourceIPWhitelistGet(d *schema.ResourceData, m interface{}) (err error) {
- b := m.(*base)
-
- res, resp, err := b.client.IPWhitelistGet(context.Background(), &restapi.Item{
- ID: d.Id(),
- })
- return resourceIPWhitelistGetDecode(d, res, resp, err)
-}
-
-func resourceIPWhitelistGetDecode(d *schema.ResourceData, res *restapi.IPWhitelistEntry, resp *http.Response, err error) error {
- switch {
- case resp != nil && resp.StatusCode == 404:
- d.SetId("")
- case err != nil:
- log.Printf("[ERROR] IPWhitelistGet: %s", err)
- return err
- default:
- d.Set("description", res.Description)
- d.Set("id", res.ID)
- d.Set("ip_net", res.IPNet)
- d.Set("metadata", res.Metadata)
- }
- return nil
-}
-
-func resourceIPWhitelistUpdate(d *schema.ResourceData, m interface{}) (err error) {
- b := m.(*base)
-
- var arg restapi.IPWhitelistEntryUpdate
- arg.ID = d.Id()
- if v, ok := d.GetOk("id"); ok {
- arg.ID = *expandString(v)
- }
- if v, ok := d.GetOk("description"); ok {
- arg.Description = expandString(v)
- }
- if v, ok := d.GetOk("metadata"); ok {
- arg.Metadata = expandString(v)
- }
-
- res, _, err := b.client.IPWhitelistUpdate(context.Background(), &arg)
- if err != nil {
- log.Printf("[ERROR] IPWhitelistUpdate: %s", err)
- return err
- }
- d.SetId(res.ID)
-
- return resourceIPWhitelistGet(d, m)
-}
-
-func resourceIPWhitelistDelete(d *schema.ResourceData, m interface{}) (err error) {
- b := m.(*base)
- _, _, err = b.client.IPWhitelistDelete(context.Background(), &restapi.Item{ID: d.Id()})
- if err != nil {
- log.Printf("[ERROR] IPWhitelistDelete: %s", err)
- }
- return err
-}
diff --git a/ngrok/resource_reserved_addr.go b/ngrok/resource_reserved_addr.go
index 1632b1a..c9fd911 100644
--- a/ngrok/resource_reserved_addr.go
+++ b/ngrok/resource_reserved_addr.go
@@ -92,7 +92,7 @@ func resourceReservedAddrsCreate(d *schema.ResourceData, m interface{}) (err err
arg.Region = *expandString(v)
}
if v, ok := d.GetOk("endpoint_configuration_id"); ok {
- arg.EndpointConfigurationID = *expandString(v)
+ arg.EndpointConfigurationID = expandString(v)
}
res, _, err := b.client.ReservedAddrsCreate(context.Background(), &arg)
@@ -124,7 +124,9 @@ func resourceReservedAddrsGetDecode(d *schema.ResourceData, res *restapi.Reserve
default:
d.Set("addr", res.Addr)
d.Set("description", res.Description)
- d.Set("endpoint_configuration_id", res.EndpointConfiguration.ID)
+ if res.EndpointConfiguration != nil {
+ d.Set("endpoint_configuration_id", res.EndpointConfiguration.ID)
+ }
d.Set("id", res.ID)
d.Set("metadata", res.Metadata)
d.Set("region", res.Region)
diff --git a/ngrok/resource_reserved_addr_test.go b/ngrok/resource_reserved_addr_test.go
index 0501d34..6e9b5a7 100644
--- a/ngrok/resource_reserved_addr_test.go
+++ b/ngrok/resource_reserved_addr_test.go
@@ -19,7 +19,7 @@ var (
region = "us"
}`
resourceReservedAddrs_updateConfig = `resource "ngrok_reserved_addr" "example" {
- endpoint_configuration_id = "ec_1rV52nyVMhAzUojsbhyljDvazMp"
+ endpoint_configuration_id = "ec_25auGH5WozRiPuURsa21MQgTm6h"
metadata = "{\"proto\": \"ssh\"}"
}`
)
@@ -35,7 +35,7 @@ func init() {
}
conn := client.(*restapi.Client)
- list, _, err := conn.ReservedAddrsList(ctx, nil)
+ list, _, err := conn.ReservedAddrsList(ctx, &restapi.Paging{})
if err != nil {
return fmt.Errorf("Error getting list of items: %s", err)
}
diff --git a/ngrok/resource_reserved_domain.go b/ngrok/resource_reserved_domain.go
index 2a6d251..55b347f 100644
--- a/ngrok/resource_reserved_domain.go
+++ b/ngrok/resource_reserved_domain.go
@@ -20,6 +20,15 @@ func resourceReservedDomains() *schema.Resource {
Delete: resourceReservedDomainsDelete,
Description: "Reserved Domains are hostnames that you can listen for traffic on. Domains\n can be used to listen for http, https or tls traffic. You may use a domain\n that you own by creating a CNAME record specified in the returned resource.\n This CNAME record points traffic for that domain to ngrok's edge servers.",
Schema: map[string]*schema.Schema{
+ "acme_challenge_cname_target": {
+ Type: schema.TypeString,
+ Required: false,
+ Computed: true,
+ Optional: true,
+ Sensitive: false,
+ ForceNew: true,
+ Description: "DNS CNAME target for the host _acme-challenge.example.com, where example.com is your reserved domain name. This is required to issue certificates for wildcard, non-ngrok reserved domains. Must be null for non-wildcard domains and ngrok subdomains.",
+ },
"certificate_id": {
Type: schema.TypeString,
Required: false,
@@ -203,6 +212,7 @@ func resourceReservedDomainsGetDecode(d *schema.ResourceData, res *restapi.Reser
log.Printf("[ERROR] ReservedDomainsGet: %s", err)
return err
default:
+ d.Set("acme_challenge_cname_target", res.ACMEChallengeCNAMETarget)
if res.Certificate != nil {
d.Set("certificate_id", res.Certificate.ID)
}
diff --git a/ngrok/resource_reserved_domain_test.go b/ngrok/resource_reserved_domain_test.go
index c7cc41d..3197396 100644
--- a/ngrok/resource_reserved_domain_test.go
+++ b/ngrok/resource_reserved_domain_test.go
@@ -15,7 +15,7 @@ import (
var (
resourceReservedDomains_createConfig = `resource "ngrok_reserved_domain" "example" {
- certificate_id = "cert_1rV51OQetZPK9V6vTWUVy3Onjir"
+ certificate_id = "cert_25auGELSEngiae3wzmLLesiZn8h"
name = "myapp.mydomain.com"
region = "us"
}`
@@ -24,8 +24,8 @@ var (
authority = "letsencrypt"
}
description = "point-of-sale new york #302"
- http_endpoint_configuration_id = "ec_1rV51lrJYw0LLC6pbNFmjW1KJLE"
- https_endpoint_configuration_id = "ec_1rV51lUKrRn6BLvLOWq2Ug0nINj"
+ http_endpoint_configuration_id = "ec_25auGIsAiev7qhPq90LDAKui4rr"
+ https_endpoint_configuration_id = "ec_25auGJLgKOstJTQXqphwKPVY6bE"
metadata = "{env: \"staging\", \"connector_id\":\"64698fcc-5f5c-4b63-910e-8669d04bd943\"}"
}`
)
@@ -41,7 +41,7 @@ func init() {
}
conn := client.(*restapi.Client)
- list, _, err := conn.ReservedDomainsList(ctx, nil)
+ list, _, err := conn.ReservedDomainsList(ctx, &restapi.Paging{})
if err != nil {
return fmt.Errorf("Error getting list of items: %s", err)
}
diff --git a/ngrok/resource_ssh_certificate_authority_test.go b/ngrok/resource_ssh_certificate_authority_test.go
index af73141..3338527 100644
--- a/ngrok/resource_ssh_certificate_authority_test.go
+++ b/ngrok/resource_ssh_certificate_authority_test.go
@@ -34,7 +34,7 @@ func init() {
}
conn := client.(*restapi.Client)
- list, _, err := conn.SSHCertificateAuthoritiesList(ctx, nil)
+ list, _, err := conn.SSHCertificateAuthoritiesList(ctx, &restapi.Paging{})
if err != nil {
return fmt.Errorf("Error getting list of items: %s", err)
}
diff --git a/ngrok/resource_ssh_credential_test.go b/ngrok/resource_ssh_credential_test.go
index 0d8e8c1..4c303f7 100644
--- a/ngrok/resource_ssh_credential_test.go
+++ b/ngrok/resource_ssh_credential_test.go
@@ -36,7 +36,7 @@ func init() {
}
conn := client.(*restapi.Client)
- list, _, err := conn.SSHCredentialsList(ctx, nil)
+ list, _, err := conn.SSHCredentialsList(ctx, &restapi.Paging{})
if err != nil {
return fmt.Errorf("Error getting list of items: %s", err)
}
diff --git a/ngrok/resource_ssh_host_certificate_test.go b/ngrok/resource_ssh_host_certificate_test.go
index a4edf9f..9187432 100644
--- a/ngrok/resource_ssh_host_certificate_test.go
+++ b/ngrok/resource_ssh_host_certificate_test.go
@@ -18,8 +18,8 @@ var (
description = "personal server"
principals = [ "inconshreveable.com", "10.2.42.9" ]
public_key = "ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBI3oSgxrOEJ+tIJ/n6VYtxQIFvynqlOHpfOAJ4x4OfmMYDkbf8dr6RAuUSf+ZC2HMCujta7EjZ9t+6v08Ue+Cgk= inconshreveable.com"
- ssh_certificate_authority_id = "sshca_1rV5GiTaiBQg8AtJiyiVeNKzYiR"
- valid_until = "2021-07-20T23:38:42Z"
+ ssh_certificate_authority_id = "sshca_25auH7sr0BYJFNyfJUwXPzyyFAz"
+ valid_until = "2022-05-26T08:23:47Z"
}`
resourceSSHHostCertificates_updateConfig = `resource "ngrok_ssh_host_certificate" "example" {
metadata = "{\"region\": \"us-west-2\"}"
@@ -37,7 +37,7 @@ func init() {
}
conn := client.(*restapi.Client)
- list, _, err := conn.SSHHostCertificatesList(ctx, nil)
+ list, _, err := conn.SSHHostCertificatesList(ctx, &restapi.Paging{})
if err != nil {
return fmt.Errorf("Error getting list of items: %s", err)
}
diff --git a/ngrok/resource_ssh_user_certificate_test.go b/ngrok/resource_ssh_user_certificate_test.go
index 173bbd2..6fc6162 100644
--- a/ngrok/resource_ssh_user_certificate_test.go
+++ b/ngrok/resource_ssh_user_certificate_test.go
@@ -18,8 +18,8 @@ var (
description = "temporary access to staging machine"
principals = [ "ec2-user", "root" ]
public_key = "ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBK58lFzmWlDimDtBz78wVT4oauA8PjY0CiXTCEIsBNC6UwOJvZ0jdSaYNhDaa7dRV84DfBb/gKzqlXC7cVMZjl0= alan@work-laptop"
- ssh_certificate_authority_id = "sshca_1rV5G33U0TV5AFqiEfKcjOi8W4t"
- valid_until = "2021-07-20T23:38:37Z"
+ ssh_certificate_authority_id = "sshca_25auH5JtiUPW9eMiXYzujvcpkGW"
+ valid_until = "2022-05-26T08:23:47Z"
}`
resourceSSHUserCertificates_updateConfig = `resource "ngrok_ssh_user_certificate" "example" {
description = "temporary access to staging machine for alan"
@@ -38,7 +38,7 @@ func init() {
}
conn := client.(*restapi.Client)
- list, _, err := conn.SSHUserCertificatesList(ctx, nil)
+ list, _, err := conn.SSHUserCertificatesList(ctx, &restapi.Paging{})
if err != nil {
return fmt.Errorf("Error getting list of items: %s", err)
}
diff --git a/ngrok/resource_tls_certificate_test.go b/ngrok/resource_tls_certificate_test.go
index e26036f..4708554 100644
--- a/ngrok/resource_tls_certificate_test.go
+++ b/ngrok/resource_tls_certificate_test.go
@@ -34,7 +34,7 @@ func init() {
}
conn := client.(*restapi.Client)
- list, _, err := conn.TLSCertificatesList(ctx, nil)
+ list, _, err := conn.TLSCertificatesList(ctx, &restapi.Paging{})
if err != nil {
return fmt.Errorf("Error getting list of items: %s", err)
}
diff --git a/restapi/debug.go b/restapi/debug.go
index 2c483a8..09daa10 100644
--- a/restapi/debug.go
+++ b/restapi/debug.go
@@ -93,6 +93,7 @@ func (d Debug) makeRequest(ctx context.Context, body io.Reader) (context.Context
var i interface{}
if err := decoder.Decode(&i); err == nil {
enc := json.NewEncoder(d.Stderr)
+ enc.SetEscapeHTML(false)
enc.SetIndent("", " ")
if err := enc.Encode(i); err != nil {
panic(err)
@@ -133,6 +134,7 @@ func (d Debug) printResponse(r *http.Response) {
var i interface{}
if err := json.Unmarshal(body, &i); err == nil {
enc := json.NewEncoder(d.Stdout)
+ enc.SetEscapeHTML(false)
enc.SetIndent("", " ")
if err := enc.Encode(i); err != nil {
panic(err)
diff --git a/restapi/methods.go b/restapi/methods.go
index 2fb0047..7c4b396 100644
--- a/restapi/methods.go
+++ b/restapi/methods.go
@@ -8,6 +8,7 @@ import (
"errors"
"io"
"net/http"
+ "net/url"
"text/template"
)
@@ -18,10 +19,9 @@ func (c *Client) AbuseReportsCreate(ctx context.Context, arg *AbuseReportCreate)
if err := template.Must(template.New("").Parse("/abuse_reports")).Execute(&path, arg); err != nil {
panic(err)
}
+ uri := path.String()
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
-
- resp, err := c.Post(ctx, path.String(), arg, &res)
+ resp, err := c.Post(ctx, uri, arg, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -35,11 +35,106 @@ func (c *Client) AbuseReportsGet(ctx context.Context, arg *Item) (*AbuseReport,
if err := template.Must(template.New("").Parse("/abuse_reports/{{ .ID }}")).Execute(&path, arg); err != nil {
panic(err)
}
+ uri := path.String()
+ arg.ID = ""
+
+ resp, err := c.Get(ctx, uri, &res)
+ if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
+ err = nil
+ }
+ return &res, resp, err
+}
+
+// Create a new Agent Ingress. The ngrok agent can be configured to connect to ngrok via the new set of addresses on the returned Agent Ingress.
+func (c *Client) AgentIngressesCreate(ctx context.Context, arg *AgentIngressCreate) (*AgentIngress, *http.Response, error) {
+ var res AgentIngress
+ var path bytes.Buffer
+ if err := template.Must(template.New("").Parse("/agent_ingresses")).Execute(&path, arg); err != nil {
+ panic(err)
+ }
+ uri := path.String()
+
+ resp, err := c.Post(ctx, uri, arg, &res)
+ if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
+ err = nil
+ }
+ return &res, resp, err
+}
+
+// Delete an Agent Ingress by ID
+func (c *Client) AgentIngressesDelete(ctx context.Context, arg *Item) (*Empty, *http.Response, error) {
+ var res Empty
+ var path bytes.Buffer
+ if err := template.Must(template.New("").Parse("/agent_ingresses/{{ .ID }}")).Execute(&path, arg); err != nil {
+ panic(err)
+ }
+ uri := path.String()
+ arg.ID = ""
+
+ resp, err := c.Delete(ctx, uri, &res)
+ if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
+ err = nil
+ }
+ return &res, resp, err
+}
+
+// Get the details of an Agent Ingress by ID.
+func (c *Client) AgentIngressesGet(ctx context.Context, arg *Item) (*AgentIngress, *http.Response, error) {
+ var res AgentIngress
+ var path bytes.Buffer
+ if err := template.Must(template.New("").Parse("/agent_ingresses/{{ .ID }}")).Execute(&path, arg); err != nil {
+ panic(err)
+ }
+ uri := path.String()
+ arg.ID = ""
+
+ resp, err := c.Get(ctx, uri, &res)
+ if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
+ err = nil
+ }
+ return &res, resp, err
+}
+
+// List all Agent Ingresses owned by this account
+func (c *Client) AgentIngressesList(ctx context.Context, arg *Paging) (*AgentIngressList, *http.Response, error) {
+ var res AgentIngressList
+ var path bytes.Buffer
+ if err := template.Must(template.New("").Parse("/agent_ingresses")).Execute(&path, arg); err != nil {
+ panic(err)
+ }
+ uri := path.String()
+ pathUrl, err := url.Parse(uri)
+ if err != nil {
+ panic(err)
+ }
+ params := url.Values{}
+ if arg.BeforeID != nil {
+ params.Add("before_id", *arg.BeforeID)
+ }
+ if arg.Limit != nil {
+ params.Add("limit", *arg.Limit)
+ }
+ pathUrl.RawQuery = params.Encode()
+ uri = pathUrl.String()
+
+ resp, err := c.Get(ctx, uri, &res)
+ if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
+ err = nil
+ }
+ return &res, resp, err
+}
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+// Update attributes of an Agent Ingress by ID.
+func (c *Client) AgentIngressesUpdate(ctx context.Context, arg *AgentIngressUpdate) (*AgentIngress, *http.Response, error) {
+ var res AgentIngress
+ var path bytes.Buffer
+ if err := template.Must(template.New("").Parse("/agent_ingresses/{{ .ID }}")).Execute(&path, arg); err != nil {
+ panic(err)
+ }
+ uri := path.String()
arg.ID = ""
- resp, err := c.Get(ctx, path.String(), &res)
+ resp, err := c.Patch(ctx, uri, arg, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -53,10 +148,9 @@ func (c *Client) APIKeysCreate(ctx context.Context, arg *APIKeyCreate) (*APIKey,
if err := template.Must(template.New("").Parse("/api_keys")).Execute(&path, arg); err != nil {
panic(err)
}
+ uri := path.String()
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
-
- resp, err := c.Post(ctx, path.String(), arg, &res)
+ resp, err := c.Post(ctx, uri, arg, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -70,11 +164,10 @@ func (c *Client) APIKeysDelete(ctx context.Context, arg *Item) (*Empty, *http.Re
if err := template.Must(template.New("").Parse("/api_keys/{{ .ID }}")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Delete(ctx, path.String(), &res)
+ resp, err := c.Delete(ctx, uri, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -88,11 +181,10 @@ func (c *Client) APIKeysGet(ctx context.Context, arg *Item) (*APIKey, *http.Resp
if err := template.Must(template.New("").Parse("/api_keys/{{ .ID }}")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Get(ctx, path.String(), &res)
+ resp, err := c.Get(ctx, uri, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -106,10 +198,22 @@ func (c *Client) APIKeysList(ctx context.Context, arg *Paging) (*APIKeyList, *ht
if err := template.Must(template.New("").Parse("/api_keys")).Execute(&path, arg); err != nil {
panic(err)
}
+ uri := path.String()
+ pathUrl, err := url.Parse(uri)
+ if err != nil {
+ panic(err)
+ }
+ params := url.Values{}
+ if arg.BeforeID != nil {
+ params.Add("before_id", *arg.BeforeID)
+ }
+ if arg.Limit != nil {
+ params.Add("limit", *arg.Limit)
+ }
+ pathUrl.RawQuery = params.Encode()
+ uri = pathUrl.String()
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
-
- resp, err := c.Get(ctx, path.String(), &res)
+ resp, err := c.Get(ctx, uri, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -123,99 +227,197 @@ func (c *Client) APIKeysUpdate(ctx context.Context, arg *APIKeyUpdate) (*APIKey,
if err := template.Must(template.New("").Parse("/api_keys/{{ .ID }}")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Patch(ctx, path.String(), arg, &res)
+ resp, err := c.Patch(ctx, uri, arg, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
return &res, resp, err
}
-// Create a new Priority backend
-func (c *Client) PriorityBackendsCreate(ctx context.Context, arg *PriorityBackendCreate) (*PriorityBackend, *http.Response, error) {
- var res PriorityBackend
+// Create a new Failover backend
+func (c *Client) FailoverBackendsCreate(ctx context.Context, arg *FailoverBackendCreate) (*FailoverBackend, *http.Response, error) {
+ var res FailoverBackend
var path bytes.Buffer
- if err := template.Must(template.New("").Parse("/backends/priority")).Execute(&path, arg); err != nil {
+ if err := template.Must(template.New("").Parse("/backends/failover")).Execute(&path, arg); err != nil {
panic(err)
}
+ uri := path.String()
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
-
- resp, err := c.Post(ctx, path.String(), arg, &res)
+ resp, err := c.Post(ctx, uri, arg, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
return &res, resp, err
}
-// Delete a Priority backend by ID. TODO what if used?
-func (c *Client) PriorityBackendsDelete(ctx context.Context, arg *Item) (*Empty, *http.Response, error) {
+// Delete a Failover backend by ID. TODO what if used?
+func (c *Client) FailoverBackendsDelete(ctx context.Context, arg *Item) (*Empty, *http.Response, error) {
var res Empty
var path bytes.Buffer
- if err := template.Must(template.New("").Parse("/backends/priority/{{ .ID }}")).Execute(&path, arg); err != nil {
+ if err := template.Must(template.New("").Parse("/backends/failover/{{ .ID }}")).Execute(&path, arg); err != nil {
panic(err)
}
+ uri := path.String()
+ arg.ID = ""
+
+ resp, err := c.Delete(ctx, uri, &res)
+ if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
+ err = nil
+ }
+ return &res, resp, err
+}
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+// Get detailed information about a Failover backend by ID
+func (c *Client) FailoverBackendsGet(ctx context.Context, arg *Item) (*FailoverBackend, *http.Response, error) {
+ var res FailoverBackend
+ var path bytes.Buffer
+ if err := template.Must(template.New("").Parse("/backends/failover/{{ .ID }}")).Execute(&path, arg); err != nil {
+ panic(err)
+ }
+ uri := path.String()
arg.ID = ""
- resp, err := c.Delete(ctx, path.String(), &res)
+ resp, err := c.Get(ctx, uri, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
return &res, resp, err
}
-// Get detailed information about a Priority backend by ID
-func (c *Client) PriorityBackendsGet(ctx context.Context, arg *Item) (*PriorityBackend, *http.Response, error) {
- var res PriorityBackend
+// List all Failover backends on this account
+func (c *Client) FailoverBackendsList(ctx context.Context, arg *Paging) (*FailoverBackendList, *http.Response, error) {
+ var res FailoverBackendList
var path bytes.Buffer
- if err := template.Must(template.New("").Parse("/backends/priority/{{ .ID }}")).Execute(&path, arg); err != nil {
+ if err := template.Must(template.New("").Parse("/backends/failover")).Execute(&path, arg); err != nil {
+ panic(err)
+ }
+ uri := path.String()
+ pathUrl, err := url.Parse(uri)
+ if err != nil {
panic(err)
}
+ params := url.Values{}
+ if arg.BeforeID != nil {
+ params.Add("before_id", *arg.BeforeID)
+ }
+ if arg.Limit != nil {
+ params.Add("limit", *arg.Limit)
+ }
+ pathUrl.RawQuery = params.Encode()
+ uri = pathUrl.String()
+
+ resp, err := c.Get(ctx, uri, &res)
+ if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
+ err = nil
+ }
+ return &res, resp, err
+}
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+// Update Failover backend by ID
+func (c *Client) FailoverBackendsUpdate(ctx context.Context, arg *FailoverBackendUpdate) (*FailoverBackend, *http.Response, error) {
+ var res FailoverBackend
+ var path bytes.Buffer
+ if err := template.Must(template.New("").Parse("/backends/failover/{{ .ID }}")).Execute(&path, arg); err != nil {
+ panic(err)
+ }
+ uri := path.String()
arg.ID = ""
- resp, err := c.Get(ctx, path.String(), &res)
+ resp, err := c.Patch(ctx, uri, arg, &res)
+ if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
+ err = nil
+ }
+ return &res, resp, err
+}
+
+func (c *Client) HTTPResponseBackendsCreate(ctx context.Context, arg *HTTPResponseBackendCreate) (*HTTPResponseBackend, *http.Response, error) {
+ var res HTTPResponseBackend
+ var path bytes.Buffer
+ if err := template.Must(template.New("").Parse("/backends/http_response")).Execute(&path, arg); err != nil {
+ panic(err)
+ }
+ uri := path.String()
+
+ resp, err := c.Post(ctx, uri, arg, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
return &res, resp, err
}
-// List all Priority backends on this account
-func (c *Client) PriorityBackendsList(ctx context.Context, arg *Paging) (*PriorityBackendList, *http.Response, error) {
- var res PriorityBackendList
+func (c *Client) HTTPResponseBackendsDelete(ctx context.Context, arg *Item) (*Empty, *http.Response, error) {
+ var res Empty
var path bytes.Buffer
- if err := template.Must(template.New("").Parse("/backends/priority")).Execute(&path, arg); err != nil {
+ if err := template.Must(template.New("").Parse("/backends/http_response/{{ .ID }}")).Execute(&path, arg); err != nil {
panic(err)
}
+ uri := path.String()
+ arg.ID = ""
+
+ resp, err := c.Delete(ctx, uri, &res)
+ if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
+ err = nil
+ }
+ return &res, resp, err
+}
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+func (c *Client) HTTPResponseBackendsGet(ctx context.Context, arg *Item) (*HTTPResponseBackend, *http.Response, error) {
+ var res HTTPResponseBackend
+ var path bytes.Buffer
+ if err := template.Must(template.New("").Parse("/backends/http_response/{{ .ID }}")).Execute(&path, arg); err != nil {
+ panic(err)
+ }
+ uri := path.String()
+ arg.ID = ""
- resp, err := c.Get(ctx, path.String(), &res)
+ resp, err := c.Get(ctx, uri, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
return &res, resp, err
}
-// Update Priority backend by ID
-func (c *Client) PriorityBackendsUpdate(ctx context.Context, arg *PriorityBackendUpdate) (*PriorityBackend, *http.Response, error) {
- var res PriorityBackend
+func (c *Client) HTTPResponseBackendsList(ctx context.Context, arg *Paging) (*HTTPResponseBackendList, *http.Response, error) {
+ var res HTTPResponseBackendList
var path bytes.Buffer
- if err := template.Must(template.New("").Parse("/backends/priority/{{ .ID }}")).Execute(&path, arg); err != nil {
+ if err := template.Must(template.New("").Parse("/backends/http_response")).Execute(&path, arg); err != nil {
+ panic(err)
+ }
+ uri := path.String()
+ pathUrl, err := url.Parse(uri)
+ if err != nil {
panic(err)
}
+ params := url.Values{}
+ if arg.BeforeID != nil {
+ params.Add("before_id", *arg.BeforeID)
+ }
+ if arg.Limit != nil {
+ params.Add("limit", *arg.Limit)
+ }
+ pathUrl.RawQuery = params.Encode()
+ uri = pathUrl.String()
+
+ resp, err := c.Get(ctx, uri, &res)
+ if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
+ err = nil
+ }
+ return &res, resp, err
+}
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+func (c *Client) HTTPResponseBackendsUpdate(ctx context.Context, arg *HTTPResponseBackendUpdate) (*HTTPResponseBackend, *http.Response, error) {
+ var res HTTPResponseBackend
+ var path bytes.Buffer
+ if err := template.Must(template.New("").Parse("/backends/http_response/{{ .ID }}")).Execute(&path, arg); err != nil {
+ panic(err)
+ }
+ uri := path.String()
arg.ID = ""
- resp, err := c.Patch(ctx, path.String(), arg, &res)
+ resp, err := c.Patch(ctx, uri, arg, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -229,10 +431,9 @@ func (c *Client) StaticBackendsCreate(ctx context.Context, arg *StaticBackendCre
if err := template.Must(template.New("").Parse("/backends/static")).Execute(&path, arg); err != nil {
panic(err)
}
+ uri := path.String()
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
-
- resp, err := c.Post(ctx, path.String(), arg, &res)
+ resp, err := c.Post(ctx, uri, arg, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -246,11 +447,10 @@ func (c *Client) StaticBackendsDelete(ctx context.Context, arg *Item) (*Empty, *
if err := template.Must(template.New("").Parse("/backends/static/{{ .ID }}")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Delete(ctx, path.String(), &res)
+ resp, err := c.Delete(ctx, uri, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -264,11 +464,10 @@ func (c *Client) StaticBackendsGet(ctx context.Context, arg *Item) (*StaticBacke
if err := template.Must(template.New("").Parse("/backends/static/{{ .ID }}")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Get(ctx, path.String(), &res)
+ resp, err := c.Get(ctx, uri, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -282,10 +481,22 @@ func (c *Client) StaticBackendsList(ctx context.Context, arg *Paging) (*StaticBa
if err := template.Must(template.New("").Parse("/backends/static")).Execute(&path, arg); err != nil {
panic(err)
}
+ uri := path.String()
+ pathUrl, err := url.Parse(uri)
+ if err != nil {
+ panic(err)
+ }
+ params := url.Values{}
+ if arg.BeforeID != nil {
+ params.Add("before_id", *arg.BeforeID)
+ }
+ if arg.Limit != nil {
+ params.Add("limit", *arg.Limit)
+ }
+ pathUrl.RawQuery = params.Encode()
+ uri = pathUrl.String()
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
-
- resp, err := c.Get(ctx, path.String(), &res)
+ resp, err := c.Get(ctx, uri, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -299,11 +510,10 @@ func (c *Client) StaticBackendsUpdate(ctx context.Context, arg *StaticBackendUpd
if err := template.Must(template.New("").Parse("/backends/static/{{ .ID }}")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Patch(ctx, path.String(), arg, &res)
+ resp, err := c.Patch(ctx, uri, arg, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -314,13 +524,12 @@ func (c *Client) StaticBackendsUpdate(ctx context.Context, arg *StaticBackendUpd
func (c *Client) TunnelGroupBackendsCreate(ctx context.Context, arg *TunnelGroupBackendCreate) (*TunnelGroupBackend, *http.Response, error) {
var res TunnelGroupBackend
var path bytes.Buffer
- if err := template.Must(template.New("").Parse("/backends/tunnel-group")).Execute(&path, arg); err != nil {
+ if err := template.Must(template.New("").Parse("/backends/tunnel_group")).Execute(&path, arg); err != nil {
panic(err)
}
+ uri := path.String()
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
-
- resp, err := c.Post(ctx, path.String(), arg, &res)
+ resp, err := c.Post(ctx, uri, arg, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -331,14 +540,13 @@ func (c *Client) TunnelGroupBackendsCreate(ctx context.Context, arg *TunnelGroup
func (c *Client) TunnelGroupBackendsDelete(ctx context.Context, arg *Item) (*Empty, *http.Response, error) {
var res Empty
var path bytes.Buffer
- if err := template.Must(template.New("").Parse("/backends/tunnel-group/{{ .ID }}")).Execute(&path, arg); err != nil {
+ if err := template.Must(template.New("").Parse("/backends/tunnel_group/{{ .ID }}")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Delete(ctx, path.String(), &res)
+ resp, err := c.Delete(ctx, uri, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -349,14 +557,13 @@ func (c *Client) TunnelGroupBackendsDelete(ctx context.Context, arg *Item) (*Emp
func (c *Client) TunnelGroupBackendsGet(ctx context.Context, arg *Item) (*TunnelGroupBackend, *http.Response, error) {
var res TunnelGroupBackend
var path bytes.Buffer
- if err := template.Must(template.New("").Parse("/backends/tunnel-group/{{ .ID }}")).Execute(&path, arg); err != nil {
+ if err := template.Must(template.New("").Parse("/backends/tunnel_group/{{ .ID }}")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Get(ctx, path.String(), &res)
+ resp, err := c.Get(ctx, uri, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -367,13 +574,25 @@ func (c *Client) TunnelGroupBackendsGet(ctx context.Context, arg *Item) (*Tunnel
func (c *Client) TunnelGroupBackendsList(ctx context.Context, arg *Paging) (*TunnelGroupBackendList, *http.Response, error) {
var res TunnelGroupBackendList
var path bytes.Buffer
- if err := template.Must(template.New("").Parse("/backends/tunnel-group")).Execute(&path, arg); err != nil {
+ if err := template.Must(template.New("").Parse("/backends/tunnel_group")).Execute(&path, arg); err != nil {
panic(err)
}
+ uri := path.String()
+ pathUrl, err := url.Parse(uri)
+ if err != nil {
+ panic(err)
+ }
+ params := url.Values{}
+ if arg.BeforeID != nil {
+ params.Add("before_id", *arg.BeforeID)
+ }
+ if arg.Limit != nil {
+ params.Add("limit", *arg.Limit)
+ }
+ pathUrl.RawQuery = params.Encode()
+ uri = pathUrl.String()
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
-
- resp, err := c.Get(ctx, path.String(), &res)
+ resp, err := c.Get(ctx, uri, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -384,14 +603,13 @@ func (c *Client) TunnelGroupBackendsList(ctx context.Context, arg *Paging) (*Tun
func (c *Client) TunnelGroupBackendsUpdate(ctx context.Context, arg *TunnelGroupBackendUpdate) (*TunnelGroupBackend, *http.Response, error) {
var res TunnelGroupBackend
var path bytes.Buffer
- if err := template.Must(template.New("").Parse("/backends/tunnel-group/{{ .ID }}")).Execute(&path, arg); err != nil {
+ if err := template.Must(template.New("").Parse("/backends/tunnel_group/{{ .ID }}")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Patch(ctx, path.String(), arg, &res)
+ resp, err := c.Patch(ctx, uri, arg, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -405,10 +623,9 @@ func (c *Client) WeightedBackendsCreate(ctx context.Context, arg *WeightedBacken
if err := template.Must(template.New("").Parse("/backends/weighted")).Execute(&path, arg); err != nil {
panic(err)
}
+ uri := path.String()
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
-
- resp, err := c.Post(ctx, path.String(), arg, &res)
+ resp, err := c.Post(ctx, uri, arg, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -422,11 +639,10 @@ func (c *Client) WeightedBackendsDelete(ctx context.Context, arg *Item) (*Empty,
if err := template.Must(template.New("").Parse("/backends/weighted/{{ .ID }}")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Delete(ctx, path.String(), &res)
+ resp, err := c.Delete(ctx, uri, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -440,11 +656,10 @@ func (c *Client) WeightedBackendsGet(ctx context.Context, arg *Item) (*WeightedB
if err := template.Must(template.New("").Parse("/backends/weighted/{{ .ID }}")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Get(ctx, path.String(), &res)
+ resp, err := c.Get(ctx, uri, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -458,10 +673,22 @@ func (c *Client) WeightedBackendsList(ctx context.Context, arg *Paging) (*Weight
if err := template.Must(template.New("").Parse("/backends/weighted")).Execute(&path, arg); err != nil {
panic(err)
}
+ uri := path.String()
+ pathUrl, err := url.Parse(uri)
+ if err != nil {
+ panic(err)
+ }
+ params := url.Values{}
+ if arg.BeforeID != nil {
+ params.Add("before_id", *arg.BeforeID)
+ }
+ if arg.Limit != nil {
+ params.Add("limit", *arg.Limit)
+ }
+ pathUrl.RawQuery = params.Encode()
+ uri = pathUrl.String()
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
-
- resp, err := c.Get(ctx, path.String(), &res)
+ resp, err := c.Get(ctx, uri, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -475,11 +702,10 @@ func (c *Client) WeightedBackendsUpdate(ctx context.Context, arg *WeightedBacken
if err := template.Must(template.New("").Parse("/backends/weighted/{{ .ID }}")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Patch(ctx, path.String(), arg, &res)
+ resp, err := c.Patch(ctx, uri, arg, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -493,10 +719,9 @@ func (c *Client) CertificateAuthoritiesCreate(ctx context.Context, arg *Certific
if err := template.Must(template.New("").Parse("/certificate_authorities")).Execute(&path, arg); err != nil {
panic(err)
}
+ uri := path.String()
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
-
- resp, err := c.Post(ctx, path.String(), arg, &res)
+ resp, err := c.Post(ctx, uri, arg, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -510,11 +735,10 @@ func (c *Client) CertificateAuthoritiesDelete(ctx context.Context, arg *Item) (*
if err := template.Must(template.New("").Parse("/certificate_authorities/{{ .ID }}")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Delete(ctx, path.String(), &res)
+ resp, err := c.Delete(ctx, uri, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -528,11 +752,10 @@ func (c *Client) CertificateAuthoritiesGet(ctx context.Context, arg *Item) (*Cer
if err := template.Must(template.New("").Parse("/certificate_authorities/{{ .ID }}")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Get(ctx, path.String(), &res)
+ resp, err := c.Get(ctx, uri, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -546,10 +769,22 @@ func (c *Client) CertificateAuthoritiesList(ctx context.Context, arg *Paging) (*
if err := template.Must(template.New("").Parse("/certificate_authorities")).Execute(&path, arg); err != nil {
panic(err)
}
+ uri := path.String()
+ pathUrl, err := url.Parse(uri)
+ if err != nil {
+ panic(err)
+ }
+ params := url.Values{}
+ if arg.BeforeID != nil {
+ params.Add("before_id", *arg.BeforeID)
+ }
+ if arg.Limit != nil {
+ params.Add("limit", *arg.Limit)
+ }
+ pathUrl.RawQuery = params.Encode()
+ uri = pathUrl.String()
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
-
- resp, err := c.Get(ctx, path.String(), &res)
+ resp, err := c.Get(ctx, uri, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -563,11 +798,10 @@ func (c *Client) CertificateAuthoritiesUpdate(ctx context.Context, arg *Certific
if err := template.Must(template.New("").Parse("/certificate_authorities/{{ .ID }}")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Patch(ctx, path.String(), arg, &res)
+ resp, err := c.Patch(ctx, uri, arg, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -581,10 +815,9 @@ func (c *Client) CredentialsCreate(ctx context.Context, arg *CredentialCreate) (
if err := template.Must(template.New("").Parse("/credentials")).Execute(&path, arg); err != nil {
panic(err)
}
+ uri := path.String()
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
-
- resp, err := c.Post(ctx, path.String(), arg, &res)
+ resp, err := c.Post(ctx, uri, arg, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -598,11 +831,10 @@ func (c *Client) CredentialsDelete(ctx context.Context, arg *Item) (*Empty, *htt
if err := template.Must(template.New("").Parse("/credentials/{{ .ID }}")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Delete(ctx, path.String(), &res)
+ resp, err := c.Delete(ctx, uri, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -616,11 +848,10 @@ func (c *Client) CredentialsGet(ctx context.Context, arg *Item) (*Credential, *h
if err := template.Must(template.New("").Parse("/credentials/{{ .ID }}")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Get(ctx, path.String(), &res)
+ resp, err := c.Get(ctx, uri, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -634,10 +865,22 @@ func (c *Client) CredentialsList(ctx context.Context, arg *Paging) (*CredentialL
if err := template.Must(template.New("").Parse("/credentials")).Execute(&path, arg); err != nil {
panic(err)
}
+ uri := path.String()
+ pathUrl, err := url.Parse(uri)
+ if err != nil {
+ panic(err)
+ }
+ params := url.Values{}
+ if arg.BeforeID != nil {
+ params.Add("before_id", *arg.BeforeID)
+ }
+ if arg.Limit != nil {
+ params.Add("limit", *arg.Limit)
+ }
+ pathUrl.RawQuery = params.Encode()
+ uri = pathUrl.String()
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
-
- resp, err := c.Get(ctx, path.String(), &res)
+ resp, err := c.Get(ctx, uri, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -651,11 +894,10 @@ func (c *Client) CredentialsUpdate(ctx context.Context, arg *CredentialUpdate) (
if err := template.Must(template.New("").Parse("/credentials/{{ .ID }}")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Patch(ctx, path.String(), arg, &res)
+ resp, err := c.Patch(ctx, uri, arg, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -669,10 +911,9 @@ func (c *Client) EndpointConfigurationsCreate(ctx context.Context, arg *Endpoint
if err := template.Must(template.New("").Parse("/endpoint_configurations")).Execute(&path, arg); err != nil {
panic(err)
}
+ uri := path.String()
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
-
- resp, err := c.Post(ctx, path.String(), arg, &res)
+ resp, err := c.Post(ctx, uri, arg, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -686,11 +927,10 @@ func (c *Client) EndpointConfigurationsDelete(ctx context.Context, arg *Item) (*
if err := template.Must(template.New("").Parse("/endpoint_configurations/{{ .ID }}")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Delete(ctx, path.String(), &res)
+ resp, err := c.Delete(ctx, uri, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -704,11 +944,10 @@ func (c *Client) EndpointConfigurationsGet(ctx context.Context, arg *Item) (*End
if err := template.Must(template.New("").Parse("/endpoint_configurations/{{ .ID }}")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Get(ctx, path.String(), &res)
+ resp, err := c.Get(ctx, uri, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -722,10 +961,22 @@ func (c *Client) EndpointConfigurationsList(ctx context.Context, arg *Paging) (*
if err := template.Must(template.New("").Parse("/endpoint_configurations")).Execute(&path, arg); err != nil {
panic(err)
}
+ uri := path.String()
+ pathUrl, err := url.Parse(uri)
+ if err != nil {
+ panic(err)
+ }
+ params := url.Values{}
+ if arg.BeforeID != nil {
+ params.Add("before_id", *arg.BeforeID)
+ }
+ if arg.Limit != nil {
+ params.Add("limit", *arg.Limit)
+ }
+ pathUrl.RawQuery = params.Encode()
+ uri = pathUrl.String()
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
-
- resp, err := c.Get(ctx, path.String(), &res)
+ resp, err := c.Get(ctx, uri, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -739,187 +990,1360 @@ func (c *Client) EndpointConfigurationsUpdate(ctx context.Context, arg *Endpoint
if err := template.Must(template.New("").Parse("/endpoint_configurations/{{ .ID }}")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Patch(ctx, path.String(), arg, &res)
+ resp, err := c.Patch(ctx, uri, arg, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
return &res, resp, err
}
-// Create a TCP Edge
-func (c *Client) EdgesTCPCreate(ctx context.Context, arg *TCPEdgeCreate) (*TCPEdge, *http.Response, error) {
- var res TCPEdge
+// Create an HTTPS Edge Route
+func (c *Client) EdgesHTTPSRoutesCreate(ctx context.Context, arg *HTTPSEdgeRouteCreate) (*HTTPSEdgeRoute, *http.Response, error) {
+ var res HTTPSEdgeRoute
var path bytes.Buffer
- if err := template.Must(template.New("").Parse("/tcp_edges")).Execute(&path, arg); err != nil {
+ if err := template.Must(template.New("").Parse("/edges/https/{{ .EdgeID }}/routes")).Execute(&path, arg); err != nil {
panic(err)
}
+ uri := path.String()
+ arg.EdgeID = ""
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
-
- resp, err := c.Post(ctx, path.String(), arg, &res)
+ resp, err := c.Post(ctx, uri, arg, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
return &res, resp, err
}
-// Get a TCP Edge by ID
-func (c *Client) EdgesTCPGet(ctx context.Context, arg *Item) (*TCPEdge, *http.Response, error) {
- var res TCPEdge
+// Get an HTTPS Edge Route by ID
+func (c *Client) EdgesHTTPSRoutesGet(ctx context.Context, arg *EdgeRouteItem) (*HTTPSEdgeRoute, *http.Response, error) {
+ var res HTTPSEdgeRoute
var path bytes.Buffer
- if err := template.Must(template.New("").Parse("/tcp_edges/{{ .ID }}")).Execute(&path, arg); err != nil {
+ if err := template.Must(template.New("").Parse("/edges/https/{{ .EdgeID }}/routes/{{ .ID }}")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
+ arg.EdgeID = ""
arg.ID = ""
- resp, err := c.Get(ctx, path.String(), &res)
+ resp, err := c.Get(ctx, uri, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
return &res, resp, err
}
-// Returns a list of all TCP Edges on this account
-func (c *Client) EdgesTCPList(ctx context.Context, arg *Paging) (*TCPEdgeList, *http.Response, error) {
- var res TCPEdgeList
+// Updates an HTTPS Edge Route by ID. If a module is not specified in the update, it will not be modified. However, each module configuration that is specified will completely replace the existing value. There is no way to delete an existing module via this API, instead use the delete module API.
+func (c *Client) EdgesHTTPSRoutesUpdate(ctx context.Context, arg *HTTPSEdgeRouteUpdate) (*HTTPSEdgeRoute, *http.Response, error) {
+ var res HTTPSEdgeRoute
var path bytes.Buffer
- if err := template.Must(template.New("").Parse("/tcp_edges")).Execute(&path, arg); err != nil {
+ if err := template.Must(template.New("").Parse("/edges/https/{{ .EdgeID }}/routes/{{ .ID }}")).Execute(&path, arg); err != nil {
panic(err)
}
+ uri := path.String()
+ arg.EdgeID = ""
+ arg.ID = ""
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
-
- resp, err := c.Get(ctx, path.String(), &res)
+ resp, err := c.Patch(ctx, uri, arg, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
return &res, resp, err
}
-// Updates a TCP Edge by ID. If a module is not specified in the update, it will not be modified. However, each module configuration that is specified will completely replace the existing value. There is no way to delete an existing module via this API, instead use the delete module API.
-func (c *Client) EdgesTCPUpdate(ctx context.Context, arg *TCPEdgeUpdate) (*TCPEdge, *http.Response, error) {
- var res TCPEdge
+// Delete an HTTPS Edge Route by ID
+func (c *Client) EdgesHTTPSRoutesDelete(ctx context.Context, arg *EdgeRouteItem) (*Empty, *http.Response, error) {
+ var res Empty
var path bytes.Buffer
- if err := template.Must(template.New("").Parse("/tcp_edges/{{ .ID }}")).Execute(&path, arg); err != nil {
+ if err := template.Must(template.New("").Parse("/edges/https/{{ .EdgeID }}/routes/{{ .ID }}")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
+ arg.EdgeID = ""
arg.ID = ""
- resp, err := c.Patch(ctx, path.String(), arg, &res)
+ resp, err := c.Delete(ctx, uri, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
return &res, resp, err
}
-// Delete a TCP Edge by ID
-func (c *Client) EdgesTCPDelete(ctx context.Context, arg *Item) (*Empty, *http.Response, error) {
- var res Empty
+// Create an HTTPS Edge
+func (c *Client) EdgesHTTPSCreate(ctx context.Context, arg *HTTPSEdgeCreate) (*HTTPSEdge, *http.Response, error) {
+ var res HTTPSEdge
var path bytes.Buffer
- if err := template.Must(template.New("").Parse("/tcp_edges/{{ .ID }}")).Execute(&path, arg); err != nil {
+ if err := template.Must(template.New("").Parse("/edges/https")).Execute(&path, arg); err != nil {
panic(err)
}
+ uri := path.String()
+
+ resp, err := c.Post(ctx, uri, arg, &res)
+ if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
+ err = nil
+ }
+ return &res, resp, err
+}
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+// Get an HTTPS Edge by ID
+func (c *Client) EdgesHTTPSGet(ctx context.Context, arg *Item) (*HTTPSEdge, *http.Response, error) {
+ var res HTTPSEdge
+ var path bytes.Buffer
+ if err := template.Must(template.New("").Parse("/edges/https/{{ .ID }}")).Execute(&path, arg); err != nil {
+ panic(err)
+ }
+ uri := path.String()
arg.ID = ""
- resp, err := c.Delete(ctx, path.String(), &res)
+ resp, err := c.Get(ctx, uri, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
return &res, resp, err
}
-// Create a TLS Edge
-func (c *Client) EdgesTLSCreate(ctx context.Context, arg *TLSEdgeCreate) (*TLSEdge, *http.Response, error) {
- var res TLSEdge
+// Returns a list of all HTTPS Edges on this account
+func (c *Client) EdgesHTTPSList(ctx context.Context, arg *Paging) (*HTTPSEdgeList, *http.Response, error) {
+ var res HTTPSEdgeList
var path bytes.Buffer
- if err := template.Must(template.New("").Parse("/tls_edges")).Execute(&path, arg); err != nil {
+ if err := template.Must(template.New("").Parse("/edges/https")).Execute(&path, arg); err != nil {
panic(err)
}
+ uri := path.String()
+ pathUrl, err := url.Parse(uri)
+ if err != nil {
+ panic(err)
+ }
+ params := url.Values{}
+ if arg.BeforeID != nil {
+ params.Add("before_id", *arg.BeforeID)
+ }
+ if arg.Limit != nil {
+ params.Add("limit", *arg.Limit)
+ }
+ pathUrl.RawQuery = params.Encode()
+ uri = pathUrl.String()
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
-
- resp, err := c.Post(ctx, path.String(), arg, &res)
+ resp, err := c.Get(ctx, uri, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
return &res, resp, err
}
-// Get a TLS Edge by ID
-func (c *Client) EdgesTLSGet(ctx context.Context, arg *Item) (*TLSEdge, *http.Response, error) {
- var res TLSEdge
+// Updates an HTTPS Edge by ID. If a module is not specified in the update, it will not be modified. However, each module configuration that is specified will completely replace the existing value. There is no way to delete an existing module via this API, instead use the delete module API.
+func (c *Client) EdgesHTTPSUpdate(ctx context.Context, arg *HTTPSEdgeUpdate) (*HTTPSEdge, *http.Response, error) {
+ var res HTTPSEdge
var path bytes.Buffer
- if err := template.Must(template.New("").Parse("/tls_edges/{{ .ID }}")).Execute(&path, arg); err != nil {
+ if err := template.Must(template.New("").Parse("/edges/https/{{ .ID }}")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Get(ctx, path.String(), &res)
+ resp, err := c.Patch(ctx, uri, arg, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
return &res, resp, err
}
-// Returns a list of all TLS Edges on this account
-func (c *Client) EdgesTLSList(ctx context.Context, arg *Paging) (*TLSEdgeList, *http.Response, error) {
- var res TLSEdgeList
+// Delete an HTTPS Edge by ID
+func (c *Client) EdgesHTTPSDelete(ctx context.Context, arg *Item) (*Empty, *http.Response, error) {
+ var res Empty
var path bytes.Buffer
- if err := template.Must(template.New("").Parse("/tls_edges")).Execute(&path, arg); err != nil {
+ if err := template.Must(template.New("").Parse("/edges/https/{{ .ID }}")).Execute(&path, arg); err != nil {
panic(err)
}
+ uri := path.String()
+ arg.ID = ""
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
-
- resp, err := c.Get(ctx, path.String(), &res)
+ resp, err := c.Delete(ctx, uri, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
return &res, resp, err
}
-// Updates a TLS Edge by ID. If a module is not specified in the update, it will not be modified. However, each module configuration that is specified will completely replace the existing value. There is no way to delete an existing module via this API, instead use the delete module API.
-func (c *Client) EdgesTLSUpdate(ctx context.Context, arg *TLSEdgeUpdate) (*TLSEdge, *http.Response, error) {
- var res TLSEdge
+func (c *Client) HTTPSEdgeMutualTLSModuleReplace(ctx context.Context, arg *EdgeMutualTLSReplace) (*EndpointMutualTLS, *http.Response, error) {
+ var res EndpointMutualTLS
var path bytes.Buffer
- if err := template.Must(template.New("").Parse("/tls_edges/{{ .ID }}")).Execute(&path, arg); err != nil {
+ if err := template.Must(template.New("").Parse("/edges/https/{{ .ID }}/mutual_tls")).Execute(&path, arg); err != nil {
panic(err)
}
+ uri := path.String()
+ arg.ID = ""
+
+ resp, err := c.Put(ctx, uri, arg.Module, &res)
+ if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
+ err = nil
+ }
+ return &res, resp, err
+}
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+func (c *Client) HTTPSEdgeMutualTLSModuleGet(ctx context.Context, arg *Item) (*EndpointMutualTLS, *http.Response, error) {
+ var res EndpointMutualTLS
+ var path bytes.Buffer
+ if err := template.Must(template.New("").Parse("/edges/https/{{ .ID }}/mutual_tls")).Execute(&path, arg); err != nil {
+ panic(err)
+ }
+ uri := path.String()
arg.ID = ""
- resp, err := c.Patch(ctx, path.String(), arg, &res)
+ resp, err := c.Get(ctx, uri, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
return &res, resp, err
}
-// Delete a TLS Edge by ID
-func (c *Client) EdgesTLSDelete(ctx context.Context, arg *Item) (*Empty, *http.Response, error) {
+func (c *Client) HTTPSEdgeMutualTLSModuleDelete(ctx context.Context, arg *Item) (*Empty, *http.Response, error) {
var res Empty
var path bytes.Buffer
- if err := template.Must(template.New("").Parse("/tls_edges/{{ .ID }}")).Execute(&path, arg); err != nil {
+ if err := template.Must(template.New("").Parse("/edges/https/{{ .ID }}/mutual_tls")).Execute(&path, arg); err != nil {
+ panic(err)
+ }
+ uri := path.String()
+ arg.ID = ""
+
+ resp, err := c.Delete(ctx, uri, &res)
+ if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
+ err = nil
+ }
+ return &res, resp, err
+}
+
+func (c *Client) HTTPSEdgeTLSTerminationModuleReplace(ctx context.Context, arg *EdgeTLSTerminationAtEdgeReplace) (*EndpointTLSTermination, *http.Response, error) {
+ var res EndpointTLSTermination
+ var path bytes.Buffer
+ if err := template.Must(template.New("").Parse("/edges/https/{{ .ID }}/tls_termination")).Execute(&path, arg); err != nil {
+ panic(err)
+ }
+ uri := path.String()
+ arg.ID = ""
+
+ resp, err := c.Put(ctx, uri, arg.Module, &res)
+ if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
+ err = nil
+ }
+ return &res, resp, err
+}
+
+func (c *Client) HTTPSEdgeTLSTerminationModuleGet(ctx context.Context, arg *Item) (*EndpointTLSTermination, *http.Response, error) {
+ var res EndpointTLSTermination
+ var path bytes.Buffer
+ if err := template.Must(template.New("").Parse("/edges/https/{{ .ID }}/tls_termination")).Execute(&path, arg); err != nil {
+ panic(err)
+ }
+ uri := path.String()
+ arg.ID = ""
+
+ resp, err := c.Get(ctx, uri, &res)
+ if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
+ err = nil
+ }
+ return &res, resp, err
+}
+
+func (c *Client) HTTPSEdgeTLSTerminationModuleDelete(ctx context.Context, arg *Item) (*Empty, *http.Response, error) {
+ var res Empty
+ var path bytes.Buffer
+ if err := template.Must(template.New("").Parse("/edges/https/{{ .ID }}/tls_termination")).Execute(&path, arg); err != nil {
+ panic(err)
+ }
+ uri := path.String()
+ arg.ID = ""
+
+ resp, err := c.Delete(ctx, uri, &res)
+ if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
+ err = nil
+ }
+ return &res, resp, err
+}
+
+func (c *Client) EdgeRouteBackendModuleReplace(ctx context.Context, arg *EdgeRouteBackendReplace) (*EndpointBackend, *http.Response, error) {
+ var res EndpointBackend
+ var path bytes.Buffer
+ if err := template.Must(template.New("").Parse("/edges/https/{{ .EdgeID }}/routes/{{ .ID }}/backend")).Execute(&path, arg); err != nil {
+ panic(err)
+ }
+ uri := path.String()
+ arg.EdgeID = ""
+ arg.ID = ""
+
+ resp, err := c.Put(ctx, uri, arg.Module, &res)
+ if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
+ err = nil
+ }
+ return &res, resp, err
+}
+
+func (c *Client) EdgeRouteBackendModuleGet(ctx context.Context, arg *EdgeRouteItem) (*EndpointBackend, *http.Response, error) {
+ var res EndpointBackend
+ var path bytes.Buffer
+ if err := template.Must(template.New("").Parse("/edges/https/{{ .EdgeID }}/routes/{{ .ID }}/backend")).Execute(&path, arg); err != nil {
+ panic(err)
+ }
+ uri := path.String()
+ arg.EdgeID = ""
+ arg.ID = ""
+
+ resp, err := c.Get(ctx, uri, &res)
+ if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
+ err = nil
+ }
+ return &res, resp, err
+}
+
+func (c *Client) EdgeRouteBackendModuleDelete(ctx context.Context, arg *EdgeRouteItem) (*Empty, *http.Response, error) {
+ var res Empty
+ var path bytes.Buffer
+ if err := template.Must(template.New("").Parse("/edges/https/{{ .EdgeID }}/routes/{{ .ID }}/backend")).Execute(&path, arg); err != nil {
+ panic(err)
+ }
+ uri := path.String()
+ arg.EdgeID = ""
+ arg.ID = ""
+
+ resp, err := c.Delete(ctx, uri, &res)
+ if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
+ err = nil
+ }
+ return &res, resp, err
+}
+
+func (c *Client) EdgeRouteIPRestrictionModuleReplace(ctx context.Context, arg *EdgeRouteIPRestrictionReplace) (*EndpointIPPolicy, *http.Response, error) {
+ var res EndpointIPPolicy
+ var path bytes.Buffer
+ if err := template.Must(template.New("").Parse("/edges/https/{{ .EdgeID }}/routes/{{ .ID }}/ip_restriction")).Execute(&path, arg); err != nil {
+ panic(err)
+ }
+ uri := path.String()
+ arg.EdgeID = ""
+ arg.ID = ""
+
+ resp, err := c.Put(ctx, uri, arg.Module, &res)
+ if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
+ err = nil
+ }
+ return &res, resp, err
+}
+
+func (c *Client) EdgeRouteIPRestrictionModuleGet(ctx context.Context, arg *EdgeRouteItem) (*EndpointIPPolicy, *http.Response, error) {
+ var res EndpointIPPolicy
+ var path bytes.Buffer
+ if err := template.Must(template.New("").Parse("/edges/https/{{ .EdgeID }}/routes/{{ .ID }}/ip_restriction")).Execute(&path, arg); err != nil {
+ panic(err)
+ }
+ uri := path.String()
+ arg.EdgeID = ""
+ arg.ID = ""
+
+ resp, err := c.Get(ctx, uri, &res)
+ if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
+ err = nil
+ }
+ return &res, resp, err
+}
+
+func (c *Client) EdgeRouteIPRestrictionModuleDelete(ctx context.Context, arg *EdgeRouteItem) (*Empty, *http.Response, error) {
+ var res Empty
+ var path bytes.Buffer
+ if err := template.Must(template.New("").Parse("/edges/https/{{ .EdgeID }}/routes/{{ .ID }}/ip_restriction")).Execute(&path, arg); err != nil {
+ panic(err)
+ }
+ uri := path.String()
+ arg.EdgeID = ""
+ arg.ID = ""
+
+ resp, err := c.Delete(ctx, uri, &res)
+ if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
+ err = nil
+ }
+ return &res, resp, err
+}
+
+func (c *Client) EdgeRouteRequestHeadersModuleReplace(ctx context.Context, arg *EdgeRouteRequestHeadersReplace) (*EndpointRequestHeaders, *http.Response, error) {
+ var res EndpointRequestHeaders
+ var path bytes.Buffer
+ if err := template.Must(template.New("").Parse("/edges/https/{{ .EdgeID }}/routes/{{ .ID }}/request_headers")).Execute(&path, arg); err != nil {
+ panic(err)
+ }
+ uri := path.String()
+ arg.EdgeID = ""
+ arg.ID = ""
+
+ resp, err := c.Put(ctx, uri, arg.Module, &res)
+ if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
+ err = nil
+ }
+ return &res, resp, err
+}
+
+func (c *Client) EdgeRouteRequestHeadersModuleGet(ctx context.Context, arg *EdgeRouteItem) (*EndpointRequestHeaders, *http.Response, error) {
+ var res EndpointRequestHeaders
+ var path bytes.Buffer
+ if err := template.Must(template.New("").Parse("/edges/https/{{ .EdgeID }}/routes/{{ .ID }}/request_headers")).Execute(&path, arg); err != nil {
+ panic(err)
+ }
+ uri := path.String()
+ arg.EdgeID = ""
+ arg.ID = ""
+
+ resp, err := c.Get(ctx, uri, &res)
+ if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
+ err = nil
+ }
+ return &res, resp, err
+}
+
+func (c *Client) EdgeRouteRequestHeadersModuleDelete(ctx context.Context, arg *EdgeRouteItem) (*Empty, *http.Response, error) {
+ var res Empty
+ var path bytes.Buffer
+ if err := template.Must(template.New("").Parse("/edges/https/{{ .EdgeID }}/routes/{{ .ID }}/request_headers")).Execute(&path, arg); err != nil {
+ panic(err)
+ }
+ uri := path.String()
+ arg.EdgeID = ""
+ arg.ID = ""
+
+ resp, err := c.Delete(ctx, uri, &res)
+ if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
+ err = nil
+ }
+ return &res, resp, err
+}
+
+func (c *Client) EdgeRouteResponseHeadersModuleReplace(ctx context.Context, arg *EdgeRouteResponseHeadersReplace) (*EndpointResponseHeaders, *http.Response, error) {
+ var res EndpointResponseHeaders
+ var path bytes.Buffer
+ if err := template.Must(template.New("").Parse("/edges/https/{{ .EdgeID }}/routes/{{ .ID }}/response_headers")).Execute(&path, arg); err != nil {
+ panic(err)
+ }
+ uri := path.String()
+ arg.EdgeID = ""
+ arg.ID = ""
+
+ resp, err := c.Put(ctx, uri, arg.Module, &res)
+ if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
+ err = nil
+ }
+ return &res, resp, err
+}
+
+func (c *Client) EdgeRouteResponseHeadersModuleGet(ctx context.Context, arg *EdgeRouteItem) (*EndpointResponseHeaders, *http.Response, error) {
+ var res EndpointResponseHeaders
+ var path bytes.Buffer
+ if err := template.Must(template.New("").Parse("/edges/https/{{ .EdgeID }}/routes/{{ .ID }}/response_headers")).Execute(&path, arg); err != nil {
+ panic(err)
+ }
+ uri := path.String()
+ arg.EdgeID = ""
+ arg.ID = ""
+
+ resp, err := c.Get(ctx, uri, &res)
+ if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
+ err = nil
+ }
+ return &res, resp, err
+}
+
+func (c *Client) EdgeRouteResponseHeadersModuleDelete(ctx context.Context, arg *EdgeRouteItem) (*Empty, *http.Response, error) {
+ var res Empty
+ var path bytes.Buffer
+ if err := template.Must(template.New("").Parse("/edges/https/{{ .EdgeID }}/routes/{{ .ID }}/response_headers")).Execute(&path, arg); err != nil {
+ panic(err)
+ }
+ uri := path.String()
+ arg.EdgeID = ""
+ arg.ID = ""
+
+ resp, err := c.Delete(ctx, uri, &res)
+ if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
+ err = nil
+ }
+ return &res, resp, err
+}
+
+func (c *Client) EdgeRouteCompressionModuleReplace(ctx context.Context, arg *EdgeRouteCompressionReplace) (*EndpointCompression, *http.Response, error) {
+ var res EndpointCompression
+ var path bytes.Buffer
+ if err := template.Must(template.New("").Parse("/edges/https/{{ .EdgeID }}/routes/{{ .ID }}/compression")).Execute(&path, arg); err != nil {
+ panic(err)
+ }
+ uri := path.String()
+ arg.EdgeID = ""
+ arg.ID = ""
+
+ resp, err := c.Put(ctx, uri, arg.Module, &res)
+ if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
+ err = nil
+ }
+ return &res, resp, err
+}
+
+func (c *Client) EdgeRouteCompressionModuleGet(ctx context.Context, arg *EdgeRouteItem) (*EndpointCompression, *http.Response, error) {
+ var res EndpointCompression
+ var path bytes.Buffer
+ if err := template.Must(template.New("").Parse("/edges/https/{{ .EdgeID }}/routes/{{ .ID }}/compression")).Execute(&path, arg); err != nil {
+ panic(err)
+ }
+ uri := path.String()
+ arg.EdgeID = ""
+ arg.ID = ""
+
+ resp, err := c.Get(ctx, uri, &res)
+ if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
+ err = nil
+ }
+ return &res, resp, err
+}
+
+func (c *Client) EdgeRouteCompressionModuleDelete(ctx context.Context, arg *EdgeRouteItem) (*Empty, *http.Response, error) {
+ var res Empty
+ var path bytes.Buffer
+ if err := template.Must(template.New("").Parse("/edges/https/{{ .EdgeID }}/routes/{{ .ID }}/compression")).Execute(&path, arg); err != nil {
+ panic(err)
+ }
+ uri := path.String()
+ arg.EdgeID = ""
+ arg.ID = ""
+
+ resp, err := c.Delete(ctx, uri, &res)
+ if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
+ err = nil
+ }
+ return &res, resp, err
+}
+
+func (c *Client) EdgeRouteCircuitBreakerModuleReplace(ctx context.Context, arg *EdgeRouteCircuitBreakerReplace) (*EndpointCircuitBreaker, *http.Response, error) {
+ var res EndpointCircuitBreaker
+ var path bytes.Buffer
+ if err := template.Must(template.New("").Parse("/edges/https/{{ .EdgeID }}/routes/{{ .ID }}/circuit_breaker")).Execute(&path, arg); err != nil {
+ panic(err)
+ }
+ uri := path.String()
+ arg.EdgeID = ""
+ arg.ID = ""
+
+ resp, err := c.Put(ctx, uri, arg.Module, &res)
+ if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
+ err = nil
+ }
+ return &res, resp, err
+}
+
+func (c *Client) EdgeRouteCircuitBreakerModuleGet(ctx context.Context, arg *EdgeRouteItem) (*EndpointCircuitBreaker, *http.Response, error) {
+ var res EndpointCircuitBreaker
+ var path bytes.Buffer
+ if err := template.Must(template.New("").Parse("/edges/https/{{ .EdgeID }}/routes/{{ .ID }}/circuit_breaker")).Execute(&path, arg); err != nil {
+ panic(err)
+ }
+ uri := path.String()
+ arg.EdgeID = ""
+ arg.ID = ""
+
+ resp, err := c.Get(ctx, uri, &res)
+ if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
+ err = nil
+ }
+ return &res, resp, err
+}
+
+func (c *Client) EdgeRouteCircuitBreakerModuleDelete(ctx context.Context, arg *EdgeRouteItem) (*Empty, *http.Response, error) {
+ var res Empty
+ var path bytes.Buffer
+ if err := template.Must(template.New("").Parse("/edges/https/{{ .EdgeID }}/routes/{{ .ID }}/circuit_breaker")).Execute(&path, arg); err != nil {
+ panic(err)
+ }
+ uri := path.String()
+ arg.EdgeID = ""
+ arg.ID = ""
+
+ resp, err := c.Delete(ctx, uri, &res)
+ if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
+ err = nil
+ }
+ return &res, resp, err
+}
+
+func (c *Client) EdgeRouteWebhookVerificationModuleReplace(ctx context.Context, arg *EdgeRouteWebhookVerificationReplace) (*EndpointWebhookValidation, *http.Response, error) {
+ var res EndpointWebhookValidation
+ var path bytes.Buffer
+ if err := template.Must(template.New("").Parse("/edges/https/{{ .EdgeID }}/routes/{{ .ID }}/webhook_verification")).Execute(&path, arg); err != nil {
+ panic(err)
+ }
+ uri := path.String()
+ arg.EdgeID = ""
+ arg.ID = ""
+
+ resp, err := c.Put(ctx, uri, arg.Module, &res)
+ if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
+ err = nil
+ }
+ return &res, resp, err
+}
+
+func (c *Client) EdgeRouteWebhookVerificationModuleGet(ctx context.Context, arg *EdgeRouteItem) (*EndpointWebhookValidation, *http.Response, error) {
+ var res EndpointWebhookValidation
+ var path bytes.Buffer
+ if err := template.Must(template.New("").Parse("/edges/https/{{ .EdgeID }}/routes/{{ .ID }}/webhook_verification")).Execute(&path, arg); err != nil {
+ panic(err)
+ }
+ uri := path.String()
+ arg.EdgeID = ""
+ arg.ID = ""
+
+ resp, err := c.Get(ctx, uri, &res)
+ if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
+ err = nil
+ }
+ return &res, resp, err
+}
+
+func (c *Client) EdgeRouteWebhookVerificationModuleDelete(ctx context.Context, arg *EdgeRouteItem) (*Empty, *http.Response, error) {
+ var res Empty
+ var path bytes.Buffer
+ if err := template.Must(template.New("").Parse("/edges/https/{{ .EdgeID }}/routes/{{ .ID }}/webhook_verification")).Execute(&path, arg); err != nil {
+ panic(err)
+ }
+ uri := path.String()
+ arg.EdgeID = ""
+ arg.ID = ""
+
+ resp, err := c.Delete(ctx, uri, &res)
+ if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
+ err = nil
+ }
+ return &res, resp, err
+}
+
+func (c *Client) EdgeRouteOAuthModuleReplace(ctx context.Context, arg *EdgeRouteOAuthReplace) (*EndpointOAuth, *http.Response, error) {
+ var res EndpointOAuth
+ var path bytes.Buffer
+ if err := template.Must(template.New("").Parse("/edges/https/{{ .EdgeID }}/routes/{{ .ID }}/oauth")).Execute(&path, arg); err != nil {
+ panic(err)
+ }
+ uri := path.String()
+ arg.EdgeID = ""
+ arg.ID = ""
+
+ resp, err := c.Put(ctx, uri, arg.Module, &res)
+ if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
+ err = nil
+ }
+ return &res, resp, err
+}
+
+func (c *Client) EdgeRouteOAuthModuleGet(ctx context.Context, arg *EdgeRouteItem) (*EndpointOAuth, *http.Response, error) {
+ var res EndpointOAuth
+ var path bytes.Buffer
+ if err := template.Must(template.New("").Parse("/edges/https/{{ .EdgeID }}/routes/{{ .ID }}/oauth")).Execute(&path, arg); err != nil {
+ panic(err)
+ }
+ uri := path.String()
+ arg.EdgeID = ""
+ arg.ID = ""
+
+ resp, err := c.Get(ctx, uri, &res)
+ if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
+ err = nil
+ }
+ return &res, resp, err
+}
+
+func (c *Client) EdgeRouteOAuthModuleDelete(ctx context.Context, arg *EdgeRouteItem) (*Empty, *http.Response, error) {
+ var res Empty
+ var path bytes.Buffer
+ if err := template.Must(template.New("").Parse("/edges/https/{{ .EdgeID }}/routes/{{ .ID }}/oauth")).Execute(&path, arg); err != nil {
+ panic(err)
+ }
+ uri := path.String()
+ arg.EdgeID = ""
+ arg.ID = ""
+
+ resp, err := c.Delete(ctx, uri, &res)
+ if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
+ err = nil
+ }
+ return &res, resp, err
+}
+
+func (c *Client) EdgeRouteSAMLModuleReplace(ctx context.Context, arg *EdgeRouteSAMLReplace) (*EndpointSAML, *http.Response, error) {
+ var res EndpointSAML
+ var path bytes.Buffer
+ if err := template.Must(template.New("").Parse("/edges/https/{{ .EdgeID }}/routes/{{ .ID }}/saml")).Execute(&path, arg); err != nil {
+ panic(err)
+ }
+ uri := path.String()
+ arg.EdgeID = ""
+ arg.ID = ""
+
+ resp, err := c.Put(ctx, uri, arg.Module, &res)
+ if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
+ err = nil
+ }
+ return &res, resp, err
+}
+
+func (c *Client) EdgeRouteSAMLModuleGet(ctx context.Context, arg *EdgeRouteItem) (*EndpointSAML, *http.Response, error) {
+ var res EndpointSAML
+ var path bytes.Buffer
+ if err := template.Must(template.New("").Parse("/edges/https/{{ .EdgeID }}/routes/{{ .ID }}/saml")).Execute(&path, arg); err != nil {
+ panic(err)
+ }
+ uri := path.String()
+ arg.EdgeID = ""
+ arg.ID = ""
+
+ resp, err := c.Get(ctx, uri, &res)
+ if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
+ err = nil
+ }
+ return &res, resp, err
+}
+
+func (c *Client) EdgeRouteSAMLModuleDelete(ctx context.Context, arg *EdgeRouteItem) (*Empty, *http.Response, error) {
+ var res Empty
+ var path bytes.Buffer
+ if err := template.Must(template.New("").Parse("/edges/https/{{ .EdgeID }}/routes/{{ .ID }}/saml")).Execute(&path, arg); err != nil {
+ panic(err)
+ }
+ uri := path.String()
+ arg.EdgeID = ""
+ arg.ID = ""
+
+ resp, err := c.Delete(ctx, uri, &res)
+ if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
+ err = nil
+ }
+ return &res, resp, err
+}
+
+func (c *Client) EdgeRouteOIDCModuleReplace(ctx context.Context, arg *EdgeRouteOIDCReplace) (*EndpointOIDC, *http.Response, error) {
+ var res EndpointOIDC
+ var path bytes.Buffer
+ if err := template.Must(template.New("").Parse("/edges/https/{{ .EdgeID }}/routes/{{ .ID }}/oidc")).Execute(&path, arg); err != nil {
+ panic(err)
+ }
+ uri := path.String()
+ arg.EdgeID = ""
+ arg.ID = ""
+
+ resp, err := c.Put(ctx, uri, arg.Module, &res)
+ if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
+ err = nil
+ }
+ return &res, resp, err
+}
+
+func (c *Client) EdgeRouteOIDCModuleGet(ctx context.Context, arg *EdgeRouteItem) (*EndpointOIDC, *http.Response, error) {
+ var res EndpointOIDC
+ var path bytes.Buffer
+ if err := template.Must(template.New("").Parse("/edges/https/{{ .EdgeID }}/routes/{{ .ID }}/oidc")).Execute(&path, arg); err != nil {
+ panic(err)
+ }
+ uri := path.String()
+ arg.EdgeID = ""
+ arg.ID = ""
+
+ resp, err := c.Get(ctx, uri, &res)
+ if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
+ err = nil
+ }
+ return &res, resp, err
+}
+
+func (c *Client) EdgeRouteOIDCModuleDelete(ctx context.Context, arg *EdgeRouteItem) (*Empty, *http.Response, error) {
+ var res Empty
+ var path bytes.Buffer
+ if err := template.Must(template.New("").Parse("/edges/https/{{ .EdgeID }}/routes/{{ .ID }}/oidc")).Execute(&path, arg); err != nil {
+ panic(err)
+ }
+ uri := path.String()
+ arg.EdgeID = ""
+ arg.ID = ""
+
+ resp, err := c.Delete(ctx, uri, &res)
+ if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
+ err = nil
+ }
+ return &res, resp, err
+}
+
+func (c *Client) EdgeRouteWebsocketTCPConverterModuleReplace(ctx context.Context, arg *EdgeRouteWebsocketTCPConverterReplace) (*EndpointWebsocketTCPConverter, *http.Response, error) {
+ var res EndpointWebsocketTCPConverter
+ var path bytes.Buffer
+ if err := template.Must(template.New("").Parse("/edges/https/{{ .EdgeID }}/routes/{{ .ID }}/websocket_tcp_converter")).Execute(&path, arg); err != nil {
+ panic(err)
+ }
+ uri := path.String()
+ arg.EdgeID = ""
+ arg.ID = ""
+
+ resp, err := c.Put(ctx, uri, arg.Module, &res)
+ if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
+ err = nil
+ }
+ return &res, resp, err
+}
+
+func (c *Client) EdgeRouteWebsocketTCPConverterModuleGet(ctx context.Context, arg *EdgeRouteItem) (*EndpointWebsocketTCPConverter, *http.Response, error) {
+ var res EndpointWebsocketTCPConverter
+ var path bytes.Buffer
+ if err := template.Must(template.New("").Parse("/edges/https/{{ .EdgeID }}/routes/{{ .ID }}/websocket_tcp_converter")).Execute(&path, arg); err != nil {
+ panic(err)
+ }
+ uri := path.String()
+ arg.EdgeID = ""
+ arg.ID = ""
+
+ resp, err := c.Get(ctx, uri, &res)
+ if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
+ err = nil
+ }
+ return &res, resp, err
+}
+
+func (c *Client) EdgeRouteWebsocketTCPConverterModuleDelete(ctx context.Context, arg *EdgeRouteItem) (*Empty, *http.Response, error) {
+ var res Empty
+ var path bytes.Buffer
+ if err := template.Must(template.New("").Parse("/edges/https/{{ .EdgeID }}/routes/{{ .ID }}/websocket_tcp_converter")).Execute(&path, arg); err != nil {
+ panic(err)
+ }
+ uri := path.String()
+ arg.EdgeID = ""
+ arg.ID = ""
+
+ resp, err := c.Delete(ctx, uri, &res)
+ if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
+ err = nil
+ }
+ return &res, resp, err
+}
+
+// Create a TCP Edge
+func (c *Client) EdgesTCPCreate(ctx context.Context, arg *TCPEdgeCreate) (*TCPEdge, *http.Response, error) {
+ var res TCPEdge
+ var path bytes.Buffer
+ if err := template.Must(template.New("").Parse("/edges/tcp")).Execute(&path, arg); err != nil {
+ panic(err)
+ }
+ uri := path.String()
+
+ resp, err := c.Post(ctx, uri, arg, &res)
+ if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
+ err = nil
+ }
+ return &res, resp, err
+}
+
+// Get a TCP Edge by ID
+func (c *Client) EdgesTCPGet(ctx context.Context, arg *Item) (*TCPEdge, *http.Response, error) {
+ var res TCPEdge
+ var path bytes.Buffer
+ if err := template.Must(template.New("").Parse("/edges/tcp/{{ .ID }}")).Execute(&path, arg); err != nil {
+ panic(err)
+ }
+ uri := path.String()
+ arg.ID = ""
+
+ resp, err := c.Get(ctx, uri, &res)
+ if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
+ err = nil
+ }
+ return &res, resp, err
+}
+
+// Returns a list of all TCP Edges on this account
+func (c *Client) EdgesTCPList(ctx context.Context, arg *Paging) (*TCPEdgeList, *http.Response, error) {
+ var res TCPEdgeList
+ var path bytes.Buffer
+ if err := template.Must(template.New("").Parse("/edges/tcp")).Execute(&path, arg); err != nil {
+ panic(err)
+ }
+ uri := path.String()
+ pathUrl, err := url.Parse(uri)
+ if err != nil {
+ panic(err)
+ }
+ params := url.Values{}
+ if arg.BeforeID != nil {
+ params.Add("before_id", *arg.BeforeID)
+ }
+ if arg.Limit != nil {
+ params.Add("limit", *arg.Limit)
+ }
+ pathUrl.RawQuery = params.Encode()
+ uri = pathUrl.String()
+
+ resp, err := c.Get(ctx, uri, &res)
+ if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
+ err = nil
+ }
+ return &res, resp, err
+}
+
+// Updates a TCP Edge by ID. If a module is not specified in the update, it will not be modified. However, each module configuration that is specified will completely replace the existing value. There is no way to delete an existing module via this API, instead use the delete module API.
+func (c *Client) EdgesTCPUpdate(ctx context.Context, arg *TCPEdgeUpdate) (*TCPEdge, *http.Response, error) {
+ var res TCPEdge
+ var path bytes.Buffer
+ if err := template.Must(template.New("").Parse("/edges/tcp/{{ .ID }}")).Execute(&path, arg); err != nil {
+ panic(err)
+ }
+ uri := path.String()
+ arg.ID = ""
+
+ resp, err := c.Patch(ctx, uri, arg, &res)
+ if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
+ err = nil
+ }
+ return &res, resp, err
+}
+
+// Delete a TCP Edge by ID
+func (c *Client) EdgesTCPDelete(ctx context.Context, arg *Item) (*Empty, *http.Response, error) {
+ var res Empty
+ var path bytes.Buffer
+ if err := template.Must(template.New("").Parse("/edges/tcp/{{ .ID }}")).Execute(&path, arg); err != nil {
+ panic(err)
+ }
+ uri := path.String()
+ arg.ID = ""
+
+ resp, err := c.Delete(ctx, uri, &res)
+ if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
+ err = nil
+ }
+ return &res, resp, err
+}
+
+func (c *Client) TCPEdgeBackendModuleReplace(ctx context.Context, arg *EdgeBackendReplace) (*EndpointBackend, *http.Response, error) {
+ var res EndpointBackend
+ var path bytes.Buffer
+ if err := template.Must(template.New("").Parse("/edges/tcp/{{ .ID }}/backend")).Execute(&path, arg); err != nil {
+ panic(err)
+ }
+ uri := path.String()
+ arg.ID = ""
+
+ resp, err := c.Put(ctx, uri, arg.Module, &res)
+ if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
+ err = nil
+ }
+ return &res, resp, err
+}
+
+func (c *Client) TCPEdgeBackendModuleGet(ctx context.Context, arg *Item) (*EndpointBackend, *http.Response, error) {
+ var res EndpointBackend
+ var path bytes.Buffer
+ if err := template.Must(template.New("").Parse("/edges/tcp/{{ .ID }}/backend")).Execute(&path, arg); err != nil {
+ panic(err)
+ }
+ uri := path.String()
+ arg.ID = ""
+
+ resp, err := c.Get(ctx, uri, &res)
+ if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
+ err = nil
+ }
+ return &res, resp, err
+}
+
+func (c *Client) TCPEdgeBackendModuleDelete(ctx context.Context, arg *Item) (*Empty, *http.Response, error) {
+ var res Empty
+ var path bytes.Buffer
+ if err := template.Must(template.New("").Parse("/edges/tcp/{{ .ID }}/backend")).Execute(&path, arg); err != nil {
+ panic(err)
+ }
+ uri := path.String()
+ arg.ID = ""
+
+ resp, err := c.Delete(ctx, uri, &res)
+ if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
+ err = nil
+ }
+ return &res, resp, err
+}
+
+func (c *Client) TCPEdgeIPRestrictionModuleReplace(ctx context.Context, arg *EdgeIPRestrictionReplace) (*EndpointIPPolicy, *http.Response, error) {
+ var res EndpointIPPolicy
+ var path bytes.Buffer
+ if err := template.Must(template.New("").Parse("/edges/tcp/{{ .ID }}/ip_restriction")).Execute(&path, arg); err != nil {
+ panic(err)
+ }
+ uri := path.String()
+ arg.ID = ""
+
+ resp, err := c.Put(ctx, uri, arg.Module, &res)
+ if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
+ err = nil
+ }
+ return &res, resp, err
+}
+
+func (c *Client) TCPEdgeIPRestrictionModuleGet(ctx context.Context, arg *Item) (*EndpointIPPolicy, *http.Response, error) {
+ var res EndpointIPPolicy
+ var path bytes.Buffer
+ if err := template.Must(template.New("").Parse("/edges/tcp/{{ .ID }}/ip_restriction")).Execute(&path, arg); err != nil {
+ panic(err)
+ }
+ uri := path.String()
+ arg.ID = ""
+
+ resp, err := c.Get(ctx, uri, &res)
+ if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
+ err = nil
+ }
+ return &res, resp, err
+}
+
+func (c *Client) TCPEdgeIPRestrictionModuleDelete(ctx context.Context, arg *Item) (*Empty, *http.Response, error) {
+ var res Empty
+ var path bytes.Buffer
+ if err := template.Must(template.New("").Parse("/edges/tcp/{{ .ID }}/ip_restriction")).Execute(&path, arg); err != nil {
+ panic(err)
+ }
+ uri := path.String()
+ arg.ID = ""
+
+ resp, err := c.Delete(ctx, uri, &res)
+ if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
+ err = nil
+ }
+ return &res, resp, err
+}
+
+// Create a TLS Edge
+func (c *Client) EdgesTLSCreate(ctx context.Context, arg *TLSEdgeCreate) (*TLSEdge, *http.Response, error) {
+ var res TLSEdge
+ var path bytes.Buffer
+ if err := template.Must(template.New("").Parse("/edges/tls")).Execute(&path, arg); err != nil {
+ panic(err)
+ }
+ uri := path.String()
+
+ resp, err := c.Post(ctx, uri, arg, &res)
+ if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
+ err = nil
+ }
+ return &res, resp, err
+}
+
+// Get a TLS Edge by ID
+func (c *Client) EdgesTLSGet(ctx context.Context, arg *Item) (*TLSEdge, *http.Response, error) {
+ var res TLSEdge
+ var path bytes.Buffer
+ if err := template.Must(template.New("").Parse("/edges/tls/{{ .ID }}")).Execute(&path, arg); err != nil {
+ panic(err)
+ }
+ uri := path.String()
+ arg.ID = ""
+
+ resp, err := c.Get(ctx, uri, &res)
+ if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
+ err = nil
+ }
+ return &res, resp, err
+}
+
+// Returns a list of all TLS Edges on this account
+func (c *Client) EdgesTLSList(ctx context.Context, arg *Paging) (*TLSEdgeList, *http.Response, error) {
+ var res TLSEdgeList
+ var path bytes.Buffer
+ if err := template.Must(template.New("").Parse("/edges/tls")).Execute(&path, arg); err != nil {
+ panic(err)
+ }
+ uri := path.String()
+ pathUrl, err := url.Parse(uri)
+ if err != nil {
+ panic(err)
+ }
+ params := url.Values{}
+ if arg.BeforeID != nil {
+ params.Add("before_id", *arg.BeforeID)
+ }
+ if arg.Limit != nil {
+ params.Add("limit", *arg.Limit)
+ }
+ pathUrl.RawQuery = params.Encode()
+ uri = pathUrl.String()
+
+ resp, err := c.Get(ctx, uri, &res)
+ if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
+ err = nil
+ }
+ return &res, resp, err
+}
+
+// Updates a TLS Edge by ID. If a module is not specified in the update, it will not be modified. However, each module configuration that is specified will completely replace the existing value. There is no way to delete an existing module via this API, instead use the delete module API.
+func (c *Client) EdgesTLSUpdate(ctx context.Context, arg *TLSEdgeUpdate) (*TLSEdge, *http.Response, error) {
+ var res TLSEdge
+ var path bytes.Buffer
+ if err := template.Must(template.New("").Parse("/edges/tls/{{ .ID }}")).Execute(&path, arg); err != nil {
+ panic(err)
+ }
+ uri := path.String()
+ arg.ID = ""
+
+ resp, err := c.Patch(ctx, uri, arg, &res)
+ if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
+ err = nil
+ }
+ return &res, resp, err
+}
+
+// Delete a TLS Edge by ID
+func (c *Client) EdgesTLSDelete(ctx context.Context, arg *Item) (*Empty, *http.Response, error) {
+ var res Empty
+ var path bytes.Buffer
+ if err := template.Must(template.New("").Parse("/edges/tls/{{ .ID }}")).Execute(&path, arg); err != nil {
+ panic(err)
+ }
+ uri := path.String()
+ arg.ID = ""
+
+ resp, err := c.Delete(ctx, uri, &res)
+ if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
+ err = nil
+ }
+ return &res, resp, err
+}
+
+func (c *Client) TLSEdgeBackendModuleReplace(ctx context.Context, arg *EdgeBackendReplace) (*EndpointBackend, *http.Response, error) {
+ var res EndpointBackend
+ var path bytes.Buffer
+ if err := template.Must(template.New("").Parse("/edges/tls/{{ .ID }}/backend")).Execute(&path, arg); err != nil {
+ panic(err)
+ }
+ uri := path.String()
+ arg.ID = ""
+
+ resp, err := c.Put(ctx, uri, arg.Module, &res)
+ if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
+ err = nil
+ }
+ return &res, resp, err
+}
+
+func (c *Client) TLSEdgeBackendModuleGet(ctx context.Context, arg *Item) (*EndpointBackend, *http.Response, error) {
+ var res EndpointBackend
+ var path bytes.Buffer
+ if err := template.Must(template.New("").Parse("/edges/tls/{{ .ID }}/backend")).Execute(&path, arg); err != nil {
+ panic(err)
+ }
+ uri := path.String()
+ arg.ID = ""
+
+ resp, err := c.Get(ctx, uri, &res)
+ if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
+ err = nil
+ }
+ return &res, resp, err
+}
+
+func (c *Client) TLSEdgeBackendModuleDelete(ctx context.Context, arg *Item) (*Empty, *http.Response, error) {
+ var res Empty
+ var path bytes.Buffer
+ if err := template.Must(template.New("").Parse("/edges/tls/{{ .ID }}/backend")).Execute(&path, arg); err != nil {
+ panic(err)
+ }
+ uri := path.String()
+ arg.ID = ""
+
+ resp, err := c.Delete(ctx, uri, &res)
+ if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
+ err = nil
+ }
+ return &res, resp, err
+}
+
+func (c *Client) TLSEdgeIPRestrictionModuleReplace(ctx context.Context, arg *EdgeIPRestrictionReplace) (*EndpointIPPolicy, *http.Response, error) {
+ var res EndpointIPPolicy
+ var path bytes.Buffer
+ if err := template.Must(template.New("").Parse("/edges/tls/{{ .ID }}/ip_restriction")).Execute(&path, arg); err != nil {
+ panic(err)
+ }
+ uri := path.String()
+ arg.ID = ""
+
+ resp, err := c.Put(ctx, uri, arg.Module, &res)
+ if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
+ err = nil
+ }
+ return &res, resp, err
+}
+
+func (c *Client) TLSEdgeIPRestrictionModuleGet(ctx context.Context, arg *Item) (*EndpointIPPolicy, *http.Response, error) {
+ var res EndpointIPPolicy
+ var path bytes.Buffer
+ if err := template.Must(template.New("").Parse("/edges/tls/{{ .ID }}/ip_restriction")).Execute(&path, arg); err != nil {
+ panic(err)
+ }
+ uri := path.String()
+ arg.ID = ""
+
+ resp, err := c.Get(ctx, uri, &res)
+ if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
+ err = nil
+ }
+ return &res, resp, err
+}
+
+func (c *Client) TLSEdgeIPRestrictionModuleDelete(ctx context.Context, arg *Item) (*Empty, *http.Response, error) {
+ var res Empty
+ var path bytes.Buffer
+ if err := template.Must(template.New("").Parse("/edges/tls/{{ .ID }}/ip_restriction")).Execute(&path, arg); err != nil {
+ panic(err)
+ }
+ uri := path.String()
+ arg.ID = ""
+
+ resp, err := c.Delete(ctx, uri, &res)
+ if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
+ err = nil
+ }
+ return &res, resp, err
+}
+
+func (c *Client) TLSEdgeMutualTLSModuleReplace(ctx context.Context, arg *EdgeMutualTLSReplace) (*EndpointMutualTLS, *http.Response, error) {
+ var res EndpointMutualTLS
+ var path bytes.Buffer
+ if err := template.Must(template.New("").Parse("/edges/tls/{{ .ID }}/mutual_tls")).Execute(&path, arg); err != nil {
+ panic(err)
+ }
+ uri := path.String()
+ arg.ID = ""
+
+ resp, err := c.Put(ctx, uri, arg.Module, &res)
+ if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
+ err = nil
+ }
+ return &res, resp, err
+}
+
+func (c *Client) TLSEdgeMutualTLSModuleGet(ctx context.Context, arg *Item) (*EndpointMutualTLS, *http.Response, error) {
+ var res EndpointMutualTLS
+ var path bytes.Buffer
+ if err := template.Must(template.New("").Parse("/edges/tls/{{ .ID }}/mutual_tls")).Execute(&path, arg); err != nil {
+ panic(err)
+ }
+ uri := path.String()
+ arg.ID = ""
+
+ resp, err := c.Get(ctx, uri, &res)
+ if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
+ err = nil
+ }
+ return &res, resp, err
+}
+
+func (c *Client) TLSEdgeMutualTLSModuleDelete(ctx context.Context, arg *Item) (*Empty, *http.Response, error) {
+ var res Empty
+ var path bytes.Buffer
+ if err := template.Must(template.New("").Parse("/edges/tls/{{ .ID }}/mutual_tls")).Execute(&path, arg); err != nil {
+ panic(err)
+ }
+ uri := path.String()
+ arg.ID = ""
+
+ resp, err := c.Delete(ctx, uri, &res)
+ if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
+ err = nil
+ }
+ return &res, resp, err
+}
+
+func (c *Client) TLSEdgeTLSTerminationModuleReplace(ctx context.Context, arg *EdgeTLSTerminationReplace) (*EndpointTLSTermination, *http.Response, error) {
+ var res EndpointTLSTermination
+ var path bytes.Buffer
+ if err := template.Must(template.New("").Parse("/edges/tls/{{ .ID }}/tls_termination")).Execute(&path, arg); err != nil {
+ panic(err)
+ }
+ uri := path.String()
+ arg.ID = ""
+
+ resp, err := c.Put(ctx, uri, arg.Module, &res)
+ if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
+ err = nil
+ }
+ return &res, resp, err
+}
+
+func (c *Client) TLSEdgeTLSTerminationModuleGet(ctx context.Context, arg *Item) (*EndpointTLSTermination, *http.Response, error) {
+ var res EndpointTLSTermination
+ var path bytes.Buffer
+ if err := template.Must(template.New("").Parse("/edges/tls/{{ .ID }}/tls_termination")).Execute(&path, arg); err != nil {
+ panic(err)
+ }
+ uri := path.String()
+ arg.ID = ""
+
+ resp, err := c.Get(ctx, uri, &res)
+ if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
+ err = nil
+ }
+ return &res, resp, err
+}
+
+func (c *Client) TLSEdgeTLSTerminationModuleDelete(ctx context.Context, arg *Item) (*Empty, *http.Response, error) {
+ var res Empty
+ var path bytes.Buffer
+ if err := template.Must(template.New("").Parse("/edges/tls/{{ .ID }}/tls_termination")).Execute(&path, arg); err != nil {
+ panic(err)
+ }
+ uri := path.String()
+ arg.ID = ""
+
+ resp, err := c.Delete(ctx, uri, &res)
+ if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
+ err = nil
+ }
+ return &res, resp, err
+}
+
+// List all active endpoints on the account
+func (c *Client) EndpointsList(ctx context.Context, arg *Paging) (*EndpointList, *http.Response, error) {
+ var res EndpointList
+ var path bytes.Buffer
+ if err := template.Must(template.New("").Parse("/endpoints")).Execute(&path, arg); err != nil {
+ panic(err)
+ }
+ uri := path.String()
+ pathUrl, err := url.Parse(uri)
+ if err != nil {
+ panic(err)
+ }
+ params := url.Values{}
+ if arg.BeforeID != nil {
+ params.Add("before_id", *arg.BeforeID)
+ }
+ if arg.Limit != nil {
+ params.Add("limit", *arg.Limit)
+ }
+ pathUrl.RawQuery = params.Encode()
+ uri = pathUrl.String()
+
+ resp, err := c.Get(ctx, uri, &res)
+ if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
+ err = nil
+ }
+ return &res, resp, err
+}
+
+// Get the status of an endpoint by ID
+func (c *Client) EndpointsGet(ctx context.Context, arg *Item) (*Endpoint, *http.Response, error) {
+ var res Endpoint
+ var path bytes.Buffer
+ if err := template.Must(template.New("").Parse("/endpoints/{{ .ID }}")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Delete(ctx, path.String(), &res)
+ resp, err := c.Get(ctx, uri, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -933,10 +2357,9 @@ func (c *Client) EventStreamsCreate(ctx context.Context, arg *EventStreamCreate)
if err := template.Must(template.New("").Parse("/event_streams")).Execute(&path, arg); err != nil {
panic(err)
}
+ uri := path.String()
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
-
- resp, err := c.Post(ctx, path.String(), arg, &res)
+ resp, err := c.Post(ctx, uri, arg, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -950,11 +2373,10 @@ func (c *Client) EventStreamsDelete(ctx context.Context, arg *Item) (*Empty, *ht
if err := template.Must(template.New("").Parse("/event_streams/{{ .ID }}")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Delete(ctx, path.String(), &res)
+ resp, err := c.Delete(ctx, uri, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -968,11 +2390,10 @@ func (c *Client) EventStreamsGet(ctx context.Context, arg *Item) (*EventStream,
if err := template.Must(template.New("").Parse("/event_streams/{{ .ID }}")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Get(ctx, path.String(), &res)
+ resp, err := c.Get(ctx, uri, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -986,10 +2407,22 @@ func (c *Client) EventStreamsList(ctx context.Context, arg *Paging) (*EventStrea
if err := template.Must(template.New("").Parse("/event_streams")).Execute(&path, arg); err != nil {
panic(err)
}
+ uri := path.String()
+ pathUrl, err := url.Parse(uri)
+ if err != nil {
+ panic(err)
+ }
+ params := url.Values{}
+ if arg.BeforeID != nil {
+ params.Add("before_id", *arg.BeforeID)
+ }
+ if arg.Limit != nil {
+ params.Add("limit", *arg.Limit)
+ }
+ pathUrl.RawQuery = params.Encode()
+ uri = pathUrl.String()
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
-
- resp, err := c.Get(ctx, path.String(), &res)
+ resp, err := c.Get(ctx, uri, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -1003,11 +2436,10 @@ func (c *Client) EventStreamsUpdate(ctx context.Context, arg *EventStreamUpdate)
if err := template.Must(template.New("").Parse("/event_streams/{{ .ID }}")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Patch(ctx, path.String(), arg, &res)
+ resp, err := c.Patch(ctx, uri, arg, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -1021,28 +2453,26 @@ func (c *Client) EventDestinationsCreate(ctx context.Context, arg *EventDestinat
if err := template.Must(template.New("").Parse("/event_destinations")).Execute(&path, arg); err != nil {
panic(err)
}
+ uri := path.String()
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
-
- resp, err := c.Post(ctx, path.String(), arg, &res)
+ resp, err := c.Post(ctx, uri, arg, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
return &res, resp, err
}
-// Delete an Event Destination. If the Event Destination is still referenced by an Event Stream, this will throw an error until that Event Stream has removed that reference.
+// Delete an Event Destination. If the Event Destination is still referenced by an Event Subscription.
func (c *Client) EventDestinationsDelete(ctx context.Context, arg *Item) (*Empty, *http.Response, error) {
var res Empty
var path bytes.Buffer
if err := template.Must(template.New("").Parse("/event_destinations/{{ .ID }}")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Delete(ctx, path.String(), &res)
+ resp, err := c.Delete(ctx, uri, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -1056,11 +2486,10 @@ func (c *Client) EventDestinationsGet(ctx context.Context, arg *Item) (*EventDes
if err := template.Must(template.New("").Parse("/event_destinations/{{ .ID }}")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Get(ctx, path.String(), &res)
+ resp, err := c.Get(ctx, uri, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -1074,10 +2503,22 @@ func (c *Client) EventDestinationsList(ctx context.Context, arg *Paging) (*Event
if err := template.Must(template.New("").Parse("/event_destinations")).Execute(&path, arg); err != nil {
panic(err)
}
+ uri := path.String()
+ pathUrl, err := url.Parse(uri)
+ if err != nil {
+ panic(err)
+ }
+ params := url.Values{}
+ if arg.BeforeID != nil {
+ params.Add("before_id", *arg.BeforeID)
+ }
+ if arg.Limit != nil {
+ params.Add("limit", *arg.Limit)
+ }
+ pathUrl.RawQuery = params.Encode()
+ uri = pathUrl.String()
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
-
- resp, err := c.Get(ctx, path.String(), &res)
+ resp, err := c.Get(ctx, uri, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -1091,11 +2532,10 @@ func (c *Client) EventDestinationsUpdate(ctx context.Context, arg *EventDestinat
if err := template.Must(template.New("").Parse("/event_destinations/{{ .ID }}")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Patch(ctx, path.String(), arg, &res)
+ resp, err := c.Patch(ctx, uri, arg, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -1109,11 +2549,10 @@ func (c *Client) EventDestinationsSendTestEvent(ctx context.Context, arg *Item)
if err := template.Must(template.New("").Parse("/event_destinations/{{ .ID }}/send_test_event")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Post(ctx, path.String(), arg, &res)
+ resp, err := c.Post(ctx, uri, arg, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -1127,10 +2566,9 @@ func (c *Client) EventSubscriptionsCreate(ctx context.Context, arg *EventSubscri
if err := template.Must(template.New("").Parse("/event_subscriptions")).Execute(&path, arg); err != nil {
panic(err)
}
+ uri := path.String()
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
-
- resp, err := c.Post(ctx, path.String(), arg, &res)
+ resp, err := c.Post(ctx, uri, arg, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -1144,11 +2582,10 @@ func (c *Client) EventSubscriptionsDelete(ctx context.Context, arg *Item) (*Empt
if err := template.Must(template.New("").Parse("/event_subscriptions/{{ .ID }}")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Delete(ctx, path.String(), &res)
+ resp, err := c.Delete(ctx, uri, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -1162,11 +2599,10 @@ func (c *Client) EventSubscriptionsGet(ctx context.Context, arg *Item) (*EventSu
if err := template.Must(template.New("").Parse("/event_subscriptions/{{ .ID }}")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Get(ctx, path.String(), &res)
+ resp, err := c.Get(ctx, uri, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -1180,10 +2616,22 @@ func (c *Client) EventSubscriptionsList(ctx context.Context, arg *Paging) (*Even
if err := template.Must(template.New("").Parse("/event_subscriptions")).Execute(&path, arg); err != nil {
panic(err)
}
+ uri := path.String()
+ pathUrl, err := url.Parse(uri)
+ if err != nil {
+ panic(err)
+ }
+ params := url.Values{}
+ if arg.BeforeID != nil {
+ params.Add("before_id", *arg.BeforeID)
+ }
+ if arg.Limit != nil {
+ params.Add("limit", *arg.Limit)
+ }
+ pathUrl.RawQuery = params.Encode()
+ uri = pathUrl.String()
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
-
- resp, err := c.Get(ctx, path.String(), &res)
+ resp, err := c.Get(ctx, uri, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -1197,11 +2645,10 @@ func (c *Client) EventSubscriptionsUpdate(ctx context.Context, arg *EventSubscri
if err := template.Must(template.New("").Parse("/event_subscriptions/{{ .ID }}")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Patch(ctx, path.String(), arg, &res)
+ resp, err := c.Patch(ctx, uri, arg, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -1215,11 +2662,10 @@ func (c *Client) EventSourcesCreate(ctx context.Context, arg *EventSourceCreate)
if err := template.Must(template.New("").Parse("/event_subscriptions/{{ .SubscriptionID }}/sources")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.SubscriptionID = ""
- resp, err := c.Post(ctx, path.String(), arg, &res)
+ resp, err := c.Post(ctx, uri, arg, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -1233,12 +2679,11 @@ func (c *Client) EventSourcesDelete(ctx context.Context, arg *EventSourceItem) (
if err := template.Must(template.New("").Parse("/event_subscriptions/{{ .SubscriptionID }}/sources/{{ .Type }}")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.SubscriptionID = ""
arg.Type = ""
- resp, err := c.Delete(ctx, path.String(), &res)
+ resp, err := c.Delete(ctx, uri, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -1252,12 +2697,11 @@ func (c *Client) EventSourcesGet(ctx context.Context, arg *EventSourceItem) (*Ev
if err := template.Must(template.New("").Parse("/event_subscriptions/{{ .SubscriptionID }}/sources/{{ .Type }}")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.SubscriptionID = ""
arg.Type = ""
- resp, err := c.Get(ctx, path.String(), &res)
+ resp, err := c.Get(ctx, uri, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -1271,11 +2715,10 @@ func (c *Client) EventSourcesList(ctx context.Context, arg *EventSourcePaging) (
if err := template.Must(template.New("").Parse("/event_subscriptions/{{ .SubscriptionID }}/sources")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.SubscriptionID = ""
- resp, err := c.Get(ctx, path.String(), &res)
+ resp, err := c.Get(ctx, uri, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -1289,12 +2732,11 @@ func (c *Client) EventSourcesUpdate(ctx context.Context, arg *EventSourceUpdate)
if err := template.Must(template.New("").Parse("/event_subscriptions/{{ .SubscriptionID }}/sources/{{ .Type }}")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.SubscriptionID = ""
arg.Type = ""
- resp, err := c.Patch(ctx, path.String(), arg, &res)
+ resp, err := c.Patch(ctx, uri, arg, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -1308,10 +2750,9 @@ func (c *Client) IPPoliciesCreate(ctx context.Context, arg *IPPolicyCreate) (*IP
if err := template.Must(template.New("").Parse("/ip_policies")).Execute(&path, arg); err != nil {
panic(err)
}
+ uri := path.String()
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
-
- resp, err := c.Post(ctx, path.String(), arg, &res)
+ resp, err := c.Post(ctx, uri, arg, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -1325,11 +2766,10 @@ func (c *Client) IPPoliciesDelete(ctx context.Context, arg *Item) (*Empty, *http
if err := template.Must(template.New("").Parse("/ip_policies/{{ .ID }}")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Delete(ctx, path.String(), &res)
+ resp, err := c.Delete(ctx, uri, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -1343,11 +2783,10 @@ func (c *Client) IPPoliciesGet(ctx context.Context, arg *Item) (*IPPolicy, *http
if err := template.Must(template.New("").Parse("/ip_policies/{{ .ID }}")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Get(ctx, path.String(), &res)
+ resp, err := c.Get(ctx, uri, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -1361,10 +2800,22 @@ func (c *Client) IPPoliciesList(ctx context.Context, arg *Paging) (*IPPolicyList
if err := template.Must(template.New("").Parse("/ip_policies")).Execute(&path, arg); err != nil {
panic(err)
}
+ uri := path.String()
+ pathUrl, err := url.Parse(uri)
+ if err != nil {
+ panic(err)
+ }
+ params := url.Values{}
+ if arg.BeforeID != nil {
+ params.Add("before_id", *arg.BeforeID)
+ }
+ if arg.Limit != nil {
+ params.Add("limit", *arg.Limit)
+ }
+ pathUrl.RawQuery = params.Encode()
+ uri = pathUrl.String()
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
-
- resp, err := c.Get(ctx, path.String(), &res)
+ resp, err := c.Get(ctx, uri, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -1378,11 +2829,10 @@ func (c *Client) IPPoliciesUpdate(ctx context.Context, arg *IPPolicyUpdate) (*IP
if err := template.Must(template.New("").Parse("/ip_policies/{{ .ID }}")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Patch(ctx, path.String(), arg, &res)
+ resp, err := c.Patch(ctx, uri, arg, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -1396,10 +2846,9 @@ func (c *Client) IPPolicyRulesCreate(ctx context.Context, arg *IPPolicyRuleCreat
if err := template.Must(template.New("").Parse("/ip_policy_rules")).Execute(&path, arg); err != nil {
panic(err)
}
+ uri := path.String()
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
-
- resp, err := c.Post(ctx, path.String(), arg, &res)
+ resp, err := c.Post(ctx, uri, arg, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -1413,11 +2862,10 @@ func (c *Client) IPPolicyRulesDelete(ctx context.Context, arg *Item) (*Empty, *h
if err := template.Must(template.New("").Parse("/ip_policy_rules/{{ .ID }}")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Delete(ctx, path.String(), &res)
+ resp, err := c.Delete(ctx, uri, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -1431,11 +2879,10 @@ func (c *Client) IPPolicyRulesGet(ctx context.Context, arg *Item) (*IPPolicyRule
if err := template.Must(template.New("").Parse("/ip_policy_rules/{{ .ID }}")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Get(ctx, path.String(), &res)
+ resp, err := c.Get(ctx, uri, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -1449,10 +2896,22 @@ func (c *Client) IPPolicyRulesList(ctx context.Context, arg *Paging) (*IPPolicyR
if err := template.Must(template.New("").Parse("/ip_policy_rules")).Execute(&path, arg); err != nil {
panic(err)
}
+ uri := path.String()
+ pathUrl, err := url.Parse(uri)
+ if err != nil {
+ panic(err)
+ }
+ params := url.Values{}
+ if arg.BeforeID != nil {
+ params.Add("before_id", *arg.BeforeID)
+ }
+ if arg.Limit != nil {
+ params.Add("limit", *arg.Limit)
+ }
+ pathUrl.RawQuery = params.Encode()
+ uri = pathUrl.String()
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
-
- resp, err := c.Get(ctx, path.String(), &res)
+ resp, err := c.Get(ctx, uri, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -1466,11 +2925,10 @@ func (c *Client) IPPolicyRulesUpdate(ctx context.Context, arg *IPPolicyRuleUpdat
if err := template.Must(template.New("").Parse("/ip_policy_rules/{{ .ID }}")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Patch(ctx, path.String(), arg, &res)
+ resp, err := c.Patch(ctx, uri, arg, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -1484,10 +2942,9 @@ func (c *Client) IPRestrictionsCreate(ctx context.Context, arg *IPRestrictionCre
if err := template.Must(template.New("").Parse("/ip_restrictions")).Execute(&path, arg); err != nil {
panic(err)
}
+ uri := path.String()
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
-
- resp, err := c.Post(ctx, path.String(), arg, &res)
+ resp, err := c.Post(ctx, uri, arg, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -1501,11 +2958,10 @@ func (c *Client) IPRestrictionsDelete(ctx context.Context, arg *Item) (*Empty, *
if err := template.Must(template.New("").Parse("/ip_restrictions/{{ .ID }}")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Delete(ctx, path.String(), &res)
+ resp, err := c.Delete(ctx, uri, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -1519,11 +2975,10 @@ func (c *Client) IPRestrictionsGet(ctx context.Context, arg *Item) (*IPRestricti
if err := template.Must(template.New("").Parse("/ip_restrictions/{{ .ID }}")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Get(ctx, path.String(), &res)
+ resp, err := c.Get(ctx, uri, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -1537,116 +2992,39 @@ func (c *Client) IPRestrictionsList(ctx context.Context, arg *Paging) (*IPRestri
if err := template.Must(template.New("").Parse("/ip_restrictions")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
-
- resp, err := c.Get(ctx, path.String(), &res)
- if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
- err = nil
- }
- return &res, resp, err
-}
-
-// Update attributes of an IP restriction by ID
-func (c *Client) IPRestrictionsUpdate(ctx context.Context, arg *IPRestrictionUpdate) (*IPRestriction, *http.Response, error) {
- var res IPRestriction
- var path bytes.Buffer
- if err := template.Must(template.New("").Parse("/ip_restrictions/{{ .ID }}")).Execute(&path, arg); err != nil {
- panic(err)
- }
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
- arg.ID = ""
-
- resp, err := c.Patch(ctx, path.String(), arg, &res)
- if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
- err = nil
- }
- return &res, resp, err
-}
-
-// Create a new IP whitelist entry that will restrict traffic to all tunnel endpoints on the account.
-func (c *Client) IPWhitelistCreate(ctx context.Context, arg *IPWhitelistEntryCreate) (*IPWhitelistEntry, *http.Response, error) {
- var res IPWhitelistEntry
- var path bytes.Buffer
- if err := template.Must(template.New("").Parse("/ip_whitelist")).Execute(&path, arg); err != nil {
- panic(err)
- }
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
-
- resp, err := c.Post(ctx, path.String(), arg, &res)
- if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
- err = nil
- }
- return &res, resp, err
-}
-
-// Delete an IP whitelist entry.
-func (c *Client) IPWhitelistDelete(ctx context.Context, arg *Item) (*Empty, *http.Response, error) {
- var res Empty
- var path bytes.Buffer
- if err := template.Must(template.New("").Parse("/ip_whitelist/{{ .ID }}")).Execute(&path, arg); err != nil {
- panic(err)
- }
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
- arg.ID = ""
-
- resp, err := c.Delete(ctx, path.String(), &res)
- if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
- err = nil
- }
- return &res, resp, err
-}
-
-// Get detailed information about an IP whitelist entry by ID.
-func (c *Client) IPWhitelistGet(ctx context.Context, arg *Item) (*IPWhitelistEntry, *http.Response, error) {
- var res IPWhitelistEntry
- var path bytes.Buffer
- if err := template.Must(template.New("").Parse("/ip_whitelist/{{ .ID }}")).Execute(&path, arg); err != nil {
+ uri := path.String()
+ pathUrl, err := url.Parse(uri)
+ if err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
- arg.ID = ""
-
- resp, err := c.Get(ctx, path.String(), &res)
- if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
- err = nil
+ params := url.Values{}
+ if arg.BeforeID != nil {
+ params.Add("before_id", *arg.BeforeID)
}
- return &res, resp, err
-}
-
-// List all IP whitelist entries on this account
-func (c *Client) IPWhitelistList(ctx context.Context, arg *Paging) (*IPWhitelistEntryList, *http.Response, error) {
- var res IPWhitelistEntryList
- var path bytes.Buffer
- if err := template.Must(template.New("").Parse("/ip_whitelist")).Execute(&path, arg); err != nil {
- panic(err)
+ if arg.Limit != nil {
+ params.Add("limit", *arg.Limit)
}
+ pathUrl.RawQuery = params.Encode()
+ uri = pathUrl.String()
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
-
- resp, err := c.Get(ctx, path.String(), &res)
+ resp, err := c.Get(ctx, uri, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
return &res, resp, err
}
-// Update attributes of an IP whitelist entry by ID
-func (c *Client) IPWhitelistUpdate(ctx context.Context, arg *IPWhitelistEntryUpdate) (*IPWhitelistEntry, *http.Response, error) {
- var res IPWhitelistEntry
+// Update attributes of an IP restriction by ID
+func (c *Client) IPRestrictionsUpdate(ctx context.Context, arg *IPRestrictionUpdate) (*IPRestriction, *http.Response, error) {
+ var res IPRestriction
var path bytes.Buffer
- if err := template.Must(template.New("").Parse("/ip_whitelist/{{ .ID }}")).Execute(&path, arg); err != nil {
+ if err := template.Must(template.New("").Parse("/ip_restrictions/{{ .ID }}")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Patch(ctx, path.String(), arg, &res)
+ resp, err := c.Patch(ctx, uri, arg, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -1659,11 +3037,10 @@ func (c *Client) EndpointLoggingModuleReplace(ctx context.Context, arg *Endpoint
if err := template.Must(template.New("").Parse("/endpoint_configurations/{{ .ID }}/logging")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Put(ctx, path.String(), arg.Module, &res)
+ resp, err := c.Put(ctx, uri, arg.Module, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -1676,11 +3053,10 @@ func (c *Client) EndpointLoggingModuleGet(ctx context.Context, arg *Item) (*Endp
if err := template.Must(template.New("").Parse("/endpoint_configurations/{{ .ID }}/logging")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Get(ctx, path.String(), &res)
+ resp, err := c.Get(ctx, uri, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -1693,11 +3069,10 @@ func (c *Client) EndpointLoggingModuleDelete(ctx context.Context, arg *Item) (*E
if err := template.Must(template.New("").Parse("/endpoint_configurations/{{ .ID }}/logging")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Delete(ctx, path.String(), &res)
+ resp, err := c.Delete(ctx, uri, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -1710,11 +3085,10 @@ func (c *Client) EndpointBasicAuthModuleReplace(ctx context.Context, arg *Endpoi
if err := template.Must(template.New("").Parse("/endpoint_configurations/{{ .ID }}/basic_auth")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Put(ctx, path.String(), arg.Module, &res)
+ resp, err := c.Put(ctx, uri, arg.Module, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -1727,11 +3101,10 @@ func (c *Client) EndpointBasicAuthModuleGet(ctx context.Context, arg *Item) (*En
if err := template.Must(template.New("").Parse("/endpoint_configurations/{{ .ID }}/basic_auth")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Get(ctx, path.String(), &res)
+ resp, err := c.Get(ctx, uri, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -1744,11 +3117,10 @@ func (c *Client) EndpointBasicAuthModuleDelete(ctx context.Context, arg *Item) (
if err := template.Must(template.New("").Parse("/endpoint_configurations/{{ .ID }}/basic_auth")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Delete(ctx, path.String(), &res)
+ resp, err := c.Delete(ctx, uri, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -1761,11 +3133,10 @@ func (c *Client) EndpointCircuitBreakerModuleReplace(ctx context.Context, arg *E
if err := template.Must(template.New("").Parse("/endpoint_configurations/{{ .ID }}/circuit_breaker")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Put(ctx, path.String(), arg.Module, &res)
+ resp, err := c.Put(ctx, uri, arg.Module, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -1778,11 +3149,10 @@ func (c *Client) EndpointCircuitBreakerModuleGet(ctx context.Context, arg *Item)
if err := template.Must(template.New("").Parse("/endpoint_configurations/{{ .ID }}/circuit_breaker")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Get(ctx, path.String(), &res)
+ resp, err := c.Get(ctx, uri, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -1795,11 +3165,10 @@ func (c *Client) EndpointCircuitBreakerModuleDelete(ctx context.Context, arg *It
if err := template.Must(template.New("").Parse("/endpoint_configurations/{{ .ID }}/circuit_breaker")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Delete(ctx, path.String(), &res)
+ resp, err := c.Delete(ctx, uri, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -1812,11 +3181,10 @@ func (c *Client) EndpointCompressionModuleReplace(ctx context.Context, arg *Endp
if err := template.Must(template.New("").Parse("/endpoint_configurations/{{ .ID }}/compression")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Put(ctx, path.String(), arg.Module, &res)
+ resp, err := c.Put(ctx, uri, arg.Module, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -1829,11 +3197,10 @@ func (c *Client) EndpointCompressionModuleGet(ctx context.Context, arg *Item) (*
if err := template.Must(template.New("").Parse("/endpoint_configurations/{{ .ID }}/compression")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Get(ctx, path.String(), &res)
+ resp, err := c.Get(ctx, uri, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -1846,11 +3213,10 @@ func (c *Client) EndpointCompressionModuleDelete(ctx context.Context, arg *Item)
if err := template.Must(template.New("").Parse("/endpoint_configurations/{{ .ID }}/compression")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Delete(ctx, path.String(), &res)
+ resp, err := c.Delete(ctx, uri, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -1863,11 +3229,10 @@ func (c *Client) EndpointTLSTerminationModuleReplace(ctx context.Context, arg *E
if err := template.Must(template.New("").Parse("/endpoint_configurations/{{ .ID }}/tls_termination")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Put(ctx, path.String(), arg.Module, &res)
+ resp, err := c.Put(ctx, uri, arg.Module, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -1880,11 +3245,10 @@ func (c *Client) EndpointTLSTerminationModuleGet(ctx context.Context, arg *Item)
if err := template.Must(template.New("").Parse("/endpoint_configurations/{{ .ID }}/tls_termination")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Get(ctx, path.String(), &res)
+ resp, err := c.Get(ctx, uri, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -1897,11 +3261,10 @@ func (c *Client) EndpointTLSTerminationModuleDelete(ctx context.Context, arg *It
if err := template.Must(template.New("").Parse("/endpoint_configurations/{{ .ID }}/tls_termination")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Delete(ctx, path.String(), &res)
+ resp, err := c.Delete(ctx, uri, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -1914,11 +3277,10 @@ func (c *Client) EndpointIPPolicyModuleReplace(ctx context.Context, arg *Endpoin
if err := template.Must(template.New("").Parse("/endpoint_configurations/{{ .ID }}/ip_policy")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Put(ctx, path.String(), arg.Module, &res)
+ resp, err := c.Put(ctx, uri, arg.Module, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -1931,11 +3293,10 @@ func (c *Client) EndpointIPPolicyModuleGet(ctx context.Context, arg *Item) (*End
if err := template.Must(template.New("").Parse("/endpoint_configurations/{{ .ID }}/ip_policy")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Get(ctx, path.String(), &res)
+ resp, err := c.Get(ctx, uri, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -1948,11 +3309,10 @@ func (c *Client) EndpointIPPolicyModuleDelete(ctx context.Context, arg *Item) (*
if err := template.Must(template.New("").Parse("/endpoint_configurations/{{ .ID }}/ip_policy")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Delete(ctx, path.String(), &res)
+ resp, err := c.Delete(ctx, uri, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -1965,11 +3325,10 @@ func (c *Client) EndpointMutualTLSModuleReplace(ctx context.Context, arg *Endpoi
if err := template.Must(template.New("").Parse("/endpoint_configurations/{{ .ID }}/mutual_tls")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Put(ctx, path.String(), arg.Module, &res)
+ resp, err := c.Put(ctx, uri, arg.Module, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -1982,11 +3341,10 @@ func (c *Client) EndpointMutualTLSModuleGet(ctx context.Context, arg *Item) (*En
if err := template.Must(template.New("").Parse("/endpoint_configurations/{{ .ID }}/mutual_tls")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Get(ctx, path.String(), &res)
+ resp, err := c.Get(ctx, uri, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -1999,11 +3357,10 @@ func (c *Client) EndpointMutualTLSModuleDelete(ctx context.Context, arg *Item) (
if err := template.Must(template.New("").Parse("/endpoint_configurations/{{ .ID }}/mutual_tls")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Delete(ctx, path.String(), &res)
+ resp, err := c.Delete(ctx, uri, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -2016,11 +3373,10 @@ func (c *Client) EndpointRequestHeadersModuleReplace(ctx context.Context, arg *E
if err := template.Must(template.New("").Parse("/endpoint_configurations/{{ .ID }}/request_headers")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Put(ctx, path.String(), arg.Module, &res)
+ resp, err := c.Put(ctx, uri, arg.Module, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -2033,11 +3389,10 @@ func (c *Client) EndpointRequestHeadersModuleGet(ctx context.Context, arg *Item)
if err := template.Must(template.New("").Parse("/endpoint_configurations/{{ .ID }}/request_headers")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Get(ctx, path.String(), &res)
+ resp, err := c.Get(ctx, uri, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -2050,11 +3405,10 @@ func (c *Client) EndpointRequestHeadersModuleDelete(ctx context.Context, arg *It
if err := template.Must(template.New("").Parse("/endpoint_configurations/{{ .ID }}/request_headers")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Delete(ctx, path.String(), &res)
+ resp, err := c.Delete(ctx, uri, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -2067,11 +3421,10 @@ func (c *Client) EndpointResponseHeadersModuleReplace(ctx context.Context, arg *
if err := template.Must(template.New("").Parse("/endpoint_configurations/{{ .ID }}/response_headers")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Put(ctx, path.String(), arg.Module, &res)
+ resp, err := c.Put(ctx, uri, arg.Module, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -2084,11 +3437,10 @@ func (c *Client) EndpointResponseHeadersModuleGet(ctx context.Context, arg *Item
if err := template.Must(template.New("").Parse("/endpoint_configurations/{{ .ID }}/response_headers")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Get(ctx, path.String(), &res)
+ resp, err := c.Get(ctx, uri, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -2101,11 +3453,10 @@ func (c *Client) EndpointResponseHeadersModuleDelete(ctx context.Context, arg *I
if err := template.Must(template.New("").Parse("/endpoint_configurations/{{ .ID }}/response_headers")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Delete(ctx, path.String(), &res)
+ resp, err := c.Delete(ctx, uri, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -2118,11 +3469,10 @@ func (c *Client) EndpointOAuthModuleReplace(ctx context.Context, arg *EndpointOA
if err := template.Must(template.New("").Parse("/endpoint_configurations/{{ .ID }}/oauth")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Put(ctx, path.String(), arg.Module, &res)
+ resp, err := c.Put(ctx, uri, arg.Module, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -2135,11 +3485,10 @@ func (c *Client) EndpointOAuthModuleGet(ctx context.Context, arg *Item) (*Endpoi
if err := template.Must(template.New("").Parse("/endpoint_configurations/{{ .ID }}/oauth")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Get(ctx, path.String(), &res)
+ resp, err := c.Get(ctx, uri, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -2152,11 +3501,10 @@ func (c *Client) EndpointOAuthModuleDelete(ctx context.Context, arg *Item) (*Emp
if err := template.Must(template.New("").Parse("/endpoint_configurations/{{ .ID }}/oauth")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Delete(ctx, path.String(), &res)
+ resp, err := c.Delete(ctx, uri, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -2169,11 +3517,10 @@ func (c *Client) EndpointWebhookValidationModuleReplace(ctx context.Context, arg
if err := template.Must(template.New("").Parse("/endpoint_configurations/{{ .ID }}/webhook_validation")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Put(ctx, path.String(), arg.Module, &res)
+ resp, err := c.Put(ctx, uri, arg.Module, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -2186,11 +3533,10 @@ func (c *Client) EndpointWebhookValidationModuleGet(ctx context.Context, arg *It
if err := template.Must(template.New("").Parse("/endpoint_configurations/{{ .ID }}/webhook_validation")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Get(ctx, path.String(), &res)
+ resp, err := c.Get(ctx, uri, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -2203,11 +3549,10 @@ func (c *Client) EndpointWebhookValidationModuleDelete(ctx context.Context, arg
if err := template.Must(template.New("").Parse("/endpoint_configurations/{{ .ID }}/webhook_validation")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Delete(ctx, path.String(), &res)
+ resp, err := c.Delete(ctx, uri, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -2220,11 +3565,10 @@ func (c *Client) EndpointSAMLModuleReplace(ctx context.Context, arg *EndpointSAM
if err := template.Must(template.New("").Parse("/endpoint_configurations/{{ .ID }}/saml")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Put(ctx, path.String(), arg.Module, &res)
+ resp, err := c.Put(ctx, uri, arg.Module, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -2237,11 +3581,10 @@ func (c *Client) EndpointSAMLModuleGet(ctx context.Context, arg *Item) (*Endpoin
if err := template.Must(template.New("").Parse("/endpoint_configurations/{{ .ID }}/saml")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Get(ctx, path.String(), &res)
+ resp, err := c.Get(ctx, uri, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -2254,11 +3597,10 @@ func (c *Client) EndpointSAMLModuleDelete(ctx context.Context, arg *Item) (*Empt
if err := template.Must(template.New("").Parse("/endpoint_configurations/{{ .ID }}/saml")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Delete(ctx, path.String(), &res)
+ resp, err := c.Delete(ctx, uri, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -2271,11 +3613,10 @@ func (c *Client) EndpointOIDCModuleReplace(ctx context.Context, arg *EndpointOID
if err := template.Must(template.New("").Parse("/endpoint_configurations/{{ .ID }}/oidc")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Put(ctx, path.String(), arg.Module, &res)
+ resp, err := c.Put(ctx, uri, arg.Module, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -2288,11 +3629,10 @@ func (c *Client) EndpointOIDCModuleGet(ctx context.Context, arg *Item) (*Endpoin
if err := template.Must(template.New("").Parse("/endpoint_configurations/{{ .ID }}/oidc")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Get(ctx, path.String(), &res)
+ resp, err := c.Get(ctx, uri, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -2305,11 +3645,10 @@ func (c *Client) EndpointOIDCModuleDelete(ctx context.Context, arg *Item) (*Empt
if err := template.Must(template.New("").Parse("/endpoint_configurations/{{ .ID }}/oidc")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Delete(ctx, path.String(), &res)
+ resp, err := c.Delete(ctx, uri, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -2322,11 +3661,10 @@ func (c *Client) EndpointBackendModuleReplace(ctx context.Context, arg *Endpoint
if err := template.Must(template.New("").Parse("/endpoint_configurations/{{ .ID }}/backend")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Put(ctx, path.String(), arg.Module, &res)
+ resp, err := c.Put(ctx, uri, arg.Module, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -2339,11 +3677,10 @@ func (c *Client) EndpointBackendModuleGet(ctx context.Context, arg *Item) (*Endp
if err := template.Must(template.New("").Parse("/endpoint_configurations/{{ .ID }}/backend")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Get(ctx, path.String(), &res)
+ resp, err := c.Get(ctx, uri, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -2356,11 +3693,10 @@ func (c *Client) EndpointBackendModuleDelete(ctx context.Context, arg *Item) (*E
if err := template.Must(template.New("").Parse("/endpoint_configurations/{{ .ID }}/backend")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Delete(ctx, path.String(), &res)
+ resp, err := c.Delete(ctx, uri, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -2374,10 +3710,9 @@ func (c *Client) ReservedAddrsCreate(ctx context.Context, arg *ReservedAddrCreat
if err := template.Must(template.New("").Parse("/reserved_addrs")).Execute(&path, arg); err != nil {
panic(err)
}
+ uri := path.String()
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
-
- resp, err := c.Post(ctx, path.String(), arg, &res)
+ resp, err := c.Post(ctx, uri, arg, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -2391,11 +3726,10 @@ func (c *Client) ReservedAddrsDelete(ctx context.Context, arg *Item) (*Empty, *h
if err := template.Must(template.New("").Parse("/reserved_addrs/{{ .ID }}")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Delete(ctx, path.String(), &res)
+ resp, err := c.Delete(ctx, uri, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -2409,11 +3743,10 @@ func (c *Client) ReservedAddrsGet(ctx context.Context, arg *Item) (*ReservedAddr
if err := template.Must(template.New("").Parse("/reserved_addrs/{{ .ID }}")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Get(ctx, path.String(), &res)
+ resp, err := c.Get(ctx, uri, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -2427,10 +3760,22 @@ func (c *Client) ReservedAddrsList(ctx context.Context, arg *Paging) (*ReservedA
if err := template.Must(template.New("").Parse("/reserved_addrs")).Execute(&path, arg); err != nil {
panic(err)
}
+ uri := path.String()
+ pathUrl, err := url.Parse(uri)
+ if err != nil {
+ panic(err)
+ }
+ params := url.Values{}
+ if arg.BeforeID != nil {
+ params.Add("before_id", *arg.BeforeID)
+ }
+ if arg.Limit != nil {
+ params.Add("limit", *arg.Limit)
+ }
+ pathUrl.RawQuery = params.Encode()
+ uri = pathUrl.String()
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
-
- resp, err := c.Get(ctx, path.String(), &res)
+ resp, err := c.Get(ctx, uri, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -2444,11 +3789,10 @@ func (c *Client) ReservedAddrsUpdate(ctx context.Context, arg *ReservedAddrUpdat
if err := template.Must(template.New("").Parse("/reserved_addrs/{{ .ID }}")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Patch(ctx, path.String(), arg, &res)
+ resp, err := c.Patch(ctx, uri, arg, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -2462,11 +3806,10 @@ func (c *Client) ReservedAddrsDeleteEndpointConfig(ctx context.Context, arg *Ite
if err := template.Must(template.New("").Parse("/reserved_addrs/{{ .ID }}/endpoint_configuration")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Delete(ctx, path.String(), &res)
+ resp, err := c.Delete(ctx, uri, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -2480,10 +3823,9 @@ func (c *Client) ReservedDomainsCreate(ctx context.Context, arg *ReservedDomainC
if err := template.Must(template.New("").Parse("/reserved_domains")).Execute(&path, arg); err != nil {
panic(err)
}
+ uri := path.String()
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
-
- resp, err := c.Post(ctx, path.String(), arg, &res)
+ resp, err := c.Post(ctx, uri, arg, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -2497,11 +3839,10 @@ func (c *Client) ReservedDomainsDelete(ctx context.Context, arg *Item) (*Empty,
if err := template.Must(template.New("").Parse("/reserved_domains/{{ .ID }}")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Delete(ctx, path.String(), &res)
+ resp, err := c.Delete(ctx, uri, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -2515,11 +3856,10 @@ func (c *Client) ReservedDomainsGet(ctx context.Context, arg *Item) (*ReservedDo
if err := template.Must(template.New("").Parse("/reserved_domains/{{ .ID }}")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Get(ctx, path.String(), &res)
+ resp, err := c.Get(ctx, uri, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -2533,10 +3873,22 @@ func (c *Client) ReservedDomainsList(ctx context.Context, arg *Paging) (*Reserve
if err := template.Must(template.New("").Parse("/reserved_domains")).Execute(&path, arg); err != nil {
panic(err)
}
+ uri := path.String()
+ pathUrl, err := url.Parse(uri)
+ if err != nil {
+ panic(err)
+ }
+ params := url.Values{}
+ if arg.BeforeID != nil {
+ params.Add("before_id", *arg.BeforeID)
+ }
+ if arg.Limit != nil {
+ params.Add("limit", *arg.Limit)
+ }
+ pathUrl.RawQuery = params.Encode()
+ uri = pathUrl.String()
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
-
- resp, err := c.Get(ctx, path.String(), &res)
+ resp, err := c.Get(ctx, uri, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -2550,11 +3902,10 @@ func (c *Client) ReservedDomainsUpdate(ctx context.Context, arg *ReservedDomainU
if err := template.Must(template.New("").Parse("/reserved_domains/{{ .ID }}")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Patch(ctx, path.String(), arg, &res)
+ resp, err := c.Patch(ctx, uri, arg, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -2568,11 +3919,10 @@ func (c *Client) ReservedDomainsDeleteCertificateManagementPolicy(ctx context.Co
if err := template.Must(template.New("").Parse("/reserved_domains/{{ .ID }}/certificate_management_policy")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Delete(ctx, path.String(), &res)
+ resp, err := c.Delete(ctx, uri, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -2586,11 +3936,10 @@ func (c *Client) ReservedDomainsDeleteCertificate(ctx context.Context, arg *Item
if err := template.Must(template.New("").Parse("/reserved_domains/{{ .ID }}/certificate")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Delete(ctx, path.String(), &res)
+ resp, err := c.Delete(ctx, uri, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -2604,11 +3953,10 @@ func (c *Client) ReservedDomainsDeleteHTTPEndpointConfig(ctx context.Context, ar
if err := template.Must(template.New("").Parse("/reserved_domains/{{ .ID }}/http_endpoint_configuration")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Delete(ctx, path.String(), &res)
+ resp, err := c.Delete(ctx, uri, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -2622,11 +3970,10 @@ func (c *Client) ReservedDomainsDeleteHTTPSEndpointConfig(ctx context.Context, a
if err := template.Must(template.New("").Parse("/reserved_domains/{{ .ID }}/https_endpoint_configuration")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Delete(ctx, path.String(), &res)
+ resp, err := c.Delete(ctx, uri, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -2639,10 +3986,9 @@ func (c *Client) RootGet(ctx context.Context, arg *Empty) (*RootResponse, *http.
if err := template.Must(template.New("").Parse("/")).Execute(&path, arg); err != nil {
panic(err)
}
+ uri := path.String()
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
-
- resp, err := c.Get(ctx, path.String(), &res)
+ resp, err := c.Get(ctx, uri, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -2656,10 +4002,9 @@ func (c *Client) SSHCertificateAuthoritiesCreate(ctx context.Context, arg *SSHCe
if err := template.Must(template.New("").Parse("/ssh_certificate_authorities")).Execute(&path, arg); err != nil {
panic(err)
}
+ uri := path.String()
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
-
- resp, err := c.Post(ctx, path.String(), arg, &res)
+ resp, err := c.Post(ctx, uri, arg, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -2673,11 +4018,10 @@ func (c *Client) SSHCertificateAuthoritiesDelete(ctx context.Context, arg *Item)
if err := template.Must(template.New("").Parse("/ssh_certificate_authorities/{{ .ID }}")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Delete(ctx, path.String(), &res)
+ resp, err := c.Delete(ctx, uri, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -2691,11 +4035,10 @@ func (c *Client) SSHCertificateAuthoritiesGet(ctx context.Context, arg *Item) (*
if err := template.Must(template.New("").Parse("/ssh_certificate_authorities/{{ .ID }}")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Get(ctx, path.String(), &res)
+ resp, err := c.Get(ctx, uri, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -2709,10 +4052,22 @@ func (c *Client) SSHCertificateAuthoritiesList(ctx context.Context, arg *Paging)
if err := template.Must(template.New("").Parse("/ssh_certificate_authorities")).Execute(&path, arg); err != nil {
panic(err)
}
+ uri := path.String()
+ pathUrl, err := url.Parse(uri)
+ if err != nil {
+ panic(err)
+ }
+ params := url.Values{}
+ if arg.BeforeID != nil {
+ params.Add("before_id", *arg.BeforeID)
+ }
+ if arg.Limit != nil {
+ params.Add("limit", *arg.Limit)
+ }
+ pathUrl.RawQuery = params.Encode()
+ uri = pathUrl.String()
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
-
- resp, err := c.Get(ctx, path.String(), &res)
+ resp, err := c.Get(ctx, uri, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -2726,11 +4081,10 @@ func (c *Client) SSHCertificateAuthoritiesUpdate(ctx context.Context, arg *SSHCe
if err := template.Must(template.New("").Parse("/ssh_certificate_authorities/{{ .ID }}")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Patch(ctx, path.String(), arg, &res)
+ resp, err := c.Patch(ctx, uri, arg, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -2744,10 +4098,9 @@ func (c *Client) SSHCredentialsCreate(ctx context.Context, arg *SSHCredentialCre
if err := template.Must(template.New("").Parse("/ssh_credentials")).Execute(&path, arg); err != nil {
panic(err)
}
+ uri := path.String()
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
-
- resp, err := c.Post(ctx, path.String(), arg, &res)
+ resp, err := c.Post(ctx, uri, arg, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -2761,11 +4114,10 @@ func (c *Client) SSHCredentialsDelete(ctx context.Context, arg *Item) (*Empty, *
if err := template.Must(template.New("").Parse("/ssh_credentials/{{ .ID }}")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Delete(ctx, path.String(), &res)
+ resp, err := c.Delete(ctx, uri, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -2779,11 +4131,10 @@ func (c *Client) SSHCredentialsGet(ctx context.Context, arg *Item) (*SSHCredenti
if err := template.Must(template.New("").Parse("/ssh_credentials/{{ .ID }}")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Get(ctx, path.String(), &res)
+ resp, err := c.Get(ctx, uri, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -2797,10 +4148,22 @@ func (c *Client) SSHCredentialsList(ctx context.Context, arg *Paging) (*SSHCrede
if err := template.Must(template.New("").Parse("/ssh_credentials")).Execute(&path, arg); err != nil {
panic(err)
}
+ uri := path.String()
+ pathUrl, err := url.Parse(uri)
+ if err != nil {
+ panic(err)
+ }
+ params := url.Values{}
+ if arg.BeforeID != nil {
+ params.Add("before_id", *arg.BeforeID)
+ }
+ if arg.Limit != nil {
+ params.Add("limit", *arg.Limit)
+ }
+ pathUrl.RawQuery = params.Encode()
+ uri = pathUrl.String()
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
-
- resp, err := c.Get(ctx, path.String(), &res)
+ resp, err := c.Get(ctx, uri, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -2814,11 +4177,10 @@ func (c *Client) SSHCredentialsUpdate(ctx context.Context, arg *SSHCredentialUpd
if err := template.Must(template.New("").Parse("/ssh_credentials/{{ .ID }}")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Patch(ctx, path.String(), arg, &res)
+ resp, err := c.Patch(ctx, uri, arg, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -2832,10 +4194,9 @@ func (c *Client) SSHHostCertificatesCreate(ctx context.Context, arg *SSHHostCert
if err := template.Must(template.New("").Parse("/ssh_host_certificates")).Execute(&path, arg); err != nil {
panic(err)
}
+ uri := path.String()
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
-
- resp, err := c.Post(ctx, path.String(), arg, &res)
+ resp, err := c.Post(ctx, uri, arg, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -2849,11 +4210,10 @@ func (c *Client) SSHHostCertificatesDelete(ctx context.Context, arg *Item) (*Emp
if err := template.Must(template.New("").Parse("/ssh_host_certificates/{{ .ID }}")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Delete(ctx, path.String(), &res)
+ resp, err := c.Delete(ctx, uri, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -2867,11 +4227,10 @@ func (c *Client) SSHHostCertificatesGet(ctx context.Context, arg *Item) (*SSHHos
if err := template.Must(template.New("").Parse("/ssh_host_certificates/{{ .ID }}")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Get(ctx, path.String(), &res)
+ resp, err := c.Get(ctx, uri, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -2885,10 +4244,22 @@ func (c *Client) SSHHostCertificatesList(ctx context.Context, arg *Paging) (*SSH
if err := template.Must(template.New("").Parse("/ssh_host_certificates")).Execute(&path, arg); err != nil {
panic(err)
}
+ uri := path.String()
+ pathUrl, err := url.Parse(uri)
+ if err != nil {
+ panic(err)
+ }
+ params := url.Values{}
+ if arg.BeforeID != nil {
+ params.Add("before_id", *arg.BeforeID)
+ }
+ if arg.Limit != nil {
+ params.Add("limit", *arg.Limit)
+ }
+ pathUrl.RawQuery = params.Encode()
+ uri = pathUrl.String()
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
-
- resp, err := c.Get(ctx, path.String(), &res)
+ resp, err := c.Get(ctx, uri, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -2902,11 +4273,10 @@ func (c *Client) SSHHostCertificatesUpdate(ctx context.Context, arg *SSHHostCert
if err := template.Must(template.New("").Parse("/ssh_host_certificates/{{ .ID }}")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Patch(ctx, path.String(), arg, &res)
+ resp, err := c.Patch(ctx, uri, arg, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -2920,10 +4290,9 @@ func (c *Client) SSHUserCertificatesCreate(ctx context.Context, arg *SSHUserCert
if err := template.Must(template.New("").Parse("/ssh_user_certificates")).Execute(&path, arg); err != nil {
panic(err)
}
+ uri := path.String()
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
-
- resp, err := c.Post(ctx, path.String(), arg, &res)
+ resp, err := c.Post(ctx, uri, arg, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -2937,11 +4306,10 @@ func (c *Client) SSHUserCertificatesDelete(ctx context.Context, arg *Item) (*Emp
if err := template.Must(template.New("").Parse("/ssh_user_certificates/{{ .ID }}")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Delete(ctx, path.String(), &res)
+ resp, err := c.Delete(ctx, uri, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -2955,11 +4323,10 @@ func (c *Client) SSHUserCertificatesGet(ctx context.Context, arg *Item) (*SSHUse
if err := template.Must(template.New("").Parse("/ssh_user_certificates/{{ .ID }}")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Get(ctx, path.String(), &res)
+ resp, err := c.Get(ctx, uri, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -2973,10 +4340,22 @@ func (c *Client) SSHUserCertificatesList(ctx context.Context, arg *Paging) (*SSH
if err := template.Must(template.New("").Parse("/ssh_user_certificates")).Execute(&path, arg); err != nil {
panic(err)
}
+ uri := path.String()
+ pathUrl, err := url.Parse(uri)
+ if err != nil {
+ panic(err)
+ }
+ params := url.Values{}
+ if arg.BeforeID != nil {
+ params.Add("before_id", *arg.BeforeID)
+ }
+ if arg.Limit != nil {
+ params.Add("limit", *arg.Limit)
+ }
+ pathUrl.RawQuery = params.Encode()
+ uri = pathUrl.String()
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
-
- resp, err := c.Get(ctx, path.String(), &res)
+ resp, err := c.Get(ctx, uri, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -2990,11 +4369,10 @@ func (c *Client) SSHUserCertificatesUpdate(ctx context.Context, arg *SSHUserCert
if err := template.Must(template.New("").Parse("/ssh_user_certificates/{{ .ID }}")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Patch(ctx, path.String(), arg, &res)
+ resp, err := c.Patch(ctx, uri, arg, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -3008,10 +4386,9 @@ func (c *Client) TLSCertificatesCreate(ctx context.Context, arg *TLSCertificateC
if err := template.Must(template.New("").Parse("/tls_certificates")).Execute(&path, arg); err != nil {
panic(err)
}
+ uri := path.String()
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
-
- resp, err := c.Post(ctx, path.String(), arg, &res)
+ resp, err := c.Post(ctx, uri, arg, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -3025,11 +4402,10 @@ func (c *Client) TLSCertificatesDelete(ctx context.Context, arg *Item) (*Empty,
if err := template.Must(template.New("").Parse("/tls_certificates/{{ .ID }}")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Delete(ctx, path.String(), &res)
+ resp, err := c.Delete(ctx, uri, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -3043,11 +4419,10 @@ func (c *Client) TLSCertificatesGet(ctx context.Context, arg *Item) (*TLSCertifi
if err := template.Must(template.New("").Parse("/tls_certificates/{{ .ID }}")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Get(ctx, path.String(), &res)
+ resp, err := c.Get(ctx, uri, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -3061,10 +4436,22 @@ func (c *Client) TLSCertificatesList(ctx context.Context, arg *Paging) (*TLSCert
if err := template.Must(template.New("").Parse("/tls_certificates")).Execute(&path, arg); err != nil {
panic(err)
}
+ uri := path.String()
+ pathUrl, err := url.Parse(uri)
+ if err != nil {
+ panic(err)
+ }
+ params := url.Values{}
+ if arg.BeforeID != nil {
+ params.Add("before_id", *arg.BeforeID)
+ }
+ if arg.Limit != nil {
+ params.Add("limit", *arg.Limit)
+ }
+ pathUrl.RawQuery = params.Encode()
+ uri = pathUrl.String()
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
-
- resp, err := c.Get(ctx, path.String(), &res)
+ resp, err := c.Get(ctx, uri, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -3078,11 +4465,10 @@ func (c *Client) TLSCertificatesUpdate(ctx context.Context, arg *TLSCertificateU
if err := template.Must(template.New("").Parse("/tls_certificates/{{ .ID }}")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Patch(ctx, path.String(), arg, &res)
+ resp, err := c.Patch(ctx, uri, arg, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -3096,10 +4482,22 @@ func (c *Client) TunnelSessionsList(ctx context.Context, arg *Paging) (*TunnelSe
if err := template.Must(template.New("").Parse("/tunnel_sessions")).Execute(&path, arg); err != nil {
panic(err)
}
+ uri := path.String()
+ pathUrl, err := url.Parse(uri)
+ if err != nil {
+ panic(err)
+ }
+ params := url.Values{}
+ if arg.BeforeID != nil {
+ params.Add("before_id", *arg.BeforeID)
+ }
+ if arg.Limit != nil {
+ params.Add("limit", *arg.Limit)
+ }
+ pathUrl.RawQuery = params.Encode()
+ uri = pathUrl.String()
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
-
- resp, err := c.Get(ctx, path.String(), &res)
+ resp, err := c.Get(ctx, uri, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -3113,11 +4511,10 @@ func (c *Client) TunnelSessionsGet(ctx context.Context, arg *Item) (*TunnelSessi
if err := template.Must(template.New("").Parse("/tunnel_sessions/{{ .ID }}")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Get(ctx, path.String(), &res)
+ resp, err := c.Get(ctx, uri, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -3131,11 +4528,10 @@ func (c *Client) TunnelSessionsRestart(ctx context.Context, arg *Item) (*Empty,
if err := template.Must(template.New("").Parse("/tunnel_sessions/{{ .ID }}/restart")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Post(ctx, path.String(), arg, &res)
+ resp, err := c.Post(ctx, uri, arg, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -3149,11 +4545,10 @@ func (c *Client) TunnelSessionsStop(ctx context.Context, arg *Item) (*Empty, *ht
if err := template.Must(template.New("").Parse("/tunnel_sessions/{{ .ID }}/stop")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Post(ctx, path.String(), arg, &res)
+ resp, err := c.Post(ctx, uri, arg, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -3167,11 +4562,10 @@ func (c *Client) TunnelSessionsUpdate(ctx context.Context, arg *TunnelSessionsUp
if err := template.Must(template.New("").Parse("/tunnel_sessions/{{ .ID }}/update")).Execute(&path, arg); err != nil {
panic(err)
}
-
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+ uri := path.String()
arg.ID = ""
- resp, err := c.Post(ctx, path.String(), arg, &res)
+ resp, err := c.Post(ctx, uri, arg, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
@@ -3185,10 +4579,39 @@ func (c *Client) TunnelsList(ctx context.Context, arg *Paging) (*TunnelList, *ht
if err := template.Must(template.New("").Parse("/tunnels")).Execute(&path, arg); err != nil {
panic(err)
}
+ uri := path.String()
+ pathUrl, err := url.Parse(uri)
+ if err != nil {
+ panic(err)
+ }
+ params := url.Values{}
+ if arg.BeforeID != nil {
+ params.Add("before_id", *arg.BeforeID)
+ }
+ if arg.Limit != nil {
+ params.Add("limit", *arg.Limit)
+ }
+ pathUrl.RawQuery = params.Encode()
+ uri = pathUrl.String()
+
+ resp, err := c.Get(ctx, uri, &res)
+ if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
+ err = nil
+ }
+ return &res, resp, err
+}
- // setting URI parameters to zero isn't really necessary but it makes the generated examples in the documentation pretty
+// Get the status of a tunnel by ID
+func (c *Client) TunnelsGet(ctx context.Context, arg *Item) (*Tunnel, *http.Response, error) {
+ var res Tunnel
+ var path bytes.Buffer
+ if err := template.Must(template.New("").Parse("/tunnels/{{ .ID }}")).Execute(&path, arg); err != nil {
+ panic(err)
+ }
+ uri := path.String()
+ arg.ID = ""
- resp, err := c.Get(ctx, path.String(), &res)
+ resp, err := c.Get(ctx, uri, &res)
if errors.Is(err, io.EOF) && resp.StatusCode == 204 {
err = nil
}
diff --git a/restapi/resources.go b/restapi/resources.go
index e5f9210..1c1fc27 100644
--- a/restapi/resources.go
+++ b/restapi/resources.go
@@ -63,6 +63,61 @@ type AbuseReportCreate struct {
Metadata string `json:"metadata,omitempty"`
}
+type AgentIngressCreate struct {
+ // human-readable description of the use of this Agent Ingress. optional, max 255
+ // bytes.
+ Description string `json:"description,omitempty"`
+ // arbitrary user-defined machine-readable data of this Agent Ingress. optional,
+ // max 4096 bytes
+ Metadata string `json:"metadata,omitempty"`
+ // the domain that you own to be used as the base domain name to generate regional
+ // agent ingress domains.
+ Domain string `json:"domain,omitempty"`
+}
+
+type AgentIngressUpdate struct {
+ ID string `json:"id,omitempty"`
+ // human-readable description of the use of this Agent Ingress. optional, max 255
+ // bytes.
+ Description *string `json:"description,omitempty"`
+ // arbitrary user-defined machine-readable data of this Agent Ingress. optional,
+ // max 4096 bytes
+ Metadata *string `json:"metadata,omitempty"`
+}
+
+type AgentIngress struct {
+ // unique Agent Ingress resource identifier
+ ID string `json:"id,omitempty"`
+ // URI to the API resource of this Agent ingress
+ URI string `json:"uri,omitempty"`
+ // human-readable description of the use of this Agent Ingress. optional, max 255
+ // bytes.
+ Description string `json:"description,omitempty"`
+ // arbitrary user-defined machine-readable data of this Agent Ingress. optional,
+ // max 4096 bytes
+ Metadata string `json:"metadata,omitempty"`
+ // the domain that you own to be used as the base domain name to generate regional
+ // agent ingress domains.
+ Domain string `json:"domain,omitempty"`
+ // a list of target values to use as the values of NS records for the domain
+ // property these values will delegate control over the domain to ngrok
+ NSTargets []string `json:"ns_targets,omitempty"`
+ // a list of regional agent ingress domains that are subdomains of the value of
+ // domain this value may increase over time as ngrok adds more regions
+ RegionDomains []string `json:"region_domains,omitempty"`
+ // timestamp when the Agent Ingress was created, RFC 3339 format
+ CreatedAt string `json:"created_at,omitempty"`
+}
+
+type AgentIngressList struct {
+ // the list of Agent Ingresses owned by this account
+ Ingresses []AgentIngress `json:"ingresses,omitempty"`
+ // URI of the Agent Ingress list API resource
+ URI string `json:"uri,omitempty"`
+ // URI of the next page, or null if there is no next page
+ NextPageURI *string `json:"next_page_uri,omitempty"`
+}
+
type APIKeyCreate struct {
// human-readable description of what uses the API key to authenticate. optional,
// max 255 bytes.
@@ -107,9 +162,11 @@ type APIKeyList struct {
NextPageURI *string `json:"next_page_uri,omitempty"`
}
-type PriorityBackend struct {
- // unique identifier for this Priority backend
+type FailoverBackend struct {
+ // unique identifier for this Failover backend
ID string `json:"id,omitempty"`
+ // URI of the FailoverBackend API resource
+ URI string `json:"uri,omitempty"`
// timestamp when the backend was created, RFC 3339 format
CreatedAt string `json:"created_at,omitempty"`
// human-readable description of this backend. Optional
@@ -120,7 +177,7 @@ type PriorityBackend struct {
Backends []string `json:"backends,omitempty"`
}
-type PriorityBackendCreate struct {
+type FailoverBackendCreate struct {
// human-readable description of this backend. Optional
Description string `json:"description,omitempty"`
// arbitrary user-defined machine-readable data of this backend. Optional
@@ -129,7 +186,7 @@ type PriorityBackendCreate struct {
Backends []string `json:"backends,omitempty"`
}
-type PriorityBackendUpdate struct {
+type FailoverBackendUpdate struct {
ID string `json:"id,omitempty"`
// human-readable description of this backend. Optional
Description *string `json:"description,omitempty"`
@@ -139,18 +196,71 @@ type PriorityBackendUpdate struct {
Backends []string `json:"backends,omitempty"`
}
-type PriorityBackendList struct {
- // the list of all Priority backends on this account
- Backends []PriorityBackend `json:"backends,omitempty"`
- // URI of the Priority backends list API resource
+type FailoverBackendList struct {
+ // the list of all Failover backends on this account
+ Backends []FailoverBackend `json:"backends,omitempty"`
+ // URI of the Failover backends list API resource
URI string `json:"uri,omitempty"`
// URI of the next page, or null if there is no next page
NextPageURI *string `json:"next_page_uri,omitempty"`
}
+type HTTPResponseBackend struct {
+ ID string `json:"id,omitempty"`
+ // URI of the HTTPResponseBackend API resource
+ URI string `json:"uri,omitempty"`
+ // timestamp when the backend was created, RFC 3339 format
+ CreatedAt string `json:"created_at,omitempty"`
+ // human-readable description of this backend. Optional
+ Description string `json:"description,omitempty"`
+ // arbitrary user-defined machine-readable data of this backend. Optional
+ Metadata string `json:"metadata,omitempty"`
+ // body to return as fixed content
+ Body string `json:"body,omitempty"`
+ // headers to return
+ Headers map[string]string `json:"headers,omitempty"`
+ // status code to return
+ StatusCode int32 `json:"status_code,omitempty"`
+}
+
+type HTTPResponseBackendCreate struct {
+ // human-readable description of this backend. Optional
+ Description string `json:"description,omitempty"`
+ // arbitrary user-defined machine-readable data of this backend. Optional
+ Metadata string `json:"metadata,omitempty"`
+ // body to return as fixed content
+ Body string `json:"body,omitempty"`
+ // headers to return
+ Headers map[string]string `json:"headers,omitempty"`
+ // status code to return
+ StatusCode *int32 `json:"status_code,omitempty"`
+}
+
+type HTTPResponseBackendUpdate struct {
+ ID string `json:"id,omitempty"`
+ // human-readable description of this backend. Optional
+ Description *string `json:"description,omitempty"`
+ // arbitrary user-defined machine-readable data of this backend. Optional
+ Metadata *string `json:"metadata,omitempty"`
+ // body to return as fixed content
+ Body *string `json:"body,omitempty"`
+ // headers to return
+ Headers *map[string]string `json:"headers,omitempty"`
+ // status code to return
+ StatusCode *int32 `json:"status_code,omitempty"`
+}
+
+type HTTPResponseBackendList struct {
+ Backends []HTTPResponseBackend `json:"backends,omitempty"`
+ URI string `json:"uri,omitempty"`
+ NextPageURI *string `json:"next_page_uri,omitempty"`
+}
+
type StaticBackend struct {
// unique identifier for this static backend
ID string `json:"id,omitempty"`
+ // URI of the StaticBackend API resource
+ URI string `json:"uri,omitempty"`
// timestamp when the backend was created, RFC 3339 format
CreatedAt string `json:"created_at,omitempty"`
// human-readable description of this backend. Optional
@@ -203,6 +313,8 @@ type StaticBackendList struct {
type TunnelGroupBackend struct {
// unique identifier for this TunnelGroup backend
ID string `json:"id,omitempty"`
+ // URI of the TunnelGroupBackend API resource
+ URI string `json:"uri,omitempty"`
// timestamp when the backend was created, RFC 3339 format
CreatedAt string `json:"created_at,omitempty"`
// human-readable description of this backend. Optional
@@ -211,6 +323,8 @@ type TunnelGroupBackend struct {
Metadata string `json:"metadata,omitempty"`
// labels to watch for tunnels on, e.g. app->foo, dc->bar
Labels map[string]string `json:"labels,omitempty"`
+ // tunnels matching this backend
+ Tunnels []Ref `json:"tunnels,omitempty"`
}
type TunnelGroupBackendCreate struct {
@@ -244,6 +358,8 @@ type TunnelGroupBackendList struct {
type WeightedBackend struct {
// unique identifier for this Weighted backend
ID string `json:"id,omitempty"`
+ // URI of the WeightedBackend API resource
+ URI string `json:"uri,omitempty"`
// timestamp when the backend was created, RFC 3339 format
CreatedAt string `json:"created_at,omitempty"`
// human-readable description of this backend. Optional
@@ -557,7 +673,7 @@ type EndpointWebhookValidation struct {
Enabled *bool `json:"enabled,omitempty"`
// a string indicating which webhook provider will be sending webhooks to this
// endpoint. Value must be one of the supported providers: SLACK, SNS, STRIPE,
- // GITHUB, TWILIO, SHOPIFY, GITLAB, INTERCOM.
+ // GITHUB, TWILIO, SHOPIFY, GITLAB, INTERCOM, SENDGRID, XERO, PAGERDUTY.
Provider string `json:"provider,omitempty"`
// a string secret used to validate requests from the given provider. All providers
// except AWS SNS require a secret
@@ -603,13 +719,24 @@ type EndpointTLSTermination struct {
MinVersion *string `json:"min_version,omitempty"`
}
+type EndpointTLSTerminationAtEdge struct {
+ // true if the module will be applied to traffic, false to disable. default true if
+ // unspecified
+ Enabled *bool `json:"enabled,omitempty"`
+ // The minimum TLS version used for termination and advertised to the client during
+ // the TLS handshake. if unspecified, ngrok will choose an industry-safe default.
+ // This value must be null if terminate_at is set to upstream.
+ MinVersion *string `json:"min_version,omitempty"`
+}
+
type EndpointBasicAuth struct {
// true if the module will be applied to traffic, false to disable. default true if
// unspecified
Enabled *bool `json:"enabled,omitempty"`
// determines how the basic auth credentials are validated. Currently only the
// value agent is supported which means that credentials will be validated against
- // the username and password specified by the ngrok agent's -auth flag, if any.
+ // the username and password specified by the ngrok agent's --basic-auth flag, if
+ // any.
AuthProviderID string `json:"auth_provider_id,omitempty"`
// an arbitrary string to be specified in as the 'realm' value in the
// WWW-Authenticate header. default is ngrok
@@ -892,6 +1019,11 @@ type EndpointSAML struct {
// A public URL where the SP's metadata is hosted. If an IdP supports dynamic
// configuration, this is the URL it can use to retrieve the SP metadata.
MetadataURL string `json:"metadata_url,omitempty"`
+ // Defines the name identifier format the SP expects the IdP to use in its
+ // assertions to identify subjects. If unspecified, a default value of
+ // urn:oasis:names:tc:SAML:2.0:nameid-format:persistent will be used. A subset of
+ // the allowed values enumerated by the SAML specification are supported.
+ NameIDFormat string `json:"nameid_format,omitempty"`
}
type EndpointSAMLMutate struct {
@@ -931,6 +1063,11 @@ type EndpointSAMLMutate struct {
// If present, only users who are a member of one of the listed groups may access
// the target endpoint.
AuthorizedGroups []string `json:"authorized_groups,omitempty"`
+ // Defines the name identifier format the SP expects the IdP to use in its
+ // assertions to identify subjects. If unspecified, a default value of
+ // urn:oasis:names:tc:SAML:2.0:nameid-format:persistent will be used. A subset of
+ // the allowed values enumerated by the SAML specification are supported.
+ NameIDFormat string `json:"nameid_format,omitempty"`
}
type EndpointOIDC struct {
@@ -976,6 +1113,293 @@ type EndpointBackendMutate struct {
BackendID string `json:"backend_id,omitempty"`
}
+type EndpointWebsocketTCPConverter struct {
+ // true if the module will be applied to traffic, false to disable. default true if
+ // unspecified
+ Enabled *bool `json:"enabled,omitempty"`
+}
+
+type EdgeRouteItem struct {
+ // unique identifier of this edge
+ EdgeID string `json:"edge_id,omitempty"`
+ // unique identifier of this edge route
+ ID string `json:"id,omitempty"`
+}
+
+type HTTPSEdgeRouteCreate struct {
+ // unique identifier of this edge
+ EdgeID string `json:"edge_id,omitempty"`
+ // Type of match to use for this route. Valid values are "exact_path" and
+ // "path_prefix".
+ MatchType string `json:"match_type,omitempty"`
+ // Route selector: "/blog" or "example.com" or "example.com/blog"
+ Match string `json:"match,omitempty"`
+ // human-readable description of what this edge will be used for; optional, max 255
+ // bytes.
+ Description string `json:"description,omitempty"`
+ // arbitrary user-defined machine-readable data of this edge. Optional, max 4096
+ // bytes.
+ Metadata string `json:"metadata,omitempty"`
+ // backend module configuration or null
+ Backend *EndpointBackendMutate `json:"backend,omitempty"`
+ // ip restriction module configuration or null
+ IPRestriction *EndpointIPPolicyMutate `json:"ip_restriction,omitempty"`
+ // circuit breaker module configuration or null
+ CircuitBreaker *EndpointCircuitBreaker `json:"circuit_breaker,omitempty"`
+ // compression module configuration or null
+ Compression *EndpointCompression `json:"compression,omitempty"`
+ // request headers module configuration or null
+ RequestHeaders *EndpointRequestHeaders `json:"request_headers,omitempty"`
+ // response headers module configuration or null
+ ResponseHeaders *EndpointResponseHeaders `json:"response_headers,omitempty"`
+ // webhook verification module configuration or null
+ WebhookVerification *EndpointWebhookValidation `json:"webhook_verification,omitempty"`
+ // oauth module configuration or null
+ OAuth *EndpointOAuth `json:"oauth,omitempty"`
+ // saml module configuration or null
+ SAML *EndpointSAMLMutate `json:"saml,omitempty"`
+ // oidc module configuration or null
+ OIDC *EndpointOIDC `json:"oidc,omitempty"`
+ // websocket to tcp adapter configuration or null
+ WebsocketTCPConverter *EndpointWebsocketTCPConverter `json:"websocket_tcp_converter,omitempty"`
+}
+
+type HTTPSEdgeRouteUpdate struct {
+ // unique identifier of this edge
+ EdgeID string `json:"edge_id,omitempty"`
+ // unique identifier of this edge route
+ ID string `json:"id,omitempty"`
+ // Type of match to use for this route. Valid values are "exact_path" and
+ // "path_prefix".
+ MatchType string `json:"match_type,omitempty"`
+ // Route selector: "/blog" or "example.com" or "example.com/blog"
+ Match string `json:"match,omitempty"`
+ // human-readable description of what this edge will be used for; optional, max 255
+ // bytes.
+ Description string `json:"description,omitempty"`
+ // arbitrary user-defined machine-readable data of this edge. Optional, max 4096
+ // bytes.
+ Metadata string `json:"metadata,omitempty"`
+ // backend module configuration or null
+ Backend *EndpointBackendMutate `json:"backend,omitempty"`
+ // ip restriction module configuration or null
+ IPRestriction *EndpointIPPolicyMutate `json:"ip_restriction,omitempty"`
+ // circuit breaker module configuration or null
+ CircuitBreaker *EndpointCircuitBreaker `json:"circuit_breaker,omitempty"`
+ // compression module configuration or null
+ Compression *EndpointCompression `json:"compression,omitempty"`
+ // request headers module configuration or null
+ RequestHeaders *EndpointRequestHeaders `json:"request_headers,omitempty"`
+ // response headers module configuration or null
+ ResponseHeaders *EndpointResponseHeaders `json:"response_headers,omitempty"`
+ // webhook verification module configuration or null
+ WebhookVerification *EndpointWebhookValidation `json:"webhook_verification,omitempty"`
+ // oauth module configuration or null
+ OAuth *EndpointOAuth `json:"oauth,omitempty"`
+ // saml module configuration or null
+ SAML *EndpointSAMLMutate `json:"saml,omitempty"`
+ // oidc module configuration or null
+ OIDC *EndpointOIDC `json:"oidc,omitempty"`
+ // websocket to tcp adapter configuration or null
+ WebsocketTCPConverter *EndpointWebsocketTCPConverter `json:"websocket_tcp_converter,omitempty"`
+}
+
+type HTTPSEdgeRoute struct {
+ // unique identifier of this edge
+ EdgeID string `json:"edge_id,omitempty"`
+ // unique identifier of this edge route
+ ID string `json:"id,omitempty"`
+ // timestamp when the edge configuration was created, RFC 3339 format
+ CreatedAt string `json:"created_at,omitempty"`
+ // Type of match to use for this route. Valid values are "exact_path" and
+ // "path_prefix".
+ MatchType string `json:"match_type,omitempty"`
+ // Route selector: "/blog" or "example.com" or "example.com/blog"
+ Match string `json:"match,omitempty"`
+ // URI of the edge API resource
+ URI string `json:"uri,omitempty"`
+ // human-readable description of what this edge will be used for; optional, max 255
+ // bytes.
+ Description string `json:"description,omitempty"`
+ // arbitrary user-defined machine-readable data of this edge. Optional, max 4096
+ // bytes.
+ Metadata string `json:"metadata,omitempty"`
+ // backend module configuration or null
+ Backend *EndpointBackend `json:"backend,omitempty"`
+ // ip restriction module configuration or null
+ IpRestriction *EndpointIPPolicy `json:"ip_restriction,omitempty"`
+ // circuit breaker module configuration or null
+ CircuitBreaker *EndpointCircuitBreaker `json:"circuit_breaker,omitempty"`
+ // compression module configuration or null
+ Compression *EndpointCompression `json:"compression,omitempty"`
+ // request headers module configuration or null
+ RequestHeaders *EndpointRequestHeaders `json:"request_headers,omitempty"`
+ // response headers module configuration or null
+ ResponseHeaders *EndpointResponseHeaders `json:"response_headers,omitempty"`
+ // webhook verification module configuration or null
+ WebhookVerification *EndpointWebhookValidation `json:"webhook_verification,omitempty"`
+ // oauth module configuration or null
+ OAuth *EndpointOAuth `json:"oauth,omitempty"`
+ // saml module configuration or null
+ SAML *EndpointSAML `json:"saml,omitempty"`
+ // oidc module configuration or null
+ OIDC *EndpointOIDC `json:"oidc,omitempty"`
+ // websocket to tcp adapter configuration or null
+ WebsocketTCPConverter *EndpointWebsocketTCPConverter `json:"websocket_tcp_converter,omitempty"`
+}
+
+type HTTPSEdgeList struct {
+ // the list of all HTTPS Edges on this account
+ HTTPSEdges []HTTPSEdge `json:"https_edges,omitempty"`
+ // URI of the HTTPS Edge list API resource
+ URI string `json:"uri,omitempty"`
+ // URI of the next page, or null if there is no next page
+ NextPageURI *string `json:"next_page_uri,omitempty"`
+}
+
+type HTTPSEdgeCreate struct {
+ // human-readable description of what this edge will be used for; optional, max 255
+ // bytes.
+ Description string `json:"description,omitempty"`
+ // arbitrary user-defined machine-readable data of this edge; optional, max 4096
+ // bytes.
+ Metadata string `json:"metadata,omitempty"`
+ // hostports served by this edge
+ Hostports *[]string `json:"hostports,omitempty"`
+ // edge modules
+ MutualTLS *EndpointMutualTLSMutate `json:"mutual_tls,omitempty"`
+ TLSTermination *EndpointTLSTerminationAtEdge `json:"tls_termination,omitempty"`
+}
+
+type HTTPSEdgeUpdate struct {
+ // unique identifier of this edge
+ ID string `json:"id,omitempty"`
+ // human-readable description of what this edge will be used for; optional, max 255
+ // bytes.
+ Description *string `json:"description,omitempty"`
+ // arbitrary user-defined machine-readable data of this edge; optional, max 4096
+ // bytes.
+ Metadata *string `json:"metadata,omitempty"`
+ // hostports served by this edge
+ Hostports *[]string `json:"hostports,omitempty"`
+ // edge modules
+ MutualTLS *EndpointMutualTLSMutate `json:"mutual_tls,omitempty"`
+ TLSTermination *EndpointTLSTerminationAtEdge `json:"tls_termination,omitempty"`
+}
+
+type HTTPSEdge struct {
+ // unique identifier of this edge
+ ID string `json:"id,omitempty"`
+ // human-readable description of what this edge will be used for; optional, max 255
+ // bytes.
+ Description string `json:"description,omitempty"`
+ // arbitrary user-defined machine-readable data of this edge; optional, max 4096
+ // bytes.
+ Metadata string `json:"metadata,omitempty"`
+ // timestamp when the edge configuration was created, RFC 3339 format
+ CreatedAt string `json:"created_at,omitempty"`
+ // URI of the edge API resource
+ URI string `json:"uri,omitempty"`
+ // hostports served by this edge
+ Hostports *[]string `json:"hostports,omitempty"`
+ // edge modules
+ MutualTls *EndpointMutualTLS `json:"mutual_tls,omitempty"`
+ TlsTermination *EndpointTLSTermination `json:"tls_termination,omitempty"`
+ // routes
+ Routes []HTTPSEdgeRoute `json:"routes,omitempty"`
+}
+
+type EdgeBackendReplace struct {
+ ID string `json:"id,omitempty"`
+ Module EndpointBackendMutate `json:"module,omitempty"`
+}
+
+type EdgeIPRestrictionReplace struct {
+ ID string `json:"id,omitempty"`
+ Module EndpointIPPolicyMutate `json:"module,omitempty"`
+}
+
+type EdgeMutualTLSReplace struct {
+ ID string `json:"id,omitempty"`
+ Module EndpointMutualTLSMutate `json:"module,omitempty"`
+}
+
+type EdgeTLSTerminationReplace struct {
+ ID string `json:"id,omitempty"`
+ Module EndpointTLSTermination `json:"module,omitempty"`
+}
+
+type EdgeTLSTerminationAtEdgeReplace struct {
+ ID string `json:"id,omitempty"`
+ Module EndpointTLSTerminationAtEdge `json:"module,omitempty"`
+}
+
+type EdgeRouteBackendReplace struct {
+ EdgeID string `json:"edge_id,omitempty"`
+ ID string `json:"id,omitempty"`
+ Module EndpointBackendMutate `json:"module,omitempty"`
+}
+
+type EdgeRouteIPRestrictionReplace struct {
+ EdgeID string `json:"edge_id,omitempty"`
+ ID string `json:"id,omitempty"`
+ Module EndpointIPPolicyMutate `json:"module,omitempty"`
+}
+
+type EdgeRouteRequestHeadersReplace struct {
+ EdgeID string `json:"edge_id,omitempty"`
+ ID string `json:"id,omitempty"`
+ Module EndpointRequestHeaders `json:"module,omitempty"`
+}
+
+type EdgeRouteResponseHeadersReplace struct {
+ EdgeID string `json:"edge_id,omitempty"`
+ ID string `json:"id,omitempty"`
+ Module EndpointResponseHeaders `json:"module,omitempty"`
+}
+
+type EdgeRouteCompressionReplace struct {
+ EdgeID string `json:"edge_id,omitempty"`
+ ID string `json:"id,omitempty"`
+ Module EndpointCompression `json:"module,omitempty"`
+}
+
+type EdgeRouteCircuitBreakerReplace struct {
+ EdgeID string `json:"edge_id,omitempty"`
+ ID string `json:"id,omitempty"`
+ Module EndpointCircuitBreaker `json:"module,omitempty"`
+}
+
+type EdgeRouteWebhookVerificationReplace struct {
+ EdgeID string `json:"edge_id,omitempty"`
+ ID string `json:"id,omitempty"`
+ Module EndpointWebhookValidation `json:"module,omitempty"`
+}
+
+type EdgeRouteOAuthReplace struct {
+ EdgeID string `json:"edge_id,omitempty"`
+ ID string `json:"id,omitempty"`
+ Module EndpointOAuth `json:"module,omitempty"`
+}
+
+type EdgeRouteSAMLReplace struct {
+ EdgeID string `json:"edge_id,omitempty"`
+ ID string `json:"id,omitempty"`
+ Module EndpointSAMLMutate `json:"module,omitempty"`
+}
+
+type EdgeRouteOIDCReplace struct {
+ EdgeID string `json:"edge_id,omitempty"`
+ ID string `json:"id,omitempty"`
+ Module EndpointOIDC `json:"module,omitempty"`
+}
+
+type EdgeRouteWebsocketTCPConverterReplace struct {
+ EdgeID string `json:"edge_id,omitempty"`
+ ID string `json:"id,omitempty"`
+ Module EndpointWebsocketTCPConverter `json:"module,omitempty"`
+}
+
type TCPEdgeList struct {
// the list of all TCP Edges on this account
TCPEdges []TCPEdge `json:"tcp_edges,omitempty"`
@@ -986,12 +1410,14 @@ type TCPEdgeList struct {
}
type TCPEdgeCreate struct {
- // human-readable description of what this edge will be do when applied or what
- // traffic it will be applied to. Optional, max 255 bytes
+ // human-readable description of what this edge will be used for; optional, max 255
+ // bytes.
Description string `json:"description,omitempty"`
// arbitrary user-defined machine-readable data of this edge. Optional, max 4096
// bytes.
Metadata string `json:"metadata,omitempty"`
+ // hostports served by this edge
+ Hostports *[]string `json:"hostports,omitempty"`
// edge modules
Backend *EndpointBackendMutate `json:"backend,omitempty"`
IPRestriction *EndpointIPPolicyMutate `json:"ip_restriction,omitempty"`
@@ -1000,12 +1426,14 @@ type TCPEdgeCreate struct {
type TCPEdgeUpdate struct {
// unique identifier of this edge
ID string `json:"id,omitempty"`
- // human-readable description of what this edge will be do when applied or what
- // traffic it will be applied to. Optional, max 255 bytes
+ // human-readable description of what this edge will be used for; optional, max 255
+ // bytes.
Description *string `json:"description,omitempty"`
// arbitrary user-defined machine-readable data of this edge. Optional, max 4096
// bytes.
Metadata *string `json:"metadata,omitempty"`
+ // hostports served by this edge
+ Hostports *[]string `json:"hostports,omitempty"`
// edge modules
Backend *EndpointBackendMutate `json:"backend,omitempty"`
IPRestriction *EndpointIPPolicyMutate `json:"ip_restriction,omitempty"`
@@ -1014,8 +1442,8 @@ type TCPEdgeUpdate struct {
type TCPEdge struct {
// unique identifier of this edge
ID string `json:"id,omitempty"`
- // human-readable description of what this edge will be do when applied or what
- // traffic it will be applied to. Optional, max 255 bytes
+ // human-readable description of what this edge will be used for; optional, max 255
+ // bytes.
Description string `json:"description,omitempty"`
// arbitrary user-defined machine-readable data of this edge. Optional, max 4096
// bytes.
@@ -1024,6 +1452,8 @@ type TCPEdge struct {
CreatedAt string `json:"created_at,omitempty"`
// URI of the edge API resource
URI string `json:"uri,omitempty"`
+ // hostports served by this edge
+ Hostports *[]string `json:"hostports,omitempty"`
// edge modules
Backend *EndpointBackend `json:"backend,omitempty"`
IpRestriction *EndpointIPPolicy `json:"ip_restriction,omitempty"`
@@ -1039,12 +1469,14 @@ type TLSEdgeList struct {
}
type TLSEdgeCreate struct {
- // human-readable description of what this edge will be do when applied or what
- // traffic it will be applied to. Optional, max 255 bytes
+ // human-readable description of what this edge will be used for; optional, max 255
+ // bytes.
Description string `json:"description,omitempty"`
// arbitrary user-defined machine-readable data of this edge. Optional, max 4096
// bytes.
Metadata string `json:"metadata,omitempty"`
+ // hostports served by this edge
+ Hostports *[]string `json:"hostports,omitempty"`
// edge modules
Backend *EndpointBackendMutate `json:"backend,omitempty"`
IPRestriction *EndpointIPPolicyMutate `json:"ip_restriction,omitempty"`
@@ -1055,12 +1487,14 @@ type TLSEdgeCreate struct {
type TLSEdgeUpdate struct {
// unique identifier of this edge
ID string `json:"id,omitempty"`
- // human-readable description of what this edge will be do when applied or what
- // traffic it will be applied to. Optional, max 255 bytes
+ // human-readable description of what this edge will be used for; optional, max 255
+ // bytes.
Description *string `json:"description,omitempty"`
// arbitrary user-defined machine-readable data of this edge. Optional, max 4096
// bytes.
Metadata *string `json:"metadata,omitempty"`
+ // hostports served by this edge
+ Hostports *[]string `json:"hostports,omitempty"`
// edge modules
Backend *EndpointBackendMutate `json:"backend,omitempty"`
IPRestriction *EndpointIPPolicyMutate `json:"ip_restriction,omitempty"`
@@ -1071,8 +1505,8 @@ type TLSEdgeUpdate struct {
type TLSEdge struct {
// unique identifier of this edge
ID string `json:"id,omitempty"`
- // human-readable description of what this edge will be do when applied or what
- // traffic it will be applied to. Optional, max 255 bytes
+ // human-readable description of what this edge will be used for; optional, max 255
+ // bytes.
Description string `json:"description,omitempty"`
// arbitrary user-defined machine-readable data of this edge. Optional, max 4096
// bytes.
@@ -1081,6 +1515,8 @@ type TLSEdge struct {
CreatedAt string `json:"created_at,omitempty"`
// URI of the edge API resource
URI string `json:"uri,omitempty"`
+ // hostports served by this edge
+ Hostports *[]string `json:"hostports,omitempty"`
// edge modules
Backend *EndpointBackend `json:"backend,omitempty"`
IpRestriction *EndpointIPPolicy `json:"ip_restriction,omitempty"`
@@ -1088,6 +1524,45 @@ type TLSEdge struct {
TlsTermination *EndpointTLSTermination `json:"tls_termination,omitempty"`
}
+type Endpoint struct {
+ // unique endpoint resource identifier
+ ID string `json:"id,omitempty"`
+ // identifier of the region this endpoint belongs to
+ Region string `json:"region,omitempty"`
+ // timestamp when the endpoint was created in RFC 3339 format
+ CreatedAt string `json:"created_at,omitempty"`
+ // timestamp when the endpoint was updated in RFC 3339 format
+ UpdatedAt string `json:"updated_at,omitempty"`
+ // URL of the hostport served by this endpoint
+ PublicURL string `json:"public_url,omitempty"`
+ // protocol served by this endpoint. one of http, https, tcp, or tls
+ Proto string `json:"proto,omitempty"`
+ // hostport served by this endpoint (hostname:port)
+ Hostport string `json:"hostport,omitempty"`
+ // whether the endpoint is ephemeral (served directly by an agent-initiated tunnel)
+ // or edge (served by an edge)
+ Type string `json:"type,omitempty"`
+ // user-supplied metadata of the associated tunnel or edge object
+ Metadata string `json:"metadata,omitempty"`
+ // the domain reserved for this endpoint
+ Domain *Ref `json:"domain,omitempty"`
+ // the address reserved for this endpoint
+ TCPAddr *Ref `json:"tcp_addr,omitempty"`
+ // the tunnel serving requests to this endpoint, if this is an ephemeral endpoint
+ Tunnel *Ref `json:"tunnel,omitempty"`
+ // the edge serving requests to this endpoint, if this is an edge endpoint
+ Edge *Ref `json:"edge,omitempty"`
+}
+
+type EndpointList struct {
+ // the list of all active endpoints on this account
+ Endpoints []Endpoint `json:"endpoints,omitempty"`
+ // URI of the endpoints list API resource
+ URI string `json:"uri,omitempty"`
+ // URI of the next page, or null if there is no next page
+ NextPageURI *string `json:"next_page_uri,omitempty"`
+}
+
type EventStreamCreate struct {
// Arbitrary user-defined machine-readable data of this Event Stream. Optional, max
// 4096 bytes.
@@ -1318,8 +1793,8 @@ type EventSubscriptionCreate struct {
Description string `json:"description,omitempty"`
// Sources containing the types for which this event subscription will trigger
Sources []EventSourceReplace `json:"sources,omitempty"`
- // A list of Event Destination IDs which should be used for this Event Stream.
- // Event Streams are required to have at least one Event Destination.
+ // A list of Event Destination IDs which should be used for this Event
+ // Subscription.
DestinationIDs []string `json:"destination_ids,omitempty"`
}
@@ -1334,8 +1809,8 @@ type EventSubscriptionUpdate struct {
Description *string `json:"description,omitempty"`
// Sources containing the types for which this event subscription will trigger
Sources *[]EventSourceReplace `json:"sources,omitempty"`
- // A list of Event Destination IDs which should be used for this Event Stream.
- // Event Streams are required to have at least one Event Destination.
+ // A list of Event Destination IDs which should be used for this Event
+ // Subscription.
DestinationIDs *[]string `json:"destination_ids,omitempty"`
}
@@ -1441,8 +1916,10 @@ type IPPolicyCreate struct {
// arbitrary user-defined machine-readable data of this IP policy. optional, max
// 4096 bytes.
Metadata string `json:"metadata,omitempty"`
- // the IP policy action. Supported values are allow or deny
- Action string `json:"action,omitempty"`
+ // this field is deprecated. Please leave it empty and use the ip policy rule
+ // object's "action" field instead. It is temporarily retained for backwards
+ // compatibility reasons.
+ Action *string `json:"action,omitempty"`
}
type IPPolicyUpdate struct {
@@ -1468,8 +1945,10 @@ type IPPolicy struct {
// arbitrary user-defined machine-readable data of this IP policy. optional, max
// 4096 bytes.
Metadata string `json:"metadata,omitempty"`
- // the IP policy action. Supported values are allow or deny
- Action string `json:"action,omitempty"`
+ // this field is deprecated. Please leave it empty and use the ip policy rule
+ // object's "action" field instead. It is temporarily retained for backwards
+ // compatibility reasons.
+ Action *string `json:"action,omitempty"`
}
type IPPolicyList struct {
@@ -1492,6 +1971,8 @@ type IPPolicyRuleCreate struct {
CIDR string `json:"cidr,omitempty"`
// ID of the IP policy this IP policy rule will be attached to
IPPolicyID string `json:"ip_policy_id,omitempty"`
+ // the action to apply to the policy rule, either allow or deny
+ Action *string `json:"action,omitempty"`
}
type IPPolicyRuleUpdate struct {
@@ -1523,6 +2004,8 @@ type IPPolicyRule struct {
CIDR string `json:"cidr,omitempty"`
// object describing the IP policy this IP Policy Rule belongs to
IPPolicy Ref `json:"ip_policy,omitempty"`
+ // the action to apply to the policy rule, either allow or deny
+ Action string `json:"action,omitempty"`
}
type IPPolicyRuleList struct {
@@ -1597,57 +2080,6 @@ type IPRestrictionList struct {
NextPageURI *string `json:"next_page_uri,omitempty"`
}
-type IPWhitelistEntryCreate struct {
- // human-readable description of the source IPs for this IP whitelist entry.
- // optional, max 255 bytes.
- Description string `json:"description,omitempty"`
- // arbitrary user-defined machine-readable data of this IP whitelist entry.
- // optional, max 4096 bytes.
- Metadata string `json:"metadata,omitempty"`
- // an IP address or IP network range in CIDR notation (e.g. 10.1.1.1 or
- // 10.1.0.0/16) of addresses that will be whitelisted to communicate with your
- // tunnel endpoints
- IPNet string `json:"ip_net,omitempty"`
-}
-
-type IPWhitelistEntryUpdate struct {
- ID string `json:"id,omitempty"`
- // human-readable description of the source IPs for this IP whitelist entry.
- // optional, max 255 bytes.
- Description *string `json:"description,omitempty"`
- // arbitrary user-defined machine-readable data of this IP whitelist entry.
- // optional, max 4096 bytes.
- Metadata *string `json:"metadata,omitempty"`
-}
-
-type IPWhitelistEntry struct {
- // unique identifier for this IP whitelist entry
- ID string `json:"id,omitempty"`
- // URI of the IP whitelist entry API resource
- URI string `json:"uri,omitempty"`
- // timestamp when the IP whitelist entry was created, RFC 3339 format
- CreatedAt string `json:"created_at,omitempty"`
- // human-readable description of the source IPs for this IP whitelist entry.
- // optional, max 255 bytes.
- Description string `json:"description,omitempty"`
- // arbitrary user-defined machine-readable data of this IP whitelist entry.
- // optional, max 4096 bytes.
- Metadata string `json:"metadata,omitempty"`
- // an IP address or IP network range in CIDR notation (e.g. 10.1.1.1 or
- // 10.1.0.0/16) of addresses that will be whitelisted to communicate with your
- // tunnel endpoints
- IPNet string `json:"ip_net,omitempty"`
-}
-
-type IPWhitelistEntryList struct {
- // the list of all IP whitelist entries on this account
- Whitelist []IPWhitelistEntry `json:"whitelist,omitempty"`
- // URI of the IP whitelist API resource
- URI string `json:"uri,omitempty"`
- // URI of the next page, or null if there is no next page
- NextPageURI *string `json:"next_page_uri,omitempty"`
-}
-
type EndpointLoggingReplace struct {
ID string `json:"id,omitempty"`
Module EndpointLoggingMutate `json:"module,omitempty"`
@@ -1729,7 +2161,7 @@ type ReservedAddrCreate struct {
Region string `json:"region,omitempty"`
// ID of an endpoint configuration of type tcp that will be used to handle inbound
// traffic to this address
- EndpointConfigurationID string `json:"endpoint_configuration_id,omitempty"`
+ EndpointConfigurationID *string `json:"endpoint_configuration_id,omitempty"`
}
type ReservedAddrUpdate struct {
@@ -1860,6 +2292,11 @@ type ReservedDomain struct {
// status of the automatic certificate management for this domain, or null if
// automatic management is disabled
CertificateManagementStatus *ReservedDomainCertStatus `json:"certificate_management_status,omitempty"`
+ // DNS CNAME target for the host _acme-challenge.example.com, where example.com is
+ // your reserved domain name. This is required to issue certificates for wildcard,
+ // non-ngrok reserved domains. Must be null for non-wildcard domains and ngrok
+ // subdomains.
+ ACMEChallengeCNAMETarget *string `json:"acme_challenge_cname_target,omitempty"`
}
type ReservedDomainList struct {
@@ -1888,13 +2325,6 @@ type ReservedDomainCertStatus struct {
ProvisioningJob *ReservedDomainCertJob `json:"provisioning_job,omitempty"`
}
-type ReservedDomainCertNSTarget struct {
- // the zone that the nameservers need to be applied to
- Zone string `json:"zone,omitempty"`
- // the nameservers the user must add
- Nameservers []string `json:"nameservers,omitempty"`
-}
-
type ReservedDomainCertJob struct {
// if present, an error code indicating why provisioning is failing. It may be
// either a temporary condition (INTERNAL_ERROR), or a permanent one the user must
@@ -1906,9 +2336,6 @@ type ReservedDomainCertJob struct {
StartedAt string `json:"started_at,omitempty"`
// timestamp when the provisioning job will be retried
RetriesAt *string `json:"retries_at,omitempty"`
- // if present, indicates the dns nameservers that the user must configure to
- // complete the provisioning process of a wildcard certificate
- NSTargets []ReservedDomainCertNSTarget `json:"ns_targets,omitempty"`
}
type RootResponse struct {
@@ -2367,7 +2794,7 @@ type TunnelSessionsUpdate struct {
type Tunnel struct {
// unique tunnel resource identifier
ID string `json:"id,omitempty"`
- // URL of the tunnel's public endpoint
+ // URL of the ephemeral tunnel's public endpoint
PublicURL string `json:"public_url,omitempty"`
// timestamp when the tunnel was initiated in RFC 3339 format
StartedAt string `json:"started_at,omitempty"`
@@ -2377,12 +2804,23 @@ type Tunnel struct {
// top-level (https://ngrok.com/docs#config_metadata)metadata configuration
// option.
Metadata string `json:"metadata,omitempty"`
- // tunnel protocol. one of http, https, tcp or tls
+ // tunnel protocol for ephemeral tunnels. one of http, https, tcp or tls
Proto string `json:"proto,omitempty"`
// identifier of tune region where the tunnel is running
Region string `json:"region,omitempty"`
// reference object pointing to the tunnel session on which this tunnel was started
TunnelSession Ref `json:"tunnel_session,omitempty"`
+ // the ephemeral endpoint this tunnel is associated with, if this is an
+ // agent-initiated tunnel
+ Endpoint *Ref `json:"endpoint,omitempty"`
+ // the labels the tunnel group backends will match against, if this is a backend
+ // tunnel
+ Labels map[string]string `json:"labels,omitempty"`
+ // tunnel group backends served by this backend tunnel
+ Backends *[]Ref `json:"backends,omitempty"`
+ // upstream address the ngrok agent forwards traffic over this tunnel to. this may
+ // be expressed as a URL or a network address.
+ ForwardsTo string `json:"forwards_to,omitempty"`
}
type TunnelList struct {