whois

package
v1.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 23, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CreateCmd = &cobra.Command{
	Use:   "create",
	Short: "Create WHOIS profile",
	Long:  "Create WHOIS contact profile.\n\nUse this endpoint to add new contact information for domain registration.",
	Run: func(cmd *cobra.Command, args []string) {
		utils.EnumCheck(cmd, "entity-type", []string{"individual", "organization"})
		payload, err := json.Marshal(createBody(cmd))
		if err != nil {
			log.Fatal(err)
		}
		r, err := api.Request().DomainsCreateWHOISProfileV1WithBodyWithResponse(context.TODO(), "application/json", bytes.NewReader(payload))
		if err != nil {
			log.Fatal(err)
		}

		output.Format(cmd, r.Body, r.StatusCode())
	},
}
View Source
var DeleteCmd = &cobra.Command{
	Use:   "delete <whois-id>",
	Short: "Delete WHOIS profile",
	Long:  "Delete WHOIS contact profile.\n\nUse this endpoint to remove unused contact profiles from account.",
	Args:  cobra.MatchAll(cobra.ExactArgs(1)),
	Run: func(cmd *cobra.Command, args []string) {
		r, err := api.Request().DomainsDeleteWHOISProfileV1WithResponse(context.TODO(), utils.StringToInt(args[0]))
		if err != nil {
			log.Fatal(err)
		}

		output.Format(cmd, r.Body, r.StatusCode())
	},
}
View Source
var GetCmd = &cobra.Command{
	Use:   "get <whois-id>",
	Short: "Get WHOIS profile",
	Long:  "Retrieve a WHOIS contact profile.\n\nUse this endpoint to view domain registration contact information.",
	Args:  cobra.MatchAll(cobra.ExactArgs(1)),
	Run: func(cmd *cobra.Command, args []string) {
		r, err := api.Request().DomainsGetWHOISProfileV1WithResponse(context.TODO(), utils.StringToInt(args[0]))
		if err != nil {
			log.Fatal(err)
		}

		output.Format(cmd, r.Body, r.StatusCode())
	},
}
View Source
var GroupCmd = &cobra.Command{
	Use:   "whois",
	Short: "WHOIS commands",
}
View Source
var ListCmd = &cobra.Command{
	Use:   "list",
	Short: "Get WHOIS profile list",
	Long:  "Retrieve WHOIS contact profiles.\n\nUse this endpoint to view available contact profiles for domain registration.",
	Run: func(cmd *cobra.Command, args []string) {
		r, err := api.Request().DomainsGetWHOISProfileListV1WithResponse(context.TODO(), listParams(cmd))
		if err != nil {
			log.Fatal(err)
		}

		output.Format(cmd, r.Body, r.StatusCode())
	},
}
View Source
var UsageCmd = &cobra.Command{
	Use:   "usage <whois-id>",
	Short: "Get WHOIS profile usage",
	Long:  "Retrieve domain list where provided WHOIS contact profile is used.\n\nUse this endpoint to view which domains use specific contact profiles.",
	Args:  cobra.MatchAll(cobra.ExactArgs(1)),
	Run: func(cmd *cobra.Command, args []string) {
		r, err := api.Request().DomainsGetWHOISProfileUsageV1WithResponse(context.TODO(), utils.StringToInt(args[0]))
		if err != nil {
			log.Fatal(err)
		}

		output.Format(cmd, r.Body, r.StatusCode())
	},
}

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL