From 93426ae7112e2b0e8331ed14d4503c6f35fa3fd4 Mon Sep 17 00:00:00 2001 From: skpratt Date: Sun, 11 Feb 2024 10:10:39 -0600 Subject: [PATCH] wip: attempt to use generated api client --- CHANGELOG.md | 2 +- consul/config.go | 51 +- consul/resource_consul_acl_role.go | 2 +- ...onsul_config_entry_v2_exported_services.go | 122 +- consul/resource_provider.go | 31 +- consul/resource_provider_test.go | 6 +- consul/tools/openapi/multicluster-v2.gen.go | 5493 +++++++++++++++++ .../tools/openapi/multicluster-v2.openapi.yml | 1340 ++++ consul/tools/v2_api_helpers.go | 48 + docs/data-sources/nodes.md | 4 +- docs/data-sources/service.md | 4 +- docs/data-sources/services.md | 4 +- docs/index.md | 2 +- go.mod | 61 +- go.sum | 168 +- templates/data-sources/nodes.md | 4 +- templates/data-sources/service.md | 4 +- templates/data-sources/services.md | 4 +- 18 files changed, 7231 insertions(+), 119 deletions(-) create mode 100644 consul/tools/openapi/multicluster-v2.gen.go create mode 100644 consul/tools/openapi/multicluster-v2.openapi.yml create mode 100644 consul/tools/v2_api_helpers.go diff --git a/CHANGELOG.md b/CHANGELOG.md index 913768f1..0a664a8f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -151,7 +151,7 @@ NEW FEATURES: BUG FIXES: -* The same API client is now reused across all operations ([[#233](https://github.com/hashicorp/terraform-provider-consul/issues/233)]). +* The same API Client is now reused across all operations ([[#233](https://github.com/hashicorp/terraform-provider-consul/issues/233)]). ## 2.10.0 (September 18, 2020) diff --git a/consul/config.go b/consul/config.go index bf2a08aa..7445acbd 100644 --- a/consul/config.go +++ b/consul/config.go @@ -10,6 +10,9 @@ import ( "strings" consulapi "github.com/hashicorp/consul/api" + + "github.com/hashicorp/terraform-provider-consul/consul/tools" + multicluster "github.com/hashicorp/terraform-provider-consul/consul/tools/openapi" ) // Config is configuration defined in the provider block @@ -29,11 +32,12 @@ type Config struct { InsecureHttps bool `mapstructure:"insecure_https"` Namespace string `mapstructure:"namespace"` - client *consulapi.Client + Client *consulapi.Client + V2Client *multicluster.Client } -// Client returns a new client for accessing consul. -func (c *Config) Client() (*consulapi.Client, error) { +// Client returns a new Client for accessing consul. +func (c *Config) getApiConfig() (*consulapi.Config, error) { config := consulapi.DefaultConfig() if c.Datacenter != "" { config.Datacenter = c.Datacenter @@ -74,7 +78,7 @@ func (c *Config) Client() (*consulapi.Client, error) { } // This is a temporary workaround to add the Content-Type header when - // needed until the fix is released in the Consul api client. + // needed until the fix is released in the Consul api Client. config.HttpClient = &http.Client{ Transport: transport{config.Transport}, } @@ -83,7 +87,7 @@ func (c *Config) Client() (*consulapi.Client, error) { tlsClientConfig, err := consulapi.SetupTLSConfig(&config.TLSConfig) if err != nil { - return nil, fmt.Errorf("failed to create http client: %s", err) + return nil, fmt.Errorf("failed to create http Client config: %s", err) } config.Transport.TLSClientConfig = tlsClientConfig @@ -104,10 +108,19 @@ func (c *Config) Client() (*consulapi.Client, error) { if c.Token != "" { config.Token = c.Token } + return config, nil +} + +func (c *Config) getClient() (*consulapi.Client, error) { + + config, err := c.getApiConfig() + if err != nil { + return nil, err + } client, err := consulapi.NewClient(config) - log.Printf("[INFO] Consul Client configured with address: '%s', scheme: '%s', datacenter: '%s'"+ + log.Printf("[INFO] Consul getClient configured with address: '%s', scheme: '%s', datacenter: '%s'"+ ", insecure_https: '%t'", config.Address, config.Scheme, config.Datacenter, config.TLSConfig.InsecureSkipVerify) if err != nil { return nil, err @@ -115,8 +128,32 @@ func (c *Config) Client() (*consulapi.Client, error) { return client, nil } +func (c *Config) getV2Client() (*multicluster.Client, error) { + apiConfig, err := c.getApiConfig() + if err != nil { + return nil, err + } + httpClient, err := tools.NewHttpClient(apiConfig.Transport, apiConfig.TLSConfig) + if err != nil { + return nil, err + } + + // build server including scheme and address + serverUrl := apiConfig.Address + if apiConfig.Scheme != "" { + serverUrl = apiConfig.Scheme + "://" + serverUrl + } + + v2Client := &multicluster.Client{ + Server: serverUrl, + Client: httpClient, + RequestEditors: nil, + } + return v2Client, nil +} + // transport adds the Content-Type header to all requests that might need it -// until we update the API client to a version with +// until we update the API Client to a version with // https://github.com/hashicorp/consul/pull/10204 at which time we will be able // to remove this hack. type transport struct { diff --git a/consul/resource_consul_acl_role.go b/consul/resource_consul_acl_role.go index 44e3650d..03f1b626 100644 --- a/consul/resource_consul_acl_role.go +++ b/consul/resource_consul_acl_role.go @@ -338,7 +338,7 @@ func getPolicyByIdOrName(identifier string, client *consulapi.Client, qOpts *con policy, _, err = client.ACL().PolicyReadByName(identifier, qOpts) if policy != nil && err == nil { - // we ignore the initial error that might have happened in client.ACL().PolicyRead() + // we ignore the initial error that might have happened in Client.ACL().PolicyRead() return policy, false, nil } diff --git a/consul/resource_consul_config_entry_v2_exported_services.go b/consul/resource_consul_config_entry_v2_exported_services.go index 9ad4bf34..9b919615 100644 --- a/consul/resource_consul_config_entry_v2_exported_services.go +++ b/consul/resource_consul_config_entry_v2_exported_services.go @@ -4,14 +4,18 @@ package consul import ( + "context" "encoding/json" "fmt" + "net/http" "github.com/hashicorp/consul/api" pbmulticluster "github.com/hashicorp/consul/proto-public/pbmulticluster/v2" "github.com/hashicorp/consul/proto-public/pbresource" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "google.golang.org/protobuf/encoding/protojson" + + multicluster "github.com/hashicorp/terraform-provider-consul/consul/tools/openapi" ) func resourceConsulV2ExportedServices() *schema.Resource { @@ -94,50 +98,118 @@ func resourceConsulV2ExportedServicesCreate(d *schema.ResourceData, meta interfa } func resourceConsulV2ExportedServicesUpdate(d *schema.ResourceData, meta interface{}) error { - client, qOpts, _ := getClient(d, meta) + client, _, _ := getMulticlusterV2Client(d, meta) name := d.Get("name").(string) kind := d.Get("kind").(string) - gvk := &api.GVK{ - Group: "multicluster", - Version: "v2", - Kind: kind, - } - var consumers []map[string]any + partition := d.Get("partition").(string) + namespace := d.Get("namespace").(string) + var consumers []multicluster.HashicorpConsulMulticlusterV2ExportedServicesConsumer peerConsumers := d.Get("peer_consumers").([]interface{}) for _, p := range peerConsumers { - consumers = append(consumers, map[string]any{"peer": p}) + peerString := p.(string) + consumers = append(consumers, multicluster.HashicorpConsulMulticlusterV2ExportedServicesConsumer{ + Peer: &peerString, + }) } partitionConsumers := d.Get("partition_consumers").([]interface{}) for _, ap := range partitionConsumers { - consumers = append(consumers, map[string]any{"partition": ap}) + partitionString := ap.(string) + consumers = append(consumers, multicluster.HashicorpConsulMulticlusterV2ExportedServicesConsumer{ + Peer: &partitionString, + }) } samenessConsumers := d.Get("sameness_group_consumers").([]interface{}) - for _, ap := range samenessConsumers { - consumers = append(consumers, map[string]any{"sameness_group": ap}) + for _, sg := range samenessConsumers { + sgString := sg.(string) + consumers = append(consumers, multicluster.HashicorpConsulMulticlusterV2ExportedServicesConsumer{ + SamenessGroup: &sgString, + }) } - data := map[string]any{"consumers": consumers} services := d.Get("services").([]interface{}) - if len(services) > 0 { - data["services"] = services + var servicesData []string + for _, s := range services { + servicesData = append(servicesData, s.(string)) } - wReq := &api.WriteRequest{ - Metadata: nil, - Data: data, - Owner: nil, - } - resp, _, err := client.Resource().Apply(gvk, name, qOpts, wReq) + resp, err := doWriteForKind(client, name, kind, namespace, partition, servicesData, consumers) if err != nil || resp == nil { return fmt.Errorf("failed to write exported services config '%s': %v", name, err) } - d.SetId(resp.ID.Type.Kind + resp.ID.Tenancy.Partition + resp.ID.Tenancy.Namespace + resp.ID.Name) + + // Probably should parse the response body to get this instead of just relying on OK response + d.SetId(kind + partition + namespace + name) sw := newStateWriter(d) - sw.set("name", resp.ID.Name) - sw.set("kind", resp.ID.Type.Kind) - sw.set("partition", resp.ID.Tenancy.Partition) - sw.set("namespace", resp.ID.Tenancy.Namespace) + sw.set("name", name) + sw.set("kind", kind) + sw.set("partition", partition) + sw.set("namespace", namespace) return resourceConsulV2ExportedServicesRead(d, meta) } +func doWriteForKind(client *multicluster.Client, name string, kind string, namespace string, partition string, services []string, consumers []multicluster.HashicorpConsulMulticlusterV2ExportedServicesConsumer) (*http.Response, error) { + group := "multicluster" + gv := "v2" + gvk := &multicluster.HashicorpConsulResourceType{ + Group: &group, + GroupVersion: &gv, + Kind: &kind, + } + id := &multicluster.HashicorpConsulResourceID{ + Name: &name, + Tenancy: &multicluster.HashicorpConsulResourceTenancy{ + Namespace: &namespace, + Partition: &partition, + }, + Type: gvk, + } + + var resp *http.Response + var err error + switch kind { + case "ExportedServices": + wParams := &multicluster.WriteExportedServicesParams{ + Peer: nil, + Namespace: &namespace, + Ns: nil, // why is this a thing? + Partition: &partition, + } + body := multicluster.WriteExportedServicesJSONRequestBody{ + Data: &multicluster.HashicorpConsulMulticlusterV2ExportedServices{ + Consumers: &consumers, + Services: &services, + }, + Id: id, + } + resp, err = client.WriteExportedServices(context.Background(), name, wParams, body, nil) + case "NamespaceExportedServices": + wParams := &multicluster.WriteNamespaceExportedServicesParams{ + Peer: nil, + Namespace: &namespace, + Ns: nil, // why is this a thing? + Partition: &partition, + } + body := multicluster.WriteNamespaceExportedServicesJSONRequestBody{ + Data: &multicluster.HashicorpConsulMulticlusterV2NamespaceExportedServices{ + Consumers: &consumers, + }, + Id: id, + } + resp, err = client.WriteNamespaceExportedServices(context.Background(), name, wParams, body, nil) + case "PartitionExportedServices": + wParams := &multicluster.WritePartitionExportedServicesParams{ + Peer: nil, + Partition: &partition, + } + body := multicluster.WritePartitionExportedServicesJSONRequestBody{ + Data: &multicluster.HashicorpConsulMulticlusterV2PartitionExportedServices{ + Consumers: &consumers, + }, + Id: id, + } + resp, err = client.WritePartitionExportedServices(context.Background(), name, wParams, body) + } + return resp, err +} + func resourceConsulV2ExportedServicesRead(d *schema.ResourceData, meta interface{}) error { client, qOpts, _ := getClient(d, meta) name := d.Get("name").(string) diff --git a/consul/resource_provider.go b/consul/resource_provider.go index 41782415..65ceee09 100644 --- a/consul/resource_provider.go +++ b/consul/resource_provider.go @@ -15,6 +15,8 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/terraform" "github.com/mitchellh/mapstructure" + + multicluster "github.com/hashicorp/terraform-provider-consul/consul/tools/openapi" ) var ( @@ -113,7 +115,7 @@ func Provider() terraform.ResourceProvider { Type: schema.TypeString, Optional: true, DefaultFunc: schema.EnvDefaultFunc("CONSUL_CAPATH", ""), - Description: "A path to a directory of PEM-encoded certificate authority files to use to check the authenticity of client and server connections. Can also be specified with the `CONSUL_CAPATH` environment variable.", + Description: "A path to a directory of PEM-encoded certificate authority files to use to check the authenticity of Client and server connections. Can also be specified with the `CONSUL_CAPATH` environment variable.", }, "insecure_https": { @@ -271,12 +273,21 @@ func providerConfigure(d *schema.ResourceData) (interface{}, error) { if err := mapstructure.Decode(configRaw, &config); err != nil { return nil, err } - log.Printf("[INFO] Initializing Consul client") - client, err := config.Client() + log.Printf("[INFO] Initializing Consul Clients") + + // configure V1 client + client, err := config.getClient() + if err != nil { + return nil, err + } + config.Client = client + + // Configure the v2 client + v2Client, err := config.getV2Client() if err != nil { return nil, err } - config.client = client + config.V2Client = v2Client // Set headers if provided headers := d.Get("header").([]interface{}) @@ -331,7 +342,15 @@ func providerConfigure(d *schema.ResourceData) (interface{}, error) { func getClient(d *schema.ResourceData, meta interface{}) (*consulapi.Client, *consulapi.QueryOptions, *consulapi.WriteOptions) { config := meta.(*Config) - client := config.client + client := config.Client + + qOpts, wOpts := getOptions(d, config) + return client, qOpts, wOpts +} + +func getMulticlusterV2Client(d *schema.ResourceData, meta interface{}) (*multicluster.Client, *consulapi.QueryOptions, *consulapi.WriteOptions) { + config := meta.(*Config) + client := config.V2Client qOpts, wOpts := getOptions(d, config) return client, qOpts, wOpts @@ -339,7 +358,7 @@ func getClient(d *schema.ResourceData, meta interface{}) (*consulapi.Client, *co func getOptions(d *schema.ResourceData, meta interface{}) (*consulapi.QueryOptions, *consulapi.WriteOptions) { config := meta.(*Config) - client := config.client + client := config.Client var dc, token, namespace, partition string if v, ok := d.GetOk("datacenter"); ok { diff --git a/consul/resource_provider_test.go b/consul/resource_provider_test.go index f89f6d99..f1c3a794 100644 --- a/consul/resource_provider_test.go +++ b/consul/resource_provider_test.go @@ -48,7 +48,7 @@ func TestResourceProvider(t *testing.T) { data "consul_key_prefix" "app" { path_prefix = "test" }`, - ExpectError: regexp.MustCompile("server gave HTTP response to HTTPS client"), + ExpectError: regexp.MustCompile("server gave HTTP response to HTTPS Client"), }, "insecure_https": { Config: ` @@ -60,7 +60,7 @@ func TestResourceProvider(t *testing.T) { data "consul_key_prefix" "app" { path_prefix = "test" }`, - ExpectError: regexp.MustCompile("server gave HTTP response to HTTPS client"), + ExpectError: regexp.MustCompile("server gave HTTP response to HTTPS Client"), }, "insecure_https_err": { Config: ` @@ -350,7 +350,7 @@ func waitForService(t *testing.T, address string) (terraform.ResourceProvider, * config.Token = initialManagementToken client, err := consulapi.NewClient(config) if err != nil { - t.Fatalf("failed to instantiate client: %v", err) + t.Fatalf("failed to instantiate Client: %v", err) } logger := func(format string, args ...any) {} diff --git a/consul/tools/openapi/multicluster-v2.gen.go b/consul/tools/openapi/multicluster-v2.gen.go new file mode 100644 index 00000000..558f4856 --- /dev/null +++ b/consul/tools/openapi/multicluster-v2.gen.go @@ -0,0 +1,5493 @@ +// Package multicluster provides primitives to interact with the openapi HTTP API. +// +// Code generated by github.com/deepmap/oapi-codegen/v2 version v2.1.0 DO NOT EDIT. +package multicluster + +import ( + "bytes" + "compress/gzip" + "context" + "encoding/base64" + "encoding/json" + "fmt" + "io" + "net/http" + "net/url" + "path" + "strings" + "time" + + "github.com/getkin/kin-openapi/openapi3" + "github.com/labstack/echo/v4" + "github.com/oapi-codegen/runtime" +) + +const ( + BearerAuthScopes = "BearerAuth.Scopes" + ConsulTokenHeaderScopes = "ConsulTokenHeader.Scopes" +) + +// Defines values for HashicorpConsulResourceConditionState. +const ( + STATEFALSE HashicorpConsulResourceConditionState = "STATE_FALSE" + STATETRUE HashicorpConsulResourceConditionState = "STATE_TRUE" + STATEUNKNOWN HashicorpConsulResourceConditionState = "STATE_UNKNOWN" +) + +// HashicorpConsulMulticlusterV2ComputedExportedService defines model for hashicorp.consul.multicluster.v2.ComputedExportedService. +type HashicorpConsulMulticlusterV2ComputedExportedService struct { + Consumers *[]HashicorpConsulMulticlusterV2ComputedExportedServicesConsumer `json:"consumers,omitempty"` + + // TargetRef Reference identifies which resource a condition relates to, when it is not + // the core resource itself. + TargetRef *HashicorpConsulResourceReference `json:"target_ref,omitempty"` +} + +// HashicorpConsulMulticlusterV2ComputedExportedServices defines model for hashicorp.consul.multicluster.v2.ComputedExportedServices. +type HashicorpConsulMulticlusterV2ComputedExportedServices struct { + Consumers *[]HashicorpConsulMulticlusterV2ComputedExportedService `json:"consumers,omitempty"` +} + +// HashicorpConsulMulticlusterV2ComputedExportedServicesConsumer defines model for hashicorp.consul.multicluster.v2.ComputedExportedServicesConsumer. +type HashicorpConsulMulticlusterV2ComputedExportedServicesConsumer struct { + Partition *string `json:"partition,omitempty"` + Peer *string `json:"peer,omitempty"` +} + +// HashicorpConsulMulticlusterV2ExportedServices defines model for hashicorp.consul.multicluster.v2.ExportedServices. +type HashicorpConsulMulticlusterV2ExportedServices struct { + Consumers *[]HashicorpConsulMulticlusterV2ExportedServicesConsumer `json:"consumers,omitempty"` + Services *[]string `json:"services,omitempty"` +} + +// HashicorpConsulMulticlusterV2ExportedServicesConsumer defines model for hashicorp.consul.multicluster.v2.ExportedServicesConsumer. +type HashicorpConsulMulticlusterV2ExportedServicesConsumer struct { + Partition *string `json:"partition,omitempty"` + Peer *string `json:"peer,omitempty"` + SamenessGroup *string `json:"sameness_group,omitempty"` +} + +// HashicorpConsulMulticlusterV2NamespaceExportedServices defines model for hashicorp.consul.multicluster.v2.NamespaceExportedServices. +type HashicorpConsulMulticlusterV2NamespaceExportedServices struct { + Consumers *[]HashicorpConsulMulticlusterV2ExportedServicesConsumer `json:"consumers,omitempty"` +} + +// HashicorpConsulMulticlusterV2PartitionExportedServices defines model for hashicorp.consul.multicluster.v2.PartitionExportedServices. +type HashicorpConsulMulticlusterV2PartitionExportedServices struct { + Consumers *[]HashicorpConsulMulticlusterV2ExportedServicesConsumer `json:"consumers,omitempty"` +} + +// HashicorpConsulResourceCondition Condition represents a discreet observation about a resource in relation to +// +// the current state of the system. +// It is heavily inspired by Kubernetes' [conditions](https://bit.ly/3H9Y6IK) +// and the Gateway API [types and reasons](https://bit.ly/3n2PPiP). +type HashicorpConsulResourceCondition struct { + // Message // Message contains a human-friendly description of the status. + Message *string `json:"message,omitempty"` + + // Reason // Reason provides more machine-readable details about the condition (e.g. + // // "InvalidProtocol"). + Reason *string `json:"reason,omitempty"` + + // Resource Reference identifies which resource a condition relates to, when it is not + // the core resource itself. + Resource *HashicorpConsulResourceReference `json:"resource,omitempty"` + + // State State represents the state of the condition (i.e. true/false/unknown). + State *HashicorpConsulResourceConditionState `json:"state,omitempty"` + + // Type // Type identifies the type of condition (e.g. "Invalid", "ResolvedRefs"). + Type *string `json:"type,omitempty"` +} + +// HashicorpConsulResourceConditionState State represents the state of the condition (i.e. true/false/unknown). +type HashicorpConsulResourceConditionState string + +// HashicorpConsulResourceID ID uniquely identifies a resource. +type HashicorpConsulResourceID struct { + // Name // Name is the user-given name of the resource (e.g. the "billing" service). + Name *string `json:"name,omitempty"` + + // Tenancy Tenancy describes the tenancy units in which the resource resides. + Tenancy *HashicorpConsulResourceTenancy `json:"tenancy,omitempty"` + + // Type Type describes a resource's type. It follows the GVK (Group Version Kind) + // [pattern](https://book.kubebuilder.io/cronjob-tutorial/gvks.html) established + // by Kubernetes. + Type *HashicorpConsulResourceType `json:"type,omitempty"` + + // Uid // Uid is the unique internal identifier we gave to the resource. + // // + // // It is primarily used to tell the difference between the current resource + // // and previous deleted resources with the same user-given name. + // // + // // Concretely, Uid is a [ULID](https://github.com/ulid/spec) and you can treat + // // its timestamp component as the resource's creation time. + Uid *string `json:"uid,omitempty"` +} + +// HashicorpConsulResourceReference Reference identifies which resource a condition relates to, when it is not +// +// the core resource itself. +type HashicorpConsulResourceReference struct { + // Name // Name is the user-given name of the resource (e.g. the "billing" service). + Name *string `json:"name,omitempty"` + + // Section // Section identifies which part of the resource the condition relates to. + Section *string `json:"section,omitempty"` + + // Tenancy Tenancy describes the tenancy units in which the resource resides. + Tenancy *HashicorpConsulResourceTenancy `json:"tenancy,omitempty"` + + // Type Type describes a resource's type. It follows the GVK (Group Version Kind) + // [pattern](https://book.kubebuilder.io/cronjob-tutorial/gvks.html) established + // by Kubernetes. + Type *HashicorpConsulResourceType `json:"type,omitempty"` +} + +// HashicorpConsulResourceStatus Status is used by controllers to communicate the result of attempting to +// +// reconcile and apply a resource (e.g. surface semantic validation errors) +// with users and other controllers. +type HashicorpConsulResourceStatus struct { + // Conditions // Conditions contains a set of discreet observations about the resource in + // // relation to the current state of the system (e.g. it is semantically valid). + Conditions *[]HashicorpConsulResourceCondition `json:"conditions,omitempty"` + + // ObservedGeneration // ObservedGeneration identifies which generation of a resource this status + // // related to. It can be used to determine whether the current generation of + // // a resource has been reconciled. + ObservedGeneration *string `json:"observed_generation,omitempty"` + + // UpdatedAt // UpdatedAt is the time at which the status was last written. + UpdatedAt *time.Time `json:"updated_at,omitempty"` +} + +// HashicorpConsulResourceTenancy Tenancy describes the tenancy units in which the resource resides. +type HashicorpConsulResourceTenancy struct { + // Namespace // Namespace further isolates resources within a partition. + // // https://developer.hashicorp.com/consul/docs/enterprise/namespaces + // // + // // When using the List and WatchList endpoints, provide the wildcard value "*" + // // to list resources across all namespaces. + Namespace *string `json:"namespace,omitempty"` + + // Partition // Partition is the topmost administrative boundary within a cluster. + // // https://developer.hashicorp.com/consul/docs/enterprise/admin-partitions + // // + // // When using the List and WatchList endpoints, provide the wildcard value "*" + // // to list resources across all partitions. + Partition *string `json:"partition,omitempty"` + + // PeerName // PeerName identifies which peer the resource is imported from. + // // https://developer.hashicorp.com/consul/docs/connect/cluster-peering + // // + // // When using the List and WatchList endpoints, provide the wildcard value "*" + // // to list resources across all peers. + PeerName *string `json:"peer_name,omitempty"` +} + +// HashicorpConsulResourceType Type describes a resource's type. It follows the GVK (Group Version Kind) +// +// [pattern](https://book.kubebuilder.io/cronjob-tutorial/gvks.html) established +// by Kubernetes. +type HashicorpConsulResourceType struct { + // Group // Group describes the area of functionality to which this resource type + // // relates (e.g. "catalog", "authorization"). + Group *string `json:"group,omitempty"` + + // GroupVersion // GroupVersion is incremented when sweeping or backward-incompatible changes + // // are made to the group's resource types. + GroupVersion *string `json:"group_version,omitempty"` + + // Kind // Kind identifies the specific resource type within the group. + Kind *string `json:"kind,omitempty"` +} + +// Consistent defines model for consistent. +type Consistent = bool + +// Name defines model for name. +type Name = string + +// NamePrefix defines model for name_prefix. +type NamePrefix = string + +// Namespace defines model for namespace. +type Namespace = string + +// Ns defines model for ns. +type Ns = string + +// Partition defines model for partition. +type Partition = string + +// Peer defines model for peer. +type Peer = string + +// ListComputedExportedServicesParams defines parameters for ListComputedExportedServices. +type ListComputedExportedServicesParams struct { + // Peer Specifies the Consul peer of imported resources to operate on. + Peer *Peer `form:"peer,omitempty" json:"peer,omitempty"` + + // Consistent When true, the operation will be performed with strong consistency + Consistent *Consistent `form:"consistent,omitempty" json:"consistent,omitempty"` + + // NamePrefix The resource name prefix used to filter the result list. + NamePrefix *NamePrefix `form:"name_prefix,omitempty" json:"name_prefix,omitempty"` + + // Partition Specifies the Consul partition of resources to operate on. + Partition *Partition `form:"partition,omitempty" json:"partition,omitempty"` +} + +// DeleteComputedExportedServicesParams defines parameters for DeleteComputedExportedServices. +type DeleteComputedExportedServicesParams struct { + // Peer Specifies the Consul peer of imported resources to operate on. + Peer *Peer `form:"peer,omitempty" json:"peer,omitempty"` + + // Partition Specifies the Consul partition of resources to operate on. + Partition *Partition `form:"partition,omitempty" json:"partition,omitempty"` +} + +// ReadComputedExportedServicesParams defines parameters for ReadComputedExportedServices. +type ReadComputedExportedServicesParams struct { + // Consistent When true, the operation will be performed with strong consistency + Consistent *Consistent `form:"consistent,omitempty" json:"consistent,omitempty"` + + // Peer Specifies the Consul peer of imported resources to operate on. + Peer *Peer `form:"peer,omitempty" json:"peer,omitempty"` + + // Partition Specifies the Consul partition of resources to operate on. + Partition *Partition `form:"partition,omitempty" json:"partition,omitempty"` +} + +// WriteComputedExportedServicesJSONBody defines parameters for WriteComputedExportedServices. +type WriteComputedExportedServicesJSONBody struct { + Data *HashicorpConsulMulticlusterV2ComputedExportedServices `json:"data,omitempty"` + + // Generation // Generation is incremented whenever the resource's content (i.e. not its + // // status) is modified. You can think of it as being the "user version". + // // + // // Concretely, Generation is a [ULID](https://github.com/ulid/spec) and you + // // can treat its timestamp component as the resource's modification time. + Generation *string `json:"generation,omitempty"` + + // Id ID uniquely identifies a resource. + Id *HashicorpConsulResourceID `json:"id,omitempty"` + + // Metadata // Metadata contains key/value pairs of arbitrary metadata about the resource. + // // "deletionTimestamp" and "finalizers" keys are reserved for internal use. + Metadata *map[string]string `json:"metadata,omitempty"` + + // Owner ID uniquely identifies a resource. + Owner *HashicorpConsulResourceID `json:"owner,omitempty"` + + // Status // Status is used by controllers to communicate the result of attempting to + // // reconcile and apply the resource (e.g. surface semantic validation errors) + // // with users and other controllers. Each status is identified by a unique key + // // and should only ever be updated by one controller. + // // + // // Status can only be updated via the WriteStatus endpoint. Attempting to do + // // so via the Write endpoint will result in an InvalidArgument error code. + Status *map[string]HashicorpConsulResourceStatus `json:"status,omitempty"` + + // Version // Version is the low-level version identifier used by the storage backend + // // in CAS (Compare-And-Swap) operations. It will change when the resource is + // // modified in any way, including status updates. + // // + // // When calling the Write endpoint, providing a non-blank version will perform + // // a CAS (Compare-And-Swap) write, which will result in an Aborted error code + // // if the given version doesn't match what is stored. + Version *string `json:"version,omitempty"` +} + +// WriteComputedExportedServicesParams defines parameters for WriteComputedExportedServices. +type WriteComputedExportedServicesParams struct { + // Peer Specifies the Consul peer of imported resources to operate on. + Peer *Peer `form:"peer,omitempty" json:"peer,omitempty"` + + // Partition Specifies the Consul partition of resources to operate on. + Partition *Partition `form:"partition,omitempty" json:"partition,omitempty"` +} + +// ListExportedServicesParams defines parameters for ListExportedServices. +type ListExportedServicesParams struct { + // Peer Specifies the Consul peer of imported resources to operate on. + Peer *Peer `form:"peer,omitempty" json:"peer,omitempty"` + + // Consistent When true, the operation will be performed with strong consistency + Consistent *Consistent `form:"consistent,omitempty" json:"consistent,omitempty"` + + // NamePrefix The resource name prefix used to filter the result list. + NamePrefix *NamePrefix `form:"name_prefix,omitempty" json:"name_prefix,omitempty"` + + // Namespace Specifies the Consul namespace of resources to operate on. This parameter takes precedence over the `ns` alias. + Namespace *Namespace `form:"namespace,omitempty" json:"namespace,omitempty"` + + // Ns `ns` is an alias for the `namespace` query param. The `namespace` parameter takes precedence. + Ns *Ns `form:"ns,omitempty" json:"ns,omitempty"` + + // Partition Specifies the Consul partition of resources to operate on. + Partition *Partition `form:"partition,omitempty" json:"partition,omitempty"` +} + +// DeleteExportedServicesParams defines parameters for DeleteExportedServices. +type DeleteExportedServicesParams struct { + // Peer Specifies the Consul peer of imported resources to operate on. + Peer *Peer `form:"peer,omitempty" json:"peer,omitempty"` + + // Namespace Specifies the Consul namespace of resources to operate on. This parameter takes precedence over the `ns` alias. + Namespace *Namespace `form:"namespace,omitempty" json:"namespace,omitempty"` + + // Ns `ns` is an alias for the `namespace` query param. The `namespace` parameter takes precedence. + Ns *Ns `form:"ns,omitempty" json:"ns,omitempty"` + + // Partition Specifies the Consul partition of resources to operate on. + Partition *Partition `form:"partition,omitempty" json:"partition,omitempty"` +} + +// ReadExportedServicesParams defines parameters for ReadExportedServices. +type ReadExportedServicesParams struct { + // Consistent When true, the operation will be performed with strong consistency + Consistent *Consistent `form:"consistent,omitempty" json:"consistent,omitempty"` + + // Peer Specifies the Consul peer of imported resources to operate on. + Peer *Peer `form:"peer,omitempty" json:"peer,omitempty"` + + // Namespace Specifies the Consul namespace of resources to operate on. This parameter takes precedence over the `ns` alias. + Namespace *Namespace `form:"namespace,omitempty" json:"namespace,omitempty"` + + // Ns `ns` is an alias for the `namespace` query param. The `namespace` parameter takes precedence. + Ns *Ns `form:"ns,omitempty" json:"ns,omitempty"` + + // Partition Specifies the Consul partition of resources to operate on. + Partition *Partition `form:"partition,omitempty" json:"partition,omitempty"` +} + +// WriteExportedServicesJSONBody defines parameters for WriteExportedServices. +type WriteExportedServicesJSONBody struct { + Data *HashicorpConsulMulticlusterV2ExportedServices `json:"data,omitempty"` + + // Generation // Generation is incremented whenever the resource's content (i.e. not its + // // status) is modified. You can think of it as being the "user version". + // // + // // Concretely, Generation is a [ULID](https://github.com/ulid/spec) and you + // // can treat its timestamp component as the resource's modification time. + Generation *string `json:"generation,omitempty"` + + // Id ID uniquely identifies a resource. + Id *HashicorpConsulResourceID `json:"id,omitempty"` + + // Metadata // Metadata contains key/value pairs of arbitrary metadata about the resource. + // // "deletionTimestamp" and "finalizers" keys are reserved for internal use. + Metadata *map[string]string `json:"metadata,omitempty"` + + // Owner ID uniquely identifies a resource. + Owner *HashicorpConsulResourceID `json:"owner,omitempty"` + + // Status // Status is used by controllers to communicate the result of attempting to + // // reconcile and apply the resource (e.g. surface semantic validation errors) + // // with users and other controllers. Each status is identified by a unique key + // // and should only ever be updated by one controller. + // // + // // Status can only be updated via the WriteStatus endpoint. Attempting to do + // // so via the Write endpoint will result in an InvalidArgument error code. + Status *map[string]HashicorpConsulResourceStatus `json:"status,omitempty"` + + // Version // Version is the low-level version identifier used by the storage backend + // // in CAS (Compare-And-Swap) operations. It will change when the resource is + // // modified in any way, including status updates. + // // + // // When calling the Write endpoint, providing a non-blank version will perform + // // a CAS (Compare-And-Swap) write, which will result in an Aborted error code + // // if the given version doesn't match what is stored. + Version *string `json:"version,omitempty"` +} + +// WriteExportedServicesParams defines parameters for WriteExportedServices. +type WriteExportedServicesParams struct { + // Peer Specifies the Consul peer of imported resources to operate on. + Peer *Peer `form:"peer,omitempty" json:"peer,omitempty"` + + // Namespace Specifies the Consul namespace of resources to operate on. This parameter takes precedence over the `ns` alias. + Namespace *Namespace `form:"namespace,omitempty" json:"namespace,omitempty"` + + // Ns `ns` is an alias for the `namespace` query param. The `namespace` parameter takes precedence. + Ns *Ns `form:"ns,omitempty" json:"ns,omitempty"` + + // Partition Specifies the Consul partition of resources to operate on. + Partition *Partition `form:"partition,omitempty" json:"partition,omitempty"` +} + +// ListNamespaceExportedServicesParams defines parameters for ListNamespaceExportedServices. +type ListNamespaceExportedServicesParams struct { + // Peer Specifies the Consul peer of imported resources to operate on. + Peer *Peer `form:"peer,omitempty" json:"peer,omitempty"` + + // Consistent When true, the operation will be performed with strong consistency + Consistent *Consistent `form:"consistent,omitempty" json:"consistent,omitempty"` + + // NamePrefix The resource name prefix used to filter the result list. + NamePrefix *NamePrefix `form:"name_prefix,omitempty" json:"name_prefix,omitempty"` + + // Namespace Specifies the Consul namespace of resources to operate on. This parameter takes precedence over the `ns` alias. + Namespace *Namespace `form:"namespace,omitempty" json:"namespace,omitempty"` + + // Ns `ns` is an alias for the `namespace` query param. The `namespace` parameter takes precedence. + Ns *Ns `form:"ns,omitempty" json:"ns,omitempty"` + + // Partition Specifies the Consul partition of resources to operate on. + Partition *Partition `form:"partition,omitempty" json:"partition,omitempty"` +} + +// DeleteNamespaceExportedServicesParams defines parameters for DeleteNamespaceExportedServices. +type DeleteNamespaceExportedServicesParams struct { + // Peer Specifies the Consul peer of imported resources to operate on. + Peer *Peer `form:"peer,omitempty" json:"peer,omitempty"` + + // Namespace Specifies the Consul namespace of resources to operate on. This parameter takes precedence over the `ns` alias. + Namespace *Namespace `form:"namespace,omitempty" json:"namespace,omitempty"` + + // Ns `ns` is an alias for the `namespace` query param. The `namespace` parameter takes precedence. + Ns *Ns `form:"ns,omitempty" json:"ns,omitempty"` + + // Partition Specifies the Consul partition of resources to operate on. + Partition *Partition `form:"partition,omitempty" json:"partition,omitempty"` +} + +// ReadNamespaceExportedServicesParams defines parameters for ReadNamespaceExportedServices. +type ReadNamespaceExportedServicesParams struct { + // Consistent When true, the operation will be performed with strong consistency + Consistent *Consistent `form:"consistent,omitempty" json:"consistent,omitempty"` + + // Peer Specifies the Consul peer of imported resources to operate on. + Peer *Peer `form:"peer,omitempty" json:"peer,omitempty"` + + // Namespace Specifies the Consul namespace of resources to operate on. This parameter takes precedence over the `ns` alias. + Namespace *Namespace `form:"namespace,omitempty" json:"namespace,omitempty"` + + // Ns `ns` is an alias for the `namespace` query param. The `namespace` parameter takes precedence. + Ns *Ns `form:"ns,omitempty" json:"ns,omitempty"` + + // Partition Specifies the Consul partition of resources to operate on. + Partition *Partition `form:"partition,omitempty" json:"partition,omitempty"` +} + +// WriteNamespaceExportedServicesJSONBody defines parameters for WriteNamespaceExportedServices. +type WriteNamespaceExportedServicesJSONBody struct { + Data *HashicorpConsulMulticlusterV2NamespaceExportedServices `json:"data,omitempty"` + + // Generation // Generation is incremented whenever the resource's content (i.e. not its + // // status) is modified. You can think of it as being the "user version". + // // + // // Concretely, Generation is a [ULID](https://github.com/ulid/spec) and you + // // can treat its timestamp component as the resource's modification time. + Generation *string `json:"generation,omitempty"` + + // Id ID uniquely identifies a resource. + Id *HashicorpConsulResourceID `json:"id,omitempty"` + + // Metadata // Metadata contains key/value pairs of arbitrary metadata about the resource. + // // "deletionTimestamp" and "finalizers" keys are reserved for internal use. + Metadata *map[string]string `json:"metadata,omitempty"` + + // Owner ID uniquely identifies a resource. + Owner *HashicorpConsulResourceID `json:"owner,omitempty"` + + // Status // Status is used by controllers to communicate the result of attempting to + // // reconcile and apply the resource (e.g. surface semantic validation errors) + // // with users and other controllers. Each status is identified by a unique key + // // and should only ever be updated by one controller. + // // + // // Status can only be updated via the WriteStatus endpoint. Attempting to do + // // so via the Write endpoint will result in an InvalidArgument error code. + Status *map[string]HashicorpConsulResourceStatus `json:"status,omitempty"` + + // Version // Version is the low-level version identifier used by the storage backend + // // in CAS (Compare-And-Swap) operations. It will change when the resource is + // // modified in any way, including status updates. + // // + // // When calling the Write endpoint, providing a non-blank version will perform + // // a CAS (Compare-And-Swap) write, which will result in an Aborted error code + // // if the given version doesn't match what is stored. + Version *string `json:"version,omitempty"` +} + +// WriteNamespaceExportedServicesParams defines parameters for WriteNamespaceExportedServices. +type WriteNamespaceExportedServicesParams struct { + // Peer Specifies the Consul peer of imported resources to operate on. + Peer *Peer `form:"peer,omitempty" json:"peer,omitempty"` + + // Namespace Specifies the Consul namespace of resources to operate on. This parameter takes precedence over the `ns` alias. + Namespace *Namespace `form:"namespace,omitempty" json:"namespace,omitempty"` + + // Ns `ns` is an alias for the `namespace` query param. The `namespace` parameter takes precedence. + Ns *Ns `form:"ns,omitempty" json:"ns,omitempty"` + + // Partition Specifies the Consul partition of resources to operate on. + Partition *Partition `form:"partition,omitempty" json:"partition,omitempty"` +} + +// ListPartitionExportedServicesParams defines parameters for ListPartitionExportedServices. +type ListPartitionExportedServicesParams struct { + // Peer Specifies the Consul peer of imported resources to operate on. + Peer *Peer `form:"peer,omitempty" json:"peer,omitempty"` + + // Consistent When true, the operation will be performed with strong consistency + Consistent *Consistent `form:"consistent,omitempty" json:"consistent,omitempty"` + + // NamePrefix The resource name prefix used to filter the result list. + NamePrefix *NamePrefix `form:"name_prefix,omitempty" json:"name_prefix,omitempty"` + + // Partition Specifies the Consul partition of resources to operate on. + Partition *Partition `form:"partition,omitempty" json:"partition,omitempty"` +} + +// DeletePartitionExportedServicesParams defines parameters for DeletePartitionExportedServices. +type DeletePartitionExportedServicesParams struct { + // Peer Specifies the Consul peer of imported resources to operate on. + Peer *Peer `form:"peer,omitempty" json:"peer,omitempty"` + + // Partition Specifies the Consul partition of resources to operate on. + Partition *Partition `form:"partition,omitempty" json:"partition,omitempty"` +} + +// ReadPartitionExportedServicesParams defines parameters for ReadPartitionExportedServices. +type ReadPartitionExportedServicesParams struct { + // Consistent When true, the operation will be performed with strong consistency + Consistent *Consistent `form:"consistent,omitempty" json:"consistent,omitempty"` + + // Peer Specifies the Consul peer of imported resources to operate on. + Peer *Peer `form:"peer,omitempty" json:"peer,omitempty"` + + // Partition Specifies the Consul partition of resources to operate on. + Partition *Partition `form:"partition,omitempty" json:"partition,omitempty"` +} + +// WritePartitionExportedServicesJSONBody defines parameters for WritePartitionExportedServices. +type WritePartitionExportedServicesJSONBody struct { + Data *HashicorpConsulMulticlusterV2PartitionExportedServices `json:"data,omitempty"` + + // Generation // Generation is incremented whenever the resource's content (i.e. not its + // // status) is modified. You can think of it as being the "user version". + // // + // // Concretely, Generation is a [ULID](https://github.com/ulid/spec) and you + // // can treat its timestamp component as the resource's modification time. + Generation *string `json:"generation,omitempty"` + + // Id ID uniquely identifies a resource. + Id *HashicorpConsulResourceID `json:"id,omitempty"` + + // Metadata // Metadata contains key/value pairs of arbitrary metadata about the resource. + // // "deletionTimestamp" and "finalizers" keys are reserved for internal use. + Metadata *map[string]string `json:"metadata,omitempty"` + + // Owner ID uniquely identifies a resource. + Owner *HashicorpConsulResourceID `json:"owner,omitempty"` + + // Status // Status is used by controllers to communicate the result of attempting to + // // reconcile and apply the resource (e.g. surface semantic validation errors) + // // with users and other controllers. Each status is identified by a unique key + // // and should only ever be updated by one controller. + // // + // // Status can only be updated via the WriteStatus endpoint. Attempting to do + // // so via the Write endpoint will result in an InvalidArgument error code. + Status *map[string]HashicorpConsulResourceStatus `json:"status,omitempty"` + + // Version // Version is the low-level version identifier used by the storage backend + // // in CAS (Compare-And-Swap) operations. It will change when the resource is + // // modified in any way, including status updates. + // // + // // When calling the Write endpoint, providing a non-blank version will perform + // // a CAS (Compare-And-Swap) write, which will result in an Aborted error code + // // if the given version doesn't match what is stored. + Version *string `json:"version,omitempty"` +} + +// WritePartitionExportedServicesParams defines parameters for WritePartitionExportedServices. +type WritePartitionExportedServicesParams struct { + // Peer Specifies the Consul peer of imported resources to operate on. + Peer *Peer `form:"peer,omitempty" json:"peer,omitempty"` + + // Partition Specifies the Consul partition of resources to operate on. + Partition *Partition `form:"partition,omitempty" json:"partition,omitempty"` +} + +// WriteComputedExportedServicesJSONRequestBody defines body for WriteComputedExportedServices for application/json ContentType. +type WriteComputedExportedServicesJSONRequestBody WriteComputedExportedServicesJSONBody + +// WriteExportedServicesJSONRequestBody defines body for WriteExportedServices for application/json ContentType. +type WriteExportedServicesJSONRequestBody WriteExportedServicesJSONBody + +// WriteNamespaceExportedServicesJSONRequestBody defines body for WriteNamespaceExportedServices for application/json ContentType. +type WriteNamespaceExportedServicesJSONRequestBody WriteNamespaceExportedServicesJSONBody + +// WritePartitionExportedServicesJSONRequestBody defines body for WritePartitionExportedServices for application/json ContentType. +type WritePartitionExportedServicesJSONRequestBody WritePartitionExportedServicesJSONBody + +// RequestEditorFn is the function signature for the RequestEditor callback function +type RequestEditorFn func(ctx context.Context, req *http.Request) error + +// Doer performs HTTP requests. +// +// The standard http.Client implements this interface. +type HttpRequestDoer interface { + Do(req *http.Request) (*http.Response, error) +} + +// Client which conforms to the OpenAPI3 specification for this service. +type Client struct { + // The endpoint of the server conforming to this interface, with scheme, + // https://api.deepmap.com for example. This can contain a path relative + // to the server, such as https://api.deepmap.com/dev-test, and all the + // paths in the swagger spec will be appended to the server. + Server string + + // Doer for performing requests, typically a *http.Client with any + // customized settings, such as certificate chains. + Client HttpRequestDoer + + // A list of callbacks for modifying requests which are generated before sending over + // the network. + RequestEditors []RequestEditorFn +} + +// ClientOption allows setting custom parameters during construction +type ClientOption func(*Client) error + +// Creates a new Client, with reasonable defaults +func NewClient(server string, opts ...ClientOption) (*Client, error) { + // create a client with sane default values + client := Client{ + Server: server, + } + // mutate client and add all optional params + for _, o := range opts { + if err := o(&client); err != nil { + return nil, err + } + } + // ensure the server URL always has a trailing slash + if !strings.HasSuffix(client.Server, "/") { + client.Server += "/" + } + // create httpClient, if not already present + if client.Client == nil { + client.Client = &http.Client{} + } + return &client, nil +} + +// WithHTTPClient allows overriding the default Doer, which is +// automatically created using http.Client. This is useful for tests. +func WithHTTPClient(doer HttpRequestDoer) ClientOption { + return func(c *Client) error { + c.Client = doer + return nil + } +} + +// WithRequestEditorFn allows setting up a callback function, which will be +// called right before sending the request. This can be used to mutate the request. +func WithRequestEditorFn(fn RequestEditorFn) ClientOption { + return func(c *Client) error { + c.RequestEditors = append(c.RequestEditors, fn) + return nil + } +} + +// The interface specification for the client above. +type ClientInterface interface { + // ListComputedExportedServices request + ListComputedExportedServices(ctx context.Context, params *ListComputedExportedServicesParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // DeleteComputedExportedServices request + DeleteComputedExportedServices(ctx context.Context, name Name, params *DeleteComputedExportedServicesParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // ReadComputedExportedServices request + ReadComputedExportedServices(ctx context.Context, name Name, params *ReadComputedExportedServicesParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // WriteComputedExportedServicesWithBody request with any body + WriteComputedExportedServicesWithBody(ctx context.Context, name Name, params *WriteComputedExportedServicesParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + WriteComputedExportedServices(ctx context.Context, name Name, params *WriteComputedExportedServicesParams, body WriteComputedExportedServicesJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // ListExportedServices request + ListExportedServices(ctx context.Context, params *ListExportedServicesParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // DeleteExportedServices request + DeleteExportedServices(ctx context.Context, name Name, params *DeleteExportedServicesParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // ReadExportedServices request + ReadExportedServices(ctx context.Context, name Name, params *ReadExportedServicesParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // WriteExportedServicesWithBody request with any body + WriteExportedServicesWithBody(ctx context.Context, name Name, params *WriteExportedServicesParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + WriteExportedServices(ctx context.Context, name Name, params *WriteExportedServicesParams, body WriteExportedServicesJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // ListNamespaceExportedServices request + ListNamespaceExportedServices(ctx context.Context, params *ListNamespaceExportedServicesParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // DeleteNamespaceExportedServices request + DeleteNamespaceExportedServices(ctx context.Context, name Name, params *DeleteNamespaceExportedServicesParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // ReadNamespaceExportedServices request + ReadNamespaceExportedServices(ctx context.Context, name Name, params *ReadNamespaceExportedServicesParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // WriteNamespaceExportedServicesWithBody request with any body + WriteNamespaceExportedServicesWithBody(ctx context.Context, name Name, params *WriteNamespaceExportedServicesParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + WriteNamespaceExportedServices(ctx context.Context, name Name, params *WriteNamespaceExportedServicesParams, body WriteNamespaceExportedServicesJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // ListPartitionExportedServices request + ListPartitionExportedServices(ctx context.Context, params *ListPartitionExportedServicesParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // DeletePartitionExportedServices request + DeletePartitionExportedServices(ctx context.Context, name Name, params *DeletePartitionExportedServicesParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // ReadPartitionExportedServices request + ReadPartitionExportedServices(ctx context.Context, name Name, params *ReadPartitionExportedServicesParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // WritePartitionExportedServicesWithBody request with any body + WritePartitionExportedServicesWithBody(ctx context.Context, name Name, params *WritePartitionExportedServicesParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + WritePartitionExportedServices(ctx context.Context, name Name, params *WritePartitionExportedServicesParams, body WritePartitionExportedServicesJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) +} + +func (c *Client) ListComputedExportedServices(ctx context.Context, params *ListComputedExportedServicesParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewListComputedExportedServicesRequest(c.Server, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) DeleteComputedExportedServices(ctx context.Context, name Name, params *DeleteComputedExportedServicesParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDeleteComputedExportedServicesRequest(c.Server, name, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) ReadComputedExportedServices(ctx context.Context, name Name, params *ReadComputedExportedServicesParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewReadComputedExportedServicesRequest(c.Server, name, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) WriteComputedExportedServicesWithBody(ctx context.Context, name Name, params *WriteComputedExportedServicesParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewWriteComputedExportedServicesRequestWithBody(c.Server, name, params, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) WriteComputedExportedServices(ctx context.Context, name Name, params *WriteComputedExportedServicesParams, body WriteComputedExportedServicesJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewWriteComputedExportedServicesRequest(c.Server, name, params, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) ListExportedServices(ctx context.Context, params *ListExportedServicesParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewListExportedServicesRequest(c.Server, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) DeleteExportedServices(ctx context.Context, name Name, params *DeleteExportedServicesParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDeleteExportedServicesRequest(c.Server, name, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) ReadExportedServices(ctx context.Context, name Name, params *ReadExportedServicesParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewReadExportedServicesRequest(c.Server, name, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) WriteExportedServicesWithBody(ctx context.Context, name Name, params *WriteExportedServicesParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewWriteExportedServicesRequestWithBody(c.Server, name, params, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) WriteExportedServices(ctx context.Context, name Name, params *WriteExportedServicesParams, body WriteExportedServicesJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewWriteExportedServicesRequest(c.Server, name, params, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) ListNamespaceExportedServices(ctx context.Context, params *ListNamespaceExportedServicesParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewListNamespaceExportedServicesRequest(c.Server, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) DeleteNamespaceExportedServices(ctx context.Context, name Name, params *DeleteNamespaceExportedServicesParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDeleteNamespaceExportedServicesRequest(c.Server, name, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) ReadNamespaceExportedServices(ctx context.Context, name Name, params *ReadNamespaceExportedServicesParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewReadNamespaceExportedServicesRequest(c.Server, name, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) WriteNamespaceExportedServicesWithBody(ctx context.Context, name Name, params *WriteNamespaceExportedServicesParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewWriteNamespaceExportedServicesRequestWithBody(c.Server, name, params, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) WriteNamespaceExportedServices(ctx context.Context, name Name, params *WriteNamespaceExportedServicesParams, body WriteNamespaceExportedServicesJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewWriteNamespaceExportedServicesRequest(c.Server, name, params, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) ListPartitionExportedServices(ctx context.Context, params *ListPartitionExportedServicesParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewListPartitionExportedServicesRequest(c.Server, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) DeletePartitionExportedServices(ctx context.Context, name Name, params *DeletePartitionExportedServicesParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewDeletePartitionExportedServicesRequest(c.Server, name, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) ReadPartitionExportedServices(ctx context.Context, name Name, params *ReadPartitionExportedServicesParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewReadPartitionExportedServicesRequest(c.Server, name, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) WritePartitionExportedServicesWithBody(ctx context.Context, name Name, params *WritePartitionExportedServicesParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewWritePartitionExportedServicesRequestWithBody(c.Server, name, params, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +func (c *Client) WritePartitionExportedServices(ctx context.Context, name Name, params *WritePartitionExportedServicesParams, body WritePartitionExportedServicesJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewWritePartitionExportedServicesRequest(c.Server, name, params, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// NewListComputedExportedServicesRequest generates requests for ListComputedExportedServices +func NewListComputedExportedServicesRequest(server string, params *ListComputedExportedServicesParams) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/multicluster/v2/ComputedExportedServices") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + queryValues := queryURL.Query() + + if params.Peer != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "peer", runtime.ParamLocationQuery, *params.Peer); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.Consistent != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "consistent", runtime.ParamLocationQuery, *params.Consistent); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.NamePrefix != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "name_prefix", runtime.ParamLocationQuery, *params.NamePrefix); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.Partition != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "partition", runtime.ParamLocationQuery, *params.Partition); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + queryURL.RawQuery = queryValues.Encode() + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewDeleteComputedExportedServicesRequest generates requests for DeleteComputedExportedServices +func NewDeleteComputedExportedServicesRequest(server string, name Name, params *DeleteComputedExportedServicesParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "name", runtime.ParamLocationPath, name) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/multicluster/v2/ComputedExportedServices/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + queryValues := queryURL.Query() + + if params.Peer != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "peer", runtime.ParamLocationQuery, *params.Peer); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.Partition != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "partition", runtime.ParamLocationQuery, *params.Partition); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + queryURL.RawQuery = queryValues.Encode() + } + + req, err := http.NewRequest("DELETE", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewReadComputedExportedServicesRequest generates requests for ReadComputedExportedServices +func NewReadComputedExportedServicesRequest(server string, name Name, params *ReadComputedExportedServicesParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "name", runtime.ParamLocationPath, name) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/multicluster/v2/ComputedExportedServices/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + queryValues := queryURL.Query() + + if params.Consistent != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "consistent", runtime.ParamLocationQuery, *params.Consistent); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.Peer != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "peer", runtime.ParamLocationQuery, *params.Peer); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.Partition != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "partition", runtime.ParamLocationQuery, *params.Partition); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + queryURL.RawQuery = queryValues.Encode() + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewWriteComputedExportedServicesRequest calls the generic WriteComputedExportedServices builder with application/json body +func NewWriteComputedExportedServicesRequest(server string, name Name, params *WriteComputedExportedServicesParams, body WriteComputedExportedServicesJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewWriteComputedExportedServicesRequestWithBody(server, name, params, "application/json", bodyReader) +} + +// NewWriteComputedExportedServicesRequestWithBody generates requests for WriteComputedExportedServices with any type of body +func NewWriteComputedExportedServicesRequestWithBody(server string, name Name, params *WriteComputedExportedServicesParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "name", runtime.ParamLocationPath, name) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/multicluster/v2/ComputedExportedServices/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + queryValues := queryURL.Query() + + if params.Peer != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "peer", runtime.ParamLocationQuery, *params.Peer); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.Partition != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "partition", runtime.ParamLocationQuery, *params.Partition); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + queryURL.RawQuery = queryValues.Encode() + } + + req, err := http.NewRequest("PUT", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewListExportedServicesRequest generates requests for ListExportedServices +func NewListExportedServicesRequest(server string, params *ListExportedServicesParams) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/multicluster/v2/ExportedServices") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + queryValues := queryURL.Query() + + if params.Peer != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "peer", runtime.ParamLocationQuery, *params.Peer); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.Consistent != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "consistent", runtime.ParamLocationQuery, *params.Consistent); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.NamePrefix != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "name_prefix", runtime.ParamLocationQuery, *params.NamePrefix); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.Namespace != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "namespace", runtime.ParamLocationQuery, *params.Namespace); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.Ns != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "ns", runtime.ParamLocationQuery, *params.Ns); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.Partition != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "partition", runtime.ParamLocationQuery, *params.Partition); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + queryURL.RawQuery = queryValues.Encode() + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewDeleteExportedServicesRequest generates requests for DeleteExportedServices +func NewDeleteExportedServicesRequest(server string, name Name, params *DeleteExportedServicesParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "name", runtime.ParamLocationPath, name) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/multicluster/v2/ExportedServices/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + queryValues := queryURL.Query() + + if params.Peer != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "peer", runtime.ParamLocationQuery, *params.Peer); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.Namespace != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "namespace", runtime.ParamLocationQuery, *params.Namespace); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.Ns != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "ns", runtime.ParamLocationQuery, *params.Ns); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.Partition != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "partition", runtime.ParamLocationQuery, *params.Partition); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + queryURL.RawQuery = queryValues.Encode() + } + + req, err := http.NewRequest("DELETE", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewReadExportedServicesRequest generates requests for ReadExportedServices +func NewReadExportedServicesRequest(server string, name Name, params *ReadExportedServicesParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "name", runtime.ParamLocationPath, name) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/multicluster/v2/ExportedServices/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + queryValues := queryURL.Query() + + if params.Consistent != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "consistent", runtime.ParamLocationQuery, *params.Consistent); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.Peer != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "peer", runtime.ParamLocationQuery, *params.Peer); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.Namespace != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "namespace", runtime.ParamLocationQuery, *params.Namespace); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.Ns != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "ns", runtime.ParamLocationQuery, *params.Ns); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.Partition != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "partition", runtime.ParamLocationQuery, *params.Partition); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + queryURL.RawQuery = queryValues.Encode() + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewWriteExportedServicesRequest calls the generic WriteExportedServices builder with application/json body +func NewWriteExportedServicesRequest(server string, name Name, params *WriteExportedServicesParams, body WriteExportedServicesJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewWriteExportedServicesRequestWithBody(server, name, params, "application/json", bodyReader) +} + +// NewWriteExportedServicesRequestWithBody generates requests for WriteExportedServices with any type of body +func NewWriteExportedServicesRequestWithBody(server string, name Name, params *WriteExportedServicesParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "name", runtime.ParamLocationPath, name) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/multicluster/v2/ExportedServices/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + queryValues := queryURL.Query() + + if params.Peer != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "peer", runtime.ParamLocationQuery, *params.Peer); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.Namespace != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "namespace", runtime.ParamLocationQuery, *params.Namespace); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.Ns != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "ns", runtime.ParamLocationQuery, *params.Ns); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.Partition != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "partition", runtime.ParamLocationQuery, *params.Partition); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + queryURL.RawQuery = queryValues.Encode() + } + + req, err := http.NewRequest("PUT", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewListNamespaceExportedServicesRequest generates requests for ListNamespaceExportedServices +func NewListNamespaceExportedServicesRequest(server string, params *ListNamespaceExportedServicesParams) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/multicluster/v2/NamespaceExportedServices") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + queryValues := queryURL.Query() + + if params.Peer != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "peer", runtime.ParamLocationQuery, *params.Peer); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.Consistent != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "consistent", runtime.ParamLocationQuery, *params.Consistent); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.NamePrefix != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "name_prefix", runtime.ParamLocationQuery, *params.NamePrefix); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.Namespace != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "namespace", runtime.ParamLocationQuery, *params.Namespace); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.Ns != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "ns", runtime.ParamLocationQuery, *params.Ns); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.Partition != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "partition", runtime.ParamLocationQuery, *params.Partition); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + queryURL.RawQuery = queryValues.Encode() + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewDeleteNamespaceExportedServicesRequest generates requests for DeleteNamespaceExportedServices +func NewDeleteNamespaceExportedServicesRequest(server string, name Name, params *DeleteNamespaceExportedServicesParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "name", runtime.ParamLocationPath, name) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/multicluster/v2/NamespaceExportedServices/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + queryValues := queryURL.Query() + + if params.Peer != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "peer", runtime.ParamLocationQuery, *params.Peer); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.Namespace != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "namespace", runtime.ParamLocationQuery, *params.Namespace); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.Ns != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "ns", runtime.ParamLocationQuery, *params.Ns); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.Partition != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "partition", runtime.ParamLocationQuery, *params.Partition); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + queryURL.RawQuery = queryValues.Encode() + } + + req, err := http.NewRequest("DELETE", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewReadNamespaceExportedServicesRequest generates requests for ReadNamespaceExportedServices +func NewReadNamespaceExportedServicesRequest(server string, name Name, params *ReadNamespaceExportedServicesParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "name", runtime.ParamLocationPath, name) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/multicluster/v2/NamespaceExportedServices/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + queryValues := queryURL.Query() + + if params.Consistent != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "consistent", runtime.ParamLocationQuery, *params.Consistent); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.Peer != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "peer", runtime.ParamLocationQuery, *params.Peer); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.Namespace != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "namespace", runtime.ParamLocationQuery, *params.Namespace); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.Ns != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "ns", runtime.ParamLocationQuery, *params.Ns); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.Partition != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "partition", runtime.ParamLocationQuery, *params.Partition); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + queryURL.RawQuery = queryValues.Encode() + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewWriteNamespaceExportedServicesRequest calls the generic WriteNamespaceExportedServices builder with application/json body +func NewWriteNamespaceExportedServicesRequest(server string, name Name, params *WriteNamespaceExportedServicesParams, body WriteNamespaceExportedServicesJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewWriteNamespaceExportedServicesRequestWithBody(server, name, params, "application/json", bodyReader) +} + +// NewWriteNamespaceExportedServicesRequestWithBody generates requests for WriteNamespaceExportedServices with any type of body +func NewWriteNamespaceExportedServicesRequestWithBody(server string, name Name, params *WriteNamespaceExportedServicesParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "name", runtime.ParamLocationPath, name) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/multicluster/v2/NamespaceExportedServices/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + queryValues := queryURL.Query() + + if params.Peer != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "peer", runtime.ParamLocationQuery, *params.Peer); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.Namespace != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "namespace", runtime.ParamLocationQuery, *params.Namespace); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.Ns != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "ns", runtime.ParamLocationQuery, *params.Ns); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.Partition != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "partition", runtime.ParamLocationQuery, *params.Partition); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + queryURL.RawQuery = queryValues.Encode() + } + + req, err := http.NewRequest("PUT", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewListPartitionExportedServicesRequest generates requests for ListPartitionExportedServices +func NewListPartitionExportedServicesRequest(server string, params *ListPartitionExportedServicesParams) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/multicluster/v2/PartitionExportedServices") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + queryValues := queryURL.Query() + + if params.Peer != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "peer", runtime.ParamLocationQuery, *params.Peer); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.Consistent != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "consistent", runtime.ParamLocationQuery, *params.Consistent); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.NamePrefix != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "name_prefix", runtime.ParamLocationQuery, *params.NamePrefix); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.Partition != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "partition", runtime.ParamLocationQuery, *params.Partition); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + queryURL.RawQuery = queryValues.Encode() + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewDeletePartitionExportedServicesRequest generates requests for DeletePartitionExportedServices +func NewDeletePartitionExportedServicesRequest(server string, name Name, params *DeletePartitionExportedServicesParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "name", runtime.ParamLocationPath, name) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/multicluster/v2/PartitionExportedServices/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + queryValues := queryURL.Query() + + if params.Peer != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "peer", runtime.ParamLocationQuery, *params.Peer); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.Partition != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "partition", runtime.ParamLocationQuery, *params.Partition); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + queryURL.RawQuery = queryValues.Encode() + } + + req, err := http.NewRequest("DELETE", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewReadPartitionExportedServicesRequest generates requests for ReadPartitionExportedServices +func NewReadPartitionExportedServicesRequest(server string, name Name, params *ReadPartitionExportedServicesParams) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "name", runtime.ParamLocationPath, name) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/multicluster/v2/PartitionExportedServices/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + queryValues := queryURL.Query() + + if params.Consistent != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "consistent", runtime.ParamLocationQuery, *params.Consistent); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.Peer != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "peer", runtime.ParamLocationQuery, *params.Peer); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.Partition != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "partition", runtime.ParamLocationQuery, *params.Partition); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + queryURL.RawQuery = queryValues.Encode() + } + + req, err := http.NewRequest("GET", queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewWritePartitionExportedServicesRequest calls the generic WritePartitionExportedServices builder with application/json body +func NewWritePartitionExportedServicesRequest(server string, name Name, params *WritePartitionExportedServicesParams, body WritePartitionExportedServicesJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewWritePartitionExportedServicesRequestWithBody(server, name, params, "application/json", bodyReader) +} + +// NewWritePartitionExportedServicesRequestWithBody generates requests for WritePartitionExportedServices with any type of body +func NewWritePartitionExportedServicesRequestWithBody(server string, name Name, params *WritePartitionExportedServicesParams, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithLocation("simple", false, "name", runtime.ParamLocationPath, name) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/multicluster/v2/PartitionExportedServices/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + queryValues := queryURL.Query() + + if params.Peer != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "peer", runtime.ParamLocationQuery, *params.Peer); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + if params.Partition != nil { + + if queryFrag, err := runtime.StyleParamWithLocation("form", true, "partition", runtime.ParamLocationQuery, *params.Partition); err != nil { + return nil, err + } else if parsed, err := url.ParseQuery(queryFrag); err != nil { + return nil, err + } else { + for k, v := range parsed { + for _, v2 := range v { + queryValues.Add(k, v2) + } + } + } + + } + + queryURL.RawQuery = queryValues.Encode() + } + + req, err := http.NewRequest("PUT", queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +func (c *Client) applyEditors(ctx context.Context, req *http.Request, additionalEditors []RequestEditorFn) error { + for _, r := range c.RequestEditors { + if err := r(ctx, req); err != nil { + return err + } + } + for _, r := range additionalEditors { + if err := r(ctx, req); err != nil { + return err + } + } + return nil +} + +// ClientWithResponses builds on ClientInterface to offer response payloads +type ClientWithResponses struct { + ClientInterface +} + +// NewClientWithResponses creates a new ClientWithResponses, which wraps +// Client with return type handling +func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error) { + client, err := NewClient(server, opts...) + if err != nil { + return nil, err + } + return &ClientWithResponses{client}, nil +} + +// WithBaseURL overrides the baseURL. +func WithBaseURL(baseURL string) ClientOption { + return func(c *Client) error { + newBaseURL, err := url.Parse(baseURL) + if err != nil { + return err + } + c.Server = newBaseURL.String() + return nil + } +} + +// ClientWithResponsesInterface is the interface specification for the client with responses above. +type ClientWithResponsesInterface interface { + // ListComputedExportedServicesWithResponse request + ListComputedExportedServicesWithResponse(ctx context.Context, params *ListComputedExportedServicesParams, reqEditors ...RequestEditorFn) (*ListComputedExportedServicesResponse, error) + + // DeleteComputedExportedServicesWithResponse request + DeleteComputedExportedServicesWithResponse(ctx context.Context, name Name, params *DeleteComputedExportedServicesParams, reqEditors ...RequestEditorFn) (*DeleteComputedExportedServicesResponse, error) + + // ReadComputedExportedServicesWithResponse request + ReadComputedExportedServicesWithResponse(ctx context.Context, name Name, params *ReadComputedExportedServicesParams, reqEditors ...RequestEditorFn) (*ReadComputedExportedServicesResponse, error) + + // WriteComputedExportedServicesWithBodyWithResponse request with any body + WriteComputedExportedServicesWithBodyWithResponse(ctx context.Context, name Name, params *WriteComputedExportedServicesParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*WriteComputedExportedServicesResponse, error) + + WriteComputedExportedServicesWithResponse(ctx context.Context, name Name, params *WriteComputedExportedServicesParams, body WriteComputedExportedServicesJSONRequestBody, reqEditors ...RequestEditorFn) (*WriteComputedExportedServicesResponse, error) + + // ListExportedServicesWithResponse request + ListExportedServicesWithResponse(ctx context.Context, params *ListExportedServicesParams, reqEditors ...RequestEditorFn) (*ListExportedServicesResponse, error) + + // DeleteExportedServicesWithResponse request + DeleteExportedServicesWithResponse(ctx context.Context, name Name, params *DeleteExportedServicesParams, reqEditors ...RequestEditorFn) (*DeleteExportedServicesResponse, error) + + // ReadExportedServicesWithResponse request + ReadExportedServicesWithResponse(ctx context.Context, name Name, params *ReadExportedServicesParams, reqEditors ...RequestEditorFn) (*ReadExportedServicesResponse, error) + + // WriteExportedServicesWithBodyWithResponse request with any body + WriteExportedServicesWithBodyWithResponse(ctx context.Context, name Name, params *WriteExportedServicesParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*WriteExportedServicesResponse, error) + + WriteExportedServicesWithResponse(ctx context.Context, name Name, params *WriteExportedServicesParams, body WriteExportedServicesJSONRequestBody, reqEditors ...RequestEditorFn) (*WriteExportedServicesResponse, error) + + // ListNamespaceExportedServicesWithResponse request + ListNamespaceExportedServicesWithResponse(ctx context.Context, params *ListNamespaceExportedServicesParams, reqEditors ...RequestEditorFn) (*ListNamespaceExportedServicesResponse, error) + + // DeleteNamespaceExportedServicesWithResponse request + DeleteNamespaceExportedServicesWithResponse(ctx context.Context, name Name, params *DeleteNamespaceExportedServicesParams, reqEditors ...RequestEditorFn) (*DeleteNamespaceExportedServicesResponse, error) + + // ReadNamespaceExportedServicesWithResponse request + ReadNamespaceExportedServicesWithResponse(ctx context.Context, name Name, params *ReadNamespaceExportedServicesParams, reqEditors ...RequestEditorFn) (*ReadNamespaceExportedServicesResponse, error) + + // WriteNamespaceExportedServicesWithBodyWithResponse request with any body + WriteNamespaceExportedServicesWithBodyWithResponse(ctx context.Context, name Name, params *WriteNamespaceExportedServicesParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*WriteNamespaceExportedServicesResponse, error) + + WriteNamespaceExportedServicesWithResponse(ctx context.Context, name Name, params *WriteNamespaceExportedServicesParams, body WriteNamespaceExportedServicesJSONRequestBody, reqEditors ...RequestEditorFn) (*WriteNamespaceExportedServicesResponse, error) + + // ListPartitionExportedServicesWithResponse request + ListPartitionExportedServicesWithResponse(ctx context.Context, params *ListPartitionExportedServicesParams, reqEditors ...RequestEditorFn) (*ListPartitionExportedServicesResponse, error) + + // DeletePartitionExportedServicesWithResponse request + DeletePartitionExportedServicesWithResponse(ctx context.Context, name Name, params *DeletePartitionExportedServicesParams, reqEditors ...RequestEditorFn) (*DeletePartitionExportedServicesResponse, error) + + // ReadPartitionExportedServicesWithResponse request + ReadPartitionExportedServicesWithResponse(ctx context.Context, name Name, params *ReadPartitionExportedServicesParams, reqEditors ...RequestEditorFn) (*ReadPartitionExportedServicesResponse, error) + + // WritePartitionExportedServicesWithBodyWithResponse request with any body + WritePartitionExportedServicesWithBodyWithResponse(ctx context.Context, name Name, params *WritePartitionExportedServicesParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*WritePartitionExportedServicesResponse, error) + + WritePartitionExportedServicesWithResponse(ctx context.Context, name Name, params *WritePartitionExportedServicesParams, body WritePartitionExportedServicesJSONRequestBody, reqEditors ...RequestEditorFn) (*WritePartitionExportedServicesResponse, error) +} + +type ListComputedExportedServicesResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *[]struct { + Data *HashicorpConsulMulticlusterV2ComputedExportedServices `json:"data,omitempty"` + + // Generation // Generation is incremented whenever the resource's content (i.e. not its + // // status) is modified. You can think of it as being the "user version". + // // + // // Concretely, Generation is a [ULID](https://github.com/ulid/spec) and you + // // can treat its timestamp component as the resource's modification time. + Generation *string `json:"generation,omitempty"` + + // Id ID uniquely identifies a resource. + Id *HashicorpConsulResourceID `json:"id,omitempty"` + + // Metadata // Metadata contains key/value pairs of arbitrary metadata about the resource. + // // "deletionTimestamp" and "finalizers" keys are reserved for internal use. + Metadata *map[string]string `json:"metadata,omitempty"` + + // Owner ID uniquely identifies a resource. + Owner *HashicorpConsulResourceID `json:"owner,omitempty"` + + // Status // Status is used by controllers to communicate the result of attempting to + // // reconcile and apply the resource (e.g. surface semantic validation errors) + // // with users and other controllers. Each status is identified by a unique key + // // and should only ever be updated by one controller. + // // + // // Status can only be updated via the WriteStatus endpoint. Attempting to do + // // so via the Write endpoint will result in an InvalidArgument error code. + Status *map[string]HashicorpConsulResourceStatus `json:"status,omitempty"` + + // Version // Version is the low-level version identifier used by the storage backend + // // in CAS (Compare-And-Swap) operations. It will change when the resource is + // // modified in any way, including status updates. + // // + // // When calling the Write endpoint, providing a non-blank version will perform + // // a CAS (Compare-And-Swap) write, which will result in an Aborted error code + // // if the given version doesn't match what is stored. + Version *string `json:"version,omitempty"` + } +} + +// Status returns HTTPResponse.Status +func (r ListComputedExportedServicesResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r ListComputedExportedServicesResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type DeleteComputedExportedServicesResponse struct { + Body []byte + HTTPResponse *http.Response +} + +// Status returns HTTPResponse.Status +func (r DeleteComputedExportedServicesResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r DeleteComputedExportedServicesResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type ReadComputedExportedServicesResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *struct { + Data *HashicorpConsulMulticlusterV2ComputedExportedServices `json:"data,omitempty"` + + // Generation // Generation is incremented whenever the resource's content (i.e. not its + // // status) is modified. You can think of it as being the "user version". + // // + // // Concretely, Generation is a [ULID](https://github.com/ulid/spec) and you + // // can treat its timestamp component as the resource's modification time. + Generation *string `json:"generation,omitempty"` + + // Id ID uniquely identifies a resource. + Id *HashicorpConsulResourceID `json:"id,omitempty"` + + // Metadata // Metadata contains key/value pairs of arbitrary metadata about the resource. + // // "deletionTimestamp" and "finalizers" keys are reserved for internal use. + Metadata *map[string]string `json:"metadata,omitempty"` + + // Owner ID uniquely identifies a resource. + Owner *HashicorpConsulResourceID `json:"owner,omitempty"` + + // Status // Status is used by controllers to communicate the result of attempting to + // // reconcile and apply the resource (e.g. surface semantic validation errors) + // // with users and other controllers. Each status is identified by a unique key + // // and should only ever be updated by one controller. + // // + // // Status can only be updated via the WriteStatus endpoint. Attempting to do + // // so via the Write endpoint will result in an InvalidArgument error code. + Status *map[string]HashicorpConsulResourceStatus `json:"status,omitempty"` + + // Version // Version is the low-level version identifier used by the storage backend + // // in CAS (Compare-And-Swap) operations. It will change when the resource is + // // modified in any way, including status updates. + // // + // // When calling the Write endpoint, providing a non-blank version will perform + // // a CAS (Compare-And-Swap) write, which will result in an Aborted error code + // // if the given version doesn't match what is stored. + Version *string `json:"version,omitempty"` + } +} + +// Status returns HTTPResponse.Status +func (r ReadComputedExportedServicesResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r ReadComputedExportedServicesResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type WriteComputedExportedServicesResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *struct { + Data *HashicorpConsulMulticlusterV2ComputedExportedServices `json:"data,omitempty"` + + // Generation // Generation is incremented whenever the resource's content (i.e. not its + // // status) is modified. You can think of it as being the "user version". + // // + // // Concretely, Generation is a [ULID](https://github.com/ulid/spec) and you + // // can treat its timestamp component as the resource's modification time. + Generation *string `json:"generation,omitempty"` + + // Id ID uniquely identifies a resource. + Id *HashicorpConsulResourceID `json:"id,omitempty"` + + // Metadata // Metadata contains key/value pairs of arbitrary metadata about the resource. + // // "deletionTimestamp" and "finalizers" keys are reserved for internal use. + Metadata *map[string]string `json:"metadata,omitempty"` + + // Owner ID uniquely identifies a resource. + Owner *HashicorpConsulResourceID `json:"owner,omitempty"` + + // Status // Status is used by controllers to communicate the result of attempting to + // // reconcile and apply the resource (e.g. surface semantic validation errors) + // // with users and other controllers. Each status is identified by a unique key + // // and should only ever be updated by one controller. + // // + // // Status can only be updated via the WriteStatus endpoint. Attempting to do + // // so via the Write endpoint will result in an InvalidArgument error code. + Status *map[string]HashicorpConsulResourceStatus `json:"status,omitempty"` + + // Version // Version is the low-level version identifier used by the storage backend + // // in CAS (Compare-And-Swap) operations. It will change when the resource is + // // modified in any way, including status updates. + // // + // // When calling the Write endpoint, providing a non-blank version will perform + // // a CAS (Compare-And-Swap) write, which will result in an Aborted error code + // // if the given version doesn't match what is stored. + Version *string `json:"version,omitempty"` + } +} + +// Status returns HTTPResponse.Status +func (r WriteComputedExportedServicesResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r WriteComputedExportedServicesResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type ListExportedServicesResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *[]struct { + Data *HashicorpConsulMulticlusterV2ExportedServices `json:"data,omitempty"` + + // Generation // Generation is incremented whenever the resource's content (i.e. not its + // // status) is modified. You can think of it as being the "user version". + // // + // // Concretely, Generation is a [ULID](https://github.com/ulid/spec) and you + // // can treat its timestamp component as the resource's modification time. + Generation *string `json:"generation,omitempty"` + + // Id ID uniquely identifies a resource. + Id *HashicorpConsulResourceID `json:"id,omitempty"` + + // Metadata // Metadata contains key/value pairs of arbitrary metadata about the resource. + // // "deletionTimestamp" and "finalizers" keys are reserved for internal use. + Metadata *map[string]string `json:"metadata,omitempty"` + + // Owner ID uniquely identifies a resource. + Owner *HashicorpConsulResourceID `json:"owner,omitempty"` + + // Status // Status is used by controllers to communicate the result of attempting to + // // reconcile and apply the resource (e.g. surface semantic validation errors) + // // with users and other controllers. Each status is identified by a unique key + // // and should only ever be updated by one controller. + // // + // // Status can only be updated via the WriteStatus endpoint. Attempting to do + // // so via the Write endpoint will result in an InvalidArgument error code. + Status *map[string]HashicorpConsulResourceStatus `json:"status,omitempty"` + + // Version // Version is the low-level version identifier used by the storage backend + // // in CAS (Compare-And-Swap) operations. It will change when the resource is + // // modified in any way, including status updates. + // // + // // When calling the Write endpoint, providing a non-blank version will perform + // // a CAS (Compare-And-Swap) write, which will result in an Aborted error code + // // if the given version doesn't match what is stored. + Version *string `json:"version,omitempty"` + } +} + +// Status returns HTTPResponse.Status +func (r ListExportedServicesResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r ListExportedServicesResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type DeleteExportedServicesResponse struct { + Body []byte + HTTPResponse *http.Response +} + +// Status returns HTTPResponse.Status +func (r DeleteExportedServicesResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r DeleteExportedServicesResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type ReadExportedServicesResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *struct { + Data *HashicorpConsulMulticlusterV2ExportedServices `json:"data,omitempty"` + + // Generation // Generation is incremented whenever the resource's content (i.e. not its + // // status) is modified. You can think of it as being the "user version". + // // + // // Concretely, Generation is a [ULID](https://github.com/ulid/spec) and you + // // can treat its timestamp component as the resource's modification time. + Generation *string `json:"generation,omitempty"` + + // Id ID uniquely identifies a resource. + Id *HashicorpConsulResourceID `json:"id,omitempty"` + + // Metadata // Metadata contains key/value pairs of arbitrary metadata about the resource. + // // "deletionTimestamp" and "finalizers" keys are reserved for internal use. + Metadata *map[string]string `json:"metadata,omitempty"` + + // Owner ID uniquely identifies a resource. + Owner *HashicorpConsulResourceID `json:"owner,omitempty"` + + // Status // Status is used by controllers to communicate the result of attempting to + // // reconcile and apply the resource (e.g. surface semantic validation errors) + // // with users and other controllers. Each status is identified by a unique key + // // and should only ever be updated by one controller. + // // + // // Status can only be updated via the WriteStatus endpoint. Attempting to do + // // so via the Write endpoint will result in an InvalidArgument error code. + Status *map[string]HashicorpConsulResourceStatus `json:"status,omitempty"` + + // Version // Version is the low-level version identifier used by the storage backend + // // in CAS (Compare-And-Swap) operations. It will change when the resource is + // // modified in any way, including status updates. + // // + // // When calling the Write endpoint, providing a non-blank version will perform + // // a CAS (Compare-And-Swap) write, which will result in an Aborted error code + // // if the given version doesn't match what is stored. + Version *string `json:"version,omitempty"` + } +} + +// Status returns HTTPResponse.Status +func (r ReadExportedServicesResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r ReadExportedServicesResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type WriteExportedServicesResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *struct { + Data *HashicorpConsulMulticlusterV2ExportedServices `json:"data,omitempty"` + + // Generation // Generation is incremented whenever the resource's content (i.e. not its + // // status) is modified. You can think of it as being the "user version". + // // + // // Concretely, Generation is a [ULID](https://github.com/ulid/spec) and you + // // can treat its timestamp component as the resource's modification time. + Generation *string `json:"generation,omitempty"` + + // Id ID uniquely identifies a resource. + Id *HashicorpConsulResourceID `json:"id,omitempty"` + + // Metadata // Metadata contains key/value pairs of arbitrary metadata about the resource. + // // "deletionTimestamp" and "finalizers" keys are reserved for internal use. + Metadata *map[string]string `json:"metadata,omitempty"` + + // Owner ID uniquely identifies a resource. + Owner *HashicorpConsulResourceID `json:"owner,omitempty"` + + // Status // Status is used by controllers to communicate the result of attempting to + // // reconcile and apply the resource (e.g. surface semantic validation errors) + // // with users and other controllers. Each status is identified by a unique key + // // and should only ever be updated by one controller. + // // + // // Status can only be updated via the WriteStatus endpoint. Attempting to do + // // so via the Write endpoint will result in an InvalidArgument error code. + Status *map[string]HashicorpConsulResourceStatus `json:"status,omitempty"` + + // Version // Version is the low-level version identifier used by the storage backend + // // in CAS (Compare-And-Swap) operations. It will change when the resource is + // // modified in any way, including status updates. + // // + // // When calling the Write endpoint, providing a non-blank version will perform + // // a CAS (Compare-And-Swap) write, which will result in an Aborted error code + // // if the given version doesn't match what is stored. + Version *string `json:"version,omitempty"` + } +} + +// Status returns HTTPResponse.Status +func (r WriteExportedServicesResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r WriteExportedServicesResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type ListNamespaceExportedServicesResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *[]struct { + Data *HashicorpConsulMulticlusterV2NamespaceExportedServices `json:"data,omitempty"` + + // Generation // Generation is incremented whenever the resource's content (i.e. not its + // // status) is modified. You can think of it as being the "user version". + // // + // // Concretely, Generation is a [ULID](https://github.com/ulid/spec) and you + // // can treat its timestamp component as the resource's modification time. + Generation *string `json:"generation,omitempty"` + + // Id ID uniquely identifies a resource. + Id *HashicorpConsulResourceID `json:"id,omitempty"` + + // Metadata // Metadata contains key/value pairs of arbitrary metadata about the resource. + // // "deletionTimestamp" and "finalizers" keys are reserved for internal use. + Metadata *map[string]string `json:"metadata,omitempty"` + + // Owner ID uniquely identifies a resource. + Owner *HashicorpConsulResourceID `json:"owner,omitempty"` + + // Status // Status is used by controllers to communicate the result of attempting to + // // reconcile and apply the resource (e.g. surface semantic validation errors) + // // with users and other controllers. Each status is identified by a unique key + // // and should only ever be updated by one controller. + // // + // // Status can only be updated via the WriteStatus endpoint. Attempting to do + // // so via the Write endpoint will result in an InvalidArgument error code. + Status *map[string]HashicorpConsulResourceStatus `json:"status,omitempty"` + + // Version // Version is the low-level version identifier used by the storage backend + // // in CAS (Compare-And-Swap) operations. It will change when the resource is + // // modified in any way, including status updates. + // // + // // When calling the Write endpoint, providing a non-blank version will perform + // // a CAS (Compare-And-Swap) write, which will result in an Aborted error code + // // if the given version doesn't match what is stored. + Version *string `json:"version,omitempty"` + } +} + +// Status returns HTTPResponse.Status +func (r ListNamespaceExportedServicesResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r ListNamespaceExportedServicesResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type DeleteNamespaceExportedServicesResponse struct { + Body []byte + HTTPResponse *http.Response +} + +// Status returns HTTPResponse.Status +func (r DeleteNamespaceExportedServicesResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r DeleteNamespaceExportedServicesResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type ReadNamespaceExportedServicesResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *struct { + Data *HashicorpConsulMulticlusterV2NamespaceExportedServices `json:"data,omitempty"` + + // Generation // Generation is incremented whenever the resource's content (i.e. not its + // // status) is modified. You can think of it as being the "user version". + // // + // // Concretely, Generation is a [ULID](https://github.com/ulid/spec) and you + // // can treat its timestamp component as the resource's modification time. + Generation *string `json:"generation,omitempty"` + + // Id ID uniquely identifies a resource. + Id *HashicorpConsulResourceID `json:"id,omitempty"` + + // Metadata // Metadata contains key/value pairs of arbitrary metadata about the resource. + // // "deletionTimestamp" and "finalizers" keys are reserved for internal use. + Metadata *map[string]string `json:"metadata,omitempty"` + + // Owner ID uniquely identifies a resource. + Owner *HashicorpConsulResourceID `json:"owner,omitempty"` + + // Status // Status is used by controllers to communicate the result of attempting to + // // reconcile and apply the resource (e.g. surface semantic validation errors) + // // with users and other controllers. Each status is identified by a unique key + // // and should only ever be updated by one controller. + // // + // // Status can only be updated via the WriteStatus endpoint. Attempting to do + // // so via the Write endpoint will result in an InvalidArgument error code. + Status *map[string]HashicorpConsulResourceStatus `json:"status,omitempty"` + + // Version // Version is the low-level version identifier used by the storage backend + // // in CAS (Compare-And-Swap) operations. It will change when the resource is + // // modified in any way, including status updates. + // // + // // When calling the Write endpoint, providing a non-blank version will perform + // // a CAS (Compare-And-Swap) write, which will result in an Aborted error code + // // if the given version doesn't match what is stored. + Version *string `json:"version,omitempty"` + } +} + +// Status returns HTTPResponse.Status +func (r ReadNamespaceExportedServicesResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r ReadNamespaceExportedServicesResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type WriteNamespaceExportedServicesResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *struct { + Data *HashicorpConsulMulticlusterV2NamespaceExportedServices `json:"data,omitempty"` + + // Generation // Generation is incremented whenever the resource's content (i.e. not its + // // status) is modified. You can think of it as being the "user version". + // // + // // Concretely, Generation is a [ULID](https://github.com/ulid/spec) and you + // // can treat its timestamp component as the resource's modification time. + Generation *string `json:"generation,omitempty"` + + // Id ID uniquely identifies a resource. + Id *HashicorpConsulResourceID `json:"id,omitempty"` + + // Metadata // Metadata contains key/value pairs of arbitrary metadata about the resource. + // // "deletionTimestamp" and "finalizers" keys are reserved for internal use. + Metadata *map[string]string `json:"metadata,omitempty"` + + // Owner ID uniquely identifies a resource. + Owner *HashicorpConsulResourceID `json:"owner,omitempty"` + + // Status // Status is used by controllers to communicate the result of attempting to + // // reconcile and apply the resource (e.g. surface semantic validation errors) + // // with users and other controllers. Each status is identified by a unique key + // // and should only ever be updated by one controller. + // // + // // Status can only be updated via the WriteStatus endpoint. Attempting to do + // // so via the Write endpoint will result in an InvalidArgument error code. + Status *map[string]HashicorpConsulResourceStatus `json:"status,omitempty"` + + // Version // Version is the low-level version identifier used by the storage backend + // // in CAS (Compare-And-Swap) operations. It will change when the resource is + // // modified in any way, including status updates. + // // + // // When calling the Write endpoint, providing a non-blank version will perform + // // a CAS (Compare-And-Swap) write, which will result in an Aborted error code + // // if the given version doesn't match what is stored. + Version *string `json:"version,omitempty"` + } +} + +// Status returns HTTPResponse.Status +func (r WriteNamespaceExportedServicesResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r WriteNamespaceExportedServicesResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type ListPartitionExportedServicesResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *[]struct { + Data *HashicorpConsulMulticlusterV2PartitionExportedServices `json:"data,omitempty"` + + // Generation // Generation is incremented whenever the resource's content (i.e. not its + // // status) is modified. You can think of it as being the "user version". + // // + // // Concretely, Generation is a [ULID](https://github.com/ulid/spec) and you + // // can treat its timestamp component as the resource's modification time. + Generation *string `json:"generation,omitempty"` + + // Id ID uniquely identifies a resource. + Id *HashicorpConsulResourceID `json:"id,omitempty"` + + // Metadata // Metadata contains key/value pairs of arbitrary metadata about the resource. + // // "deletionTimestamp" and "finalizers" keys are reserved for internal use. + Metadata *map[string]string `json:"metadata,omitempty"` + + // Owner ID uniquely identifies a resource. + Owner *HashicorpConsulResourceID `json:"owner,omitempty"` + + // Status // Status is used by controllers to communicate the result of attempting to + // // reconcile and apply the resource (e.g. surface semantic validation errors) + // // with users and other controllers. Each status is identified by a unique key + // // and should only ever be updated by one controller. + // // + // // Status can only be updated via the WriteStatus endpoint. Attempting to do + // // so via the Write endpoint will result in an InvalidArgument error code. + Status *map[string]HashicorpConsulResourceStatus `json:"status,omitempty"` + + // Version // Version is the low-level version identifier used by the storage backend + // // in CAS (Compare-And-Swap) operations. It will change when the resource is + // // modified in any way, including status updates. + // // + // // When calling the Write endpoint, providing a non-blank version will perform + // // a CAS (Compare-And-Swap) write, which will result in an Aborted error code + // // if the given version doesn't match what is stored. + Version *string `json:"version,omitempty"` + } +} + +// Status returns HTTPResponse.Status +func (r ListPartitionExportedServicesResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r ListPartitionExportedServicesResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type DeletePartitionExportedServicesResponse struct { + Body []byte + HTTPResponse *http.Response +} + +// Status returns HTTPResponse.Status +func (r DeletePartitionExportedServicesResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r DeletePartitionExportedServicesResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type ReadPartitionExportedServicesResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *struct { + Data *HashicorpConsulMulticlusterV2PartitionExportedServices `json:"data,omitempty"` + + // Generation // Generation is incremented whenever the resource's content (i.e. not its + // // status) is modified. You can think of it as being the "user version". + // // + // // Concretely, Generation is a [ULID](https://github.com/ulid/spec) and you + // // can treat its timestamp component as the resource's modification time. + Generation *string `json:"generation,omitempty"` + + // Id ID uniquely identifies a resource. + Id *HashicorpConsulResourceID `json:"id,omitempty"` + + // Metadata // Metadata contains key/value pairs of arbitrary metadata about the resource. + // // "deletionTimestamp" and "finalizers" keys are reserved for internal use. + Metadata *map[string]string `json:"metadata,omitempty"` + + // Owner ID uniquely identifies a resource. + Owner *HashicorpConsulResourceID `json:"owner,omitempty"` + + // Status // Status is used by controllers to communicate the result of attempting to + // // reconcile and apply the resource (e.g. surface semantic validation errors) + // // with users and other controllers. Each status is identified by a unique key + // // and should only ever be updated by one controller. + // // + // // Status can only be updated via the WriteStatus endpoint. Attempting to do + // // so via the Write endpoint will result in an InvalidArgument error code. + Status *map[string]HashicorpConsulResourceStatus `json:"status,omitempty"` + + // Version // Version is the low-level version identifier used by the storage backend + // // in CAS (Compare-And-Swap) operations. It will change when the resource is + // // modified in any way, including status updates. + // // + // // When calling the Write endpoint, providing a non-blank version will perform + // // a CAS (Compare-And-Swap) write, which will result in an Aborted error code + // // if the given version doesn't match what is stored. + Version *string `json:"version,omitempty"` + } +} + +// Status returns HTTPResponse.Status +func (r ReadPartitionExportedServicesResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r ReadPartitionExportedServicesResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +type WritePartitionExportedServicesResponse struct { + Body []byte + HTTPResponse *http.Response + JSON200 *struct { + Data *HashicorpConsulMulticlusterV2PartitionExportedServices `json:"data,omitempty"` + + // Generation // Generation is incremented whenever the resource's content (i.e. not its + // // status) is modified. You can think of it as being the "user version". + // // + // // Concretely, Generation is a [ULID](https://github.com/ulid/spec) and you + // // can treat its timestamp component as the resource's modification time. + Generation *string `json:"generation,omitempty"` + + // Id ID uniquely identifies a resource. + Id *HashicorpConsulResourceID `json:"id,omitempty"` + + // Metadata // Metadata contains key/value pairs of arbitrary metadata about the resource. + // // "deletionTimestamp" and "finalizers" keys are reserved for internal use. + Metadata *map[string]string `json:"metadata,omitempty"` + + // Owner ID uniquely identifies a resource. + Owner *HashicorpConsulResourceID `json:"owner,omitempty"` + + // Status // Status is used by controllers to communicate the result of attempting to + // // reconcile and apply the resource (e.g. surface semantic validation errors) + // // with users and other controllers. Each status is identified by a unique key + // // and should only ever be updated by one controller. + // // + // // Status can only be updated via the WriteStatus endpoint. Attempting to do + // // so via the Write endpoint will result in an InvalidArgument error code. + Status *map[string]HashicorpConsulResourceStatus `json:"status,omitempty"` + + // Version // Version is the low-level version identifier used by the storage backend + // // in CAS (Compare-And-Swap) operations. It will change when the resource is + // // modified in any way, including status updates. + // // + // // When calling the Write endpoint, providing a non-blank version will perform + // // a CAS (Compare-And-Swap) write, which will result in an Aborted error code + // // if the given version doesn't match what is stored. + Version *string `json:"version,omitempty"` + } +} + +// Status returns HTTPResponse.Status +func (r WritePartitionExportedServicesResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r WritePartitionExportedServicesResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ListComputedExportedServicesWithResponse request returning *ListComputedExportedServicesResponse +func (c *ClientWithResponses) ListComputedExportedServicesWithResponse(ctx context.Context, params *ListComputedExportedServicesParams, reqEditors ...RequestEditorFn) (*ListComputedExportedServicesResponse, error) { + rsp, err := c.ListComputedExportedServices(ctx, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseListComputedExportedServicesResponse(rsp) +} + +// DeleteComputedExportedServicesWithResponse request returning *DeleteComputedExportedServicesResponse +func (c *ClientWithResponses) DeleteComputedExportedServicesWithResponse(ctx context.Context, name Name, params *DeleteComputedExportedServicesParams, reqEditors ...RequestEditorFn) (*DeleteComputedExportedServicesResponse, error) { + rsp, err := c.DeleteComputedExportedServices(ctx, name, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseDeleteComputedExportedServicesResponse(rsp) +} + +// ReadComputedExportedServicesWithResponse request returning *ReadComputedExportedServicesResponse +func (c *ClientWithResponses) ReadComputedExportedServicesWithResponse(ctx context.Context, name Name, params *ReadComputedExportedServicesParams, reqEditors ...RequestEditorFn) (*ReadComputedExportedServicesResponse, error) { + rsp, err := c.ReadComputedExportedServices(ctx, name, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseReadComputedExportedServicesResponse(rsp) +} + +// WriteComputedExportedServicesWithBodyWithResponse request with arbitrary body returning *WriteComputedExportedServicesResponse +func (c *ClientWithResponses) WriteComputedExportedServicesWithBodyWithResponse(ctx context.Context, name Name, params *WriteComputedExportedServicesParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*WriteComputedExportedServicesResponse, error) { + rsp, err := c.WriteComputedExportedServicesWithBody(ctx, name, params, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseWriteComputedExportedServicesResponse(rsp) +} + +func (c *ClientWithResponses) WriteComputedExportedServicesWithResponse(ctx context.Context, name Name, params *WriteComputedExportedServicesParams, body WriteComputedExportedServicesJSONRequestBody, reqEditors ...RequestEditorFn) (*WriteComputedExportedServicesResponse, error) { + rsp, err := c.WriteComputedExportedServices(ctx, name, params, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseWriteComputedExportedServicesResponse(rsp) +} + +// ListExportedServicesWithResponse request returning *ListExportedServicesResponse +func (c *ClientWithResponses) ListExportedServicesWithResponse(ctx context.Context, params *ListExportedServicesParams, reqEditors ...RequestEditorFn) (*ListExportedServicesResponse, error) { + rsp, err := c.ListExportedServices(ctx, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseListExportedServicesResponse(rsp) +} + +// DeleteExportedServicesWithResponse request returning *DeleteExportedServicesResponse +func (c *ClientWithResponses) DeleteExportedServicesWithResponse(ctx context.Context, name Name, params *DeleteExportedServicesParams, reqEditors ...RequestEditorFn) (*DeleteExportedServicesResponse, error) { + rsp, err := c.DeleteExportedServices(ctx, name, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseDeleteExportedServicesResponse(rsp) +} + +// ReadExportedServicesWithResponse request returning *ReadExportedServicesResponse +func (c *ClientWithResponses) ReadExportedServicesWithResponse(ctx context.Context, name Name, params *ReadExportedServicesParams, reqEditors ...RequestEditorFn) (*ReadExportedServicesResponse, error) { + rsp, err := c.ReadExportedServices(ctx, name, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseReadExportedServicesResponse(rsp) +} + +// WriteExportedServicesWithBodyWithResponse request with arbitrary body returning *WriteExportedServicesResponse +func (c *ClientWithResponses) WriteExportedServicesWithBodyWithResponse(ctx context.Context, name Name, params *WriteExportedServicesParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*WriteExportedServicesResponse, error) { + rsp, err := c.WriteExportedServicesWithBody(ctx, name, params, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseWriteExportedServicesResponse(rsp) +} + +func (c *ClientWithResponses) WriteExportedServicesWithResponse(ctx context.Context, name Name, params *WriteExportedServicesParams, body WriteExportedServicesJSONRequestBody, reqEditors ...RequestEditorFn) (*WriteExportedServicesResponse, error) { + rsp, err := c.WriteExportedServices(ctx, name, params, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseWriteExportedServicesResponse(rsp) +} + +// ListNamespaceExportedServicesWithResponse request returning *ListNamespaceExportedServicesResponse +func (c *ClientWithResponses) ListNamespaceExportedServicesWithResponse(ctx context.Context, params *ListNamespaceExportedServicesParams, reqEditors ...RequestEditorFn) (*ListNamespaceExportedServicesResponse, error) { + rsp, err := c.ListNamespaceExportedServices(ctx, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseListNamespaceExportedServicesResponse(rsp) +} + +// DeleteNamespaceExportedServicesWithResponse request returning *DeleteNamespaceExportedServicesResponse +func (c *ClientWithResponses) DeleteNamespaceExportedServicesWithResponse(ctx context.Context, name Name, params *DeleteNamespaceExportedServicesParams, reqEditors ...RequestEditorFn) (*DeleteNamespaceExportedServicesResponse, error) { + rsp, err := c.DeleteNamespaceExportedServices(ctx, name, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseDeleteNamespaceExportedServicesResponse(rsp) +} + +// ReadNamespaceExportedServicesWithResponse request returning *ReadNamespaceExportedServicesResponse +func (c *ClientWithResponses) ReadNamespaceExportedServicesWithResponse(ctx context.Context, name Name, params *ReadNamespaceExportedServicesParams, reqEditors ...RequestEditorFn) (*ReadNamespaceExportedServicesResponse, error) { + rsp, err := c.ReadNamespaceExportedServices(ctx, name, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseReadNamespaceExportedServicesResponse(rsp) +} + +// WriteNamespaceExportedServicesWithBodyWithResponse request with arbitrary body returning *WriteNamespaceExportedServicesResponse +func (c *ClientWithResponses) WriteNamespaceExportedServicesWithBodyWithResponse(ctx context.Context, name Name, params *WriteNamespaceExportedServicesParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*WriteNamespaceExportedServicesResponse, error) { + rsp, err := c.WriteNamespaceExportedServicesWithBody(ctx, name, params, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseWriteNamespaceExportedServicesResponse(rsp) +} + +func (c *ClientWithResponses) WriteNamespaceExportedServicesWithResponse(ctx context.Context, name Name, params *WriteNamespaceExportedServicesParams, body WriteNamespaceExportedServicesJSONRequestBody, reqEditors ...RequestEditorFn) (*WriteNamespaceExportedServicesResponse, error) { + rsp, err := c.WriteNamespaceExportedServices(ctx, name, params, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseWriteNamespaceExportedServicesResponse(rsp) +} + +// ListPartitionExportedServicesWithResponse request returning *ListPartitionExportedServicesResponse +func (c *ClientWithResponses) ListPartitionExportedServicesWithResponse(ctx context.Context, params *ListPartitionExportedServicesParams, reqEditors ...RequestEditorFn) (*ListPartitionExportedServicesResponse, error) { + rsp, err := c.ListPartitionExportedServices(ctx, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseListPartitionExportedServicesResponse(rsp) +} + +// DeletePartitionExportedServicesWithResponse request returning *DeletePartitionExportedServicesResponse +func (c *ClientWithResponses) DeletePartitionExportedServicesWithResponse(ctx context.Context, name Name, params *DeletePartitionExportedServicesParams, reqEditors ...RequestEditorFn) (*DeletePartitionExportedServicesResponse, error) { + rsp, err := c.DeletePartitionExportedServices(ctx, name, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseDeletePartitionExportedServicesResponse(rsp) +} + +// ReadPartitionExportedServicesWithResponse request returning *ReadPartitionExportedServicesResponse +func (c *ClientWithResponses) ReadPartitionExportedServicesWithResponse(ctx context.Context, name Name, params *ReadPartitionExportedServicesParams, reqEditors ...RequestEditorFn) (*ReadPartitionExportedServicesResponse, error) { + rsp, err := c.ReadPartitionExportedServices(ctx, name, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseReadPartitionExportedServicesResponse(rsp) +} + +// WritePartitionExportedServicesWithBodyWithResponse request with arbitrary body returning *WritePartitionExportedServicesResponse +func (c *ClientWithResponses) WritePartitionExportedServicesWithBodyWithResponse(ctx context.Context, name Name, params *WritePartitionExportedServicesParams, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*WritePartitionExportedServicesResponse, error) { + rsp, err := c.WritePartitionExportedServicesWithBody(ctx, name, params, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseWritePartitionExportedServicesResponse(rsp) +} + +func (c *ClientWithResponses) WritePartitionExportedServicesWithResponse(ctx context.Context, name Name, params *WritePartitionExportedServicesParams, body WritePartitionExportedServicesJSONRequestBody, reqEditors ...RequestEditorFn) (*WritePartitionExportedServicesResponse, error) { + rsp, err := c.WritePartitionExportedServices(ctx, name, params, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseWritePartitionExportedServicesResponse(rsp) +} + +// ParseListComputedExportedServicesResponse parses an HTTP response from a ListComputedExportedServicesWithResponse call +func ParseListComputedExportedServicesResponse(rsp *http.Response) (*ListComputedExportedServicesResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &ListComputedExportedServicesResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest []struct { + Data *HashicorpConsulMulticlusterV2ComputedExportedServices `json:"data,omitempty"` + + // Generation // Generation is incremented whenever the resource's content (i.e. not its + // // status) is modified. You can think of it as being the "user version". + // // + // // Concretely, Generation is a [ULID](https://github.com/ulid/spec) and you + // // can treat its timestamp component as the resource's modification time. + Generation *string `json:"generation,omitempty"` + + // Id ID uniquely identifies a resource. + Id *HashicorpConsulResourceID `json:"id,omitempty"` + + // Metadata // Metadata contains key/value pairs of arbitrary metadata about the resource. + // // "deletionTimestamp" and "finalizers" keys are reserved for internal use. + Metadata *map[string]string `json:"metadata,omitempty"` + + // Owner ID uniquely identifies a resource. + Owner *HashicorpConsulResourceID `json:"owner,omitempty"` + + // Status // Status is used by controllers to communicate the result of attempting to + // // reconcile and apply the resource (e.g. surface semantic validation errors) + // // with users and other controllers. Each status is identified by a unique key + // // and should only ever be updated by one controller. + // // + // // Status can only be updated via the WriteStatus endpoint. Attempting to do + // // so via the Write endpoint will result in an InvalidArgument error code. + Status *map[string]HashicorpConsulResourceStatus `json:"status,omitempty"` + + // Version // Version is the low-level version identifier used by the storage backend + // // in CAS (Compare-And-Swap) operations. It will change when the resource is + // // modified in any way, including status updates. + // // + // // When calling the Write endpoint, providing a non-blank version will perform + // // a CAS (Compare-And-Swap) write, which will result in an Aborted error code + // // if the given version doesn't match what is stored. + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + +// ParseDeleteComputedExportedServicesResponse parses an HTTP response from a DeleteComputedExportedServicesWithResponse call +func ParseDeleteComputedExportedServicesResponse(rsp *http.Response) (*DeleteComputedExportedServicesResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &DeleteComputedExportedServicesResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + return response, nil +} + +// ParseReadComputedExportedServicesResponse parses an HTTP response from a ReadComputedExportedServicesWithResponse call +func ParseReadComputedExportedServicesResponse(rsp *http.Response) (*ReadComputedExportedServicesResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &ReadComputedExportedServicesResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + Data *HashicorpConsulMulticlusterV2ComputedExportedServices `json:"data,omitempty"` + + // Generation // Generation is incremented whenever the resource's content (i.e. not its + // // status) is modified. You can think of it as being the "user version". + // // + // // Concretely, Generation is a [ULID](https://github.com/ulid/spec) and you + // // can treat its timestamp component as the resource's modification time. + Generation *string `json:"generation,omitempty"` + + // Id ID uniquely identifies a resource. + Id *HashicorpConsulResourceID `json:"id,omitempty"` + + // Metadata // Metadata contains key/value pairs of arbitrary metadata about the resource. + // // "deletionTimestamp" and "finalizers" keys are reserved for internal use. + Metadata *map[string]string `json:"metadata,omitempty"` + + // Owner ID uniquely identifies a resource. + Owner *HashicorpConsulResourceID `json:"owner,omitempty"` + + // Status // Status is used by controllers to communicate the result of attempting to + // // reconcile and apply the resource (e.g. surface semantic validation errors) + // // with users and other controllers. Each status is identified by a unique key + // // and should only ever be updated by one controller. + // // + // // Status can only be updated via the WriteStatus endpoint. Attempting to do + // // so via the Write endpoint will result in an InvalidArgument error code. + Status *map[string]HashicorpConsulResourceStatus `json:"status,omitempty"` + + // Version // Version is the low-level version identifier used by the storage backend + // // in CAS (Compare-And-Swap) operations. It will change when the resource is + // // modified in any way, including status updates. + // // + // // When calling the Write endpoint, providing a non-blank version will perform + // // a CAS (Compare-And-Swap) write, which will result in an Aborted error code + // // if the given version doesn't match what is stored. + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + +// ParseWriteComputedExportedServicesResponse parses an HTTP response from a WriteComputedExportedServicesWithResponse call +func ParseWriteComputedExportedServicesResponse(rsp *http.Response) (*WriteComputedExportedServicesResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &WriteComputedExportedServicesResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + Data *HashicorpConsulMulticlusterV2ComputedExportedServices `json:"data,omitempty"` + + // Generation // Generation is incremented whenever the resource's content (i.e. not its + // // status) is modified. You can think of it as being the "user version". + // // + // // Concretely, Generation is a [ULID](https://github.com/ulid/spec) and you + // // can treat its timestamp component as the resource's modification time. + Generation *string `json:"generation,omitempty"` + + // Id ID uniquely identifies a resource. + Id *HashicorpConsulResourceID `json:"id,omitempty"` + + // Metadata // Metadata contains key/value pairs of arbitrary metadata about the resource. + // // "deletionTimestamp" and "finalizers" keys are reserved for internal use. + Metadata *map[string]string `json:"metadata,omitempty"` + + // Owner ID uniquely identifies a resource. + Owner *HashicorpConsulResourceID `json:"owner,omitempty"` + + // Status // Status is used by controllers to communicate the result of attempting to + // // reconcile and apply the resource (e.g. surface semantic validation errors) + // // with users and other controllers. Each status is identified by a unique key + // // and should only ever be updated by one controller. + // // + // // Status can only be updated via the WriteStatus endpoint. Attempting to do + // // so via the Write endpoint will result in an InvalidArgument error code. + Status *map[string]HashicorpConsulResourceStatus `json:"status,omitempty"` + + // Version // Version is the low-level version identifier used by the storage backend + // // in CAS (Compare-And-Swap) operations. It will change when the resource is + // // modified in any way, including status updates. + // // + // // When calling the Write endpoint, providing a non-blank version will perform + // // a CAS (Compare-And-Swap) write, which will result in an Aborted error code + // // if the given version doesn't match what is stored. + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + +// ParseListExportedServicesResponse parses an HTTP response from a ListExportedServicesWithResponse call +func ParseListExportedServicesResponse(rsp *http.Response) (*ListExportedServicesResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &ListExportedServicesResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest []struct { + Data *HashicorpConsulMulticlusterV2ExportedServices `json:"data,omitempty"` + + // Generation // Generation is incremented whenever the resource's content (i.e. not its + // // status) is modified. You can think of it as being the "user version". + // // + // // Concretely, Generation is a [ULID](https://github.com/ulid/spec) and you + // // can treat its timestamp component as the resource's modification time. + Generation *string `json:"generation,omitempty"` + + // Id ID uniquely identifies a resource. + Id *HashicorpConsulResourceID `json:"id,omitempty"` + + // Metadata // Metadata contains key/value pairs of arbitrary metadata about the resource. + // // "deletionTimestamp" and "finalizers" keys are reserved for internal use. + Metadata *map[string]string `json:"metadata,omitempty"` + + // Owner ID uniquely identifies a resource. + Owner *HashicorpConsulResourceID `json:"owner,omitempty"` + + // Status // Status is used by controllers to communicate the result of attempting to + // // reconcile and apply the resource (e.g. surface semantic validation errors) + // // with users and other controllers. Each status is identified by a unique key + // // and should only ever be updated by one controller. + // // + // // Status can only be updated via the WriteStatus endpoint. Attempting to do + // // so via the Write endpoint will result in an InvalidArgument error code. + Status *map[string]HashicorpConsulResourceStatus `json:"status,omitempty"` + + // Version // Version is the low-level version identifier used by the storage backend + // // in CAS (Compare-And-Swap) operations. It will change when the resource is + // // modified in any way, including status updates. + // // + // // When calling the Write endpoint, providing a non-blank version will perform + // // a CAS (Compare-And-Swap) write, which will result in an Aborted error code + // // if the given version doesn't match what is stored. + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + +// ParseDeleteExportedServicesResponse parses an HTTP response from a DeleteExportedServicesWithResponse call +func ParseDeleteExportedServicesResponse(rsp *http.Response) (*DeleteExportedServicesResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &DeleteExportedServicesResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + return response, nil +} + +// ParseReadExportedServicesResponse parses an HTTP response from a ReadExportedServicesWithResponse call +func ParseReadExportedServicesResponse(rsp *http.Response) (*ReadExportedServicesResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &ReadExportedServicesResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + Data *HashicorpConsulMulticlusterV2ExportedServices `json:"data,omitempty"` + + // Generation // Generation is incremented whenever the resource's content (i.e. not its + // // status) is modified. You can think of it as being the "user version". + // // + // // Concretely, Generation is a [ULID](https://github.com/ulid/spec) and you + // // can treat its timestamp component as the resource's modification time. + Generation *string `json:"generation,omitempty"` + + // Id ID uniquely identifies a resource. + Id *HashicorpConsulResourceID `json:"id,omitempty"` + + // Metadata // Metadata contains key/value pairs of arbitrary metadata about the resource. + // // "deletionTimestamp" and "finalizers" keys are reserved for internal use. + Metadata *map[string]string `json:"metadata,omitempty"` + + // Owner ID uniquely identifies a resource. + Owner *HashicorpConsulResourceID `json:"owner,omitempty"` + + // Status // Status is used by controllers to communicate the result of attempting to + // // reconcile and apply the resource (e.g. surface semantic validation errors) + // // with users and other controllers. Each status is identified by a unique key + // // and should only ever be updated by one controller. + // // + // // Status can only be updated via the WriteStatus endpoint. Attempting to do + // // so via the Write endpoint will result in an InvalidArgument error code. + Status *map[string]HashicorpConsulResourceStatus `json:"status,omitempty"` + + // Version // Version is the low-level version identifier used by the storage backend + // // in CAS (Compare-And-Swap) operations. It will change when the resource is + // // modified in any way, including status updates. + // // + // // When calling the Write endpoint, providing a non-blank version will perform + // // a CAS (Compare-And-Swap) write, which will result in an Aborted error code + // // if the given version doesn't match what is stored. + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + +// ParseWriteExportedServicesResponse parses an HTTP response from a WriteExportedServicesWithResponse call +func ParseWriteExportedServicesResponse(rsp *http.Response) (*WriteExportedServicesResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &WriteExportedServicesResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + Data *HashicorpConsulMulticlusterV2ExportedServices `json:"data,omitempty"` + + // Generation // Generation is incremented whenever the resource's content (i.e. not its + // // status) is modified. You can think of it as being the "user version". + // // + // // Concretely, Generation is a [ULID](https://github.com/ulid/spec) and you + // // can treat its timestamp component as the resource's modification time. + Generation *string `json:"generation,omitempty"` + + // Id ID uniquely identifies a resource. + Id *HashicorpConsulResourceID `json:"id,omitempty"` + + // Metadata // Metadata contains key/value pairs of arbitrary metadata about the resource. + // // "deletionTimestamp" and "finalizers" keys are reserved for internal use. + Metadata *map[string]string `json:"metadata,omitempty"` + + // Owner ID uniquely identifies a resource. + Owner *HashicorpConsulResourceID `json:"owner,omitempty"` + + // Status // Status is used by controllers to communicate the result of attempting to + // // reconcile and apply the resource (e.g. surface semantic validation errors) + // // with users and other controllers. Each status is identified by a unique key + // // and should only ever be updated by one controller. + // // + // // Status can only be updated via the WriteStatus endpoint. Attempting to do + // // so via the Write endpoint will result in an InvalidArgument error code. + Status *map[string]HashicorpConsulResourceStatus `json:"status,omitempty"` + + // Version // Version is the low-level version identifier used by the storage backend + // // in CAS (Compare-And-Swap) operations. It will change when the resource is + // // modified in any way, including status updates. + // // + // // When calling the Write endpoint, providing a non-blank version will perform + // // a CAS (Compare-And-Swap) write, which will result in an Aborted error code + // // if the given version doesn't match what is stored. + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + +// ParseListNamespaceExportedServicesResponse parses an HTTP response from a ListNamespaceExportedServicesWithResponse call +func ParseListNamespaceExportedServicesResponse(rsp *http.Response) (*ListNamespaceExportedServicesResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &ListNamespaceExportedServicesResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest []struct { + Data *HashicorpConsulMulticlusterV2NamespaceExportedServices `json:"data,omitempty"` + + // Generation // Generation is incremented whenever the resource's content (i.e. not its + // // status) is modified. You can think of it as being the "user version". + // // + // // Concretely, Generation is a [ULID](https://github.com/ulid/spec) and you + // // can treat its timestamp component as the resource's modification time. + Generation *string `json:"generation,omitempty"` + + // Id ID uniquely identifies a resource. + Id *HashicorpConsulResourceID `json:"id,omitempty"` + + // Metadata // Metadata contains key/value pairs of arbitrary metadata about the resource. + // // "deletionTimestamp" and "finalizers" keys are reserved for internal use. + Metadata *map[string]string `json:"metadata,omitempty"` + + // Owner ID uniquely identifies a resource. + Owner *HashicorpConsulResourceID `json:"owner,omitempty"` + + // Status // Status is used by controllers to communicate the result of attempting to + // // reconcile and apply the resource (e.g. surface semantic validation errors) + // // with users and other controllers. Each status is identified by a unique key + // // and should only ever be updated by one controller. + // // + // // Status can only be updated via the WriteStatus endpoint. Attempting to do + // // so via the Write endpoint will result in an InvalidArgument error code. + Status *map[string]HashicorpConsulResourceStatus `json:"status,omitempty"` + + // Version // Version is the low-level version identifier used by the storage backend + // // in CAS (Compare-And-Swap) operations. It will change when the resource is + // // modified in any way, including status updates. + // // + // // When calling the Write endpoint, providing a non-blank version will perform + // // a CAS (Compare-And-Swap) write, which will result in an Aborted error code + // // if the given version doesn't match what is stored. + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + +// ParseDeleteNamespaceExportedServicesResponse parses an HTTP response from a DeleteNamespaceExportedServicesWithResponse call +func ParseDeleteNamespaceExportedServicesResponse(rsp *http.Response) (*DeleteNamespaceExportedServicesResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &DeleteNamespaceExportedServicesResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + return response, nil +} + +// ParseReadNamespaceExportedServicesResponse parses an HTTP response from a ReadNamespaceExportedServicesWithResponse call +func ParseReadNamespaceExportedServicesResponse(rsp *http.Response) (*ReadNamespaceExportedServicesResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &ReadNamespaceExportedServicesResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + Data *HashicorpConsulMulticlusterV2NamespaceExportedServices `json:"data,omitempty"` + + // Generation // Generation is incremented whenever the resource's content (i.e. not its + // // status) is modified. You can think of it as being the "user version". + // // + // // Concretely, Generation is a [ULID](https://github.com/ulid/spec) and you + // // can treat its timestamp component as the resource's modification time. + Generation *string `json:"generation,omitempty"` + + // Id ID uniquely identifies a resource. + Id *HashicorpConsulResourceID `json:"id,omitempty"` + + // Metadata // Metadata contains key/value pairs of arbitrary metadata about the resource. + // // "deletionTimestamp" and "finalizers" keys are reserved for internal use. + Metadata *map[string]string `json:"metadata,omitempty"` + + // Owner ID uniquely identifies a resource. + Owner *HashicorpConsulResourceID `json:"owner,omitempty"` + + // Status // Status is used by controllers to communicate the result of attempting to + // // reconcile and apply the resource (e.g. surface semantic validation errors) + // // with users and other controllers. Each status is identified by a unique key + // // and should only ever be updated by one controller. + // // + // // Status can only be updated via the WriteStatus endpoint. Attempting to do + // // so via the Write endpoint will result in an InvalidArgument error code. + Status *map[string]HashicorpConsulResourceStatus `json:"status,omitempty"` + + // Version // Version is the low-level version identifier used by the storage backend + // // in CAS (Compare-And-Swap) operations. It will change when the resource is + // // modified in any way, including status updates. + // // + // // When calling the Write endpoint, providing a non-blank version will perform + // // a CAS (Compare-And-Swap) write, which will result in an Aborted error code + // // if the given version doesn't match what is stored. + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + +// ParseWriteNamespaceExportedServicesResponse parses an HTTP response from a WriteNamespaceExportedServicesWithResponse call +func ParseWriteNamespaceExportedServicesResponse(rsp *http.Response) (*WriteNamespaceExportedServicesResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &WriteNamespaceExportedServicesResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + Data *HashicorpConsulMulticlusterV2NamespaceExportedServices `json:"data,omitempty"` + + // Generation // Generation is incremented whenever the resource's content (i.e. not its + // // status) is modified. You can think of it as being the "user version". + // // + // // Concretely, Generation is a [ULID](https://github.com/ulid/spec) and you + // // can treat its timestamp component as the resource's modification time. + Generation *string `json:"generation,omitempty"` + + // Id ID uniquely identifies a resource. + Id *HashicorpConsulResourceID `json:"id,omitempty"` + + // Metadata // Metadata contains key/value pairs of arbitrary metadata about the resource. + // // "deletionTimestamp" and "finalizers" keys are reserved for internal use. + Metadata *map[string]string `json:"metadata,omitempty"` + + // Owner ID uniquely identifies a resource. + Owner *HashicorpConsulResourceID `json:"owner,omitempty"` + + // Status // Status is used by controllers to communicate the result of attempting to + // // reconcile and apply the resource (e.g. surface semantic validation errors) + // // with users and other controllers. Each status is identified by a unique key + // // and should only ever be updated by one controller. + // // + // // Status can only be updated via the WriteStatus endpoint. Attempting to do + // // so via the Write endpoint will result in an InvalidArgument error code. + Status *map[string]HashicorpConsulResourceStatus `json:"status,omitempty"` + + // Version // Version is the low-level version identifier used by the storage backend + // // in CAS (Compare-And-Swap) operations. It will change when the resource is + // // modified in any way, including status updates. + // // + // // When calling the Write endpoint, providing a non-blank version will perform + // // a CAS (Compare-And-Swap) write, which will result in an Aborted error code + // // if the given version doesn't match what is stored. + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + +// ParseListPartitionExportedServicesResponse parses an HTTP response from a ListPartitionExportedServicesWithResponse call +func ParseListPartitionExportedServicesResponse(rsp *http.Response) (*ListPartitionExportedServicesResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &ListPartitionExportedServicesResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest []struct { + Data *HashicorpConsulMulticlusterV2PartitionExportedServices `json:"data,omitempty"` + + // Generation // Generation is incremented whenever the resource's content (i.e. not its + // // status) is modified. You can think of it as being the "user version". + // // + // // Concretely, Generation is a [ULID](https://github.com/ulid/spec) and you + // // can treat its timestamp component as the resource's modification time. + Generation *string `json:"generation,omitempty"` + + // Id ID uniquely identifies a resource. + Id *HashicorpConsulResourceID `json:"id,omitempty"` + + // Metadata // Metadata contains key/value pairs of arbitrary metadata about the resource. + // // "deletionTimestamp" and "finalizers" keys are reserved for internal use. + Metadata *map[string]string `json:"metadata,omitempty"` + + // Owner ID uniquely identifies a resource. + Owner *HashicorpConsulResourceID `json:"owner,omitempty"` + + // Status // Status is used by controllers to communicate the result of attempting to + // // reconcile and apply the resource (e.g. surface semantic validation errors) + // // with users and other controllers. Each status is identified by a unique key + // // and should only ever be updated by one controller. + // // + // // Status can only be updated via the WriteStatus endpoint. Attempting to do + // // so via the Write endpoint will result in an InvalidArgument error code. + Status *map[string]HashicorpConsulResourceStatus `json:"status,omitempty"` + + // Version // Version is the low-level version identifier used by the storage backend + // // in CAS (Compare-And-Swap) operations. It will change when the resource is + // // modified in any way, including status updates. + // // + // // When calling the Write endpoint, providing a non-blank version will perform + // // a CAS (Compare-And-Swap) write, which will result in an Aborted error code + // // if the given version doesn't match what is stored. + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + +// ParseDeletePartitionExportedServicesResponse parses an HTTP response from a DeletePartitionExportedServicesWithResponse call +func ParseDeletePartitionExportedServicesResponse(rsp *http.Response) (*DeletePartitionExportedServicesResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &DeletePartitionExportedServicesResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + return response, nil +} + +// ParseReadPartitionExportedServicesResponse parses an HTTP response from a ReadPartitionExportedServicesWithResponse call +func ParseReadPartitionExportedServicesResponse(rsp *http.Response) (*ReadPartitionExportedServicesResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &ReadPartitionExportedServicesResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + Data *HashicorpConsulMulticlusterV2PartitionExportedServices `json:"data,omitempty"` + + // Generation // Generation is incremented whenever the resource's content (i.e. not its + // // status) is modified. You can think of it as being the "user version". + // // + // // Concretely, Generation is a [ULID](https://github.com/ulid/spec) and you + // // can treat its timestamp component as the resource's modification time. + Generation *string `json:"generation,omitempty"` + + // Id ID uniquely identifies a resource. + Id *HashicorpConsulResourceID `json:"id,omitempty"` + + // Metadata // Metadata contains key/value pairs of arbitrary metadata about the resource. + // // "deletionTimestamp" and "finalizers" keys are reserved for internal use. + Metadata *map[string]string `json:"metadata,omitempty"` + + // Owner ID uniquely identifies a resource. + Owner *HashicorpConsulResourceID `json:"owner,omitempty"` + + // Status // Status is used by controllers to communicate the result of attempting to + // // reconcile and apply the resource (e.g. surface semantic validation errors) + // // with users and other controllers. Each status is identified by a unique key + // // and should only ever be updated by one controller. + // // + // // Status can only be updated via the WriteStatus endpoint. Attempting to do + // // so via the Write endpoint will result in an InvalidArgument error code. + Status *map[string]HashicorpConsulResourceStatus `json:"status,omitempty"` + + // Version // Version is the low-level version identifier used by the storage backend + // // in CAS (Compare-And-Swap) operations. It will change when the resource is + // // modified in any way, including status updates. + // // + // // When calling the Write endpoint, providing a non-blank version will perform + // // a CAS (Compare-And-Swap) write, which will result in an Aborted error code + // // if the given version doesn't match what is stored. + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + +// ParseWritePartitionExportedServicesResponse parses an HTTP response from a WritePartitionExportedServicesWithResponse call +func ParseWritePartitionExportedServicesResponse(rsp *http.Response) (*WritePartitionExportedServicesResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &WritePartitionExportedServicesResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest struct { + Data *HashicorpConsulMulticlusterV2PartitionExportedServices `json:"data,omitempty"` + + // Generation // Generation is incremented whenever the resource's content (i.e. not its + // // status) is modified. You can think of it as being the "user version". + // // + // // Concretely, Generation is a [ULID](https://github.com/ulid/spec) and you + // // can treat its timestamp component as the resource's modification time. + Generation *string `json:"generation,omitempty"` + + // Id ID uniquely identifies a resource. + Id *HashicorpConsulResourceID `json:"id,omitempty"` + + // Metadata // Metadata contains key/value pairs of arbitrary metadata about the resource. + // // "deletionTimestamp" and "finalizers" keys are reserved for internal use. + Metadata *map[string]string `json:"metadata,omitempty"` + + // Owner ID uniquely identifies a resource. + Owner *HashicorpConsulResourceID `json:"owner,omitempty"` + + // Status // Status is used by controllers to communicate the result of attempting to + // // reconcile and apply the resource (e.g. surface semantic validation errors) + // // with users and other controllers. Each status is identified by a unique key + // // and should only ever be updated by one controller. + // // + // // Status can only be updated via the WriteStatus endpoint. Attempting to do + // // so via the Write endpoint will result in an InvalidArgument error code. + Status *map[string]HashicorpConsulResourceStatus `json:"status,omitempty"` + + // Version // Version is the low-level version identifier used by the storage backend + // // in CAS (Compare-And-Swap) operations. It will change when the resource is + // // modified in any way, including status updates. + // // + // // When calling the Write endpoint, providing a non-blank version will perform + // // a CAS (Compare-And-Swap) write, which will result in an Aborted error code + // // if the given version doesn't match what is stored. + Version *string `json:"version,omitempty"` + } + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + } + + return response, nil +} + +// ServerInterface represents all server handlers. +type ServerInterface interface { + // List multicluster.v2.ComputedExportedServices resources + // (GET /multicluster/v2/ComputedExportedServices) + ListComputedExportedServices(ctx echo.Context, params ListComputedExportedServicesParams) error + // Delete multicluster.v2.ComputedExportedServices resources + // (DELETE /multicluster/v2/ComputedExportedServices/{name}) + DeleteComputedExportedServices(ctx echo.Context, name Name, params DeleteComputedExportedServicesParams) error + // Read multicluster.v2.ComputedExportedServices resources + // (GET /multicluster/v2/ComputedExportedServices/{name}) + ReadComputedExportedServices(ctx echo.Context, name Name, params ReadComputedExportedServicesParams) error + // Write multicluster.v2.ComputedExportedServices resources + // (PUT /multicluster/v2/ComputedExportedServices/{name}) + WriteComputedExportedServices(ctx echo.Context, name Name, params WriteComputedExportedServicesParams) error + // List multicluster.v2.ExportedServices resources + // (GET /multicluster/v2/ExportedServices) + ListExportedServices(ctx echo.Context, params ListExportedServicesParams) error + // Delete multicluster.v2.ExportedServices resources + // (DELETE /multicluster/v2/ExportedServices/{name}) + DeleteExportedServices(ctx echo.Context, name Name, params DeleteExportedServicesParams) error + // Read multicluster.v2.ExportedServices resources + // (GET /multicluster/v2/ExportedServices/{name}) + ReadExportedServices(ctx echo.Context, name Name, params ReadExportedServicesParams) error + // Write multicluster.v2.ExportedServices resources + // (PUT /multicluster/v2/ExportedServices/{name}) + WriteExportedServices(ctx echo.Context, name Name, params WriteExportedServicesParams) error + // List multicluster.v2.NamespaceExportedServices resources + // (GET /multicluster/v2/NamespaceExportedServices) + ListNamespaceExportedServices(ctx echo.Context, params ListNamespaceExportedServicesParams) error + // Delete multicluster.v2.NamespaceExportedServices resources + // (DELETE /multicluster/v2/NamespaceExportedServices/{name}) + DeleteNamespaceExportedServices(ctx echo.Context, name Name, params DeleteNamespaceExportedServicesParams) error + // Read multicluster.v2.NamespaceExportedServices resources + // (GET /multicluster/v2/NamespaceExportedServices/{name}) + ReadNamespaceExportedServices(ctx echo.Context, name Name, params ReadNamespaceExportedServicesParams) error + // Write multicluster.v2.NamespaceExportedServices resources + // (PUT /multicluster/v2/NamespaceExportedServices/{name}) + WriteNamespaceExportedServices(ctx echo.Context, name Name, params WriteNamespaceExportedServicesParams) error + // List multicluster.v2.PartitionExportedServices resources + // (GET /multicluster/v2/PartitionExportedServices) + ListPartitionExportedServices(ctx echo.Context, params ListPartitionExportedServicesParams) error + // Delete multicluster.v2.PartitionExportedServices resources + // (DELETE /multicluster/v2/PartitionExportedServices/{name}) + DeletePartitionExportedServices(ctx echo.Context, name Name, params DeletePartitionExportedServicesParams) error + // Read multicluster.v2.PartitionExportedServices resources + // (GET /multicluster/v2/PartitionExportedServices/{name}) + ReadPartitionExportedServices(ctx echo.Context, name Name, params ReadPartitionExportedServicesParams) error + // Write multicluster.v2.PartitionExportedServices resources + // (PUT /multicluster/v2/PartitionExportedServices/{name}) + WritePartitionExportedServices(ctx echo.Context, name Name, params WritePartitionExportedServicesParams) error +} + +// ServerInterfaceWrapper converts echo contexts to parameters. +type ServerInterfaceWrapper struct { + Handler ServerInterface +} + +// ListComputedExportedServices converts echo context to params. +func (w *ServerInterfaceWrapper) ListComputedExportedServices(ctx echo.Context) error { + var err error + + ctx.Set(BearerAuthScopes, []string{"write:TrafficPermissions.destination"}) + + ctx.Set(ConsulTokenHeaderScopes, []string{"write:TrafficPermissions.destination"}) + + // Parameter object where we will unmarshal all parameters from the context + var params ListComputedExportedServicesParams + // ------------- Optional query parameter "peer" ------------- + + err = runtime.BindQueryParameter("form", true, false, "peer", ctx.QueryParams(), ¶ms.Peer) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter peer: %s", err)) + } + + // ------------- Optional query parameter "consistent" ------------- + + err = runtime.BindQueryParameter("form", true, false, "consistent", ctx.QueryParams(), ¶ms.Consistent) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter consistent: %s", err)) + } + + // ------------- Optional query parameter "name_prefix" ------------- + + err = runtime.BindQueryParameter("form", true, false, "name_prefix", ctx.QueryParams(), ¶ms.NamePrefix) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter name_prefix: %s", err)) + } + + // ------------- Optional query parameter "partition" ------------- + + err = runtime.BindQueryParameter("form", true, false, "partition", ctx.QueryParams(), ¶ms.Partition) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter partition: %s", err)) + } + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.ListComputedExportedServices(ctx, params) + return err +} + +// DeleteComputedExportedServices converts echo context to params. +func (w *ServerInterfaceWrapper) DeleteComputedExportedServices(ctx echo.Context) error { + var err error + // ------------- Path parameter "name" ------------- + var name Name + + err = runtime.BindStyledParameterWithOptions("simple", "name", ctx.Param("name"), &name, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter name: %s", err)) + } + + ctx.Set(BearerAuthScopes, []string{}) + + ctx.Set(ConsulTokenHeaderScopes, []string{}) + + // Parameter object where we will unmarshal all parameters from the context + var params DeleteComputedExportedServicesParams + // ------------- Optional query parameter "peer" ------------- + + err = runtime.BindQueryParameter("form", true, false, "peer", ctx.QueryParams(), ¶ms.Peer) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter peer: %s", err)) + } + + // ------------- Optional query parameter "partition" ------------- + + err = runtime.BindQueryParameter("form", true, false, "partition", ctx.QueryParams(), ¶ms.Partition) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter partition: %s", err)) + } + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.DeleteComputedExportedServices(ctx, name, params) + return err +} + +// ReadComputedExportedServices converts echo context to params. +func (w *ServerInterfaceWrapper) ReadComputedExportedServices(ctx echo.Context) error { + var err error + // ------------- Path parameter "name" ------------- + var name Name + + err = runtime.BindStyledParameterWithOptions("simple", "name", ctx.Param("name"), &name, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter name: %s", err)) + } + + ctx.Set(BearerAuthScopes, []string{}) + + ctx.Set(ConsulTokenHeaderScopes, []string{}) + + // Parameter object where we will unmarshal all parameters from the context + var params ReadComputedExportedServicesParams + // ------------- Optional query parameter "consistent" ------------- + + err = runtime.BindQueryParameter("form", true, false, "consistent", ctx.QueryParams(), ¶ms.Consistent) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter consistent: %s", err)) + } + + // ------------- Optional query parameter "peer" ------------- + + err = runtime.BindQueryParameter("form", true, false, "peer", ctx.QueryParams(), ¶ms.Peer) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter peer: %s", err)) + } + + // ------------- Optional query parameter "partition" ------------- + + err = runtime.BindQueryParameter("form", true, false, "partition", ctx.QueryParams(), ¶ms.Partition) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter partition: %s", err)) + } + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.ReadComputedExportedServices(ctx, name, params) + return err +} + +// WriteComputedExportedServices converts echo context to params. +func (w *ServerInterfaceWrapper) WriteComputedExportedServices(ctx echo.Context) error { + var err error + // ------------- Path parameter "name" ------------- + var name Name + + err = runtime.BindStyledParameterWithOptions("simple", "name", ctx.Param("name"), &name, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter name: %s", err)) + } + + ctx.Set(BearerAuthScopes, []string{}) + + ctx.Set(ConsulTokenHeaderScopes, []string{}) + + // Parameter object where we will unmarshal all parameters from the context + var params WriteComputedExportedServicesParams + // ------------- Optional query parameter "peer" ------------- + + err = runtime.BindQueryParameter("form", true, false, "peer", ctx.QueryParams(), ¶ms.Peer) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter peer: %s", err)) + } + + // ------------- Optional query parameter "partition" ------------- + + err = runtime.BindQueryParameter("form", true, false, "partition", ctx.QueryParams(), ¶ms.Partition) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter partition: %s", err)) + } + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.WriteComputedExportedServices(ctx, name, params) + return err +} + +// ListExportedServices converts echo context to params. +func (w *ServerInterfaceWrapper) ListExportedServices(ctx echo.Context) error { + var err error + + ctx.Set(BearerAuthScopes, []string{"write:TrafficPermissions.destination"}) + + ctx.Set(ConsulTokenHeaderScopes, []string{"write:TrafficPermissions.destination"}) + + // Parameter object where we will unmarshal all parameters from the context + var params ListExportedServicesParams + // ------------- Optional query parameter "peer" ------------- + + err = runtime.BindQueryParameter("form", true, false, "peer", ctx.QueryParams(), ¶ms.Peer) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter peer: %s", err)) + } + + // ------------- Optional query parameter "consistent" ------------- + + err = runtime.BindQueryParameter("form", true, false, "consistent", ctx.QueryParams(), ¶ms.Consistent) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter consistent: %s", err)) + } + + // ------------- Optional query parameter "name_prefix" ------------- + + err = runtime.BindQueryParameter("form", true, false, "name_prefix", ctx.QueryParams(), ¶ms.NamePrefix) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter name_prefix: %s", err)) + } + + // ------------- Optional query parameter "namespace" ------------- + + err = runtime.BindQueryParameter("form", true, false, "namespace", ctx.QueryParams(), ¶ms.Namespace) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter namespace: %s", err)) + } + + // ------------- Optional query parameter "ns" ------------- + + err = runtime.BindQueryParameter("form", true, false, "ns", ctx.QueryParams(), ¶ms.Ns) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter ns: %s", err)) + } + + // ------------- Optional query parameter "partition" ------------- + + err = runtime.BindQueryParameter("form", true, false, "partition", ctx.QueryParams(), ¶ms.Partition) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter partition: %s", err)) + } + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.ListExportedServices(ctx, params) + return err +} + +// DeleteExportedServices converts echo context to params. +func (w *ServerInterfaceWrapper) DeleteExportedServices(ctx echo.Context) error { + var err error + // ------------- Path parameter "name" ------------- + var name Name + + err = runtime.BindStyledParameterWithOptions("simple", "name", ctx.Param("name"), &name, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter name: %s", err)) + } + + ctx.Set(BearerAuthScopes, []string{}) + + ctx.Set(ConsulTokenHeaderScopes, []string{}) + + // Parameter object where we will unmarshal all parameters from the context + var params DeleteExportedServicesParams + // ------------- Optional query parameter "peer" ------------- + + err = runtime.BindQueryParameter("form", true, false, "peer", ctx.QueryParams(), ¶ms.Peer) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter peer: %s", err)) + } + + // ------------- Optional query parameter "namespace" ------------- + + err = runtime.BindQueryParameter("form", true, false, "namespace", ctx.QueryParams(), ¶ms.Namespace) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter namespace: %s", err)) + } + + // ------------- Optional query parameter "ns" ------------- + + err = runtime.BindQueryParameter("form", true, false, "ns", ctx.QueryParams(), ¶ms.Ns) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter ns: %s", err)) + } + + // ------------- Optional query parameter "partition" ------------- + + err = runtime.BindQueryParameter("form", true, false, "partition", ctx.QueryParams(), ¶ms.Partition) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter partition: %s", err)) + } + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.DeleteExportedServices(ctx, name, params) + return err +} + +// ReadExportedServices converts echo context to params. +func (w *ServerInterfaceWrapper) ReadExportedServices(ctx echo.Context) error { + var err error + // ------------- Path parameter "name" ------------- + var name Name + + err = runtime.BindStyledParameterWithOptions("simple", "name", ctx.Param("name"), &name, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter name: %s", err)) + } + + ctx.Set(BearerAuthScopes, []string{}) + + ctx.Set(ConsulTokenHeaderScopes, []string{}) + + // Parameter object where we will unmarshal all parameters from the context + var params ReadExportedServicesParams + // ------------- Optional query parameter "consistent" ------------- + + err = runtime.BindQueryParameter("form", true, false, "consistent", ctx.QueryParams(), ¶ms.Consistent) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter consistent: %s", err)) + } + + // ------------- Optional query parameter "peer" ------------- + + err = runtime.BindQueryParameter("form", true, false, "peer", ctx.QueryParams(), ¶ms.Peer) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter peer: %s", err)) + } + + // ------------- Optional query parameter "namespace" ------------- + + err = runtime.BindQueryParameter("form", true, false, "namespace", ctx.QueryParams(), ¶ms.Namespace) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter namespace: %s", err)) + } + + // ------------- Optional query parameter "ns" ------------- + + err = runtime.BindQueryParameter("form", true, false, "ns", ctx.QueryParams(), ¶ms.Ns) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter ns: %s", err)) + } + + // ------------- Optional query parameter "partition" ------------- + + err = runtime.BindQueryParameter("form", true, false, "partition", ctx.QueryParams(), ¶ms.Partition) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter partition: %s", err)) + } + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.ReadExportedServices(ctx, name, params) + return err +} + +// WriteExportedServices converts echo context to params. +func (w *ServerInterfaceWrapper) WriteExportedServices(ctx echo.Context) error { + var err error + // ------------- Path parameter "name" ------------- + var name Name + + err = runtime.BindStyledParameterWithOptions("simple", "name", ctx.Param("name"), &name, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter name: %s", err)) + } + + ctx.Set(BearerAuthScopes, []string{}) + + ctx.Set(ConsulTokenHeaderScopes, []string{}) + + // Parameter object where we will unmarshal all parameters from the context + var params WriteExportedServicesParams + // ------------- Optional query parameter "peer" ------------- + + err = runtime.BindQueryParameter("form", true, false, "peer", ctx.QueryParams(), ¶ms.Peer) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter peer: %s", err)) + } + + // ------------- Optional query parameter "namespace" ------------- + + err = runtime.BindQueryParameter("form", true, false, "namespace", ctx.QueryParams(), ¶ms.Namespace) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter namespace: %s", err)) + } + + // ------------- Optional query parameter "ns" ------------- + + err = runtime.BindQueryParameter("form", true, false, "ns", ctx.QueryParams(), ¶ms.Ns) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter ns: %s", err)) + } + + // ------------- Optional query parameter "partition" ------------- + + err = runtime.BindQueryParameter("form", true, false, "partition", ctx.QueryParams(), ¶ms.Partition) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter partition: %s", err)) + } + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.WriteExportedServices(ctx, name, params) + return err +} + +// ListNamespaceExportedServices converts echo context to params. +func (w *ServerInterfaceWrapper) ListNamespaceExportedServices(ctx echo.Context) error { + var err error + + ctx.Set(BearerAuthScopes, []string{"write:TrafficPermissions.destination"}) + + ctx.Set(ConsulTokenHeaderScopes, []string{"write:TrafficPermissions.destination"}) + + // Parameter object where we will unmarshal all parameters from the context + var params ListNamespaceExportedServicesParams + // ------------- Optional query parameter "peer" ------------- + + err = runtime.BindQueryParameter("form", true, false, "peer", ctx.QueryParams(), ¶ms.Peer) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter peer: %s", err)) + } + + // ------------- Optional query parameter "consistent" ------------- + + err = runtime.BindQueryParameter("form", true, false, "consistent", ctx.QueryParams(), ¶ms.Consistent) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter consistent: %s", err)) + } + + // ------------- Optional query parameter "name_prefix" ------------- + + err = runtime.BindQueryParameter("form", true, false, "name_prefix", ctx.QueryParams(), ¶ms.NamePrefix) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter name_prefix: %s", err)) + } + + // ------------- Optional query parameter "namespace" ------------- + + err = runtime.BindQueryParameter("form", true, false, "namespace", ctx.QueryParams(), ¶ms.Namespace) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter namespace: %s", err)) + } + + // ------------- Optional query parameter "ns" ------------- + + err = runtime.BindQueryParameter("form", true, false, "ns", ctx.QueryParams(), ¶ms.Ns) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter ns: %s", err)) + } + + // ------------- Optional query parameter "partition" ------------- + + err = runtime.BindQueryParameter("form", true, false, "partition", ctx.QueryParams(), ¶ms.Partition) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter partition: %s", err)) + } + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.ListNamespaceExportedServices(ctx, params) + return err +} + +// DeleteNamespaceExportedServices converts echo context to params. +func (w *ServerInterfaceWrapper) DeleteNamespaceExportedServices(ctx echo.Context) error { + var err error + // ------------- Path parameter "name" ------------- + var name Name + + err = runtime.BindStyledParameterWithOptions("simple", "name", ctx.Param("name"), &name, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter name: %s", err)) + } + + ctx.Set(BearerAuthScopes, []string{}) + + ctx.Set(ConsulTokenHeaderScopes, []string{}) + + // Parameter object where we will unmarshal all parameters from the context + var params DeleteNamespaceExportedServicesParams + // ------------- Optional query parameter "peer" ------------- + + err = runtime.BindQueryParameter("form", true, false, "peer", ctx.QueryParams(), ¶ms.Peer) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter peer: %s", err)) + } + + // ------------- Optional query parameter "namespace" ------------- + + err = runtime.BindQueryParameter("form", true, false, "namespace", ctx.QueryParams(), ¶ms.Namespace) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter namespace: %s", err)) + } + + // ------------- Optional query parameter "ns" ------------- + + err = runtime.BindQueryParameter("form", true, false, "ns", ctx.QueryParams(), ¶ms.Ns) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter ns: %s", err)) + } + + // ------------- Optional query parameter "partition" ------------- + + err = runtime.BindQueryParameter("form", true, false, "partition", ctx.QueryParams(), ¶ms.Partition) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter partition: %s", err)) + } + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.DeleteNamespaceExportedServices(ctx, name, params) + return err +} + +// ReadNamespaceExportedServices converts echo context to params. +func (w *ServerInterfaceWrapper) ReadNamespaceExportedServices(ctx echo.Context) error { + var err error + // ------------- Path parameter "name" ------------- + var name Name + + err = runtime.BindStyledParameterWithOptions("simple", "name", ctx.Param("name"), &name, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter name: %s", err)) + } + + ctx.Set(BearerAuthScopes, []string{}) + + ctx.Set(ConsulTokenHeaderScopes, []string{}) + + // Parameter object where we will unmarshal all parameters from the context + var params ReadNamespaceExportedServicesParams + // ------------- Optional query parameter "consistent" ------------- + + err = runtime.BindQueryParameter("form", true, false, "consistent", ctx.QueryParams(), ¶ms.Consistent) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter consistent: %s", err)) + } + + // ------------- Optional query parameter "peer" ------------- + + err = runtime.BindQueryParameter("form", true, false, "peer", ctx.QueryParams(), ¶ms.Peer) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter peer: %s", err)) + } + + // ------------- Optional query parameter "namespace" ------------- + + err = runtime.BindQueryParameter("form", true, false, "namespace", ctx.QueryParams(), ¶ms.Namespace) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter namespace: %s", err)) + } + + // ------------- Optional query parameter "ns" ------------- + + err = runtime.BindQueryParameter("form", true, false, "ns", ctx.QueryParams(), ¶ms.Ns) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter ns: %s", err)) + } + + // ------------- Optional query parameter "partition" ------------- + + err = runtime.BindQueryParameter("form", true, false, "partition", ctx.QueryParams(), ¶ms.Partition) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter partition: %s", err)) + } + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.ReadNamespaceExportedServices(ctx, name, params) + return err +} + +// WriteNamespaceExportedServices converts echo context to params. +func (w *ServerInterfaceWrapper) WriteNamespaceExportedServices(ctx echo.Context) error { + var err error + // ------------- Path parameter "name" ------------- + var name Name + + err = runtime.BindStyledParameterWithOptions("simple", "name", ctx.Param("name"), &name, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter name: %s", err)) + } + + ctx.Set(BearerAuthScopes, []string{}) + + ctx.Set(ConsulTokenHeaderScopes, []string{}) + + // Parameter object where we will unmarshal all parameters from the context + var params WriteNamespaceExportedServicesParams + // ------------- Optional query parameter "peer" ------------- + + err = runtime.BindQueryParameter("form", true, false, "peer", ctx.QueryParams(), ¶ms.Peer) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter peer: %s", err)) + } + + // ------------- Optional query parameter "namespace" ------------- + + err = runtime.BindQueryParameter("form", true, false, "namespace", ctx.QueryParams(), ¶ms.Namespace) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter namespace: %s", err)) + } + + // ------------- Optional query parameter "ns" ------------- + + err = runtime.BindQueryParameter("form", true, false, "ns", ctx.QueryParams(), ¶ms.Ns) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter ns: %s", err)) + } + + // ------------- Optional query parameter "partition" ------------- + + err = runtime.BindQueryParameter("form", true, false, "partition", ctx.QueryParams(), ¶ms.Partition) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter partition: %s", err)) + } + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.WriteNamespaceExportedServices(ctx, name, params) + return err +} + +// ListPartitionExportedServices converts echo context to params. +func (w *ServerInterfaceWrapper) ListPartitionExportedServices(ctx echo.Context) error { + var err error + + ctx.Set(BearerAuthScopes, []string{"write:TrafficPermissions.destination"}) + + ctx.Set(ConsulTokenHeaderScopes, []string{"write:TrafficPermissions.destination"}) + + // Parameter object where we will unmarshal all parameters from the context + var params ListPartitionExportedServicesParams + // ------------- Optional query parameter "peer" ------------- + + err = runtime.BindQueryParameter("form", true, false, "peer", ctx.QueryParams(), ¶ms.Peer) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter peer: %s", err)) + } + + // ------------- Optional query parameter "consistent" ------------- + + err = runtime.BindQueryParameter("form", true, false, "consistent", ctx.QueryParams(), ¶ms.Consistent) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter consistent: %s", err)) + } + + // ------------- Optional query parameter "name_prefix" ------------- + + err = runtime.BindQueryParameter("form", true, false, "name_prefix", ctx.QueryParams(), ¶ms.NamePrefix) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter name_prefix: %s", err)) + } + + // ------------- Optional query parameter "partition" ------------- + + err = runtime.BindQueryParameter("form", true, false, "partition", ctx.QueryParams(), ¶ms.Partition) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter partition: %s", err)) + } + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.ListPartitionExportedServices(ctx, params) + return err +} + +// DeletePartitionExportedServices converts echo context to params. +func (w *ServerInterfaceWrapper) DeletePartitionExportedServices(ctx echo.Context) error { + var err error + // ------------- Path parameter "name" ------------- + var name Name + + err = runtime.BindStyledParameterWithOptions("simple", "name", ctx.Param("name"), &name, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter name: %s", err)) + } + + ctx.Set(BearerAuthScopes, []string{}) + + ctx.Set(ConsulTokenHeaderScopes, []string{}) + + // Parameter object where we will unmarshal all parameters from the context + var params DeletePartitionExportedServicesParams + // ------------- Optional query parameter "peer" ------------- + + err = runtime.BindQueryParameter("form", true, false, "peer", ctx.QueryParams(), ¶ms.Peer) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter peer: %s", err)) + } + + // ------------- Optional query parameter "partition" ------------- + + err = runtime.BindQueryParameter("form", true, false, "partition", ctx.QueryParams(), ¶ms.Partition) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter partition: %s", err)) + } + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.DeletePartitionExportedServices(ctx, name, params) + return err +} + +// ReadPartitionExportedServices converts echo context to params. +func (w *ServerInterfaceWrapper) ReadPartitionExportedServices(ctx echo.Context) error { + var err error + // ------------- Path parameter "name" ------------- + var name Name + + err = runtime.BindStyledParameterWithOptions("simple", "name", ctx.Param("name"), &name, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter name: %s", err)) + } + + ctx.Set(BearerAuthScopes, []string{}) + + ctx.Set(ConsulTokenHeaderScopes, []string{}) + + // Parameter object where we will unmarshal all parameters from the context + var params ReadPartitionExportedServicesParams + // ------------- Optional query parameter "consistent" ------------- + + err = runtime.BindQueryParameter("form", true, false, "consistent", ctx.QueryParams(), ¶ms.Consistent) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter consistent: %s", err)) + } + + // ------------- Optional query parameter "peer" ------------- + + err = runtime.BindQueryParameter("form", true, false, "peer", ctx.QueryParams(), ¶ms.Peer) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter peer: %s", err)) + } + + // ------------- Optional query parameter "partition" ------------- + + err = runtime.BindQueryParameter("form", true, false, "partition", ctx.QueryParams(), ¶ms.Partition) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter partition: %s", err)) + } + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.ReadPartitionExportedServices(ctx, name, params) + return err +} + +// WritePartitionExportedServices converts echo context to params. +func (w *ServerInterfaceWrapper) WritePartitionExportedServices(ctx echo.Context) error { + var err error + // ------------- Path parameter "name" ------------- + var name Name + + err = runtime.BindStyledParameterWithOptions("simple", "name", ctx.Param("name"), &name, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter name: %s", err)) + } + + ctx.Set(BearerAuthScopes, []string{}) + + ctx.Set(ConsulTokenHeaderScopes, []string{}) + + // Parameter object where we will unmarshal all parameters from the context + var params WritePartitionExportedServicesParams + // ------------- Optional query parameter "peer" ------------- + + err = runtime.BindQueryParameter("form", true, false, "peer", ctx.QueryParams(), ¶ms.Peer) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter peer: %s", err)) + } + + // ------------- Optional query parameter "partition" ------------- + + err = runtime.BindQueryParameter("form", true, false, "partition", ctx.QueryParams(), ¶ms.Partition) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter partition: %s", err)) + } + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.WritePartitionExportedServices(ctx, name, params) + return err +} + +// This is a simple interface which specifies echo.Route addition functions which +// are present on both echo.Echo and echo.Group, since we want to allow using +// either of them for path registration +type EchoRouter interface { + CONNECT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route + DELETE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route + GET(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route + HEAD(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route + OPTIONS(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route + PATCH(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route + POST(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route + PUT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route + TRACE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route +} + +// RegisterHandlers adds each server route to the EchoRouter. +func RegisterHandlers(router EchoRouter, si ServerInterface) { + RegisterHandlersWithBaseURL(router, si, "") +} + +// Registers handlers, and prepends BaseURL to the paths, so that the paths +// can be served under a prefix. +func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL string) { + + wrapper := ServerInterfaceWrapper{ + Handler: si, + } + + router.GET(baseURL+"/multicluster/v2/ComputedExportedServices", wrapper.ListComputedExportedServices) + router.DELETE(baseURL+"/multicluster/v2/ComputedExportedServices/:name", wrapper.DeleteComputedExportedServices) + router.GET(baseURL+"/multicluster/v2/ComputedExportedServices/:name", wrapper.ReadComputedExportedServices) + router.PUT(baseURL+"/multicluster/v2/ComputedExportedServices/:name", wrapper.WriteComputedExportedServices) + router.GET(baseURL+"/multicluster/v2/ExportedServices", wrapper.ListExportedServices) + router.DELETE(baseURL+"/multicluster/v2/ExportedServices/:name", wrapper.DeleteExportedServices) + router.GET(baseURL+"/multicluster/v2/ExportedServices/:name", wrapper.ReadExportedServices) + router.PUT(baseURL+"/multicluster/v2/ExportedServices/:name", wrapper.WriteExportedServices) + router.GET(baseURL+"/multicluster/v2/NamespaceExportedServices", wrapper.ListNamespaceExportedServices) + router.DELETE(baseURL+"/multicluster/v2/NamespaceExportedServices/:name", wrapper.DeleteNamespaceExportedServices) + router.GET(baseURL+"/multicluster/v2/NamespaceExportedServices/:name", wrapper.ReadNamespaceExportedServices) + router.PUT(baseURL+"/multicluster/v2/NamespaceExportedServices/:name", wrapper.WriteNamespaceExportedServices) + router.GET(baseURL+"/multicluster/v2/PartitionExportedServices", wrapper.ListPartitionExportedServices) + router.DELETE(baseURL+"/multicluster/v2/PartitionExportedServices/:name", wrapper.DeletePartitionExportedServices) + router.GET(baseURL+"/multicluster/v2/PartitionExportedServices/:name", wrapper.ReadPartitionExportedServices) + router.PUT(baseURL+"/multicluster/v2/PartitionExportedServices/:name", wrapper.WritePartitionExportedServices) + +} + +// Base64 encoded, gzipped, json marshaled Swagger object +var swaggerSpec = []string{ + + "H4sIAAAAAAAC/+ydb2/bONLAvwqh5wHaHmyr6AIHXN5l21436F43aNLtLeogS4tjixuKVEnKXm2R734Y", + "Uv8cS47jpFenx1e7jiRyOBzO/GY4QL9EicpyJUFaEx19iXKqaQYWtPuVKGm4sSAt/mJgEs1zy5WMjqKP", + "KUhidQEjYlMgKgdN8RFZcSHIDEgOeq50BoysuE2JsVrJBWmGTMpoFHEc6XMBGn9ImkF01J10FJkkhYzi", + "7LbM8elMKQFURtfX9Qc3BTtPgeATouZOMg1GFToBYlUlJRAlJ/XsObVpO7n7zyjS8LngGlh05Fa4KYax", + "mstFI8VlrmHO/+wXphHASeXfJIUBhhLNubCga0ELYYngxk4GdNOd63apTE6THgWd5ZDwOQfjZn2ppCkE", + "ad5HtdUSmxs6I+cpN6SxEWLpFRhcUQIMJH67rNbyuzS/Eyo4NduW4gW8ZSFmcwVudG4IlX4OMlf1tPWo", + "vxM3nxcWBV9/OLyGQXnNLYLmVFvuBdxJ48372zQ+IEw71y0yAehdxQHQKAnPcqUtsDuLhFNtk+a6fug2", + "NKUm5YnS+SRx80+yQlieiMJY0JPli8lLleWFBfb6Ty/PGegl9+acaxTHcmicVJFVHotbyNz//L+GeXQU", + "/V/c+re4mj7ed27zspoquh7Vy6Na09L9pnoB9tJNe8fpa01P3sMcNBqh27xqBjX7AxKLU+wt97dU2qau", + "HnRpzZZsLHHtPN4wxvZkbJ6Zu8v2TdR9F9s0HcGa2TdU8gC79JV3ZxQZmoEEYy4XWhX5Q23guzowHPhO", + "7rW401rT38PiGlf5Ukk2EG1J84xoyDUYlJhQwrhJNIAlaoYHwtMqnanCEtpCGsevhH9o1VS6GJkUWoO0", + "xFgXBD1YmtJYyCZTSU4s0kgKdMlFSbg0OcIjmZXkbTEDLcGCeUI+JbVc5uJpam1ujuJ4xu1ElPEPP/3j", + "t7+fvH02lYRK5oZ/Qy2saEmOT0/IJ9SMcY80UNM7gnxxespPn02mCAXr+5qBMXTRg4JxTP7lnyGYW8ol", + "KiotMirHc81BMlGSzifN0i21hfFTbZxRL2HvZO/dI5JrteQMDMmUBpLRJOUSxhooozMBhIGlXJhqb5z+", + "mx19CpPFZCrjmEyjE7mkgrNTraxKlJhGzwYl8pv7IJF5FDkr2H+sxjwnZ26gxvB7FHZe5kA4A2lbYMOX", + "cSNuKKVVyDQakWn0HowSS2DvYW6GVLPnmasE3zx57u/dU1cbS3NoOkLzCUxcBhnPqTAQF/JKqpWsJAVZ", + "ZNHRp+js/Pj89eWHd2/f/fLxXTSqfp+///C6+fHP45/PXkcXPRs/vJaTVz3in7wiheSfC8BT3Cq99Q59", + "h6s/C41jglEF/QIuuzCgxwu+BNmfm/odxD9NoxkXgsvFNCJV3B4yawuSYh69tyWeVwN0LHDPgfDr61FU", + "cNarig+cNZpwCiZcWtCSilbPmqyALOjSJepd5bjj7o6897O55hnV6GnrJNqCEO4TxufVOSUzsCuAdfdd", + "j+gGQ2eaa1hyVRjCQMB60uOKFs58cb9u7F8r0kslEw0WRDmqV0nJpw8/n7xqPfSC27SYTRKVxYXgLDY5", + "JM/c/KUqSEIlsRqodeNxPDQ8A2NplpNmEwg1azp5YkiC37goxTN4gNPdurjNg9E86x6LVcqTtDVh2jnb", + "LoK6zHFEVilIwt3OSWXrgIqOv4251oCYH9bhMpD040UckzP/bFMZSLWbdac1t9eq5pGc6rtZ0Zkjg4HQ", + "UBjcMndqZ6UjDq2EAO1KDInKskLyBINFpxym5oRaC1luuVx4ItOQKJlwAe4M0TwXZZfg/HabQs9pAsRA", + "RqXlCXGh0Z8Y0Fppg7DlTjnaj4crZVPQXcH6bLLFuF7jaKKk6TKVAbeUPgbtgk4HQ5076KDobSBarduf", + "tHrVVIjSr7yy8/2ovge7e9JMvyZglwuQVTW4V0O/VO+9aV7bPEntEM4CuqcJl+eMqdWQCwMTjA/oTWfQ", + "RAYGFnTGJaAbcpvb1eLaJD4otBOl1JAZRpDG3NjAiS1yhiJcUtsf/PzjY1v7K3TYhNpqpS1PkxU1RFBj", + "yUpza0H6+eZKZzh0hMOM8eP7uvrz1sXcOKXVk4r5ZzVxVn8tJIYnLjuSN+rSYBDph5z4QC268uS+8jwv", + "tNsibpT3kevRmEtC26qpTwLqEMtgCQLnnHRXncV+5TFTiYkBkSPX3EDcSGSaQO7uMwrjnEwK5GdurHMJ", + "H6lNUvcLJMsVl9aM6gTGvbnigiVUMzxmBYaYv00jN6JVrpbfWQVNtDKGUNGptw9lUVvKyXFMmqS+sSmV", + "ZwpFZhmX3Fg06yWQmSoko7psFVjn5vdRn5tk3Ej4zZTYSjCkRAB9OcgQpwDac8RGHIf2Tqbyx6atjM+1", + "yu6uv0RJCYmNqw0Y4xxIIt9Kd9CEt/v5kt7U1SeurRehXXLF0Z2znish1Mob8Jtf35Knb7QqcvIraIOm", + "/ZZLhkH6U44EoGWn5qHU1eSqmMGs4IKBnnAVJ1rJP9RsbAurNKciXiyvzCS1mXhGEKdngpsU2FSu12X6", + "HFZTXNwwGS/gunekGigGqXkhHRZSwW2Jyq+9JDed8FXm0IlbpsndE2qpUAufu9PCpkrzv1xsGq5rODkv", + "l15dw/LW+kQbxmwlw6PMPJibFUCONqc0mdHkakU1G3OJUEAtnwkgSUrlwjtKXCrJKGtSNCfAkxvLGzqM", + "V1z2Z4e4zzeLHMbfUSXrQ9durJl7RwP2PF9obsszZBy/zT8C1aCPC5viLwc/7orZ/bkdFo0O5fcXZefq", + "CuRPQJmvULursNT/bO7C/j32747dy+1INOdvofR3YVzO1aY2qsu449MTf6np0mSaOPZtMtJujbXVD6rX", + "IFZU9kCWL3BmbgW0A3c/jUZRYzrR8oUjuBwkzXl0FP0weT55jgeD2tQpK+5+Gi9fxNsumxbgUKhpCjhh", + "0VGEPmzwo9Fa68Gnfj5tX4ndDcH16Nb3Ot0EO7zdvV/f4fU2Rl9fuCpjrqTxGnjx/HmVK9TtE5inYHbD", + "lYz/qAqk7W1pw+XrnohRS7/adaZzIdtRvYvom94DljfC5BOf8yBb+/KeVBaze+c8POQ+w4EyxfCoswn5", + "ra6ApFxeuftnV+uYQR0HpxGmZ7VRT6P+0su6nHerwLjBmirMHSowfhXJLVWYUeSLYvslXCevcIQMLK1N", + "gTKfgVFxumYqG9P2lPr9KG1eegVl7Kkhp1wbl2rpGbcakbGetCc9rSvwrmzGlTyv9TWNnFan0ZxjHPwL", + "tJlGOI1xsUODz/xa3yapwGRtTXMtdqiV9G72PsozTUliSHX7jV6VOvo0/XDFDkcKm+WOnvrWTgWPOL69", + "5EFe0yStU1I89XVkdguhdQX3CsqmjmpSVQhGlBQlcU4BU3Cf9uI3SkJnhvYEV2rCs+c+7Xy15NQt8qPm", + "Fqr3av6dkOOukgjzejJq/avmfd+SVqkYkyBJqpuSY70o0J95BZFEsSFL3AZZHb7CyYVajQUmBE0k7tS4", + "a3vwWb/SdAGOu0AyX/+V5OXxGXmKPptqGB9LNj5b0fxZ22FnHDu7NXk28yR3I11xo9V+1q+6JCtajtCL", + "i4Kh7qo99jo3k/VUJKGuUtqjzzr9wKeUSCXHM0HlVbNcJ1rV/ldVVQbWtMJxRxUob+7S8cwnXO3ueB35", + "spev+NaTMgVGPrEkw3SJrFLq62BW6YG6TV+ac+NGeuNon+P2cuNxjBpiiiQBY+aFaK5tZ4qVrYP1+YGm", + "ZdXkVQhrJms86mCnS6KfIqeVo3NN53OenILOuDFu3xng1D5aX/QC6a4fI6+YIsuoLisyI7tSQ5tOunXs", + "zIXxF6Sra3+CBPj7w3VCfOX+voUR+xBrc4f88LtvkN+XalsapXhh9lLLqB+A3wNlDwbAXbC9L3wG5gzM", + "GZgzMGdgzsCcgTn/q8zZz5gaKLsvvyBt7EkvX6cU54qjd66q5UUPSTnb2MqJnwsw9kfFygBCAYQCCAUQ", + "CiAUQCiA0GMDoTvzC5pka8mTqvs/lEYCEQQiCEQQiCAQQSCCR00ETsb71ka8Ah/qxutOHVDfR+dT29K9", + "y8vmO2qmCtQWqC1QW6C2QG2B2gK1hSaq7U1U90XJnZumDrNZas8mqe+9OSowZGDIwJCBIQNDBoYMDPnN", + "m6IOuRnqqxfahvurDruvKjBUYKjAUIGhAkMFhgoMtW8/1WPuowoEEAggEEAggEAAgQACARxA/9RdL7u2", + "/rMLgw1Uw1+FTqpH1Uk1vJEB5ALIBZALIBdALoBcALnQUrUbNuyNmzs3WW1DzwPottpJM1varh6OrA+8", + "/yqQZyDPQJ6BPAN5BvIM5Hk4jVg7Asz/bEfWdv48mNasgFcBrwJeBbwKeBXwKuDVvXu0bqeiR9CsFZgg", + "MEFggsAEgQkCEwQmOKSurb3v05p/g/ZO7VvDX4V/AvDr9VoNaz3gV8CvgF8BvwJ+BfwK+BV6rXbDhr3Z", + "cOdeq22ceAC9VjtpZkuv1cNh8IH3WgXyDOQZyDOQZyDPQJ6BPA+n12pHgHkc/xTgdlg8mMaowEKBhQIL", + "BRYKLBRYKLDQvRujbkeYR9AYFZggMEFggsAEgQkCEwQmOKTGqN0uv7Ze411cj770XtFdXF9c/ycAAP//", + "tT6UkHy1AAA=", +} + +// GetSwagger returns the content of the embedded swagger specification file +// or error if failed to decode +func decodeSpec() ([]byte, error) { + zipped, err := base64.StdEncoding.DecodeString(strings.Join(swaggerSpec, "")) + if err != nil { + return nil, fmt.Errorf("error base64 decoding spec: %w", err) + } + zr, err := gzip.NewReader(bytes.NewReader(zipped)) + if err != nil { + return nil, fmt.Errorf("error decompressing spec: %w", err) + } + var buf bytes.Buffer + _, err = buf.ReadFrom(zr) + if err != nil { + return nil, fmt.Errorf("error decompressing spec: %w", err) + } + + return buf.Bytes(), nil +} + +var rawSpec = decodeSpecCached() + +// a naive cached of a decoded swagger spec +func decodeSpecCached() func() ([]byte, error) { + data, err := decodeSpec() + return func() ([]byte, error) { + return data, err + } +} + +// Constructs a synthetic filesystem for resolving external references when loading openapi specifications. +func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error) { + res := make(map[string]func() ([]byte, error)) + if len(pathToFile) > 0 { + res[pathToFile] = rawSpec + } + + return res +} + +// GetSwagger returns the Swagger specification corresponding to the generated code +// in this file. The external references of Swagger specification are resolved. +// The logic of resolving external references is tightly connected to "import-mapping" feature. +// Externally referenced files must be embedded in the corresponding golang packages. +// Urls can be supported but this task was out of the scope. +func GetSwagger() (swagger *openapi3.T, err error) { + resolvePath := PathToRawSpec("") + + loader := openapi3.NewLoader() + loader.IsExternalRefsAllowed = true + loader.ReadFromURIFunc = func(loader *openapi3.Loader, url *url.URL) ([]byte, error) { + pathToFile := url.String() + pathToFile = path.Clean(pathToFile) + getSpec, ok := resolvePath[pathToFile] + if !ok { + err1 := fmt.Errorf("path not found: %s", pathToFile) + return nil, err1 + } + return getSpec() + } + var specData []byte + specData, err = rawSpec() + if err != nil { + return + } + swagger, err = loader.LoadFromData(specData) + if err != nil { + return + } + return +} diff --git a/consul/tools/openapi/multicluster-v2.openapi.yml b/consul/tools/openapi/multicluster-v2.openapi.yml new file mode 100644 index 00000000..210a31dd --- /dev/null +++ b/consul/tools/openapi/multicluster-v2.openapi.yml @@ -0,0 +1,1340 @@ +openapi: 3.0.0 +info: + title: Consul multicluster + description: Consul APIs for interacting with the multicluster resource kinds at version v2 + version: v2 +paths: + api/multicluster/v2/ComputedExportedServices: + get: + summary: List multicluster.v2.ComputedExportedServices resources + operationId: list-ComputedExportedServices + parameters: + - $ref: '#/components/parameters/peer' + - $ref: '#/components/parameters/consistent' + - $ref: '#/components/parameters/name_prefix' + - $ref: '#/components/parameters/partition' + responses: + "200": + description: The listing was successful and the body contains the array of results. + content: + application/json: + schema: + type: array + items: + type: object + properties: + data: + $ref: '#/components/schemas/hashicorp.consul.multicluster.v2.ComputedExportedServices' + generation: + type: string + description: | + // Generation is incremented whenever the resource's content (i.e. not its + // status) is modified. You can think of it as being the "user version". + // + // Concretely, Generation is a [ULID](https://github.com/ulid/spec) and you + // can treat its timestamp component as the resource's modification time. + id: + $ref: '#/components/schemas/hashicorp.consul.resource.ID' + description: | + // ID uniquely identifies the resource. + metadata: + type: object + additionalProperties: + type: string + description: | + // Metadata contains key/value pairs of arbitrary metadata about the resource. + // "deletionTimestamp" and "finalizers" keys are reserved for internal use. + owner: + $ref: '#/components/schemas/hashicorp.consul.resource.ID' + description: | + // Owner (optionally) describes which resource "owns" this resource, it is + // immutable and can only be set on resource creation. Owned resources will + // be automatically deleted when their owner is deleted. + status: + type: object + additionalProperties: + $ref: '#/components/schemas/hashicorp.consul.resource.Status' + description: | + // Status is used by controllers to communicate the result of attempting to + // reconcile and apply the resource (e.g. surface semantic validation errors) + // with users and other controllers. Each status is identified by a unique key + // and should only ever be updated by one controller. + // + // Status can only be updated via the WriteStatus endpoint. Attempting to do + // so via the Write endpoint will result in an InvalidArgument error code. + version: + type: string + description: | + // Version is the low-level version identifier used by the storage backend + // in CAS (Compare-And-Swap) operations. It will change when the resource is + // modified in any way, including status updates. + // + // When calling the Write endpoint, providing a non-blank version will perform + // a CAS (Compare-And-Swap) write, which will result in an Aborted error code + // if the given version doesn't match what is stored. + security: + - BearerAuth: + - write:TrafficPermissions.destination + ConsulTokenHeader: + - write:TrafficPermissions.destination + api/multicluster/v2/ComputedExportedServices/{name}: + get: + summary: Read multicluster.v2.ComputedExportedServices resources + operationId: read-ComputedExportedServices. + parameters: + - $ref: '#/components/parameters/consistent' + responses: + "200": + description: The read was successful and the body contains the result. + content: + application/json: + schema: + type: object + properties: + data: + $ref: '#/components/schemas/hashicorp.consul.multicluster.v2.ComputedExportedServices' + generation: + type: string + description: | + // Generation is incremented whenever the resource's content (i.e. not its + // status) is modified. You can think of it as being the "user version". + // + // Concretely, Generation is a [ULID](https://github.com/ulid/spec) and you + // can treat its timestamp component as the resource's modification time. + id: + $ref: '#/components/schemas/hashicorp.consul.resource.ID' + description: | + // ID uniquely identifies the resource. + metadata: + type: object + additionalProperties: + type: string + description: | + // Metadata contains key/value pairs of arbitrary metadata about the resource. + // "deletionTimestamp" and "finalizers" keys are reserved for internal use. + owner: + $ref: '#/components/schemas/hashicorp.consul.resource.ID' + description: | + // Owner (optionally) describes which resource "owns" this resource, it is + // immutable and can only be set on resource creation. Owned resources will + // be automatically deleted when their owner is deleted. + status: + type: object + additionalProperties: + $ref: '#/components/schemas/hashicorp.consul.resource.Status' + description: | + // Status is used by controllers to communicate the result of attempting to + // reconcile and apply the resource (e.g. surface semantic validation errors) + // with users and other controllers. Each status is identified by a unique key + // and should only ever be updated by one controller. + // + // Status can only be updated via the WriteStatus endpoint. Attempting to do + // so via the Write endpoint will result in an InvalidArgument error code. + version: + type: string + description: | + // Version is the low-level version identifier used by the storage backend + // in CAS (Compare-And-Swap) operations. It will change when the resource is + // modified in any way, including status updates. + // + // When calling the Write endpoint, providing a non-blank version will perform + // a CAS (Compare-And-Swap) write, which will result in an Aborted error code + // if the given version doesn't match what is stored. + put: + summary: Write multicluster.v2.ComputedExportedServices resources + operationId: write-ComputedExportedServices + requestBody: + description: The multicluster.v2.ComputedExportedServices resource to be updated. + content: + application/json: + schema: + type: object + properties: + data: + $ref: '#/components/schemas/hashicorp.consul.multicluster.v2.ComputedExportedServices' + generation: + type: string + description: | + // Generation is incremented whenever the resource's content (i.e. not its + // status) is modified. You can think of it as being the "user version". + // + // Concretely, Generation is a [ULID](https://github.com/ulid/spec) and you + // can treat its timestamp component as the resource's modification time. + id: + $ref: '#/components/schemas/hashicorp.consul.resource.ID' + description: | + // ID uniquely identifies the resource. + metadata: + type: object + additionalProperties: + type: string + description: | + // Metadata contains key/value pairs of arbitrary metadata about the resource. + // "deletionTimestamp" and "finalizers" keys are reserved for internal use. + owner: + $ref: '#/components/schemas/hashicorp.consul.resource.ID' + description: | + // Owner (optionally) describes which resource "owns" this resource, it is + // immutable and can only be set on resource creation. Owned resources will + // be automatically deleted when their owner is deleted. + status: + type: object + additionalProperties: + $ref: '#/components/schemas/hashicorp.consul.resource.Status' + description: | + // Status is used by controllers to communicate the result of attempting to + // reconcile and apply the resource (e.g. surface semantic validation errors) + // with users and other controllers. Each status is identified by a unique key + // and should only ever be updated by one controller. + // + // Status can only be updated via the WriteStatus endpoint. Attempting to do + // so via the Write endpoint will result in an InvalidArgument error code. + version: + type: string + description: | + // Version is the low-level version identifier used by the storage backend + // in CAS (Compare-And-Swap) operations. It will change when the resource is + // modified in any way, including status updates. + // + // When calling the Write endpoint, providing a non-blank version will perform + // a CAS (Compare-And-Swap) write, which will result in an Aborted error code + // if the given version doesn't match what is stored. + responses: + "200": + description: The write was successful and the body contains the result. + content: + application/json: + schema: + type: object + properties: + data: + $ref: '#/components/schemas/hashicorp.consul.multicluster.v2.ComputedExportedServices' + generation: + type: string + description: | + // Generation is incremented whenever the resource's content (i.e. not its + // status) is modified. You can think of it as being the "user version". + // + // Concretely, Generation is a [ULID](https://github.com/ulid/spec) and you + // can treat its timestamp component as the resource's modification time. + id: + $ref: '#/components/schemas/hashicorp.consul.resource.ID' + description: | + // ID uniquely identifies the resource. + metadata: + type: object + additionalProperties: + type: string + description: | + // Metadata contains key/value pairs of arbitrary metadata about the resource. + // "deletionTimestamp" and "finalizers" keys are reserved for internal use. + owner: + $ref: '#/components/schemas/hashicorp.consul.resource.ID' + description: | + // Owner (optionally) describes which resource "owns" this resource, it is + // immutable and can only be set on resource creation. Owned resources will + // be automatically deleted when their owner is deleted. + status: + type: object + additionalProperties: + $ref: '#/components/schemas/hashicorp.consul.resource.Status' + description: | + // Status is used by controllers to communicate the result of attempting to + // reconcile and apply the resource (e.g. surface semantic validation errors) + // with users and other controllers. Each status is identified by a unique key + // and should only ever be updated by one controller. + // + // Status can only be updated via the WriteStatus endpoint. Attempting to do + // so via the Write endpoint will result in an InvalidArgument error code. + version: + type: string + description: | + // Version is the low-level version identifier used by the storage backend + // in CAS (Compare-And-Swap) operations. It will change when the resource is + // modified in any way, including status updates. + // + // When calling the Write endpoint, providing a non-blank version will perform + // a CAS (Compare-And-Swap) write, which will result in an Aborted error code + // if the given version doesn't match what is stored. + delete: + summary: Delete multicluster.v2.ComputedExportedServices resources + operationId: delete-ComputedExportedServices + responses: + "200": + description: The delete was successful and the body contains the result. + parameters: + - $ref: '#/components/parameters/peer' + - $ref: '#/components/parameters/name' + - $ref: '#/components/parameters/partition' + api/multicluster/v2/ExportedServices: + get: + summary: List multicluster.v2.ExportedServices resources + operationId: list-ExportedServices + parameters: + - $ref: '#/components/parameters/peer' + - $ref: '#/components/parameters/consistent' + - $ref: '#/components/parameters/name_prefix' + - $ref: '#/components/parameters/namespace' + - $ref: '#/components/parameters/ns' + - $ref: '#/components/parameters/partition' + responses: + "200": + description: The listing was successful and the body contains the array of results. + content: + application/json: + schema: + type: array + items: + type: object + properties: + data: + $ref: '#/components/schemas/hashicorp.consul.multicluster.v2.ExportedServices' + generation: + type: string + description: | + // Generation is incremented whenever the resource's content (i.e. not its + // status) is modified. You can think of it as being the "user version". + // + // Concretely, Generation is a [ULID](https://github.com/ulid/spec) and you + // can treat its timestamp component as the resource's modification time. + id: + $ref: '#/components/schemas/hashicorp.consul.resource.ID' + description: | + // ID uniquely identifies the resource. + metadata: + type: object + additionalProperties: + type: string + description: | + // Metadata contains key/value pairs of arbitrary metadata about the resource. + // "deletionTimestamp" and "finalizers" keys are reserved for internal use. + owner: + $ref: '#/components/schemas/hashicorp.consul.resource.ID' + description: | + // Owner (optionally) describes which resource "owns" this resource, it is + // immutable and can only be set on resource creation. Owned resources will + // be automatically deleted when their owner is deleted. + status: + type: object + additionalProperties: + $ref: '#/components/schemas/hashicorp.consul.resource.Status' + description: | + // Status is used by controllers to communicate the result of attempting to + // reconcile and apply the resource (e.g. surface semantic validation errors) + // with users and other controllers. Each status is identified by a unique key + // and should only ever be updated by one controller. + // + // Status can only be updated via the WriteStatus endpoint. Attempting to do + // so via the Write endpoint will result in an InvalidArgument error code. + version: + type: string + description: | + // Version is the low-level version identifier used by the storage backend + // in CAS (Compare-And-Swap) operations. It will change when the resource is + // modified in any way, including status updates. + // + // When calling the Write endpoint, providing a non-blank version will perform + // a CAS (Compare-And-Swap) write, which will result in an Aborted error code + // if the given version doesn't match what is stored. + security: + - BearerAuth: + - write:TrafficPermissions.destination + ConsulTokenHeader: + - write:TrafficPermissions.destination + api/multicluster/v2/ExportedServices/{name}: + get: + summary: Read multicluster.v2.ExportedServices resources + operationId: read-ExportedServices. + parameters: + - $ref: '#/components/parameters/consistent' + responses: + "200": + description: The read was successful and the body contains the result. + content: + application/json: + schema: + type: object + properties: + data: + $ref: '#/components/schemas/hashicorp.consul.multicluster.v2.ExportedServices' + generation: + type: string + description: | + // Generation is incremented whenever the resource's content (i.e. not its + // status) is modified. You can think of it as being the "user version". + // + // Concretely, Generation is a [ULID](https://github.com/ulid/spec) and you + // can treat its timestamp component as the resource's modification time. + id: + $ref: '#/components/schemas/hashicorp.consul.resource.ID' + description: | + // ID uniquely identifies the resource. + metadata: + type: object + additionalProperties: + type: string + description: | + // Metadata contains key/value pairs of arbitrary metadata about the resource. + // "deletionTimestamp" and "finalizers" keys are reserved for internal use. + owner: + $ref: '#/components/schemas/hashicorp.consul.resource.ID' + description: | + // Owner (optionally) describes which resource "owns" this resource, it is + // immutable and can only be set on resource creation. Owned resources will + // be automatically deleted when their owner is deleted. + status: + type: object + additionalProperties: + $ref: '#/components/schemas/hashicorp.consul.resource.Status' + description: | + // Status is used by controllers to communicate the result of attempting to + // reconcile and apply the resource (e.g. surface semantic validation errors) + // with users and other controllers. Each status is identified by a unique key + // and should only ever be updated by one controller. + // + // Status can only be updated via the WriteStatus endpoint. Attempting to do + // so via the Write endpoint will result in an InvalidArgument error code. + version: + type: string + description: | + // Version is the low-level version identifier used by the storage backend + // in CAS (Compare-And-Swap) operations. It will change when the resource is + // modified in any way, including status updates. + // + // When calling the Write endpoint, providing a non-blank version will perform + // a CAS (Compare-And-Swap) write, which will result in an Aborted error code + // if the given version doesn't match what is stored. + put: + summary: Write multicluster.v2.ExportedServices resources + operationId: write-ExportedServices + requestBody: + description: The multicluster.v2.ExportedServices resource to be updated. + content: + application/json: + schema: + type: object + properties: + data: + $ref: '#/components/schemas/hashicorp.consul.multicluster.v2.ExportedServices' + generation: + type: string + description: | + // Generation is incremented whenever the resource's content (i.e. not its + // status) is modified. You can think of it as being the "user version". + // + // Concretely, Generation is a [ULID](https://github.com/ulid/spec) and you + // can treat its timestamp component as the resource's modification time. + id: + $ref: '#/components/schemas/hashicorp.consul.resource.ID' + description: | + // ID uniquely identifies the resource. + metadata: + type: object + additionalProperties: + type: string + description: | + // Metadata contains key/value pairs of arbitrary metadata about the resource. + // "deletionTimestamp" and "finalizers" keys are reserved for internal use. + owner: + $ref: '#/components/schemas/hashicorp.consul.resource.ID' + description: | + // Owner (optionally) describes which resource "owns" this resource, it is + // immutable and can only be set on resource creation. Owned resources will + // be automatically deleted when their owner is deleted. + status: + type: object + additionalProperties: + $ref: '#/components/schemas/hashicorp.consul.resource.Status' + description: | + // Status is used by controllers to communicate the result of attempting to + // reconcile and apply the resource (e.g. surface semantic validation errors) + // with users and other controllers. Each status is identified by a unique key + // and should only ever be updated by one controller. + // + // Status can only be updated via the WriteStatus endpoint. Attempting to do + // so via the Write endpoint will result in an InvalidArgument error code. + version: + type: string + description: | + // Version is the low-level version identifier used by the storage backend + // in CAS (Compare-And-Swap) operations. It will change when the resource is + // modified in any way, including status updates. + // + // When calling the Write endpoint, providing a non-blank version will perform + // a CAS (Compare-And-Swap) write, which will result in an Aborted error code + // if the given version doesn't match what is stored. + responses: + "200": + description: The write was successful and the body contains the result. + content: + application/json: + schema: + type: object + properties: + data: + $ref: '#/components/schemas/hashicorp.consul.multicluster.v2.ExportedServices' + generation: + type: string + description: | + // Generation is incremented whenever the resource's content (i.e. not its + // status) is modified. You can think of it as being the "user version". + // + // Concretely, Generation is a [ULID](https://github.com/ulid/spec) and you + // can treat its timestamp component as the resource's modification time. + id: + $ref: '#/components/schemas/hashicorp.consul.resource.ID' + description: | + // ID uniquely identifies the resource. + metadata: + type: object + additionalProperties: + type: string + description: | + // Metadata contains key/value pairs of arbitrary metadata about the resource. + // "deletionTimestamp" and "finalizers" keys are reserved for internal use. + owner: + $ref: '#/components/schemas/hashicorp.consul.resource.ID' + description: | + // Owner (optionally) describes which resource "owns" this resource, it is + // immutable and can only be set on resource creation. Owned resources will + // be automatically deleted when their owner is deleted. + status: + type: object + additionalProperties: + $ref: '#/components/schemas/hashicorp.consul.resource.Status' + description: | + // Status is used by controllers to communicate the result of attempting to + // reconcile and apply the resource (e.g. surface semantic validation errors) + // with users and other controllers. Each status is identified by a unique key + // and should only ever be updated by one controller. + // + // Status can only be updated via the WriteStatus endpoint. Attempting to do + // so via the Write endpoint will result in an InvalidArgument error code. + version: + type: string + description: | + // Version is the low-level version identifier used by the storage backend + // in CAS (Compare-And-Swap) operations. It will change when the resource is + // modified in any way, including status updates. + // + // When calling the Write endpoint, providing a non-blank version will perform + // a CAS (Compare-And-Swap) write, which will result in an Aborted error code + // if the given version doesn't match what is stored. + delete: + summary: Delete multicluster.v2.ExportedServices resources + operationId: delete-ExportedServices + responses: + "200": + description: The delete was successful and the body contains the result. + parameters: + - $ref: '#/components/parameters/peer' + - $ref: '#/components/parameters/name' + - $ref: '#/components/parameters/namespace' + - $ref: '#/components/parameters/ns' + - $ref: '#/components/parameters/partition' + api/multicluster/v2/NamespaceExportedServices: + get: + summary: List multicluster.v2.NamespaceExportedServices resources + operationId: list-NamespaceExportedServices + parameters: + - $ref: '#/components/parameters/peer' + - $ref: '#/components/parameters/consistent' + - $ref: '#/components/parameters/name_prefix' + - $ref: '#/components/parameters/namespace' + - $ref: '#/components/parameters/ns' + - $ref: '#/components/parameters/partition' + responses: + "200": + description: The listing was successful and the body contains the array of results. + content: + application/json: + schema: + type: array + items: + type: object + properties: + data: + $ref: '#/components/schemas/hashicorp.consul.multicluster.v2.NamespaceExportedServices' + generation: + type: string + description: | + // Generation is incremented whenever the resource's content (i.e. not its + // status) is modified. You can think of it as being the "user version". + // + // Concretely, Generation is a [ULID](https://github.com/ulid/spec) and you + // can treat its timestamp component as the resource's modification time. + id: + $ref: '#/components/schemas/hashicorp.consul.resource.ID' + description: | + // ID uniquely identifies the resource. + metadata: + type: object + additionalProperties: + type: string + description: | + // Metadata contains key/value pairs of arbitrary metadata about the resource. + // "deletionTimestamp" and "finalizers" keys are reserved for internal use. + owner: + $ref: '#/components/schemas/hashicorp.consul.resource.ID' + description: | + // Owner (optionally) describes which resource "owns" this resource, it is + // immutable and can only be set on resource creation. Owned resources will + // be automatically deleted when their owner is deleted. + status: + type: object + additionalProperties: + $ref: '#/components/schemas/hashicorp.consul.resource.Status' + description: | + // Status is used by controllers to communicate the result of attempting to + // reconcile and apply the resource (e.g. surface semantic validation errors) + // with users and other controllers. Each status is identified by a unique key + // and should only ever be updated by one controller. + // + // Status can only be updated via the WriteStatus endpoint. Attempting to do + // so via the Write endpoint will result in an InvalidArgument error code. + version: + type: string + description: | + // Version is the low-level version identifier used by the storage backend + // in CAS (Compare-And-Swap) operations. It will change when the resource is + // modified in any way, including status updates. + // + // When calling the Write endpoint, providing a non-blank version will perform + // a CAS (Compare-And-Swap) write, which will result in an Aborted error code + // if the given version doesn't match what is stored. + security: + - BearerAuth: + - write:TrafficPermissions.destination + ConsulTokenHeader: + - write:TrafficPermissions.destination + api/multicluster/v2/NamespaceExportedServices/{name}: + get: + summary: Read multicluster.v2.NamespaceExportedServices resources + operationId: read-NamespaceExportedServices. + parameters: + - $ref: '#/components/parameters/consistent' + responses: + "200": + description: The read was successful and the body contains the result. + content: + application/json: + schema: + type: object + properties: + data: + $ref: '#/components/schemas/hashicorp.consul.multicluster.v2.NamespaceExportedServices' + generation: + type: string + description: | + // Generation is incremented whenever the resource's content (i.e. not its + // status) is modified. You can think of it as being the "user version". + // + // Concretely, Generation is a [ULID](https://github.com/ulid/spec) and you + // can treat its timestamp component as the resource's modification time. + id: + $ref: '#/components/schemas/hashicorp.consul.resource.ID' + description: | + // ID uniquely identifies the resource. + metadata: + type: object + additionalProperties: + type: string + description: | + // Metadata contains key/value pairs of arbitrary metadata about the resource. + // "deletionTimestamp" and "finalizers" keys are reserved for internal use. + owner: + $ref: '#/components/schemas/hashicorp.consul.resource.ID' + description: | + // Owner (optionally) describes which resource "owns" this resource, it is + // immutable and can only be set on resource creation. Owned resources will + // be automatically deleted when their owner is deleted. + status: + type: object + additionalProperties: + $ref: '#/components/schemas/hashicorp.consul.resource.Status' + description: | + // Status is used by controllers to communicate the result of attempting to + // reconcile and apply the resource (e.g. surface semantic validation errors) + // with users and other controllers. Each status is identified by a unique key + // and should only ever be updated by one controller. + // + // Status can only be updated via the WriteStatus endpoint. Attempting to do + // so via the Write endpoint will result in an InvalidArgument error code. + version: + type: string + description: | + // Version is the low-level version identifier used by the storage backend + // in CAS (Compare-And-Swap) operations. It will change when the resource is + // modified in any way, including status updates. + // + // When calling the Write endpoint, providing a non-blank version will perform + // a CAS (Compare-And-Swap) write, which will result in an Aborted error code + // if the given version doesn't match what is stored. + put: + summary: Write multicluster.v2.NamespaceExportedServices resources + operationId: write-NamespaceExportedServices + requestBody: + description: The multicluster.v2.NamespaceExportedServices resource to be updated. + content: + application/json: + schema: + type: object + properties: + data: + $ref: '#/components/schemas/hashicorp.consul.multicluster.v2.NamespaceExportedServices' + generation: + type: string + description: | + // Generation is incremented whenever the resource's content (i.e. not its + // status) is modified. You can think of it as being the "user version". + // + // Concretely, Generation is a [ULID](https://github.com/ulid/spec) and you + // can treat its timestamp component as the resource's modification time. + id: + $ref: '#/components/schemas/hashicorp.consul.resource.ID' + description: | + // ID uniquely identifies the resource. + metadata: + type: object + additionalProperties: + type: string + description: | + // Metadata contains key/value pairs of arbitrary metadata about the resource. + // "deletionTimestamp" and "finalizers" keys are reserved for internal use. + owner: + $ref: '#/components/schemas/hashicorp.consul.resource.ID' + description: | + // Owner (optionally) describes which resource "owns" this resource, it is + // immutable and can only be set on resource creation. Owned resources will + // be automatically deleted when their owner is deleted. + status: + type: object + additionalProperties: + $ref: '#/components/schemas/hashicorp.consul.resource.Status' + description: | + // Status is used by controllers to communicate the result of attempting to + // reconcile and apply the resource (e.g. surface semantic validation errors) + // with users and other controllers. Each status is identified by a unique key + // and should only ever be updated by one controller. + // + // Status can only be updated via the WriteStatus endpoint. Attempting to do + // so via the Write endpoint will result in an InvalidArgument error code. + version: + type: string + description: | + // Version is the low-level version identifier used by the storage backend + // in CAS (Compare-And-Swap) operations. It will change when the resource is + // modified in any way, including status updates. + // + // When calling the Write endpoint, providing a non-blank version will perform + // a CAS (Compare-And-Swap) write, which will result in an Aborted error code + // if the given version doesn't match what is stored. + responses: + "200": + description: The write was successful and the body contains the result. + content: + application/json: + schema: + type: object + properties: + data: + $ref: '#/components/schemas/hashicorp.consul.multicluster.v2.NamespaceExportedServices' + generation: + type: string + description: | + // Generation is incremented whenever the resource's content (i.e. not its + // status) is modified. You can think of it as being the "user version". + // + // Concretely, Generation is a [ULID](https://github.com/ulid/spec) and you + // can treat its timestamp component as the resource's modification time. + id: + $ref: '#/components/schemas/hashicorp.consul.resource.ID' + description: | + // ID uniquely identifies the resource. + metadata: + type: object + additionalProperties: + type: string + description: | + // Metadata contains key/value pairs of arbitrary metadata about the resource. + // "deletionTimestamp" and "finalizers" keys are reserved for internal use. + owner: + $ref: '#/components/schemas/hashicorp.consul.resource.ID' + description: | + // Owner (optionally) describes which resource "owns" this resource, it is + // immutable and can only be set on resource creation. Owned resources will + // be automatically deleted when their owner is deleted. + status: + type: object + additionalProperties: + $ref: '#/components/schemas/hashicorp.consul.resource.Status' + description: | + // Status is used by controllers to communicate the result of attempting to + // reconcile and apply the resource (e.g. surface semantic validation errors) + // with users and other controllers. Each status is identified by a unique key + // and should only ever be updated by one controller. + // + // Status can only be updated via the WriteStatus endpoint. Attempting to do + // so via the Write endpoint will result in an InvalidArgument error code. + version: + type: string + description: | + // Version is the low-level version identifier used by the storage backend + // in CAS (Compare-And-Swap) operations. It will change when the resource is + // modified in any way, including status updates. + // + // When calling the Write endpoint, providing a non-blank version will perform + // a CAS (Compare-And-Swap) write, which will result in an Aborted error code + // if the given version doesn't match what is stored. + delete: + summary: Delete multicluster.v2.NamespaceExportedServices resources + operationId: delete-NamespaceExportedServices + responses: + "200": + description: The delete was successful and the body contains the result. + parameters: + - $ref: '#/components/parameters/peer' + - $ref: '#/components/parameters/name' + - $ref: '#/components/parameters/namespace' + - $ref: '#/components/parameters/ns' + - $ref: '#/components/parameters/partition' + api/multicluster/v2/PartitionExportedServices: + get: + summary: List multicluster.v2.PartitionExportedServices resources + operationId: list-PartitionExportedServices + parameters: + - $ref: '#/components/parameters/peer' + - $ref: '#/components/parameters/consistent' + - $ref: '#/components/parameters/name_prefix' + - $ref: '#/components/parameters/partition' + responses: + "200": + description: The listing was successful and the body contains the array of results. + content: + application/json: + schema: + type: array + items: + type: object + properties: + data: + $ref: '#/components/schemas/hashicorp.consul.multicluster.v2.PartitionExportedServices' + generation: + type: string + description: | + // Generation is incremented whenever the resource's content (i.e. not its + // status) is modified. You can think of it as being the "user version". + // + // Concretely, Generation is a [ULID](https://github.com/ulid/spec) and you + // can treat its timestamp component as the resource's modification time. + id: + $ref: '#/components/schemas/hashicorp.consul.resource.ID' + description: | + // ID uniquely identifies the resource. + metadata: + type: object + additionalProperties: + type: string + description: | + // Metadata contains key/value pairs of arbitrary metadata about the resource. + // "deletionTimestamp" and "finalizers" keys are reserved for internal use. + owner: + $ref: '#/components/schemas/hashicorp.consul.resource.ID' + description: | + // Owner (optionally) describes which resource "owns" this resource, it is + // immutable and can only be set on resource creation. Owned resources will + // be automatically deleted when their owner is deleted. + status: + type: object + additionalProperties: + $ref: '#/components/schemas/hashicorp.consul.resource.Status' + description: | + // Status is used by controllers to communicate the result of attempting to + // reconcile and apply the resource (e.g. surface semantic validation errors) + // with users and other controllers. Each status is identified by a unique key + // and should only ever be updated by one controller. + // + // Status can only be updated via the WriteStatus endpoint. Attempting to do + // so via the Write endpoint will result in an InvalidArgument error code. + version: + type: string + description: | + // Version is the low-level version identifier used by the storage backend + // in CAS (Compare-And-Swap) operations. It will change when the resource is + // modified in any way, including status updates. + // + // When calling the Write endpoint, providing a non-blank version will perform + // a CAS (Compare-And-Swap) write, which will result in an Aborted error code + // if the given version doesn't match what is stored. + security: + - BearerAuth: + - write:TrafficPermissions.destination + ConsulTokenHeader: + - write:TrafficPermissions.destination + api/multicluster/v2/PartitionExportedServices/{name}: + get: + summary: Read multicluster.v2.PartitionExportedServices resources + operationId: read-PartitionExportedServices. + parameters: + - $ref: '#/components/parameters/consistent' + responses: + "200": + description: The read was successful and the body contains the result. + content: + application/json: + schema: + type: object + properties: + data: + $ref: '#/components/schemas/hashicorp.consul.multicluster.v2.PartitionExportedServices' + generation: + type: string + description: | + // Generation is incremented whenever the resource's content (i.e. not its + // status) is modified. You can think of it as being the "user version". + // + // Concretely, Generation is a [ULID](https://github.com/ulid/spec) and you + // can treat its timestamp component as the resource's modification time. + id: + $ref: '#/components/schemas/hashicorp.consul.resource.ID' + description: | + // ID uniquely identifies the resource. + metadata: + type: object + additionalProperties: + type: string + description: | + // Metadata contains key/value pairs of arbitrary metadata about the resource. + // "deletionTimestamp" and "finalizers" keys are reserved for internal use. + owner: + $ref: '#/components/schemas/hashicorp.consul.resource.ID' + description: | + // Owner (optionally) describes which resource "owns" this resource, it is + // immutable and can only be set on resource creation. Owned resources will + // be automatically deleted when their owner is deleted. + status: + type: object + additionalProperties: + $ref: '#/components/schemas/hashicorp.consul.resource.Status' + description: | + // Status is used by controllers to communicate the result of attempting to + // reconcile and apply the resource (e.g. surface semantic validation errors) + // with users and other controllers. Each status is identified by a unique key + // and should only ever be updated by one controller. + // + // Status can only be updated via the WriteStatus endpoint. Attempting to do + // so via the Write endpoint will result in an InvalidArgument error code. + version: + type: string + description: | + // Version is the low-level version identifier used by the storage backend + // in CAS (Compare-And-Swap) operations. It will change when the resource is + // modified in any way, including status updates. + // + // When calling the Write endpoint, providing a non-blank version will perform + // a CAS (Compare-And-Swap) write, which will result in an Aborted error code + // if the given version doesn't match what is stored. + put: + summary: Write multicluster.v2.PartitionExportedServices resources + operationId: write-PartitionExportedServices + requestBody: + description: The multicluster.v2.PartitionExportedServices resource to be updated. + content: + application/json: + schema: + type: object + properties: + data: + $ref: '#/components/schemas/hashicorp.consul.multicluster.v2.PartitionExportedServices' + generation: + type: string + description: | + // Generation is incremented whenever the resource's content (i.e. not its + // status) is modified. You can think of it as being the "user version". + // + // Concretely, Generation is a [ULID](https://github.com/ulid/spec) and you + // can treat its timestamp component as the resource's modification time. + id: + $ref: '#/components/schemas/hashicorp.consul.resource.ID' + description: | + // ID uniquely identifies the resource. + metadata: + type: object + additionalProperties: + type: string + description: | + // Metadata contains key/value pairs of arbitrary metadata about the resource. + // "deletionTimestamp" and "finalizers" keys are reserved for internal use. + owner: + $ref: '#/components/schemas/hashicorp.consul.resource.ID' + description: | + // Owner (optionally) describes which resource "owns" this resource, it is + // immutable and can only be set on resource creation. Owned resources will + // be automatically deleted when their owner is deleted. + status: + type: object + additionalProperties: + $ref: '#/components/schemas/hashicorp.consul.resource.Status' + description: | + // Status is used by controllers to communicate the result of attempting to + // reconcile and apply the resource (e.g. surface semantic validation errors) + // with users and other controllers. Each status is identified by a unique key + // and should only ever be updated by one controller. + // + // Status can only be updated via the WriteStatus endpoint. Attempting to do + // so via the Write endpoint will result in an InvalidArgument error code. + version: + type: string + description: | + // Version is the low-level version identifier used by the storage backend + // in CAS (Compare-And-Swap) operations. It will change when the resource is + // modified in any way, including status updates. + // + // When calling the Write endpoint, providing a non-blank version will perform + // a CAS (Compare-And-Swap) write, which will result in an Aborted error code + // if the given version doesn't match what is stored. + responses: + "200": + description: The write was successful and the body contains the result. + content: + application/json: + schema: + type: object + properties: + data: + $ref: '#/components/schemas/hashicorp.consul.multicluster.v2.PartitionExportedServices' + generation: + type: string + description: | + // Generation is incremented whenever the resource's content (i.e. not its + // status) is modified. You can think of it as being the "user version". + // + // Concretely, Generation is a [ULID](https://github.com/ulid/spec) and you + // can treat its timestamp component as the resource's modification time. + id: + $ref: '#/components/schemas/hashicorp.consul.resource.ID' + description: | + // ID uniquely identifies the resource. + metadata: + type: object + additionalProperties: + type: string + description: | + // Metadata contains key/value pairs of arbitrary metadata about the resource. + // "deletionTimestamp" and "finalizers" keys are reserved for internal use. + owner: + $ref: '#/components/schemas/hashicorp.consul.resource.ID' + description: | + // Owner (optionally) describes which resource "owns" this resource, it is + // immutable and can only be set on resource creation. Owned resources will + // be automatically deleted when their owner is deleted. + status: + type: object + additionalProperties: + $ref: '#/components/schemas/hashicorp.consul.resource.Status' + description: | + // Status is used by controllers to communicate the result of attempting to + // reconcile and apply the resource (e.g. surface semantic validation errors) + // with users and other controllers. Each status is identified by a unique key + // and should only ever be updated by one controller. + // + // Status can only be updated via the WriteStatus endpoint. Attempting to do + // so via the Write endpoint will result in an InvalidArgument error code. + version: + type: string + description: | + // Version is the low-level version identifier used by the storage backend + // in CAS (Compare-And-Swap) operations. It will change when the resource is + // modified in any way, including status updates. + // + // When calling the Write endpoint, providing a non-blank version will perform + // a CAS (Compare-And-Swap) write, which will result in an Aborted error code + // if the given version doesn't match what is stored. + delete: + summary: Delete multicluster.v2.PartitionExportedServices resources + operationId: delete-PartitionExportedServices + responses: + "200": + description: The delete was successful and the body contains the result. + parameters: + - $ref: '#/components/parameters/peer' + - $ref: '#/components/parameters/name' + - $ref: '#/components/parameters/partition' +components: + schemas: + hashicorp.consul.multicluster.v2.ComputedExportedService: + type: object + properties: + consumers: + type: array + items: + $ref: '#/components/schemas/hashicorp.consul.multicluster.v2.ComputedExportedServicesConsumer' + target_ref: + $ref: '#/components/schemas/hashicorp.consul.resource.Reference' + hashicorp.consul.multicluster.v2.ComputedExportedServices: + type: object + properties: + consumers: + type: array + items: + $ref: '#/components/schemas/hashicorp.consul.multicluster.v2.ComputedExportedService' + hashicorp.consul.multicluster.v2.ComputedExportedServicesConsumer: + type: object + properties: + partition: + type: string + peer: + type: string + hashicorp.consul.multicluster.v2.ExportedServices: + type: object + properties: + consumers: + type: array + items: + $ref: '#/components/schemas/hashicorp.consul.multicluster.v2.ExportedServicesConsumer' + services: + type: array + items: + type: string + hashicorp.consul.multicluster.v2.ExportedServicesConsumer: + type: object + properties: + partition: + type: string + peer: + type: string + sameness_group: + type: string + hashicorp.consul.multicluster.v2.NamespaceExportedServices: + type: object + properties: + consumers: + type: array + items: + $ref: '#/components/schemas/hashicorp.consul.multicluster.v2.ExportedServicesConsumer' + hashicorp.consul.multicluster.v2.PartitionExportedServices: + type: object + properties: + consumers: + type: array + items: + $ref: '#/components/schemas/hashicorp.consul.multicluster.v2.ExportedServicesConsumer' + hashicorp.consul.resource.Condition: + type: object + properties: + message: + type: string + description: | + // Message contains a human-friendly description of the status. + reason: + type: string + description: | + // Reason provides more machine-readable details about the condition (e.g. + // "InvalidProtocol"). + resource: + $ref: '#/components/schemas/hashicorp.consul.resource.Reference' + description: | + // Resource identifies which resource this condition relates to, when it is + // not the core resource itself. + state: + $ref: '#/components/schemas/hashicorp.consul.resource.Condition.State' + description: | + // State represents the state of the condition (i.e. true/false/unknown). + type: + type: string + description: | + // Type identifies the type of condition (e.g. "Invalid", "ResolvedRefs"). + description: |4 + Condition represents a discreet observation about a resource in relation to + the current state of the system. + It is heavily inspired by Kubernetes' [conditions](https://bit.ly/3H9Y6IK) + and the Gateway API [types and reasons](https://bit.ly/3n2PPiP). + hashicorp.consul.resource.Condition.State: + type: string + enum: + - STATE_UNKNOWN + - STATE_TRUE + - STATE_FALSE + description: |4 + State represents the state of the condition (i.e. true/false/unknown). + hashicorp.consul.resource.ID: + type: object + properties: + name: + type: string + description: | + // Name is the user-given name of the resource (e.g. the "billing" service). + tenancy: + $ref: '#/components/schemas/hashicorp.consul.resource.Tenancy' + description: | + // Tenancy identifies the tenancy units (i.e. partition, namespace) in which + // the resource resides. + type: + $ref: '#/components/schemas/hashicorp.consul.resource.Type' + description: | + // Type identifies the resource's type. + uid: + type: string + description: | + // Uid is the unique internal identifier we gave to the resource. + // + // It is primarily used to tell the difference between the current resource + // and previous deleted resources with the same user-given name. + // + // Concretely, Uid is a [ULID](https://github.com/ulid/spec) and you can treat + // its timestamp component as the resource's creation time. + description: |4 + ID uniquely identifies a resource. + hashicorp.consul.resource.Reference: + type: object + properties: + name: + type: string + description: | + // Name is the user-given name of the resource (e.g. the "billing" service). + section: + type: string + description: | + // Section identifies which part of the resource the condition relates to. + tenancy: + $ref: '#/components/schemas/hashicorp.consul.resource.Tenancy' + description: | + // Tenancy identifies the tenancy units (i.e. partition, namespace) in which + // the resource resides. + type: + $ref: '#/components/schemas/hashicorp.consul.resource.Type' + description: | + // Type identifies the resource's type. + description: |4 + Reference identifies which resource a condition relates to, when it is not + the core resource itself. + hashicorp.consul.resource.Status: + type: object + properties: + conditions: + type: array + items: + $ref: '#/components/schemas/hashicorp.consul.resource.Condition' + description: | + // Conditions contains a set of discreet observations about the resource in + // relation to the current state of the system (e.g. it is semantically valid). + observed_generation: + type: string + description: | + // ObservedGeneration identifies which generation of a resource this status + // related to. It can be used to determine whether the current generation of + // a resource has been reconciled. + updated_at: + type: string + format: date-time + description: | + // UpdatedAt is the time at which the status was last written. + description: |4 + Status is used by controllers to communicate the result of attempting to + reconcile and apply a resource (e.g. surface semantic validation errors) + with users and other controllers. + hashicorp.consul.resource.Tenancy: + type: object + properties: + namespace: + type: string + description: | + // Namespace further isolates resources within a partition. + // https://developer.hashicorp.com/consul/docs/enterprise/namespaces + // + // When using the List and WatchList endpoints, provide the wildcard value "*" + // to list resources across all namespaces. + partition: + type: string + description: | + // Partition is the topmost administrative boundary within a cluster. + // https://developer.hashicorp.com/consul/docs/enterprise/admin-partitions + // + // When using the List and WatchList endpoints, provide the wildcard value "*" + // to list resources across all partitions. + peer_name: + type: string + description: | + // PeerName identifies which peer the resource is imported from. + // https://developer.hashicorp.com/consul/docs/connect/cluster-peering + // + // When using the List and WatchList endpoints, provide the wildcard value "*" + // to list resources across all peers. + description: |4 + Tenancy describes the tenancy units in which the resource resides. + hashicorp.consul.resource.Type: + type: object + properties: + group: + type: string + description: | + // Group describes the area of functionality to which this resource type + // relates (e.g. "catalog", "authorization"). + group_version: + type: string + description: | + // GroupVersion is incremented when sweeping or backward-incompatible changes + // are made to the group's resource types. + kind: + type: string + description: | + // Kind identifies the specific resource type within the group. + description: |4 + Type describes a resource's type. It follows the GVK (Group Version Kind) + [pattern](https://book.kubebuilder.io/cronjob-tutorial/gvks.html) established + by Kubernetes. + parameters: + consistent: + name: consistent + in: query + description: When true, the operation will be performed with strong consistency + schema: + type: boolean + name: + name: name + in: path + description: The name of the resource to operate on. + required: true + schema: + type: string + name_prefix: + name: name_prefix + in: query + description: The resource name prefix used to filter the result list. + schema: + type: string + namespace: + name: namespace + in: query + description: Specifies the Consul namespace of resources to operate on. This parameter takes precedence over the `ns` alias. + schema: + type: string + ns: + name: ns + in: query + description: '`ns` is an alias for the `namespace` query param. The `namespace` parameter takes precedence.' + schema: + type: string + partition: + name: partition + in: query + description: Specifies the Consul partition of resources to operate on. + schema: + type: string + peer: + name: peer + in: query + description: Specifies the Consul peer of imported resources to operate on. + schema: + type: string + securitySchemes: + BearerAuth: + type: http + scheme: bearer + ConsulTokenHeader: + type: apiKey + in: header + name: X-Consul-Token +security: + - BearerAuth: [] + - ConsulTokenHeader: [] \ No newline at end of file diff --git a/consul/tools/v2_api_helpers.go b/consul/tools/v2_api_helpers.go new file mode 100644 index 00000000..e78439dd --- /dev/null +++ b/consul/tools/v2_api_helpers.go @@ -0,0 +1,48 @@ +package tools + +import ( + "encoding/json" + "io" + "net/http" + + "github.com/hashicorp/consul/api" +) + +// NewHttpClient returns an http client configured with the given Transport and TLS +// config. +func NewHttpClient(transport *http.Transport, tlsConf api.TLSConfig) (*http.Client, error) { + client := &http.Client{ + Transport: transport, + } + + // TODO (slackpad) - Once we get some run time on the HTTP/2 support we + // should turn it on by default if TLS is enabled. We would basically + // just need to call http2.ConfigureTransport(transport) here. We also + // don't want to introduce another external dependency on + // golang.org/x/net/http2 at this time. For a complete recipe for how + // to enable HTTP/2 support on a transport suitable for the API client + // library see agent/http_test.go:TestHTTPServer_H2. + + if transport.TLSClientConfig == nil { + tlsClientConfig, err := api.SetupTLSConfig(&tlsConf) + + if err != nil { + return nil, err + } + + transport.TLSClientConfig = tlsClientConfig + } + + return client, nil +} + +func CloseResponseBody(resp *http.Response) error { + _, _ = io.Copy(io.Discard, resp.Body) + return resp.Body.Close() +} + +// decodeBody is used to JSON decode a body +func DecodeBody(resp *http.Response, out interface{}) error { + dec := json.NewDecoder(resp.Body) + return dec.Decode(out) +} diff --git a/docs/data-sources/nodes.md b/docs/data-sources/nodes.md index cb54b934..ffd0ad9c 100644 --- a/docs/data-sources/nodes.md +++ b/docs/data-sources/nodes.md @@ -47,7 +47,7 @@ The `query_options` block supports the following: * `allow_stale` - (Optional) When `true`, the default, allow responses from Consul servers that are followers. -* `require_consistent` - (Optional) When `true` force the client to perform a +* `require_consistent` - (Optional) When `true` force the Client to perform a read on at least quorum servers and verify the result is the same. Defaults to `false`. @@ -57,7 +57,7 @@ The `query_options` block supports the following: * `wait_index` - (Optional) Index number used to enable blocking queries. -* `wait_time` - (Optional) Max time the client should wait for a blocking query +* `wait_time` - (Optional) Max time the Client should wait for a blocking query to return. ## Attributes Reference diff --git a/docs/data-sources/service.md b/docs/data-sources/service.md index 60082ab1..13388d11 100644 --- a/docs/data-sources/service.md +++ b/docs/data-sources/service.md @@ -55,7 +55,7 @@ The `query_options` block supports the following: * `allow_stale` - (Optional) When `true`, the default, allow responses from Consul servers that are followers. -* `require_consistent` - (Optional) When `true` force the client to perform a +* `require_consistent` - (Optional) When `true` force the Client to perform a read on at least quorum servers and verify the result is the same. Defaults to `false`. @@ -65,7 +65,7 @@ The `query_options` block supports the following: * `wait_index` - (Optional) Index number used to enable blocking queries. -* `wait_time` - (Optional) Max time the client should wait for a blocking query +* `wait_time` - (Optional) Max time the Client should wait for a blocking query to return. * `namespace` - (Optional, Enterprise Only) The namespace to lookup the service. diff --git a/docs/data-sources/services.md b/docs/data-sources/services.md index 7691c90c..20641ee4 100644 --- a/docs/data-sources/services.md +++ b/docs/data-sources/services.md @@ -50,7 +50,7 @@ The `query_options` block supports the following: * `allow_stale` - (Optional) When `true`, the default, allow responses from Consul servers that are followers. -* `require_consistent` - (Optional) When `true` force the client to perform a +* `require_consistent` - (Optional) When `true` force the Client to perform a read on at least quorum servers and verify the result is the same. Defaults to `false`. @@ -60,7 +60,7 @@ The `query_options` block supports the following: * `wait_index` - (Optional) Index number used to enable blocking queries. -* `wait_time` - (Optional) Max time the client should wait for a blocking query +* `wait_time` - (Optional) Max time the Client should wait for a blocking query to return. * `namespace` - (Optional, Enterprise Only) The namespace to lookup the services. diff --git a/docs/index.md b/docs/index.md index d94b7849..cd95138a 100644 --- a/docs/index.md +++ b/docs/index.md @@ -72,7 +72,7 @@ The known compatibility between this provider and Consul is: - `address` (String) The HTTP(S) API address of the agent to use. Defaults to "127.0.0.1:8500". - `auth_jwt` (Block List, Max: 1) Authenticates to Consul using a JWT authentication method. (see [below for nested schema](#nestedblock--auth_jwt)) - `ca_file` (String) A path to a PEM-encoded certificate authority used to verify the remote agent's certificate. -- `ca_path` (String) A path to a directory of PEM-encoded certificate authority files to use to check the authenticity of client and server connections. Can also be specified with the `CONSUL_CAPATH` environment variable. +- `ca_path` (String) A path to a directory of PEM-encoded certificate authority files to use to check the authenticity of Client and server connections. Can also be specified with the `CONSUL_CAPATH` environment variable. - `ca_pem` (String) PEM-encoded certificate authority used to verify the remote agent's certificate. - `cert_file` (String) A path to a PEM-encoded certificate provided to the remote agent; requires use of `key_file` or `key_pem`. - `cert_pem` (String) PEM-encoded certificate provided to the remote agent; requires use of `key_file` or `key_pem`. diff --git a/go.mod b/go.mod index 1512e815..326d4177 100644 --- a/go.mod +++ b/go.mod @@ -4,44 +4,66 @@ module github.com/hashicorp/terraform-provider-consul replace github.com/hashicorp/consul/proto-public => github.com/hashicorp/consul/proto-public v0.1.2-0.20240208173503-e72afa654d22 require ( + github.com/getkin/kin-openapi v0.123.0 github.com/hashicorp/consul/api v1.10.1-0.20240209095413-ae9fb4c83d42 github.com/hashicorp/consul/proto-public v0.5.2 github.com/hashicorp/errwrap v1.1.0 github.com/hashicorp/terraform-plugin-sdk v1.17.2 + github.com/labstack/echo/v4 v4.11.4 github.com/mitchellh/mapstructure v1.5.0 + github.com/oapi-codegen/runtime v1.1.1 ) require ( cloud.google.com/go/compute v1.19.1 // indirect cloud.google.com/go/compute/metadata v0.2.3 // indirect cloud.google.com/go/iam v0.13.0 // indirect + github.com/Masterminds/semver/v3 v3.2.0 // indirect + github.com/Masterminds/sprig/v3 v3.2.3 // indirect + github.com/apapsch/go-jsonmerge/v2 v2.0.0 // indirect + github.com/apparentlymart/go-textseg/v15 v15.0.0 // indirect github.com/armon/go-metrics v0.4.1 // indirect + github.com/cloudflare/circl v1.3.7 // indirect + github.com/go-git/go-git/v5 v5.10.1 // indirect + github.com/go-openapi/jsonpointer v0.20.2 // indirect + github.com/go-openapi/swag v0.22.8 // indirect github.com/googleapis/enterprise-certificate-proxy v0.2.3 // indirect + github.com/invopop/yaml v0.2.0 // indirect + github.com/josharian/intern v1.0.0 // indirect + github.com/labstack/gommon v0.4.2 // indirect + github.com/mailru/easyjson v0.7.7 // indirect + github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect + github.com/perimeterx/marshmallow v1.1.5 // indirect + github.com/shopspring/decimal v1.3.1 // indirect + github.com/spf13/cast v1.5.0 // indirect + github.com/valyala/bytebufferpool v1.0.0 // indirect + github.com/valyala/fasttemplate v1.2.2 // indirect + github.com/vmihailenco/msgpack/v5 v5.3.5 // indirect + github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect golang.org/x/exp v0.0.0-20230817173708-d852ddb80c63 // indirect + golang.org/x/mod v0.14.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect ) require ( cloud.google.com/go v0.110.0 // indirect cloud.google.com/go/storage v1.30.1 // indirect github.com/Masterminds/goutils v1.1.1 // 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-cidr v1.1.0 // indirect github.com/apparentlymart/go-textseg/v12 v12.0.0 // indirect - github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect github.com/armon/go-radix v1.0.0 // indirect github.com/aws/aws-sdk-go v1.44.122 // 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.2-0.20180830191138-d8f796af33cc // indirect - github.com/fatih/color v1.14.1 // indirect + github.com/fatih/color v1.16.0 // indirect github.com/frankban/quicktest v1.14.4 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/protobuf v1.5.3 // indirect - github.com/golang/snappy v0.0.3 // indirect - github.com/google/go-cmp v0.5.9 // indirect - github.com/google/uuid v1.3.0 // indirect + github.com/golang/snappy v0.0.4 // indirect + github.com/google/go-cmp v0.6.0 // indirect + github.com/google/uuid v1.5.0 // indirect github.com/googleapis/gax-go/v2 v2.7.1 // indirect github.com/hashicorp/consul/sdk v0.15.0 github.com/hashicorp/go-checkpoint v0.5.0 // indirect @@ -66,33 +88,30 @@ require ( github.com/hashicorp/terraform-plugin-test/v2 v2.2.1 // indirect github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734 // indirect github.com/hashicorp/yamux v0.0.0-20211028200310-0bc27b27de87 // indirect - github.com/huandu/xstrings v1.3.2 // indirect - github.com/imdario/mergo v0.3.13 // indirect + github.com/huandu/xstrings v1.3.3 // indirect + github.com/imdario/mergo v0.3.15 // indirect github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/keybase/go-crypto v0.0.0-20180614160407-5114a9a81e1b // indirect - github.com/klauspost/compress v1.15.11 // indirect - github.com/kr/pretty v0.3.1 // indirect + github.com/klauspost/compress v1.16.7 // indirect github.com/mattn/go-colorable v0.1.13 // indirect - github.com/mattn/go-isatty v0.0.17 // indirect - github.com/mitchellh/cli v1.1.2 // indirect + github.com/mattn/go-isatty v0.0.20 // indirect + github.com/mitchellh/cli v1.1.5 // indirect github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db // indirect - github.com/mitchellh/copystructure v1.0.0 // indirect + github.com/mitchellh/copystructure v1.2.0 // indirect github.com/mitchellh/go-homedir v1.1.0 // indirect github.com/mitchellh/go-testing-interface v1.14.1 // indirect github.com/mitchellh/go-wordwrap v1.0.0 // indirect - github.com/mitchellh/reflectwalk v1.0.1 // indirect + github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/oklog/run v1.0.0 // indirect github.com/pierrec/lz4 v2.5.2+incompatible // indirect github.com/posener/complete v1.2.3 // indirect github.com/spf13/afero v1.2.2 // indirect github.com/ulikunitz/xz v0.5.10 // indirect - github.com/vmihailenco/msgpack/v4 v4.3.12 // indirect - github.com/vmihailenco/tagparser v0.1.1 // indirect - github.com/zclconf/go-cty v1.8.2 // indirect + github.com/zclconf/go-cty v1.14.1 // indirect github.com/zclconf/go-cty-yaml v1.0.2 // indirect go.opencensus.io v0.24.0 // indirect - golang.org/x/crypto v0.14.0 // indirect - golang.org/x/net v0.17.0 // indirect + golang.org/x/crypto v0.17.0 // indirect + golang.org/x/net v0.19.0 // indirect golang.org/x/oauth2 v0.7.0 // indirect golang.org/x/sys v0.15.0 // indirect golang.org/x/text v0.14.0 // indirect @@ -101,7 +120,7 @@ require ( google.golang.org/appengine v1.6.7 // indirect google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 // indirect google.golang.org/grpc v1.56.3 // indirect - google.golang.org/protobuf v1.30.0 // indirect + google.golang.org/protobuf v1.31.0 ) go 1.21 diff --git a/go.sum b/go.sum index 0f4fd6f1..94c654cb 100644 --- a/go.sum +++ b/go.sum @@ -186,6 +186,8 @@ cloud.google.com/go/webrisk v1.4.0/go.mod h1:Hn8X6Zr+ziE2aNd8SliSDWpEnSS1u4R9+xX cloud.google.com/go/webrisk v1.5.0/go.mod h1:iPG6fr52Tv7sGk0H6qUFzmL3HHZev1htXuWDEEsqMTg= cloud.google.com/go/workflows v1.6.0/go.mod h1:6t9F5h/unJz41YqfBmqSASJSXccBLtD1Vwf+KmJENM0= cloud.google.com/go/workflows v1.7.0/go.mod h1:JhSrZuVZWuiDfKEFxU0/F1PQjmpnpcoISEXH2bcHC3M= +dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk= +dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= @@ -193,14 +195,22 @@ github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3 github.com/Masterminds/goutils v1.1.0/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI= github.com/Masterminds/goutils v1.1.1/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= -github.com/Masterminds/semver v1.5.0 h1:H65muMkzWKEuNDnfl9d70GUjFniHKHRbFPGBuZ3QEww= github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= -github.com/Masterminds/sprig v2.22.0+incompatible h1:z4yfnGrZ7netVz+0EDJ0Wi+5VZCSYp4Z0m2dk6cEM60= +github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0cBrbBpGY/8hQs= +github.com/Masterminds/semver/v3 v3.2.0 h1:3MEsd0SM6jqZojhjLWWeBY+Kcjy9i6MQAeY7YgDP83g= +github.com/Masterminds/semver/v3 v3.2.0/go.mod h1:qvl/7zhW3nngYb5+80sSMF+FG2BjYrf8m9wsX0PNOMQ= github.com/Masterminds/sprig v2.22.0+incompatible/go.mod h1:y6hNFY5UBTIWBxnzTeuNhlNS5hqE0NB0E6fgfo2Br3o= +github.com/Masterminds/sprig/v3 v3.2.1/go.mod h1:UoaO7Yp8KlPnJIYWTFkMaqPUYKTfGFPhxNuwnnxkKlk= +github.com/Masterminds/sprig/v3 v3.2.3 h1:eL2fZNezLomi0uOLqjQoN6BfsDD+fyLtgbJMAj9n6YA= +github.com/Masterminds/sprig/v3 v3.2.3/go.mod h1:rXcFaZ2zZbLRJv/xSysmlgIM1u11eBaRMhvYXJNkGuM= github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= -github.com/Microsoft/go-winio v0.4.16 h1:FtSW/jqD+l4ba5iPBj9CODVtgfYAD8w2wS923g/cFDk= github.com/Microsoft/go-winio v0.4.16/go.mod h1:XB6nPKklQyQ7GC9LdcBEcBl8PF76WugXOPRXwdLnMv0= +github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= +github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= +github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371 h1:kkhsdkhsCvIsutKu5zLMgWtgh9YxGCNAw8Ad8hjwfYg= +github.com/ProtonMail/go-crypto v0.0.0-20230828082145-3c4c8a2d2371/go.mod h1:EjAoLdwvbIOoOQr3ihjnSoLZRtE8azugULFRteWMNc0= +github.com/RaveNoX/go-jsoncommentstrip v1.0.0/go.mod h1:78ihd09MekBnJnxpICcwzCMzGrKSKYe4AqU6PDYYpjk= github.com/agext/levenshtein v1.2.1/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= github.com/agext/levenshtein v1.2.2 h1:0S/Yg6LYmFJ5stwQeRp6EeOcCbj7xiqQSdNelsXvaqE= github.com/agext/levenshtein v1.2.2/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= @@ -213,6 +223,8 @@ github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRF github.com/andybalholm/crlf v0.0.0-20171020200849-670099aa064f/go.mod h1:k8feO4+kXDxro6ErPXBRTJ/ro2mf0SsFG8s7doP9kJE= github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= +github.com/apapsch/go-jsonmerge/v2 v2.0.0 h1:axGnT1gRIfimI7gJifB699GoE/oq+F2MU7Dml6nw9rQ= +github.com/apapsch/go-jsonmerge/v2 v2.0.0/go.mod h1:lvDnEdqiQrp0O42VQGgmlKpxL1AP2+08jFMw88y4klk= github.com/apparentlymart/go-cidr v1.1.0 h1:2mAhrMoF+nhXqxTzSZMUzDHkLjmIHC+Zzn4tdgBZjnU= github.com/apparentlymart/go-cidr v1.1.0/go.mod h1:EBcsNrHc3zQeuaeCeCtQruQm+n9/YjEn/vI25Lg7Gwc= github.com/apparentlymart/go-dump v0.0.0-20180507223929-23540a00eaa3/go.mod h1:oL81AME2rN47vu18xqj1S1jPIPuN7afo62yKTNn3XMM= @@ -221,8 +233,9 @@ github.com/apparentlymart/go-dump v0.0.0-20190214190832-042adf3cf4a0/go.mod h1:o github.com/apparentlymart/go-textseg v1.0.0/go.mod h1:z96Txxhf3xSFMPmb5X/1W05FF/Nj9VFpLOpjS5yuumk= github.com/apparentlymart/go-textseg/v12 v12.0.0 h1:bNEQyAGak9tojivJNkoqWErVCQbjdL7GzRt3F8NvfJ0= github.com/apparentlymart/go-textseg/v12 v12.0.0/go.mod h1:S/4uRK2UtaQttw1GenVJEynmyUenKwP++x/+DdGV/Ec= -github.com/apparentlymart/go-textseg/v13 v13.0.0 h1:Y+KvPE1NYz0xl601PVImeQfFyEy6iT90AvPUL1NNfNw= github.com/apparentlymart/go-textseg/v13 v13.0.0/go.mod h1:ZK2fH7c4NqDTLtiYLvIkEghdlcqw7yxLeM89kiTRPUo= +github.com/apparentlymart/go-textseg/v15 v15.0.0 h1:uYvfpb3DyLSCGWnctWKGj857c6ew1u1fNQOlOtuGxQY= +github.com/apparentlymart/go-textseg/v15 v15.0.0/go.mod h1:K8XmNZdhEBkdlyDdvbmmsvpAG721bKi0joRfFdHIWJ4= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= github.com/armon/go-metrics v0.4.1 h1:hR91U9KYmb6bLBYLQjyM+3j+rcd/UhE+G78SFnF8gJA= @@ -242,6 +255,7 @@ github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d h1:xDfNPAt8lFiC1U github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d/go.mod h1:6QX/PXZ00z/TKoufEY6K/a0k6AhaJrQKdFe6OfVXsa4= github.com/bgentry/speakeasy v0.1.0 h1:ByYyxL9InA1OWqxJqqp2A5pYHUrCiAL6K3J+LKSsQkY= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= +github.com/bmatcuk/doublestar v1.1.1/go.mod h1:UD6OnuiIn0yFxxA2le/rnRU1G4RaI4UvFv1sNto9p6w= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= @@ -252,6 +266,8 @@ github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMn github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag= github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cloudflare/circl v1.3.7 h1:qlCDlTPz2n9fu58M0Nh1J/JzcFpfgkFHHX3O35r5vcU= +github.com/cloudflare/circl v1.3.7/go.mod h1:sRTcRWXGLrKw6yIGJ+l7amYJFfAXbZG0kBSc8r4zxgA= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= @@ -262,12 +278,15 @@ github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWH github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= +github.com/cyphar/filepath-securejoin v0.2.4 h1:Ugdm7cg7i6ZK6x3xDF1oEu1nfkyfH53EtKeQYTC3kyg= +github.com/cyphar/filepath-securejoin v0.2.4/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/emirpasic/gods v1.12.0 h1:QAUIPSaCu4G+POclxeqb3F+WPpdKqFGlw36+yOzGlrg= github.com/emirpasic/gods v1.12.0/go.mod h1:YfzfFFoVP/catgzJb4IKIqXjX78Ha8FMSDh3ymbK86o= +github.com/emirpasic/gods v1.18.1 h1:FXtiHYKDGKCW2KzwZKx0iC0PQmdlorYgdFG9jPXJ1Bc= +github.com/emirpasic/gods v1.18.1/go.mod h1:8tpGGwCnJ5H4r6BWwaV6OrWmMoPhUl5jm/FMNAnJvWQ= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= @@ -281,21 +300,26 @@ github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7 github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= -github.com/fatih/color v1.14.1 h1:qfhVLaG5s+nCROl1zJsZRxFeYrHLqWroPOQ8BWiNb4w= -github.com/fatih/color v1.14.1/go.mod h1:2oHN61fhTpgcxD3TSWCgKDiH1+x4OiDVVGH8WlgGZGg= +github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM= +github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE= github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY= github.com/frankban/quicktest v1.14.4/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0= +github.com/getkin/kin-openapi v0.123.0 h1:zIik0mRwFNLyvtXK274Q6ut+dPh6nlxBp0x7mNrPhs8= +github.com/getkin/kin-openapi v0.123.0/go.mod h1:wb1aSZA/iWmorQP9KTAS/phLj/t17B5jT7+fS8ed9NM= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gliderlabs/ssh v0.2.2/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= -github.com/go-git/gcfg v1.5.0 h1:Q5ViNfGF8zFgyJWPqYwA7qGFoMTEiBmdlkcfRmpIMa4= github.com/go-git/gcfg v1.5.0/go.mod h1:5m20vg6GwYabIxaOonVkTdrILxQMpEShl1xiMF4ua+E= +github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 h1:+zs/tPmkDkHx3U66DAb0lQFJrpS6731Oaa12ikc+DiI= +github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376/go.mod h1:an3vInlBmSxCcxctByoQdvwPiA7DTK7jaaFDBTtu0ic= github.com/go-git/go-billy/v5 v5.0.0/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0= -github.com/go-git/go-billy/v5 v5.1.0 h1:4pl5BV4o7ZG/lterP4S6WzJ6xr49Ba5ET9ygheTYahk= github.com/go-git/go-billy/v5 v5.1.0/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0= +github.com/go-git/go-billy/v5 v5.5.0 h1:yEY4yhzCDuMGSv83oGxiBotRzhwhNr8VZyphhiu+mTU= +github.com/go-git/go-billy/v5 v5.5.0/go.mod h1:hmexnoNsr2SJU1Ju67OaNz5ASJY3+sHgFRpCtpDCKow= github.com/go-git/go-git-fixtures/v4 v4.0.2-0.20200613231340-f56387b50c12/go.mod h1:m+ICp2rF3jDhFgEZ/8yziagdT1C+ZpZcrJjappBCDSw= -github.com/go-git/go-git/v5 v5.3.0 h1:8WKMtJR2j8RntEXR/uvTKagfEt4GYlwQ7mntE4+0GWc= github.com/go-git/go-git/v5 v5.3.0/go.mod h1:xdX4bWJ48aOrdhnl2XqHYstHbbp6+LFS4r4X+lNVprw= +github.com/go-git/go-git/v5 v5.10.1 h1:tu8/D8i+TWxgKpzQ3Vc43e+kkhXqtsZCKI/egajKnxk= +github.com/go-git/go-git/v5 v5.10.1/go.mod h1:uEuHjxkHap8kAl//V5F/nNWwqIYtP/402ddd05mp0wg= github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= @@ -303,9 +327,14 @@ github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2 github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= +github.com/go-openapi/jsonpointer v0.20.2 h1:mQc3nmndL8ZBzStEo3JYF8wzmeWffDH4VbXz58sAx6Q= +github.com/go-openapi/jsonpointer v0.20.2/go.mod h1:bHen+N0u1KEO3YlmqOjTT9Adn1RfD91Ar825/PuiRVs= +github.com/go-openapi/swag v0.22.8 h1:/9RjDSQ0vbFR+NyjGMkFTsA1IA0fmhKSThmfGZjicbw= +github.com/go-openapi/swag v0.22.8/go.mod h1:6QT22icPLEqAM/z/TChgb4WAveCHF92+2gF0CNjHpPI= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-test/deep v1.0.3 h1:ZrJSEWsXzPOxaZnFteGEfooLba+ju3FYIbOrS+rQd68= github.com/go-test/deep v1.0.3/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= +github.com/go-test/deep v1.0.8 h1:TDsG77qcSprGbC6vTN8OuXp5g+J+b5Pcguhf7Zt61VM= +github.com/go-test/deep v1.0.8/go.mod h1:5C2ZWiW0ErCdrYzpqxLbTX7MG14M9iiw8DgHncVwcsE= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -344,8 +373,9 @@ github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiu github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= -github.com/golang/snappy v0.0.3 h1:fHPg5GQYlCeLIPB9BZqMVR5nR9A+IM5zcgeTdjMYmLA= github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= +github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.1 h1:gK4Kx5IaGY9CD5sPJ36FHiBJ6ZXl0kilRiiCj+jdYp4= @@ -364,8 +394,9 @@ github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= @@ -389,9 +420,11 @@ github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLe github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.5.0 h1:1p67kYwdtXjb0gL0BPiP1Av9wiZPo5A8z2cWkTZ+eyU= +github.com/google/uuid v1.5.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/enterprise-certificate-proxy v0.0.0-20220520183353-fd19c99a87aa/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= github.com/googleapis/enterprise-certificate-proxy v0.1.0/go.mod h1:17drOmN3MwGY7t0e+Ei9b45FFGA3fBs3x36SsCg1hq8= github.com/googleapis/enterprise-certificate-proxy v0.2.0/go.mod h1:8C0jb7/mgJe/9KK8Lm7X9ctZC2t60YyIpYEI16jx0Qg= @@ -410,10 +443,6 @@ github.com/googleapis/gax-go/v2 v2.7.1 h1:gF4c0zjUP2H/s/hEGyLA3I0fA2ZWjzYiONAD6c github.com/googleapis/gax-go/v2 v2.7.1/go.mod h1:4orTrqY6hXxxaUL4LHIPl6lGo8vAE38/qKbhSAKP6QI= github.com/googleapis/go-type-adapters v1.0.0/go.mod h1:zHW75FOG2aur7gAO2B+MLby+cLsWGBF62rFAi7WjWO4= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= -github.com/hashicorp/consul/api v1.10.1-0.20240122152324-758ddf84e9c9 h1:qaS6rE768dt5hGPl2y4DIABXF4eA23BNSmWFpEr3kWQ= -github.com/hashicorp/consul/api v1.10.1-0.20240122152324-758ddf84e9c9/go.mod h1:gInwZGrnWlE1Vvq6rSD5pUf6qwNa69NTLLknbdwQRUk= -github.com/hashicorp/consul/api v1.10.1-0.20240209045659-981288e4082a h1:j2KLnImjuFUjhYK7Ly63dMVW7GWRFuPn5L1RIFoDye0= -github.com/hashicorp/consul/api v1.10.1-0.20240209045659-981288e4082a/go.mod h1:gInwZGrnWlE1Vvq6rSD5pUf6qwNa69NTLLknbdwQRUk= github.com/hashicorp/consul/api v1.10.1-0.20240209095413-ae9fb4c83d42 h1:72SNfzBZccnJQ6diaGmUT6vHHzG5lcb4GiYAaED9kcM= github.com/hashicorp/consul/api v1.10.1-0.20240209095413-ae9fb4c83d42/go.mod h1:XOFRmXaFsTMJIU9jGh0iZQs54SizswiA7lIGfOOX0j0= github.com/hashicorp/consul/proto-public v0.1.2-0.20240208173503-e72afa654d22 h1:PQQfwXeitSSyeXffKDTB/pOpxOKodgXEiNYcEFpgEMI= @@ -499,14 +528,18 @@ github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKe github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= github.com/hashicorp/yamux v0.0.0-20211028200310-0bc27b27de87 h1:xixZ2bWeofWV68J+x6AzmKuVM/JWCQwkWm6GW/MUR6I= github.com/hashicorp/yamux v0.0.0-20211028200310-0bc27b27de87/go.mod h1:CtWFDAQgb7dxtzFs4tWbplKIe2jSi3+5vKbgIO0SLnQ= -github.com/huandu/xstrings v1.3.2 h1:L18LIDzqlW6xN2rEkpdV8+oL/IXWJ1APd+vsdYy4Wdw= +github.com/huandu/xstrings v1.3.1/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/huandu/xstrings v1.3.2/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= +github.com/huandu/xstrings v1.3.3 h1:/Gcsuc1x8JVbJ9/rlye4xZnVAbEkGauT8lbebqcQws4= +github.com/huandu/xstrings v1.3.3/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= -github.com/imdario/mergo v0.3.13 h1:lFzP57bqS/wsqKssCGmtLAb8A0wKjLGrve2q3PPVcBk= -github.com/imdario/mergo v0.3.13/go.mod h1:4lJ1jqUDcsbIECGy0RUJAXNIhg+6ocWgb1ALK2O4oXg= +github.com/imdario/mergo v0.3.15 h1:M8XP7IuFNsqUx6VPK2P9OSmsYsI/YFaGil0uD21V3dM= +github.com/imdario/mergo v0.3.15/go.mod h1:WBLT9ZmE3lPoWsEzCh9LPo3TiwVN+ZKEjmz+hD27ysY= +github.com/invopop/yaml v0.2.0 h1:7zky/qH+O0DwAyoobXUqvVBwgBFRxKoQ/3FjcVpjTMY= +github.com/invopop/yaml v0.2.0/go.mod h1:2XuRLgs/ouIrW3XNzuNj7J3Nvu/Dig5MXvbCEdiBN3Q= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo= github.com/jessevdk/go-flags v1.5.0/go.mod h1:Fw0T6WPc1dYxT4mKEZRfG5kJhaTDP9pj1c2EWnYs/m4= @@ -517,20 +550,25 @@ github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9Y github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8= github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= +github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= +github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= +github.com/juju/gnuflag v0.0.0-20171113085948-2ce1bb71843d/go.mod h1:2PavIy+JPciBPrBUjwbNvtwB6RQlve+hkpll6QSNmOE= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= -github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351 h1:DowS9hvgyYSX4TO5NpyC606/Z4SxnNYbT+WX27or6Ck= github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= +github.com/kevinburke/ssh_config v1.2.0 h1:x584FjTGwHzMwvHx18PXxbBVzfnxogHaAReU4gf13a4= +github.com/kevinburke/ssh_config v1.2.0/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= github.com/keybase/go-crypto v0.0.0-20161004153544-93f5b35093ba/go.mod h1:ghbZscTyKdM07+Fw3KSi0hcJm+AlEUWj8QLlPtijN/M= github.com/keybase/go-crypto v0.0.0-20180614160407-5114a9a81e1b h1:VE6r2OwP5gj+Z9aCkSKl3MlmnZbfMAjhvR5T7abKHEo= github.com/keybase/go-crypto v0.0.0-20180614160407-5114a9a81e1b/go.mod h1:ghbZscTyKdM07+Fw3KSi0hcJm+AlEUWj8QLlPtijN/M= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.11.2/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= -github.com/klauspost/compress v1.15.11 h1:Lcadnb3RKGin4FYM/orgq0qde+nc15E5Cbqg4B9Sx9c= github.com/klauspost/compress v1.15.11/go.mod h1:QPwzmACJjUTFsnSHH934V6woptycfrDDJnH7hvFVbGM= +github.com/klauspost/compress v1.16.7 h1:2mk3MPGNzKyxErAw8YaohYh69+pa4sIQSC0fPGCFR9I= +github.com/klauspost/compress v1.16.7/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= @@ -544,6 +582,12 @@ github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= +github.com/labstack/echo/v4 v4.11.4 h1:vDZmA+qNeh1pd/cCkEicDMrjtrnMGQ1QFI9gWN1zGq8= +github.com/labstack/echo/v4 v4.11.4/go.mod h1:noh7EvLwqDsmh/X/HWKPUl1AjzJrhyptRyEbQJfxen8= +github.com/labstack/gommon v0.4.2 h1:F8qTUNXgG1+6WQmqoUWnz8WiEU60mXVVw0P4ht1WRA0= +github.com/labstack/gommon v0.4.2/go.mod h1:QlUFxVM+SNXhDL/Z7YhocGIBYOiwB0mXm1+1bAPHPyU= +github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= +github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ= github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= @@ -560,20 +604,22 @@ github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOA github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= -github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPng= -github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= +github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= github.com/miekg/dns v1.1.41 h1:WMszZWJG0XmzbK9FEmzH2TVcqYzFesusSIB41b8KHxY= github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJysuI= github.com/mitchellh/cli v1.1.0/go.mod h1:xcISNoH86gajksDmfB23e/pu+B+GeFRMYmoHXxx3xhI= -github.com/mitchellh/cli v1.1.2 h1:PvH+lL2B7IQ101xQL63Of8yFS2y+aDlsFcsqNc+u/Kw= github.com/mitchellh/cli v1.1.2/go.mod h1:6iaV0fGdElS6dPBx0EApTxHrcWvmJphyh2n8YBLPPZ4= +github.com/mitchellh/cli v1.1.5 h1:OxRIeJXpAMztws/XHlN2vu6imG5Dpq+j61AzAX5fLng= +github.com/mitchellh/cli v1.1.5/go.mod h1:v8+iFts2sPIKUV1ltktPXMCC8fumSKFItNcD2cLtRR4= github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db h1:62I3jR2EmQ4l5rM/4FEfDWcRD+abF5XlKShorW5LRoQ= github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db/go.mod h1:l0dey0ia/Uv7NcFFVbCLtqEBQbrT4OCwCSKTEv6enCw= -github.com/mitchellh/copystructure v1.0.0 h1:Laisrj+bAB6b/yJwB5Bt3ITZhGJdqmxquMKeZ+mmkFQ= github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= +github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= +github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= @@ -590,22 +636,31 @@ github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= -github.com/mitchellh/reflectwalk v1.0.1 h1:FVzMWA5RllMAKIdUSC8mdWo3XtwoecrH79BY70sEEpE= github.com/mitchellh/reflectwalk v1.0.1/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= +github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= +github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 h1:RWengNIwukTxcDr9M+97sNutRR1RKhG96O6jWumTTnw= +github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= +github.com/oapi-codegen/runtime v1.1.1 h1:EXLHh0DXIJnWhdRPN2w4MXAzFyE4CskzhNLUmtpMYro= +github.com/oapi-codegen/runtime v1.1.1/go.mod h1:SK9X900oXmPWilYR5/WKPzt3Kqxn/uS/+lbpREv+eCg= github.com/oklog/run v1.0.0 h1:Ru7dDtJNOyC66gQ5dQmaCa0qIsAUFY3sFpK1Xk8igrw= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= github.com/pascaldekloe/goe v0.1.0 h1:cBOtyMzM9HTpWjXfbbunk26uA6nG3a8n06Wieeh0MwY= github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= +github.com/perimeterx/marshmallow v1.1.5 h1:a2LALqQ1BlHM8PZblsDdidgv1mWi1DgC2UmX50IvK2s= +github.com/perimeterx/marshmallow v1.1.5/go.mod h1:dsXbUu8CRzfYP5a87xpp0xq9S3u0Vchtcl8we9tYaXw= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pierrec/lz4 v2.5.2+incompatible h1:WCjObylUIOlKy/+7Abdn34TLIkXiA4UWUMhxq9m9ZXI= github.com/pierrec/lz4 v2.5.2+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= +github.com/pjbgf/sha1cd v0.3.0 h1:4D5XXmUUBUl/xQ6IjCkEAbqXskkq/4O7LmGn0AqMDs4= +github.com/pjbgf/sha1cd v0.3.0/go.mod h1:nZ1rrWOcGJ5uZgEEVL1VUM9iRQiZvWdbZjkKyFzPPsI= github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -633,8 +688,8 @@ github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+Gx github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= -github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= -github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= +github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= +github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529 h1:nn5Wsu0esKSJiIVhscUtVbo7ada43DJhG55ua/hjS5I= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= @@ -642,14 +697,23 @@ github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAm github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ= github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= +github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= +github.com/shopspring/decimal v1.3.1 h1:2Usl1nmF/WZucqkFZhnfFYxxxu8LG21F6nPQBE5gKV8= +github.com/shopspring/decimal v1.3.1/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMBDgk/93Q= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= +github.com/skeema/knownhosts v1.2.1 h1:SHWdIUa82uGZz+F+47k8SY4QhhI291cXCpopT1lK2AQ= +github.com/skeema/knownhosts v1.2.1/go.mod h1:xYbVRSPxqBZFrdmDyMmsOs+uX1UZC3nTN3ThzgDxUwo= github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.2.2 h1:5jhuqJyZCZf2JRofRvN/nIFgIWNzPa3/Vz8mYylgbWc= github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= +github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= +github.com/spf13/cast v1.5.0 h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w= +github.com/spf13/cast v1.5.0/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155UU= github.com/spf13/pflag v1.0.2/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/spkg/bom v0.0.0-20160624110644-59b7046e48ad/go.mod h1:qLr4V1qq6nMqFKkMo8ZTx3f+BZEkzsRUY10Xsm2mwU0= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= @@ -665,19 +729,28 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.3 h1:RP3t2pwF7cMEbC1dqtB6poj3niw/9gnV4Cjg5oW5gtY= -github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= +github.com/ugorji/go/codec v1.2.11 h1:BMaWp1Bb6fHwEtbplGBGJ498wD+LKlNSl25MjdZY4dU= +github.com/ugorji/go/codec v1.2.11/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= github.com/ulikunitz/xz v0.5.8/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= github.com/ulikunitz/xz v0.5.10 h1:t92gobL9l3HE202wg3rlk19F6X+JOxl9BBrCCMYEYd8= github.com/ulikunitz/xz v0.5.10/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= +github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= +github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= +github.com/valyala/fasttemplate v1.2.2 h1:lxLXG0uE3Qnshl9QyaK6XJxMXlQZELvChBOCmQD0Loo= +github.com/valyala/fasttemplate v1.2.2/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= github.com/vmihailenco/msgpack v3.3.3+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= -github.com/vmihailenco/msgpack/v4 v4.3.12 h1:07s4sz9IReOgdikxLTKNbBdqDMLsjPKXwvCazn8G65U= github.com/vmihailenco/msgpack/v4 v4.3.12/go.mod h1:gborTTJjAo/GWTqqRjrLCn9pgNN+NXzzngzBKDPIqw4= -github.com/vmihailenco/tagparser v0.1.1 h1:quXMXlA39OCbd2wAdTsGDlK9RkOk6Wuw+x37wVyIuWY= +github.com/vmihailenco/msgpack/v5 v5.3.5 h1:5gO0H1iULLWGhs2H5tbAHIZTV8/cYafcFOr9znI5mJU= +github.com/vmihailenco/msgpack/v5 v5.3.5/go.mod h1:7xyJ9e+0+9SaZT0Wt1RGleJXzli6Q/V5KbhBonMG9jc= github.com/vmihailenco/tagparser v0.1.1/go.mod h1:OeAg3pn3UbLjkWt+rN9oFYB6u/cQgqMEUPoW2WPyhdI= -github.com/xanzy/ssh-agent v0.3.0 h1:wUMzuKtKilRgBAD1sUb8gOwwRr2FGoBVumcjoOACClI= +github.com/vmihailenco/tagparser/v2 v2.0.0 h1:y09buUbR+b5aycVFQs/g70pqKVZNBmxwAhO7/IwNM9g= +github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds= github.com/xanzy/ssh-agent v0.3.0/go.mod h1:3s9xbODqPuuhK9JV1R321M/FlMZSBvE5aY6eAcqrDh0= +github.com/xanzy/ssh-agent v0.3.3 h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM= +github.com/xanzy/ssh-agent v0.3.3/go.mod h1:6dzNDKs0J9rVPHPhaGCukekBHKqfl+L3KghI1Bc68Uw= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -688,8 +761,9 @@ github.com/zclconf/go-cty v1.0.0/go.mod h1:xnAOWiHeOqg2nWS62VtQ7pbOu17FtxJNW8RLE github.com/zclconf/go-cty v1.1.0/go.mod h1:xnAOWiHeOqg2nWS62VtQ7pbOu17FtxJNW8RLEih+O3s= github.com/zclconf/go-cty v1.2.0/go.mod h1:hOPWgoHbaTUnI5k4D2ld+GRpFJSCe6bCM7m1q/N4PQ8= github.com/zclconf/go-cty v1.2.1/go.mod h1:hOPWgoHbaTUnI5k4D2ld+GRpFJSCe6bCM7m1q/N4PQ8= -github.com/zclconf/go-cty v1.8.2 h1:u+xZfBKgpycDnTNjPhGiTEYZS5qS/Sb5MqSfm7vzcjg= github.com/zclconf/go-cty v1.8.2/go.mod h1:vVKLxnk3puL4qRAv72AO+W99LUD4da90g3uUAzyuvAk= +github.com/zclconf/go-cty v1.14.1 h1:t9fyA35fwjjUMcmL5hLER+e/rEPqrbCK1/OSE4SI9KA= +github.com/zclconf/go-cty v1.14.1/go.mod h1:VvMs5i0vgZdhYawQNq5kePSpLAoz8u1xvZgrPIxfnZE= github.com/zclconf/go-cty-debug v0.0.0-20191215020915-b22d67c1ba0b/go.mod h1:ZRKQfBXbGkpdV6QMzT3rU1kSTAnfu1dO8dPKjYprgj8= github.com/zclconf/go-cty-yaml v1.0.2 h1:dNyg4QLTrv2IfJpm7Wtxi55ed5gLGOlPrZ6kMd51hY0= github.com/zclconf/go-cty-yaml v1.0.2/go.mod h1:IP3Ylp0wQpYm50IHK8OZWKMu6sPJIUgKa8XhiVHura0= @@ -711,12 +785,14 @@ golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200414173820-0848c9571904/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.14.0 h1:wBqGXzWJW6m1XrIKlAH0Hs1JJ7+9KBwnIO8v66Q9cHc= -golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf4= +golang.org/x/crypto v0.3.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= +golang.org/x/crypto v0.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k= +golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -755,6 +831,8 @@ golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= +golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0= +golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20180530234432-1e491301e022/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180811021610-c39426892332/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -810,8 +888,9 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.0.0-20220909164309-bea034e7d591/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.0.0-20221014081412-f15817d10f9b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= -golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= -golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= +golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= +golang.org/x/net v0.19.0 h1:zTwKpTd2XuCqf8huc7Fo2iSy+4RHPd10s4KzeTnVr1c= +golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -931,11 +1010,14 @@ golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1005,6 +1087,8 @@ golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= +golang.org/x/tools v0.13.0 h1:Iey4qkscZuv0VvIt8E0neZjtPVQFSc870HQ448QgEmQ= +golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -1232,8 +1316,8 @@ google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQ google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng= -google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= +google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/templates/data-sources/nodes.md b/templates/data-sources/nodes.md index cb54b934..ffd0ad9c 100644 --- a/templates/data-sources/nodes.md +++ b/templates/data-sources/nodes.md @@ -47,7 +47,7 @@ The `query_options` block supports the following: * `allow_stale` - (Optional) When `true`, the default, allow responses from Consul servers that are followers. -* `require_consistent` - (Optional) When `true` force the client to perform a +* `require_consistent` - (Optional) When `true` force the Client to perform a read on at least quorum servers and verify the result is the same. Defaults to `false`. @@ -57,7 +57,7 @@ The `query_options` block supports the following: * `wait_index` - (Optional) Index number used to enable blocking queries. -* `wait_time` - (Optional) Max time the client should wait for a blocking query +* `wait_time` - (Optional) Max time the Client should wait for a blocking query to return. ## Attributes Reference diff --git a/templates/data-sources/service.md b/templates/data-sources/service.md index 60082ab1..13388d11 100644 --- a/templates/data-sources/service.md +++ b/templates/data-sources/service.md @@ -55,7 +55,7 @@ The `query_options` block supports the following: * `allow_stale` - (Optional) When `true`, the default, allow responses from Consul servers that are followers. -* `require_consistent` - (Optional) When `true` force the client to perform a +* `require_consistent` - (Optional) When `true` force the Client to perform a read on at least quorum servers and verify the result is the same. Defaults to `false`. @@ -65,7 +65,7 @@ The `query_options` block supports the following: * `wait_index` - (Optional) Index number used to enable blocking queries. -* `wait_time` - (Optional) Max time the client should wait for a blocking query +* `wait_time` - (Optional) Max time the Client should wait for a blocking query to return. * `namespace` - (Optional, Enterprise Only) The namespace to lookup the service. diff --git a/templates/data-sources/services.md b/templates/data-sources/services.md index 7691c90c..20641ee4 100644 --- a/templates/data-sources/services.md +++ b/templates/data-sources/services.md @@ -50,7 +50,7 @@ The `query_options` block supports the following: * `allow_stale` - (Optional) When `true`, the default, allow responses from Consul servers that are followers. -* `require_consistent` - (Optional) When `true` force the client to perform a +* `require_consistent` - (Optional) When `true` force the Client to perform a read on at least quorum servers and verify the result is the same. Defaults to `false`. @@ -60,7 +60,7 @@ The `query_options` block supports the following: * `wait_index` - (Optional) Index number used to enable blocking queries. -* `wait_time` - (Optional) Max time the client should wait for a blocking query +* `wait_time` - (Optional) Max time the Client should wait for a blocking query to return. * `namespace` - (Optional, Enterprise Only) The namespace to lookup the services.