diff --git a/.github/workflows/bump-version.yaml b/.github/workflows/bump-version.yaml index 2746d07..4262bdd 100644 --- a/.github/workflows/bump-version.yaml +++ b/.github/workflows/bump-version.yaml @@ -36,7 +36,7 @@ jobs: repo: speakeasy cli_name: speakeasy package_type: zip - version: 1.455.6 # renovate: datasource=github-releases depName=speakeasy-api/speakeasy + version: 1.455.7 # renovate: datasource=github-releases depName=speakeasy-api/speakeasy - name: Checkout uses: actions/checkout@v4 diff --git a/.github/workflows/generate_on_pr.yaml b/.github/workflows/generate_on_pr.yaml index 4a3b056..9e04045 100644 --- a/.github/workflows/generate_on_pr.yaml +++ b/.github/workflows/generate_on_pr.yaml @@ -47,7 +47,7 @@ jobs: repo: speakeasy cli_name: speakeasy package_type: zip - version: 1.455.6 # renovate: datasource=github-releases depName=speakeasy-api/speakeasy + version: 1.455.7 # renovate: datasource=github-releases depName=speakeasy-api/speakeasy - name: Checkout current repo uses: actions/checkout@v4 diff --git a/.speakeasy/gen.lock b/.speakeasy/gen.lock index be80476..e65b5e0 100755 --- a/.speakeasy/gen.lock +++ b/.speakeasy/gen.lock @@ -3,15 +3,15 @@ id: b81e5def-5b1e-4753-ae7c-0efccc2e6f61 management: docChecksum: e7f0997368d05f4181c30c542b81c1b8 docVersion: 0.0.1 - speakeasyVersion: 1.455.1 - generationVersion: 2.479.3 - releaseVersion: 0.1.12 - configChecksum: 8969566b3caede08d8673179ed758403 + speakeasyVersion: 1.455.7 + generationVersion: 2.480.1 + releaseVersion: 0.1.13 + configChecksum: 2eb0a814765f2c0824d21f551f48825e features: go: additionalDependencies: 0.1.0 constsAndDefaults: 0.1.6 - core: 3.6.0 + core: 3.6.2 deepObjectParams: 0.1.1 defaultEnabledRetries: 0.2.0 envVarSecurityUsage: 0.3.2 diff --git a/.speakeasy/gen.yaml b/.speakeasy/gen.yaml index 6e8d57e..f746954 100755 --- a/.speakeasy/gen.yaml +++ b/.speakeasy/gen.yaml @@ -13,7 +13,7 @@ generation: oAuth2ClientCredentialsEnabled: false oAuth2PasswordEnabled: false go: - version: 0.1.12 + version: 0.1.13 additionalDependencies: {} allowUnknownFieldsInWeakUnions: false clientServerStatusCodesAsErrors: true diff --git a/acls.go b/acls.go index c23dee4..4b4298b 100644 --- a/acls.go +++ b/acls.go @@ -47,7 +47,12 @@ func (s *ACLs) ListACL(ctx context.Context, request operations.ListACLRequest, o } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/acls", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -268,7 +273,12 @@ func (s *ACLs) GetACL(ctx context.Context, aclID string, controlPlaneID string, } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/acls/{ACLId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -482,7 +492,12 @@ func (s *ACLs) ListACLWithConsumer(ctx context.Context, request operations.ListA } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/consumers/{ConsumerIdForNestedEntities}/acls", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -677,7 +692,12 @@ func (s *ACLs) CreateACLWithConsumer(ctx context.Context, request operations.Cre } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/consumers/{ConsumerIdForNestedEntities}/acls", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -874,7 +894,12 @@ func (s *ACLs) DeleteACLWithConsumer(ctx context.Context, request operations.Del } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/consumers/{ConsumerIdForNestedEntities}/acls/{ACLId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -1045,7 +1070,12 @@ func (s *ACLs) GetACLWithConsumer(ctx context.Context, request operations.GetACL } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/consumers/{ConsumerIdForNestedEntities}/acls/{ACLId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -1238,7 +1268,12 @@ func (s *ACLs) UpsertACLWithConsumer(ctx context.Context, request operations.Ups } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/consumers/{ConsumerIdForNestedEntities}/acls/{ACLId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) diff --git a/apikeys.go b/apikeys.go index 5739619..841ae58 100644 --- a/apikeys.go +++ b/apikeys.go @@ -47,7 +47,12 @@ func (s *APIKeys) ListKeyAuthWithConsumer(ctx context.Context, request operation } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/consumers/{ConsumerIdForNestedEntities}/key-auth", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -242,7 +247,12 @@ func (s *APIKeys) CreateKeyAuthWithConsumer(ctx context.Context, request operati } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/consumers/{ConsumerIdForNestedEntities}/key-auth", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -439,7 +449,12 @@ func (s *APIKeys) DeleteKeyAuthWithConsumer(ctx context.Context, request operati } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/consumers/{ConsumerIdForNestedEntities}/key-auth/{KeyAuthId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -610,7 +625,12 @@ func (s *APIKeys) GetKeyAuthWithConsumer(ctx context.Context, request operations } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/consumers/{ConsumerIdForNestedEntities}/key-auth/{KeyAuthId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -803,7 +823,12 @@ func (s *APIKeys) UpsertKeyAuthWithConsumer(ctx context.Context, request operati } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/consumers/{ConsumerIdForNestedEntities}/key-auth/{KeyAuthId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -1000,7 +1025,12 @@ func (s *APIKeys) ListKeyAuth(ctx context.Context, request operations.ListKeyAut } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/key-auths", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -1221,7 +1251,12 @@ func (s *APIKeys) GetKeyAuth(ctx context.Context, keyAuthID string, controlPlane } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/key-auths/{KeyAuthId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) diff --git a/authentication.go b/authentication.go index 268b758..989c93f 100644 --- a/authentication.go +++ b/authentication.go @@ -41,7 +41,6 @@ func (s *Authentication) AuthenticateSso(ctx context.Context, organizationLoginP o := operations.Options{} supportedOptions := []string{ - operations.SupportedOptionServerURL, operations.SupportedOptionRetries, operations.SupportedOptionTimeout, } diff --git a/authsettings.go b/authsettings.go index e637752..c89d58d 100644 --- a/authsettings.go +++ b/authsettings.go @@ -38,7 +38,6 @@ func (s *AuthSettings) GetAuthenticationSettings(ctx context.Context, opts ...op o := operations.Options{} supportedOptions := []string{ - operations.SupportedOptionServerURL, operations.SupportedOptionRetries, operations.SupportedOptionTimeout, } @@ -255,7 +254,6 @@ func (s *AuthSettings) UpdateAuthenticationSettings(ctx context.Context, request o := operations.Options{} supportedOptions := []string{ - operations.SupportedOptionServerURL, operations.SupportedOptionRetries, operations.SupportedOptionTimeout, } @@ -501,7 +499,6 @@ func (s *AuthSettings) GetIdpConfiguration(ctx context.Context, opts ...operatio o := operations.Options{} supportedOptions := []string{ - operations.SupportedOptionServerURL, operations.SupportedOptionRetries, operations.SupportedOptionTimeout, } @@ -781,7 +778,6 @@ func (s *AuthSettings) UpdateIdpConfiguration(ctx context.Context, request *comp o := operations.Options{} supportedOptions := []string{ - operations.SupportedOptionServerURL, operations.SupportedOptionRetries, operations.SupportedOptionTimeout, } @@ -1033,7 +1029,6 @@ func (s *AuthSettings) GetTeamGroupMappings(ctx context.Context, pageSize *int64 o := operations.Options{} supportedOptions := []string{ - operations.SupportedOptionServerURL, operations.SupportedOptionRetries, operations.SupportedOptionTimeout, } @@ -1301,7 +1296,6 @@ func (s *AuthSettings) PatchTeamGroupMappings(ctx context.Context, request *comp o := operations.Options{} supportedOptions := []string{ - operations.SupportedOptionServerURL, operations.SupportedOptionRetries, operations.SupportedOptionTimeout, } @@ -1566,7 +1560,6 @@ func (s *AuthSettings) UpdateIdpTeamMappings(ctx context.Context, request *compo o := operations.Options{} supportedOptions := []string{ - operations.SupportedOptionServerURL, operations.SupportedOptionRetries, operations.SupportedOptionTimeout, } @@ -1857,7 +1850,6 @@ func (s *AuthSettings) GetIdpTeamMappings(ctx context.Context, pageSize *int64, o := operations.Options{} supportedOptions := []string{ - operations.SupportedOptionServerURL, operations.SupportedOptionRetries, operations.SupportedOptionTimeout, } diff --git a/basicauthcredentials.go b/basicauthcredentials.go index 726b431..b4e89c5 100644 --- a/basicauthcredentials.go +++ b/basicauthcredentials.go @@ -47,7 +47,12 @@ func (s *BasicAuthCredentials) ListBasicAuth(ctx context.Context, request operat } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/basic-auths", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -268,7 +273,12 @@ func (s *BasicAuthCredentials) GetBasicAuth(ctx context.Context, basicAuthID str } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/basic-auths/{BasicAuthId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -482,7 +492,12 @@ func (s *BasicAuthCredentials) ListBasicAuthWithConsumer(ctx context.Context, re } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/consumers/{ConsumerIdForNestedEntities}/basic-auth", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -677,7 +692,12 @@ func (s *BasicAuthCredentials) CreateBasicAuthWithConsumer(ctx context.Context, } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/consumers/{ConsumerIdForNestedEntities}/basic-auth", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -874,7 +894,12 @@ func (s *BasicAuthCredentials) DeleteBasicAuthWithConsumer(ctx context.Context, } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/consumers/{ConsumerIdForNestedEntities}/basic-auth/{BasicAuthId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -1045,7 +1070,12 @@ func (s *BasicAuthCredentials) GetBasicAuthWithConsumer(ctx context.Context, req } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/consumers/{ConsumerIdForNestedEntities}/basic-auth/{BasicAuthId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -1238,7 +1268,12 @@ func (s *BasicAuthCredentials) UpsertBasicAuthWithConsumer(ctx context.Context, } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/consumers/{ConsumerIdForNestedEntities}/basic-auth/{BasicAuthId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) diff --git a/cacertificates.go b/cacertificates.go index 4be9dd1..34a75e2 100644 --- a/cacertificates.go +++ b/cacertificates.go @@ -49,7 +49,12 @@ func (s *CACertificates) ListCaCertificate(ctx context.Context, request operatio } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/ca_certificates", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -270,7 +275,12 @@ func (s *CACertificates) CreateCaCertificate(ctx context.Context, controlPlaneID } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/ca_certificates", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -493,7 +503,12 @@ func (s *CACertificates) DeleteCaCertificate(ctx context.Context, controlPlaneID } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/ca_certificates/{CACertificateId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -690,7 +705,12 @@ func (s *CACertificates) GetCaCertificate(ctx context.Context, caCertificateID s } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/ca_certificates/{CACertificateId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -904,7 +924,12 @@ func (s *CACertificates) UpsertCaCertificate(ctx context.Context, request operat } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/ca_certificates/{CACertificateId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) diff --git a/certificates.go b/certificates.go index 67371b5..762d8ae 100644 --- a/certificates.go +++ b/certificates.go @@ -52,7 +52,12 @@ func (s *Certificates) ListCertificate(ctx context.Context, request operations.L } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/certificates", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -273,7 +278,12 @@ func (s *Certificates) CreateCertificate(ctx context.Context, controlPlaneID str } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/certificates", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -496,7 +506,12 @@ func (s *Certificates) DeleteCertificate(ctx context.Context, controlPlaneID str } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/certificates/{CertificateId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -693,7 +708,12 @@ func (s *Certificates) GetCertificate(ctx context.Context, certificateID string, } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/certificates/{CertificateId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -907,7 +927,12 @@ func (s *Certificates) UpsertCertificate(ctx context.Context, request operations } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/certificates/{CertificateId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) diff --git a/consumergroups.go b/consumergroups.go index 9536431..314d6b3 100644 --- a/consumergroups.go +++ b/consumergroups.go @@ -49,7 +49,12 @@ func (s *ConsumerGroups) ListConsumerGroup(ctx context.Context, request operatio } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/consumer_groups", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -270,7 +275,12 @@ func (s *ConsumerGroups) CreateConsumerGroup(ctx context.Context, controlPlaneID } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/consumer_groups", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -493,7 +503,12 @@ func (s *ConsumerGroups) DeleteConsumerGroup(ctx context.Context, controlPlaneID } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/consumer_groups/{ConsumerGroupId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -690,7 +705,12 @@ func (s *ConsumerGroups) GetConsumerGroup(ctx context.Context, consumerGroupID s } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/consumer_groups/{ConsumerGroupId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -904,7 +924,12 @@ func (s *ConsumerGroups) UpsertConsumerGroup(ctx context.Context, request operat } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/consumer_groups/{ConsumerGroupId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -1127,7 +1152,12 @@ func (s *ConsumerGroups) RemoveAllConsumersFromConsumerGroup(ctx context.Context } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/consumer_groups/{ConsumerGroupId}/consumers", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -1300,7 +1330,12 @@ func (s *ConsumerGroups) ListConsumersForConsumerGroup(ctx context.Context, requ } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/consumer_groups/{ConsumerGroupId}/consumers", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -1495,7 +1530,12 @@ func (s *ConsumerGroups) AddConsumerToGroup(ctx context.Context, request operati } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/consumer_groups/{ConsumerGroupId}/consumers", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -1692,7 +1732,12 @@ func (s *ConsumerGroups) RemoveConsumerFromGroup(ctx context.Context, request op } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/consumer_groups/{ConsumerGroupId}/consumers/{ConsumerId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -1868,7 +1913,12 @@ func (s *ConsumerGroups) RemoveConsumerFromAllConsumerGroups(ctx context.Context } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/consumers/{ConsumerId}/consumer_groups", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -2041,7 +2091,12 @@ func (s *ConsumerGroups) ListConsumerGroupsForConsumer(ctx context.Context, requ } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/consumers/{ConsumerId}/consumer_groups", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -2236,7 +2291,12 @@ func (s *ConsumerGroups) AddConsumerToSpecificConsumerGroup(ctx context.Context, } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/consumers/{ConsumerId}/consumer_groups", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -2433,7 +2493,12 @@ func (s *ConsumerGroups) RemoveConsumerFromConsumerGroup(ctx context.Context, re } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/consumers/{ConsumerId}/consumer_groups/{ConsumerGroupId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) diff --git a/consumers.go b/consumers.go index 77c2b30..d148f9f 100644 --- a/consumers.go +++ b/consumers.go @@ -49,7 +49,12 @@ func (s *Consumers) ListConsumer(ctx context.Context, request operations.ListCon } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/consumers", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -270,7 +275,12 @@ func (s *Consumers) CreateConsumer(ctx context.Context, controlPlaneID string, c } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/consumers", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -493,7 +503,12 @@ func (s *Consumers) DeleteConsumer(ctx context.Context, controlPlaneID string, c } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/consumers/{ConsumerId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -690,7 +705,12 @@ func (s *Consumers) GetConsumer(ctx context.Context, consumerID string, controlP } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/consumers/{ConsumerId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -904,7 +924,12 @@ func (s *Consumers) UpsertConsumer(ctx context.Context, request operations.Upser } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/consumers/{ConsumerId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) diff --git a/controlplanegroups.go b/controlplanegroups.go index d44fc21..d5a76cc 100644 --- a/controlplanegroups.go +++ b/controlplanegroups.go @@ -51,7 +51,12 @@ func (s *ControlPlaneGroups) GetControlPlanesIDGroupMemberStatus(ctx context.Con } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{id}/group-member-status", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -347,7 +352,12 @@ func (s *ControlPlaneGroups) GetControlPlanesIDGroupMemberships(ctx context.Cont } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{id}/group-memberships", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -652,7 +662,12 @@ func (s *ControlPlaneGroups) PutControlPlanesIDGroupMemberships(ctx context.Cont } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{id}/group-memberships", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -939,7 +954,12 @@ func (s *ControlPlaneGroups) PostControlPlanesIDGroupMembershipsAdd(ctx context. } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{id}/group-memberships/add", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -1226,7 +1246,12 @@ func (s *ControlPlaneGroups) PostControlPlanesIDGroupMembershipsRemove(ctx conte } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{id}/group-memberships/remove", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -1512,7 +1537,12 @@ func (s *ControlPlaneGroups) GetControlPlanesIDGroupStatus(ctx context.Context, } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{id}/group-status", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) diff --git a/controlplanes.go b/controlplanes.go index 8f91c22..c01db52 100644 --- a/controlplanes.go +++ b/controlplanes.go @@ -48,7 +48,12 @@ func (s *ControlPlanes) ListControlPlanes(ctx context.Context, request operation } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := url.JoinPath(baseURL, "/v2/control-planes") if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -327,7 +332,12 @@ func (s *ControlPlanes) CreateControlPlane(ctx context.Context, request componen } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := url.JoinPath(baseURL, "/v2/control-planes") if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -654,7 +664,12 @@ func (s *ControlPlanes) GetControlPlane(ctx context.Context, id string, opts ... } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{id}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -955,7 +970,12 @@ func (s *ControlPlanes) UpdateControlPlane(ctx context.Context, id string, updat } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{id}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -1282,7 +1302,12 @@ func (s *ControlPlanes) DeleteControlPlane(ctx context.Context, id string, opts } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{id}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) diff --git a/custompluginschemas.go b/custompluginschemas.go index 2ff5904..6336263 100644 --- a/custompluginschemas.go +++ b/custompluginschemas.go @@ -48,7 +48,12 @@ func (s *CustomPluginSchemas) ListPluginSchemas(ctx context.Context, request ope } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/plugin-schemas", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -311,7 +316,12 @@ func (s *CustomPluginSchemas) CreatePluginSchemas(ctx context.Context, controlPl } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/plugin-schemas", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -597,7 +607,12 @@ func (s *CustomPluginSchemas) GetPluginSchema(ctx context.Context, controlPlaneI } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/plugin-schemas/{name}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -856,7 +871,12 @@ func (s *CustomPluginSchemas) DeletePluginSchemas(ctx context.Context, controlPl } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/plugin-schemas/{name}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -1090,7 +1110,12 @@ func (s *CustomPluginSchemas) UpdatePluginSchemas(ctx context.Context, request o } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/plugin-schemas/{name}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) diff --git a/dpcertificates.go b/dpcertificates.go index 544741c..525d749 100644 --- a/dpcertificates.go +++ b/dpcertificates.go @@ -52,7 +52,12 @@ func (s *DPCertificates) ListDpClientCertificates(ctx context.Context, controlPl } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/dp-client-certificates", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -248,7 +253,12 @@ func (s *DPCertificates) CreateDataplaneCertificate(ctx context.Context, control } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/dp-client-certificates", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -450,7 +460,12 @@ func (s *DPCertificates) GetDataplaneCertificate(ctx context.Context, controlPla } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/dp-client-certificates/{certificateId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -646,7 +661,12 @@ func (s *DPCertificates) DeleteDataplaneCertificate(ctx context.Context, control } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/dp-client-certificates/{certificateId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) diff --git a/dpnodes.go b/dpnodes.go index 086b901..9111b46 100644 --- a/dpnodes.go +++ b/dpnodes.go @@ -52,7 +52,12 @@ func (s *DPNodes) GetExpectedConfigHash(ctx context.Context, controlPlaneID stri } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/expected-config-hash", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -243,7 +248,12 @@ func (s *DPNodes) ListDataplaneNodes(ctx context.Context, request operations.Lis } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/nodes", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -438,7 +448,12 @@ func (s *DPNodes) GetNodesNodeID(ctx context.Context, request operations.GetNode } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/nodes/{nodeId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -638,7 +653,12 @@ func (s *DPNodes) DeleteNodesNodeID(ctx context.Context, nodeID string, controlP } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/nodes/{nodeId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -809,7 +829,12 @@ func (s *DPNodes) GetNodesEol(ctx context.Context, request operations.GetNodesEo } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/nodes/eol", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) diff --git a/hmacauthcredentials.go b/hmacauthcredentials.go index 9d20b8a..14edea4 100644 --- a/hmacauthcredentials.go +++ b/hmacauthcredentials.go @@ -47,7 +47,12 @@ func (s *HMACAuthCredentials) ListHmacAuthWithConsumer(ctx context.Context, requ } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/consumers/{ConsumerIdForNestedEntities}/hmac-auth", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -242,7 +247,12 @@ func (s *HMACAuthCredentials) CreateHmacAuthWithConsumer(ctx context.Context, re } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/consumers/{ConsumerIdForNestedEntities}/hmac-auth", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -439,7 +449,12 @@ func (s *HMACAuthCredentials) DeleteHmacAuthWithConsumer(ctx context.Context, re } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/consumers/{ConsumerIdForNestedEntities}/hmac-auth/{HMACAuthId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -610,7 +625,12 @@ func (s *HMACAuthCredentials) GetHmacAuthWithConsumer(ctx context.Context, reque } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/consumers/{ConsumerIdForNestedEntities}/hmac-auth/{HMACAuthId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -803,7 +823,12 @@ func (s *HMACAuthCredentials) UpsertHmacAuthWithConsumer(ctx context.Context, re } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/consumers/{ConsumerIdForNestedEntities}/hmac-auth/{HMACAuthId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -1000,7 +1025,12 @@ func (s *HMACAuthCredentials) ListHmacAuth(ctx context.Context, request operatio } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/hmac-auths", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -1221,7 +1251,12 @@ func (s *HMACAuthCredentials) GetHmacAuth(ctx context.Context, hmacAuthID string } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/hmac-auths/{HMACAuthId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) diff --git a/impersonationsettings.go b/impersonationsettings.go index 9806e92..31ed5dd 100644 --- a/impersonationsettings.go +++ b/impersonationsettings.go @@ -38,7 +38,6 @@ func (s *ImpersonationSettings) GetImpersonationSettings(ctx context.Context, op o := operations.Options{} supportedOptions := []string{ - operations.SupportedOptionServerURL, operations.SupportedOptionRetries, operations.SupportedOptionTimeout, } @@ -276,7 +275,6 @@ func (s *ImpersonationSettings) UpdateImpersonationSettings(ctx context.Context, o := operations.Options{} supportedOptions := []string{ - operations.SupportedOptionServerURL, operations.SupportedOptionRetries, operations.SupportedOptionTimeout, } diff --git a/internal/utils/requestbody.go b/internal/utils/requestbody.go index 000226e..78479c6 100644 --- a/internal/utils/requestbody.go +++ b/internal/utils/requestbody.go @@ -166,7 +166,7 @@ func encodeMultipartFormData(w io.Writer, data interface{}) (string, error) { tag := parseMultipartFormTag(field) if tag.File { - if err := encodeMultipartFormDataFile(writer, fieldType, valType); err != nil { + if err := encodeMultipartFormDataFile(writer, tag.Name, fieldType, valType); err != nil { writer.Close() return "", err } @@ -211,12 +211,11 @@ func encodeMultipartFormData(w io.Writer, data interface{}) (string, error) { return writer.FormDataContentType(), nil } -func encodeMultipartFormDataFile(w *multipart.Writer, fieldType reflect.Type, valType reflect.Value) error { +func encodeMultipartFormDataFile(w *multipart.Writer, fieldName string, fieldType reflect.Type, valType reflect.Value) error { if fieldType.Kind() != reflect.Struct { return fmt.Errorf("invalid type %s for multipart/form-data file", valType.Type()) } - var fieldName string var fileName string var reader io.Reader @@ -236,12 +235,11 @@ func encodeMultipartFormDataFile(w *multipart.Writer, fieldType reflect.Type, va reader = val.Interface().(io.Reader) } } else { - fieldName = tag.Name fileName = val.String() } } - if fieldName == "" || fileName == "" || reader == nil { + if fileName == "" || reader == nil { return fmt.Errorf("invalid multipart/form-data file") } diff --git a/invites.go b/invites.go index d7d2e27..aa903fe 100644 --- a/invites.go +++ b/invites.go @@ -38,7 +38,6 @@ func (s *Invites) InviteUser(ctx context.Context, request *components.InviteUser o := operations.Options{} supportedOptions := []string{ - operations.SupportedOptionServerURL, operations.SupportedOptionRetries, operations.SupportedOptionTimeout, } diff --git a/jwts.go b/jwts.go index 88bf385..241a21a 100644 --- a/jwts.go +++ b/jwts.go @@ -47,7 +47,12 @@ func (s *JWTs) ListJwtWithConsumer(ctx context.Context, request operations.ListJ } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/consumers/{ConsumerIdForNestedEntities}/jwt", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -242,7 +247,12 @@ func (s *JWTs) CreateJwtWithConsumer(ctx context.Context, request operations.Cre } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/consumers/{ConsumerIdForNestedEntities}/jwt", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -439,7 +449,12 @@ func (s *JWTs) DeleteJwtWithConsumer(ctx context.Context, request operations.Del } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/consumers/{ConsumerIdForNestedEntities}/jwt/{JWTId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -610,7 +625,12 @@ func (s *JWTs) GetJwtWithConsumer(ctx context.Context, request operations.GetJwt } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/consumers/{ConsumerIdForNestedEntities}/jwt/{JWTId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -803,7 +823,12 @@ func (s *JWTs) UpsertJwtWithConsumer(ctx context.Context, request operations.Ups } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/consumers/{ConsumerIdForNestedEntities}/jwt/{JWTId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -1000,7 +1025,12 @@ func (s *JWTs) ListJwt(ctx context.Context, request operations.ListJwtRequest, o } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/jwts", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -1221,7 +1251,12 @@ func (s *JWTs) GetJwt(ctx context.Context, jwtID string, controlPlaneID string, } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/jwts/{JWTId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) diff --git a/keys.go b/keys.go index 96ecbc3..c389256 100644 --- a/keys.go +++ b/keys.go @@ -48,7 +48,12 @@ func (s *Keys) ListKeyWithKeySet(ctx context.Context, request operations.ListKey } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/key-sets/{KeySetId}/keys", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -243,7 +248,12 @@ func (s *Keys) CreateKeyWithKeySet(ctx context.Context, request operations.Creat } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/key-sets/{KeySetId}/keys", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -440,7 +450,12 @@ func (s *Keys) DeleteKeyWithKeySet(ctx context.Context, request operations.Delet } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/key-sets/{KeySetId}/keys/{KeyId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -611,7 +626,12 @@ func (s *Keys) GetKeyWithKeySet(ctx context.Context, request operations.GetKeyWi } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/key-sets/{KeySetId}/keys/{KeyId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -804,7 +824,12 @@ func (s *Keys) UpsertKeyWithKeySet(ctx context.Context, request operations.Upser } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/key-sets/{KeySetId}/keys/{KeyId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -1001,7 +1026,12 @@ func (s *Keys) ListKey(ctx context.Context, request operations.ListKeyRequest, o } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/keys", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -1222,7 +1252,12 @@ func (s *Keys) CreateKey(ctx context.Context, controlPlaneID string, key compone } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/keys", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -1445,7 +1480,12 @@ func (s *Keys) DeleteKey(ctx context.Context, controlPlaneID string, keyID strin } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/keys/{KeyId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -1642,7 +1682,12 @@ func (s *Keys) GetKey(ctx context.Context, keyID string, controlPlaneID string, } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/keys/{KeyId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -1856,7 +1901,12 @@ func (s *Keys) UpsertKey(ctx context.Context, request operations.UpsertKeyReques } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/keys/{KeyId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) diff --git a/keysets.go b/keysets.go index 0db7cfe..26d5caa 100644 --- a/keysets.go +++ b/keysets.go @@ -48,7 +48,12 @@ func (s *KeySets) ListKeySet(ctx context.Context, request operations.ListKeySetR } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/key-sets", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -269,7 +274,12 @@ func (s *KeySets) CreateKeySet(ctx context.Context, controlPlaneID string, keySe } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/key-sets", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -492,7 +502,12 @@ func (s *KeySets) DeleteKeySet(ctx context.Context, controlPlaneID string, keySe } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/key-sets/{KeySetId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -689,7 +704,12 @@ func (s *KeySets) GetKeySet(ctx context.Context, keySetID string, controlPlaneID } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/key-sets/{KeySetId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -903,7 +923,12 @@ func (s *KeySets) UpsertKeySet(ctx context.Context, request operations.UpsertKey } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/key-sets/{KeySetId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) diff --git a/me.go b/me.go index 325519c..e51fc6d 100644 --- a/me.go +++ b/me.go @@ -38,7 +38,6 @@ func (s *Me) GetOrganizationsMe(ctx context.Context, opts ...operations.Option) o := operations.Options{} supportedOptions := []string{ - operations.SupportedOptionServerURL, operations.SupportedOptionRetries, operations.SupportedOptionTimeout, } @@ -255,7 +254,6 @@ func (s *Me) GetUsersMe(ctx context.Context, opts ...operations.Option) (*operat o := operations.Options{} supportedOptions := []string{ - operations.SupportedOptionServerURL, operations.SupportedOptionRetries, operations.SupportedOptionTimeout, } diff --git a/models/operations/options.go b/models/operations/options.go index 7215e96..b956b0c 100644 --- a/models/operations/options.go +++ b/models/operations/options.go @@ -12,7 +12,6 @@ import ( var ErrUnsupportedOption = errors.New("unsupported option") const ( - SupportedOptionServerURL = "serverURL" SupportedOptionRetries = "retries" SupportedOptionTimeout = "timeout" SupportedOptionAcceptHeaderOverride = "acceptHeaderOverride" @@ -45,10 +44,6 @@ type Option func(*Options, ...string) error // WithServerURL allows providing an alternative server URL. func WithServerURL(serverURL string) Option { return func(opts *Options, supportedOptions ...string) error { - if !utils.Contains(supportedOptions, SupportedOptionServerURL) { - return ErrUnsupportedOption - } - opts.ServerURL = &serverURL return nil } @@ -57,10 +52,6 @@ func WithServerURL(serverURL string) Option { // WithTemplatedServerURL allows providing an alternative server URL with templated parameters. func WithTemplatedServerURL(serverURL string, params map[string]string) Option { return func(opts *Options, supportedOptions ...string) error { - if !utils.Contains(supportedOptions, SupportedOptionServerURL) { - return ErrUnsupportedOption - } - if params != nil { serverURL = utils.ReplaceParameters(serverURL, params) } diff --git a/mtlsauthcredentials.go b/mtlsauthcredentials.go index befc5a5..a0d845b 100644 --- a/mtlsauthcredentials.go +++ b/mtlsauthcredentials.go @@ -47,7 +47,12 @@ func (s *MTLSAuthCredentials) ListMtlsAuthWithConsumer(ctx context.Context, requ } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/consumers/{ConsumerIdForNestedEntities}/mtls-auth", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -242,7 +247,12 @@ func (s *MTLSAuthCredentials) CreateMtlsAuthWithConsumer(ctx context.Context, re } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/consumers/{ConsumerIdForNestedEntities}/mtls-auth", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -439,7 +449,12 @@ func (s *MTLSAuthCredentials) DeleteMtlsAuthWithConsumer(ctx context.Context, re } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/consumers/{ConsumerIdForNestedEntities}/mtls-auth/{MTLSAuthId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -610,7 +625,12 @@ func (s *MTLSAuthCredentials) GetMtlsAuthWithConsumer(ctx context.Context, reque } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/consumers/{ConsumerIdForNestedEntities}/mtls-auth/{MTLSAuthId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -803,7 +823,12 @@ func (s *MTLSAuthCredentials) UpsertMtlsAuthWithConsumer(ctx context.Context, re } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/consumers/{ConsumerIdForNestedEntities}/mtls-auth/{MTLSAuthId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -1000,7 +1025,12 @@ func (s *MTLSAuthCredentials) ListMtlsAuth(ctx context.Context, request operatio } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/mtls-auths", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -1221,7 +1251,12 @@ func (s *MTLSAuthCredentials) GetMtlsAuth(ctx context.Context, mtlsAuthID string } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/mtls-auths/{MTLSAuthId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) diff --git a/plugins.go b/plugins.go index da3b70c..0ce966f 100644 --- a/plugins.go +++ b/plugins.go @@ -53,7 +53,12 @@ func (s *Plugins) ListPluginWithConsumerGroup(ctx context.Context, request opera } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/consumer_groups/{ConsumerGroupId}/plugins", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -248,7 +253,12 @@ func (s *Plugins) CreatePluginWithConsumerGroup(ctx context.Context, request ope } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/consumer_groups/{ConsumerGroupId}/plugins", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -445,7 +455,12 @@ func (s *Plugins) DeletePluginWithConsumerGroup(ctx context.Context, request ope } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/consumer_groups/{ConsumerGroupId}/plugins/{PluginId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -616,7 +631,12 @@ func (s *Plugins) GetPluginWithConsumerGroup(ctx context.Context, request operat } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/consumer_groups/{ConsumerGroupId}/plugins/{PluginId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -809,7 +829,12 @@ func (s *Plugins) UpsertPluginWithConsumerGroup(ctx context.Context, request ope } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/consumer_groups/{ConsumerGroupId}/plugins/{PluginId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -1006,7 +1031,12 @@ func (s *Plugins) ListPluginWithConsumer(ctx context.Context, request operations } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/consumers/{ConsumerIdForNestedEntities}/plugins", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -1201,7 +1231,12 @@ func (s *Plugins) CreatePluginWithConsumer(ctx context.Context, request operatio } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/consumers/{ConsumerIdForNestedEntities}/plugins", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -1398,7 +1433,12 @@ func (s *Plugins) DeletePluginWithConsumer(ctx context.Context, request operatio } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/consumers/{ConsumerIdForNestedEntities}/plugins/{PluginId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -1569,7 +1609,12 @@ func (s *Plugins) GetPluginWithConsumer(ctx context.Context, request operations. } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/consumers/{ConsumerIdForNestedEntities}/plugins/{PluginId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -1762,7 +1807,12 @@ func (s *Plugins) UpsertPluginWithConsumer(ctx context.Context, request operatio } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/consumers/{ConsumerIdForNestedEntities}/plugins/{PluginId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -1959,7 +2009,12 @@ func (s *Plugins) ListPlugin(ctx context.Context, request operations.ListPluginR } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/plugins", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -2180,7 +2235,12 @@ func (s *Plugins) CreatePlugin(ctx context.Context, controlPlaneID string, plugi } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/plugins", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -2403,7 +2463,12 @@ func (s *Plugins) DeletePlugin(ctx context.Context, controlPlaneID string, plugi } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/plugins/{PluginId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -2600,7 +2665,12 @@ func (s *Plugins) GetPlugin(ctx context.Context, pluginID string, controlPlaneID } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/plugins/{PluginId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -2814,7 +2884,12 @@ func (s *Plugins) UpsertPlugin(ctx context.Context, request operations.UpsertPlu } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/plugins/{PluginId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -3032,7 +3107,12 @@ func (s *Plugins) ListPluginWithRoute(ctx context.Context, request operations.Li } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/routes/{RouteId}/plugins", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -3227,7 +3307,12 @@ func (s *Plugins) CreatePluginWithRoute(ctx context.Context, request operations. } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/routes/{RouteId}/plugins", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -3424,7 +3509,12 @@ func (s *Plugins) DeletePluginWithRoute(ctx context.Context, request operations. } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/routes/{RouteId}/plugins/{PluginId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -3595,7 +3685,12 @@ func (s *Plugins) GetPluginWithRoute(ctx context.Context, request operations.Get } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/routes/{RouteId}/plugins/{PluginId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -3788,7 +3883,12 @@ func (s *Plugins) UpsertPluginWithRoute(ctx context.Context, request operations. } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/routes/{RouteId}/plugins/{PluginId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -3990,7 +4090,12 @@ func (s *Plugins) FetchPluginSchema(ctx context.Context, pluginName string, cont } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/schemas/plugins/{pluginName}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -4181,7 +4286,12 @@ func (s *Plugins) ListPluginWithService(ctx context.Context, request operations. } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/services/{ServiceId}/plugins", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -4376,7 +4486,12 @@ func (s *Plugins) CreatePluginWithService(ctx context.Context, request operation } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/services/{ServiceId}/plugins", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -4573,7 +4688,12 @@ func (s *Plugins) DeletePluginWithService(ctx context.Context, request operation } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/services/{ServiceId}/plugins/{PluginId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -4744,7 +4864,12 @@ func (s *Plugins) GetPluginWithService(ctx context.Context, request operations.G } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/services/{ServiceId}/plugins/{PluginId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -4937,7 +5062,12 @@ func (s *Plugins) UpsertPluginWithService(ctx context.Context, request operation } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/services/{ServiceId}/plugins/{PluginId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) diff --git a/roles.go b/roles.go index b421b5e..8bdcc2a 100644 --- a/roles.go +++ b/roles.go @@ -38,7 +38,6 @@ func (s *Roles) GetPredefinedRoles(ctx context.Context, opts ...operations.Optio o := operations.Options{} supportedOptions := []string{ - operations.SupportedOptionServerURL, operations.SupportedOptionRetries, operations.SupportedOptionTimeout, } @@ -281,7 +280,6 @@ func (s *Roles) ListTeamRoles(ctx context.Context, teamID string, filter *operat o := operations.Options{} supportedOptions := []string{ - operations.SupportedOptionServerURL, operations.SupportedOptionRetries, operations.SupportedOptionTimeout, } @@ -570,7 +568,6 @@ func (s *Roles) TeamsAssignRole(ctx context.Context, teamID string, assignRole * o := operations.Options{} supportedOptions := []string{ - operations.SupportedOptionServerURL, operations.SupportedOptionRetries, operations.SupportedOptionTimeout, } @@ -882,7 +879,6 @@ func (s *Roles) TeamsRemoveRole(ctx context.Context, teamID string, roleID strin o := operations.Options{} supportedOptions := []string{ - operations.SupportedOptionServerURL, operations.SupportedOptionRetries, operations.SupportedOptionTimeout, } @@ -1147,7 +1143,6 @@ func (s *Roles) ListUserRoles(ctx context.Context, userID string, filter *operat o := operations.Options{} supportedOptions := []string{ - operations.SupportedOptionServerURL, operations.SupportedOptionRetries, operations.SupportedOptionTimeout, } @@ -1394,7 +1389,6 @@ func (s *Roles) UsersAssignRole(ctx context.Context, userID string, assignRole * o := operations.Options{} supportedOptions := []string{ - operations.SupportedOptionServerURL, operations.SupportedOptionRetries, operations.SupportedOptionTimeout, } @@ -1706,7 +1700,6 @@ func (s *Roles) UsersRemoveRole(ctx context.Context, userID string, roleID strin o := operations.Options{} supportedOptions := []string{ - operations.SupportedOptionServerURL, operations.SupportedOptionRetries, operations.SupportedOptionTimeout, } diff --git a/routes.go b/routes.go index 9479df6..2d2beb2 100644 --- a/routes.go +++ b/routes.go @@ -69,7 +69,12 @@ func (s *Routes) ListRoute(ctx context.Context, request operations.ListRouteRequ } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/routes", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -290,7 +295,12 @@ func (s *Routes) CreateRoute(ctx context.Context, controlPlaneID string, route c } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/routes", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -513,7 +523,12 @@ func (s *Routes) DeleteRoute(ctx context.Context, controlPlaneID string, routeID } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/routes/{RouteId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -710,7 +725,12 @@ func (s *Routes) GetRoute(ctx context.Context, routeID string, controlPlaneID st } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/routes/{RouteId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -924,7 +944,12 @@ func (s *Routes) UpsertRoute(ctx context.Context, request operations.UpsertRoute } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/routes/{RouteId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -1142,7 +1167,12 @@ func (s *Routes) ListRouteWithService(ctx context.Context, request operations.Li } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/services/{ServiceId}/routes", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -1337,7 +1367,12 @@ func (s *Routes) CreateRouteWithService(ctx context.Context, request operations. } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/services/{ServiceId}/routes", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -1534,7 +1569,12 @@ func (s *Routes) DeleteRouteWithService(ctx context.Context, request operations. } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/services/{ServiceId}/routes/{RouteId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -1705,7 +1745,12 @@ func (s *Routes) GetRouteWithService(ctx context.Context, request operations.Get } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/services/{ServiceId}/routes/{RouteId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -1898,7 +1943,12 @@ func (s *Routes) UpsertRouteWithService(ctx context.Context, request operations. } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/services/{ServiceId}/routes/{RouteId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) diff --git a/sdk.go b/sdk.go index 361abe2..569ec79 100644 --- a/sdk.go +++ b/sdk.go @@ -261,9 +261,9 @@ func New(opts ...SDKOption) *SDK { sdkConfiguration: sdkConfiguration{ Language: "go", OpenAPIDocVersion: "0.0.1", - SDKVersion: "0.1.12", - GenVersion: "2.479.3", - UserAgent: "speakeasy-sdk/go 0.1.12 2.479.3 0.0.1 github.com/Kong/sdk-konnect-go", + SDKVersion: "0.1.13", + GenVersion: "2.480.1", + UserAgent: "speakeasy-sdk/go 0.1.13 2.480.1 0.0.1 github.com/Kong/sdk-konnect-go", Hooks: hooks.New(), }, } diff --git a/services.go b/services.go index a9123e5..8e0d256 100644 --- a/services.go +++ b/services.go @@ -54,7 +54,12 @@ func (s *Services) ListService(ctx context.Context, request operations.ListServi } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/services", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -275,7 +280,12 @@ func (s *Services) CreateService(ctx context.Context, controlPlaneID string, ser } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/services", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -498,7 +508,12 @@ func (s *Services) DeleteService(ctx context.Context, controlPlaneID string, ser } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/services/{ServiceId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -695,7 +710,12 @@ func (s *Services) GetService(ctx context.Context, serviceID string, controlPlan } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/services/{ServiceId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -909,7 +929,12 @@ func (s *Services) UpsertService(ctx context.Context, request operations.UpsertS } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/services/{ServiceId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) diff --git a/snis.go b/snis.go index cbf5e4b..d368136 100644 --- a/snis.go +++ b/snis.go @@ -50,7 +50,12 @@ func (s *SNIs) ListSniWithCertificate(ctx context.Context, request operations.Li } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/certificates/{CertificateId}/snis", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -245,7 +250,12 @@ func (s *SNIs) CreateSniWithCertificate(ctx context.Context, request operations. } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/certificates/{CertificateId}/snis", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -442,7 +452,12 @@ func (s *SNIs) DeleteSniWithCertificate(ctx context.Context, request operations. } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/certificates/{CertificateId}/snis/{SNIId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -613,7 +628,12 @@ func (s *SNIs) GetSniWithCertificate(ctx context.Context, request operations.Get } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/certificates/{CertificateId}/snis/{SNIId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -806,7 +826,12 @@ func (s *SNIs) UpsertSniWithCertificate(ctx context.Context, request operations. } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/certificates/{CertificateId}/snis/{SNIId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -1003,7 +1028,12 @@ func (s *SNIs) ListSni(ctx context.Context, request operations.ListSniRequest, o } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/snis", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -1224,7 +1254,12 @@ func (s *SNIs) CreateSni(ctx context.Context, controlPlaneID string, sni compone } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/snis", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -1447,7 +1482,12 @@ func (s *SNIs) DeleteSni(ctx context.Context, controlPlaneID string, sniID strin } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/snis/{SNIId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -1644,7 +1684,12 @@ func (s *SNIs) GetSni(ctx context.Context, sniID string, controlPlaneID string, } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/snis/{SNIId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -1858,7 +1903,12 @@ func (s *SNIs) UpsertSni(ctx context.Context, request operations.UpsertSniReques } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/snis/{SNIId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) diff --git a/systemaccounts.go b/systemaccounts.go index 99617b8..87d1bfc 100644 --- a/systemaccounts.go +++ b/systemaccounts.go @@ -38,7 +38,6 @@ func (s *SystemAccounts) GetSystemAccounts(ctx context.Context, request operatio o := operations.Options{} supportedOptions := []string{ - operations.SupportedOptionServerURL, operations.SupportedOptionRetries, operations.SupportedOptionTimeout, } @@ -282,7 +281,6 @@ func (s *SystemAccounts) PostSystemAccounts(ctx context.Context, request *compon o := operations.Options{} supportedOptions := []string{ - operations.SupportedOptionServerURL, operations.SupportedOptionRetries, operations.SupportedOptionTimeout, } @@ -532,7 +530,6 @@ func (s *SystemAccounts) GetSystemAccountsID(ctx context.Context, accountID stri o := operations.Options{} supportedOptions := []string{ - operations.SupportedOptionServerURL, operations.SupportedOptionRetries, operations.SupportedOptionTimeout, } @@ -777,7 +774,6 @@ func (s *SystemAccounts) PatchSystemAccountsID(ctx context.Context, accountID st o := operations.Options{} supportedOptions := []string{ - operations.SupportedOptionServerURL, operations.SupportedOptionRetries, operations.SupportedOptionTimeout, } @@ -1048,7 +1044,6 @@ func (s *SystemAccounts) DeleteSystemAccountsID(ctx context.Context, accountID s o := operations.Options{} supportedOptions := []string{ - operations.SupportedOptionServerURL, operations.SupportedOptionRetries, operations.SupportedOptionTimeout, } diff --git a/systemaccountsaccesstokens.go b/systemaccountsaccesstokens.go index 203c0f4..51e14de 100644 --- a/systemaccountsaccesstokens.go +++ b/systemaccountsaccesstokens.go @@ -37,7 +37,6 @@ func (s *SystemAccountsAccessTokens) GetSystemAccountIDAccessTokens(ctx context. o := operations.Options{} supportedOptions := []string{ - operations.SupportedOptionServerURL, operations.SupportedOptionRetries, operations.SupportedOptionTimeout, } @@ -307,7 +306,6 @@ func (s *SystemAccountsAccessTokens) PostSystemAccountsIDAccessTokens(ctx contex o := operations.Options{} supportedOptions := []string{ - operations.SupportedOptionServerURL, operations.SupportedOptionRetries, operations.SupportedOptionTimeout, } @@ -579,7 +577,6 @@ func (s *SystemAccountsAccessTokens) GetSystemAccountsIDAccessTokensID(ctx conte o := operations.Options{} supportedOptions := []string{ - operations.SupportedOptionServerURL, operations.SupportedOptionRetries, operations.SupportedOptionTimeout, } @@ -819,7 +816,6 @@ func (s *SystemAccountsAccessTokens) PatchSystemAccountsIDAccessTokensID(ctx con o := operations.Options{} supportedOptions := []string{ - operations.SupportedOptionServerURL, operations.SupportedOptionRetries, operations.SupportedOptionTimeout, } @@ -1091,7 +1087,6 @@ func (s *SystemAccountsAccessTokens) DeleteSystemAccountsIDAccessTokensID(ctx co o := operations.Options{} supportedOptions := []string{ - operations.SupportedOptionServerURL, operations.SupportedOptionRetries, operations.SupportedOptionTimeout, } diff --git a/systemaccountsroles.go b/systemaccountsroles.go index c1e612e..9e3f923 100644 --- a/systemaccountsroles.go +++ b/systemaccountsroles.go @@ -42,7 +42,6 @@ func (s *SystemAccountsRoles) GetSystemAccountsAccountIDAssignedRoles(ctx contex o := operations.Options{} supportedOptions := []string{ - operations.SupportedOptionServerURL, operations.SupportedOptionRetries, operations.SupportedOptionTimeout, } @@ -312,7 +311,6 @@ func (s *SystemAccountsRoles) PostSystemAccountsAccountIDAssignedRoles(ctx conte o := operations.Options{} supportedOptions := []string{ - operations.SupportedOptionServerURL, operations.SupportedOptionRetries, operations.SupportedOptionTimeout, } @@ -584,7 +582,6 @@ func (s *SystemAccountsRoles) DeleteSystemAccountsAccountIDAssignedRolesRoleID(c o := operations.Options{} supportedOptions := []string{ - operations.SupportedOptionServerURL, operations.SupportedOptionRetries, operations.SupportedOptionTimeout, } diff --git a/systemaccountsteammembership.go b/systemaccountsteammembership.go index b3edd51..71be46a 100644 --- a/systemaccountsteammembership.go +++ b/systemaccountsteammembership.go @@ -37,7 +37,6 @@ func (s *SystemAccountsTeamMembership) GetSystemAccountsAccountIDTeams(ctx conte o := operations.Options{} supportedOptions := []string{ - operations.SupportedOptionServerURL, operations.SupportedOptionRetries, operations.SupportedOptionTimeout, } @@ -281,7 +280,6 @@ func (s *SystemAccountsTeamMembership) GetTeamsTeamIDSystemAccounts(ctx context. o := operations.Options{} supportedOptions := []string{ - operations.SupportedOptionServerURL, operations.SupportedOptionRetries, operations.SupportedOptionTimeout, } @@ -530,7 +528,6 @@ func (s *SystemAccountsTeamMembership) PostTeamsTeamIDSystemAccounts(ctx context o := operations.Options{} supportedOptions := []string{ - operations.SupportedOptionServerURL, operations.SupportedOptionRetries, operations.SupportedOptionTimeout, } @@ -782,7 +779,6 @@ func (s *SystemAccountsTeamMembership) DeleteTeamsTeamIDSystemAccountsAccountID( o := operations.Options{} supportedOptions := []string{ - operations.SupportedOptionServerURL, operations.SupportedOptionRetries, operations.SupportedOptionTimeout, } diff --git a/targets.go b/targets.go index 19d7399..f0cd772 100644 --- a/targets.go +++ b/targets.go @@ -47,7 +47,12 @@ func (s *Targets) ListTargetWithUpstream(ctx context.Context, request operations } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/upstreams/{UpstreamIdForTarget}/targets", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -242,7 +247,12 @@ func (s *Targets) CreateTargetWithUpstream(ctx context.Context, request operatio } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/upstreams/{UpstreamIdForTarget}/targets", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -439,7 +449,12 @@ func (s *Targets) DeleteTargetWithUpstream(ctx context.Context, request operatio } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/upstreams/{UpstreamIdForTarget}/targets/{TargetId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -610,7 +625,12 @@ func (s *Targets) GetTargetWithUpstream(ctx context.Context, request operations. } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/upstreams/{UpstreamIdForTarget}/targets/{TargetId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -803,7 +823,12 @@ func (s *Targets) UpsertTargetWithUpstream(ctx context.Context, request operatio } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/upstreams/{UpstreamIdForTarget}/targets/{TargetId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) diff --git a/teammembership.go b/teammembership.go index ad7f33f..73dfdac 100644 --- a/teammembership.go +++ b/teammembership.go @@ -37,7 +37,6 @@ func (s *TeamMembership) ListTeamUsers(ctx context.Context, request operations.L o := operations.Options{} supportedOptions := []string{ - operations.SupportedOptionServerURL, operations.SupportedOptionRetries, operations.SupportedOptionTimeout, } @@ -284,7 +283,6 @@ func (s *TeamMembership) AddUserToTeam(ctx context.Context, teamID string, addUs o := operations.Options{} supportedOptions := []string{ - operations.SupportedOptionServerURL, operations.SupportedOptionRetries, operations.SupportedOptionTimeout, } @@ -535,7 +533,6 @@ func (s *TeamMembership) RemoveUserFromTeam(ctx context.Context, userID string, o := operations.Options{} supportedOptions := []string{ - operations.SupportedOptionServerURL, operations.SupportedOptionRetries, operations.SupportedOptionTimeout, } @@ -753,7 +750,6 @@ func (s *TeamMembership) ListUserTeams(ctx context.Context, request operations.L o := operations.Options{} supportedOptions := []string{ - operations.SupportedOptionServerURL, operations.SupportedOptionRetries, operations.SupportedOptionTimeout, } diff --git a/teams.go b/teams.go index 4d4d1dc..bc34315 100644 --- a/teams.go +++ b/teams.go @@ -38,7 +38,6 @@ func (s *Teams) ListTeams(ctx context.Context, request operations.ListTeamsReque o := operations.Options{} supportedOptions := []string{ - operations.SupportedOptionServerURL, operations.SupportedOptionRetries, operations.SupportedOptionTimeout, } @@ -280,7 +279,6 @@ func (s *Teams) CreateTeam(ctx context.Context, request *components.CreateTeam, o := operations.Options{} supportedOptions := []string{ - operations.SupportedOptionServerURL, operations.SupportedOptionRetries, operations.SupportedOptionTimeout, } @@ -528,7 +526,6 @@ func (s *Teams) GetTeam(ctx context.Context, teamID string, opts ...operations.O o := operations.Options{} supportedOptions := []string{ - operations.SupportedOptionServerURL, operations.SupportedOptionRetries, operations.SupportedOptionTimeout, } @@ -771,7 +768,6 @@ func (s *Teams) UpdateTeam(ctx context.Context, teamID string, updateTeam *compo o := operations.Options{} supportedOptions := []string{ - operations.SupportedOptionServerURL, operations.SupportedOptionRetries, operations.SupportedOptionTimeout, } @@ -1019,7 +1015,6 @@ func (s *Teams) DeleteTeam(ctx context.Context, teamID string, opts ...operation o := operations.Options{} supportedOptions := []string{ - operations.SupportedOptionServerURL, operations.SupportedOptionRetries, operations.SupportedOptionTimeout, } diff --git a/upstreams.go b/upstreams.go index 309f5c8..83b3a4b 100644 --- a/upstreams.go +++ b/upstreams.go @@ -51,7 +51,12 @@ func (s *Upstreams) ListUpstream(ctx context.Context, request operations.ListUps } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/upstreams", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -272,7 +277,12 @@ func (s *Upstreams) CreateUpstream(ctx context.Context, controlPlaneID string, u } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/upstreams", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -495,7 +505,12 @@ func (s *Upstreams) DeleteUpstream(ctx context.Context, controlPlaneID string, u } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/upstreams/{UpstreamId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -692,7 +707,12 @@ func (s *Upstreams) GetUpstream(ctx context.Context, upstreamID string, controlP } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/upstreams/{UpstreamId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -906,7 +926,12 @@ func (s *Upstreams) UpsertUpstream(ctx context.Context, request operations.Upser } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/upstreams/{UpstreamId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) diff --git a/users.go b/users.go index 5d44ab1..8afa042 100644 --- a/users.go +++ b/users.go @@ -38,7 +38,6 @@ func (s *Users) ListUsers(ctx context.Context, request operations.ListUsersReque o := operations.Options{} supportedOptions := []string{ - operations.SupportedOptionServerURL, operations.SupportedOptionRetries, operations.SupportedOptionTimeout, } @@ -263,7 +262,6 @@ func (s *Users) GetUser(ctx context.Context, userID string, opts ...operations.O o := operations.Options{} supportedOptions := []string{ - operations.SupportedOptionServerURL, operations.SupportedOptionRetries, operations.SupportedOptionTimeout, } @@ -506,7 +504,6 @@ func (s *Users) UpdateUser(ctx context.Context, userID string, updateUser *compo o := operations.Options{} supportedOptions := []string{ - operations.SupportedOptionServerURL, operations.SupportedOptionRetries, operations.SupportedOptionTimeout, } @@ -775,7 +772,6 @@ func (s *Users) DeleteUser(ctx context.Context, userID string, opts ...operation o := operations.Options{} supportedOptions := []string{ - operations.SupportedOptionServerURL, operations.SupportedOptionRetries, operations.SupportedOptionTimeout, } diff --git a/vaults.go b/vaults.go index 291190a..3c61ebd 100644 --- a/vaults.go +++ b/vaults.go @@ -54,7 +54,12 @@ func (s *Vaults) ListVault(ctx context.Context, request operations.ListVaultRequ } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/vaults", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -275,7 +280,12 @@ func (s *Vaults) CreateVault(ctx context.Context, controlPlaneID string, vault c } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/vaults", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -498,7 +508,12 @@ func (s *Vaults) DeleteVault(ctx context.Context, controlPlaneID string, vaultID } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/vaults/{VaultId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -695,7 +710,12 @@ func (s *Vaults) GetVault(ctx context.Context, vaultID string, controlPlaneID st } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/vaults/{VaultId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err) @@ -909,7 +929,12 @@ func (s *Vaults) UpsertVault(ctx context.Context, request operations.UpsertVault } } - baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + var baseURL string + if o.ServerURL == nil { + baseURL = utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails()) + } else { + baseURL = *o.ServerURL + } opURL, err := utils.GenerateURL(ctx, baseURL, "/v2/control-planes/{controlPlaneId}/core-entities/vaults/{VaultId}", request, nil) if err != nil { return nil, fmt.Errorf("error generating URL: %w", err)