Skip to content

Latest commit

 

History

History
executable file
·
118 lines (88 loc) · 4.52 KB

README.md

File metadata and controls

executable file
·
118 lines (88 loc) · 4.52 KB

CustomDomain

Available Operations

  • Add - Add a custom domain to the workspace
  • Delete - Removes a custom domain from the workspace

Add

Add a custom domain to the workspace

Example Usage

package main

import(
	"context"
	"log"
	"github.com/speakeasy-sdks/hookdeck-go"
	"github.com/speakeasy-sdks/hookdeck-go/pkg/models/shared"
	"github.com/speakeasy-sdks/hookdeck-go/pkg/models/operations"
)

func main() {
    s := hookdeck.New(
        hookdeck.WithSecurity(shared.Security{
            BasicAuth: &shared.SchemeBasicAuth{
                Password: "",
                Username: "",
            },
        }),
    )
    addCustomHostname := shared.AddCustomHostname{
        Hostname: "sandy-spruce.biz",
    }
    teamID := "modi"

    ctx := context.Background()
    res, err := s.CustomDomain.Add(ctx, addCustomHostname, teamID)
    if err != nil {
        log.Fatal(err)
    }

    if res.AddCustomHostname != nil {
        // handle response
    }
}

Parameters

Parameter Type Required Description
ctx context.Context ✔️ The context to use for the request.
addCustomHostname shared.AddCustomHostname ✔️ N/A
teamID string ✔️ N/A

Response

*operations.AddCustomDomainResponse, error

Delete

Removes a custom domain from the workspace

Example Usage

package main

import(
	"context"
	"log"
	"github.com/speakeasy-sdks/hookdeck-go"
	"github.com/speakeasy-sdks/hookdeck-go/pkg/models/shared"
	"github.com/speakeasy-sdks/hookdeck-go/pkg/models/operations"
)

func main() {
    s := hookdeck.New(
        hookdeck.WithSecurity(shared.Security{
            BasicAuth: &shared.SchemeBasicAuth{
                Password: "",
                Username: "",
            },
        }),
    )
    domainID := "qui"
    teamID := "aliquid"

    ctx := context.Background()
    res, err := s.CustomDomain.Delete(ctx, domainID, teamID)
    if err != nil {
        log.Fatal(err)
    }

    if res.DeleteCustomDomainSchema != nil {
        // handle response
    }
}

Parameters

Parameter Type Required Description
ctx context.Context ✔️ The context to use for the request.
domainID string ✔️ N/A
teamID string ✔️ N/A

Response

*operations.DeleteCustomDomainResponse, error