domain_sdk.go raw

   1  // This file was automatically generated. DO NOT EDIT.
   2  // If you have any remark or suggestion do not hesitate to open an issue.
   3  
   4  // Package domain provides methods and message types of the domain v2beta1 API.
   5  package domain
   6  
   7  import (
   8  	"bytes"
   9  	"encoding/json"
  10  	"fmt"
  11  	"net"
  12  	"net/http"
  13  	"net/url"
  14  	"strings"
  15  	"time"
  16  
  17  	std "github.com/scaleway/scaleway-sdk-go/api/std"
  18  	"github.com/scaleway/scaleway-sdk-go/errors"
  19  	"github.com/scaleway/scaleway-sdk-go/internal/async"
  20  	"github.com/scaleway/scaleway-sdk-go/marshaler"
  21  	"github.com/scaleway/scaleway-sdk-go/namegenerator"
  22  	"github.com/scaleway/scaleway-sdk-go/parameter"
  23  	"github.com/scaleway/scaleway-sdk-go/scw"
  24  )
  25  
  26  const (
  27  	defaultDomainRetryInterval = 15 * time.Second
  28  	defaultDomainTimeout       = 5 * time.Minute
  29  )
  30  
  31  // always import dependencies
  32  var (
  33  	_ fmt.Stringer
  34  	_ json.Unmarshaler
  35  	_ url.URL
  36  	_ net.IP
  37  	_ http.Header
  38  	_ bytes.Reader
  39  	_ time.Time
  40  	_ = strings.Join
  41  
  42  	_ scw.ScalewayRequest
  43  	_ marshaler.Duration
  44  	_ scw.File
  45  	_ = parameter.AddToQuery
  46  	_ = namegenerator.GetRandomName
  47  )
  48  
  49  type ContactEmailStatus string
  50  
  51  const (
  52  	// If unspecified, the status is unknown by default.
  53  	ContactEmailStatusEmailStatusUnknown = ContactEmailStatus("email_status_unknown")
  54  	// The contact email has been validated.
  55  	ContactEmailStatusValidated = ContactEmailStatus("validated")
  56  	// The contact email has not been validated.
  57  	ContactEmailStatusNotValidated = ContactEmailStatus("not_validated")
  58  	// The contact email is invalid.
  59  	ContactEmailStatusInvalidEmail = ContactEmailStatus("invalid_email")
  60  )
  61  
  62  func (enum ContactEmailStatus) String() string {
  63  	if enum == "" {
  64  		// return default value if empty
  65  		return string(ContactEmailStatusEmailStatusUnknown)
  66  	}
  67  	return string(enum)
  68  }
  69  
  70  func (enum ContactEmailStatus) Values() []ContactEmailStatus {
  71  	return []ContactEmailStatus{
  72  		"email_status_unknown",
  73  		"validated",
  74  		"not_validated",
  75  		"invalid_email",
  76  	}
  77  }
  78  
  79  func (enum ContactEmailStatus) MarshalJSON() ([]byte, error) {
  80  	return []byte(fmt.Sprintf(`"%s"`, enum)), nil
  81  }
  82  
  83  func (enum *ContactEmailStatus) UnmarshalJSON(data []byte) error {
  84  	tmp := ""
  85  
  86  	if err := json.Unmarshal(data, &tmp); err != nil {
  87  		return err
  88  	}
  89  
  90  	*enum = ContactEmailStatus(ContactEmailStatus(tmp).String())
  91  	return nil
  92  }
  93  
  94  type ContactExtensionFRMode string
  95  
  96  const (
  97  	// If unspecified, the status is unknown by default.
  98  	ContactExtensionFRModeModeUnknown = ContactExtensionFRMode("mode_unknown")
  99  	// The contact is a physical person (only for .fr domains).
 100  	ContactExtensionFRModeIndividual = ContactExtensionFRMode("individual")
 101  	// The contact is a company with a SIRET/SIREN code (only for .fr domains).
 102  	ContactExtensionFRModeCompanyIdentificationCode = ContactExtensionFRMode("company_identification_code")
 103  	// The contact has a Data Universal Numbering System code (only for .fr domains).
 104  	ContactExtensionFRModeDuns = ContactExtensionFRMode("duns")
 105  	// The contact has a local or a country ID (only for .fr domains).
 106  	ContactExtensionFRModeLocal = ContactExtensionFRMode("local")
 107  	// The contact is an association (only for .fr domains).
 108  	ContactExtensionFRModeAssociation = ContactExtensionFRMode("association")
 109  	// The contact is a brand (only for .fr domains).
 110  	ContactExtensionFRModeTrademark = ContactExtensionFRMode("trademark")
 111  	// The contact has an intervention code (DSIA) from AFNIC (only for .fr domains).
 112  	ContactExtensionFRModeCodeAuthAfnic = ContactExtensionFRMode("code_auth_afnic")
 113  )
 114  
 115  func (enum ContactExtensionFRMode) String() string {
 116  	if enum == "" {
 117  		// return default value if empty
 118  		return string(ContactExtensionFRModeModeUnknown)
 119  	}
 120  	return string(enum)
 121  }
 122  
 123  func (enum ContactExtensionFRMode) Values() []ContactExtensionFRMode {
 124  	return []ContactExtensionFRMode{
 125  		"mode_unknown",
 126  		"individual",
 127  		"company_identification_code",
 128  		"duns",
 129  		"local",
 130  		"association",
 131  		"trademark",
 132  		"code_auth_afnic",
 133  	}
 134  }
 135  
 136  func (enum ContactExtensionFRMode) MarshalJSON() ([]byte, error) {
 137  	return []byte(fmt.Sprintf(`"%s"`, enum)), nil
 138  }
 139  
 140  func (enum *ContactExtensionFRMode) UnmarshalJSON(data []byte) error {
 141  	tmp := ""
 142  
 143  	if err := json.Unmarshal(data, &tmp); err != nil {
 144  		return err
 145  	}
 146  
 147  	*enum = ContactExtensionFRMode(ContactExtensionFRMode(tmp).String())
 148  	return nil
 149  }
 150  
 151  type ContactExtensionNLLegalForm string
 152  
 153  const (
 154  	// If unspecified, the status is unknown by default.
 155  	ContactExtensionNLLegalFormLegalFormUnknown = ContactExtensionNLLegalForm("legal_form_unknown")
 156  	// The contact's legal form is not listed below (only for .nl domains).
 157  	ContactExtensionNLLegalFormOther = ContactExtensionNLLegalForm("other")
 158  	// The contact is a non-Dutch EC company (only for .nl domains).
 159  	ContactExtensionNLLegalFormNonDutchEuCompany = ContactExtensionNLLegalForm("non_dutch_eu_company")
 160  	// The contact is a non-Dutch legal form/enterprise/subsidiary (only for .nl domains).
 161  	ContactExtensionNLLegalFormNonDutchLegalFormEnterpriseSubsidiary = ContactExtensionNLLegalForm("non_dutch_legal_form_enterprise_subsidiary")
 162  	// The contact is a limited company (only for .nl domains).
 163  	ContactExtensionNLLegalFormLimitedCompany = ContactExtensionNLLegalForm("limited_company")
 164  	// The contact is a limited company in formation (only for .nl domains).
 165  	ContactExtensionNLLegalFormLimitedCompanyInFormation = ContactExtensionNLLegalForm("limited_company_in_formation")
 166  	// The contact is a cooperative (only for .nl domains).
 167  	ContactExtensionNLLegalFormCooperative = ContactExtensionNLLegalForm("cooperative")
 168  	// The contact is a limited Partnership (only for .nl domains).
 169  	ContactExtensionNLLegalFormLimitedPartnership = ContactExtensionNLLegalForm("limited_partnership")
 170  	// The contact is a sole trader (only for .nl domains).
 171  	ContactExtensionNLLegalFormSoleCompany = ContactExtensionNLLegalForm("sole_company")
 172  	// The contact is a European Economic Interest Group (only for .nl domains).
 173  	ContactExtensionNLLegalFormEuropeanEconomicInterestGroup = ContactExtensionNLLegalForm("european_economic_interest_group")
 174  	// The contact is a religious society (only for .nl domains).
 175  	ContactExtensionNLLegalFormReligiousEntity = ContactExtensionNLLegalForm("religious_entity")
 176  	// The contact is a partnership (only for .nl domains).
 177  	ContactExtensionNLLegalFormPartnership = ContactExtensionNLLegalForm("partnership")
 178  	// The contact is a public Company (only for .nl domains).
 179  	ContactExtensionNLLegalFormPublicCompany = ContactExtensionNLLegalForm("public_company")
 180  	// The contact is a mutual benefit company (only for .nl domains).
 181  	ContactExtensionNLLegalFormMutualBenefitCompany = ContactExtensionNLLegalForm("mutual_benefit_company")
 182  	// The contact is a natural person (only for .nl domains).
 183  	ContactExtensionNLLegalFormResidential = ContactExtensionNLLegalForm("residential")
 184  	// The contact is a shipping company (only for .nl domains).
 185  	ContactExtensionNLLegalFormShippingCompany = ContactExtensionNLLegalForm("shipping_company")
 186  	// The contact is a foundation (only for .nl domains).
 187  	ContactExtensionNLLegalFormFoundation = ContactExtensionNLLegalForm("foundation")
 188  	// The contact is a association (only for .nl domains).
 189  	ContactExtensionNLLegalFormAssociation = ContactExtensionNLLegalForm("association")
 190  	// The contact is a trading partnership (only for .nl domains).
 191  	ContactExtensionNLLegalFormTradingPartnership = ContactExtensionNLLegalForm("trading_partnership")
 192  	// The contact is a physical person (only for .nl domains).
 193  	ContactExtensionNLLegalFormNaturalPerson = ContactExtensionNLLegalForm("natural_person")
 194  )
 195  
 196  func (enum ContactExtensionNLLegalForm) String() string {
 197  	if enum == "" {
 198  		// return default value if empty
 199  		return string(ContactExtensionNLLegalFormLegalFormUnknown)
 200  	}
 201  	return string(enum)
 202  }
 203  
 204  func (enum ContactExtensionNLLegalForm) Values() []ContactExtensionNLLegalForm {
 205  	return []ContactExtensionNLLegalForm{
 206  		"legal_form_unknown",
 207  		"other",
 208  		"non_dutch_eu_company",
 209  		"non_dutch_legal_form_enterprise_subsidiary",
 210  		"limited_company",
 211  		"limited_company_in_formation",
 212  		"cooperative",
 213  		"limited_partnership",
 214  		"sole_company",
 215  		"european_economic_interest_group",
 216  		"religious_entity",
 217  		"partnership",
 218  		"public_company",
 219  		"mutual_benefit_company",
 220  		"residential",
 221  		"shipping_company",
 222  		"foundation",
 223  		"association",
 224  		"trading_partnership",
 225  		"natural_person",
 226  	}
 227  }
 228  
 229  func (enum ContactExtensionNLLegalForm) MarshalJSON() ([]byte, error) {
 230  	return []byte(fmt.Sprintf(`"%s"`, enum)), nil
 231  }
 232  
 233  func (enum *ContactExtensionNLLegalForm) UnmarshalJSON(data []byte) error {
 234  	tmp := ""
 235  
 236  	if err := json.Unmarshal(data, &tmp); err != nil {
 237  		return err
 238  	}
 239  
 240  	*enum = ContactExtensionNLLegalForm(ContactExtensionNLLegalForm(tmp).String())
 241  	return nil
 242  }
 243  
 244  type ContactLegalForm string
 245  
 246  const (
 247  	// If unspecified, the status is unknown by default.
 248  	ContactLegalFormLegalFormUnknown = ContactLegalForm("legal_form_unknown")
 249  	// The contact is a physical person.
 250  	ContactLegalFormIndividual = ContactLegalForm("individual")
 251  	// The contact is a corporate or a society.
 252  	ContactLegalFormCorporate = ContactLegalForm("corporate")
 253  	// The contact is an association.
 254  	ContactLegalFormAssociation = ContactLegalForm("association")
 255  	// The contact is not represented by a physical person, a corporate or an association.
 256  	ContactLegalFormOther = ContactLegalForm("other")
 257  )
 258  
 259  func (enum ContactLegalForm) String() string {
 260  	if enum == "" {
 261  		// return default value if empty
 262  		return string(ContactLegalFormLegalFormUnknown)
 263  	}
 264  	return string(enum)
 265  }
 266  
 267  func (enum ContactLegalForm) Values() []ContactLegalForm {
 268  	return []ContactLegalForm{
 269  		"legal_form_unknown",
 270  		"individual",
 271  		"corporate",
 272  		"association",
 273  		"other",
 274  	}
 275  }
 276  
 277  func (enum ContactLegalForm) MarshalJSON() ([]byte, error) {
 278  	return []byte(fmt.Sprintf(`"%s"`, enum)), nil
 279  }
 280  
 281  func (enum *ContactLegalForm) UnmarshalJSON(data []byte) error {
 282  	tmp := ""
 283  
 284  	if err := json.Unmarshal(data, &tmp); err != nil {
 285  		return err
 286  	}
 287  
 288  	*enum = ContactLegalForm(ContactLegalForm(tmp).String())
 289  	return nil
 290  }
 291  
 292  type ContactStatus string
 293  
 294  const (
 295  	// If unspecified, the status is unknown by default.
 296  	ContactStatusStatusUnknown = ContactStatus("status_unknown")
 297  	// The contact is active and can be edited.
 298  	ContactStatusActive = ContactStatus("active")
 299  	// The contact is temporarily locked (ie. while being edited).
 300  	ContactStatusPending = ContactStatus("pending")
 301  )
 302  
 303  func (enum ContactStatus) String() string {
 304  	if enum == "" {
 305  		// return default value if empty
 306  		return string(ContactStatusStatusUnknown)
 307  	}
 308  	return string(enum)
 309  }
 310  
 311  func (enum ContactStatus) Values() []ContactStatus {
 312  	return []ContactStatus{
 313  		"status_unknown",
 314  		"active",
 315  		"pending",
 316  	}
 317  }
 318  
 319  func (enum ContactStatus) MarshalJSON() ([]byte, error) {
 320  	return []byte(fmt.Sprintf(`"%s"`, enum)), nil
 321  }
 322  
 323  func (enum *ContactStatus) UnmarshalJSON(data []byte) error {
 324  	tmp := ""
 325  
 326  	if err := json.Unmarshal(data, &tmp); err != nil {
 327  		return err
 328  	}
 329  
 330  	*enum = ContactStatus(ContactStatus(tmp).String())
 331  	return nil
 332  }
 333  
 334  type DNSZoneStatus string
 335  
 336  const (
 337  	// If unspecified, the DNS zone's status is unknown by default.
 338  	DNSZoneStatusUnknown = DNSZoneStatus("unknown")
 339  	// The DNS zone is active and healthy.
 340  	DNSZoneStatusActive = DNSZoneStatus("active")
 341  	// The DNS zone is updating.
 342  	DNSZoneStatusPending = DNSZoneStatus("pending")
 343  	// An error occurred after updating the DNS zone.
 344  	DNSZoneStatusError = DNSZoneStatus("error")
 345  	// The DNS zone is locked and cannot be updated anymore.
 346  	DNSZoneStatusLocked = DNSZoneStatus("locked")
 347  )
 348  
 349  func (enum DNSZoneStatus) String() string {
 350  	if enum == "" {
 351  		// return default value if empty
 352  		return string(DNSZoneStatusUnknown)
 353  	}
 354  	return string(enum)
 355  }
 356  
 357  func (enum DNSZoneStatus) Values() []DNSZoneStatus {
 358  	return []DNSZoneStatus{
 359  		"unknown",
 360  		"active",
 361  		"pending",
 362  		"error",
 363  		"locked",
 364  	}
 365  }
 366  
 367  func (enum DNSZoneStatus) MarshalJSON() ([]byte, error) {
 368  	return []byte(fmt.Sprintf(`"%s"`, enum)), nil
 369  }
 370  
 371  func (enum *DNSZoneStatus) UnmarshalJSON(data []byte) error {
 372  	tmp := ""
 373  
 374  	if err := json.Unmarshal(data, &tmp); err != nil {
 375  		return err
 376  	}
 377  
 378  	*enum = DNSZoneStatus(DNSZoneStatus(tmp).String())
 379  	return nil
 380  }
 381  
 382  type DSRecordAlgorithm string
 383  
 384  const (
 385  	// Code 1, algorithm: 'RSAMD5'.
 386  	DSRecordAlgorithmRsamd5 = DSRecordAlgorithm("rsamd5")
 387  	// Code 2, algorithm: 'DIFFIE_HELLMAN'.
 388  	DSRecordAlgorithmDh = DSRecordAlgorithm("dh")
 389  	// Code 3, algorithm: 'DSA_SHA1'.
 390  	DSRecordAlgorithmDsa = DSRecordAlgorithm("dsa")
 391  	// Code 5, algorithm: 'RSA_SHA1'.
 392  	DSRecordAlgorithmRsasha1 = DSRecordAlgorithm("rsasha1")
 393  	// Code 6, algorithm: 'DSA_NSEC3_SHA1'.
 394  	DSRecordAlgorithmDsaNsec3Sha1 = DSRecordAlgorithm("dsa_nsec3_sha1")
 395  	// Code 7, algorithm: 'RSASHA1_NSEC3_SHA1'.
 396  	DSRecordAlgorithmRsasha1Nsec3Sha1 = DSRecordAlgorithm("rsasha1_nsec3_sha1")
 397  	// Code 8, algorithm: 'RSASHA256'.
 398  	DSRecordAlgorithmRsasha256 = DSRecordAlgorithm("rsasha256")
 399  	// Code 10, algorithm: 'RSASHA512'.
 400  	DSRecordAlgorithmRsasha512 = DSRecordAlgorithm("rsasha512")
 401  	// Code 12, algorithm: 'ECC_GOST'.
 402  	DSRecordAlgorithmEccGost = DSRecordAlgorithm("ecc_gost")
 403  	// Code 13, algorithm: 'ECDSAP256SHA256'.
 404  	DSRecordAlgorithmEcdsap256sha256 = DSRecordAlgorithm("ecdsap256sha256")
 405  	// Code 14, algorithm: 'ECDSAP384SHA384'.
 406  	DSRecordAlgorithmEcdsap384sha384 = DSRecordAlgorithm("ecdsap384sha384")
 407  	// Code 15, algorithm: 'ED25519'.
 408  	DSRecordAlgorithmEd25519 = DSRecordAlgorithm("ed25519")
 409  	// Code 16, algorithm: 'ED448'.
 410  	DSRecordAlgorithmEd448 = DSRecordAlgorithm("ed448")
 411  )
 412  
 413  func (enum DSRecordAlgorithm) String() string {
 414  	if enum == "" {
 415  		// return default value if empty
 416  		return string(DSRecordAlgorithmRsamd5)
 417  	}
 418  	return string(enum)
 419  }
 420  
 421  func (enum DSRecordAlgorithm) Values() []DSRecordAlgorithm {
 422  	return []DSRecordAlgorithm{
 423  		"rsamd5",
 424  		"dh",
 425  		"dsa",
 426  		"rsasha1",
 427  		"dsa_nsec3_sha1",
 428  		"rsasha1_nsec3_sha1",
 429  		"rsasha256",
 430  		"rsasha512",
 431  		"ecc_gost",
 432  		"ecdsap256sha256",
 433  		"ecdsap384sha384",
 434  		"ed25519",
 435  		"ed448",
 436  	}
 437  }
 438  
 439  func (enum DSRecordAlgorithm) MarshalJSON() ([]byte, error) {
 440  	return []byte(fmt.Sprintf(`"%s"`, enum)), nil
 441  }
 442  
 443  func (enum *DSRecordAlgorithm) UnmarshalJSON(data []byte) error {
 444  	tmp := ""
 445  
 446  	if err := json.Unmarshal(data, &tmp); err != nil {
 447  		return err
 448  	}
 449  
 450  	*enum = DSRecordAlgorithm(DSRecordAlgorithm(tmp).String())
 451  	return nil
 452  }
 453  
 454  type DSRecordDigestType string
 455  
 456  const (
 457  	// Code 1, digest type: 'SHA_1'.
 458  	DSRecordDigestTypeSha1 = DSRecordDigestType("sha_1")
 459  	// Code 2, digest type: 'SHA_256'.
 460  	DSRecordDigestTypeSha256 = DSRecordDigestType("sha_256")
 461  	// Code 3, digest type: 'GOST_R_34_11_94'.
 462  	DSRecordDigestTypeGostR34_11_94 = DSRecordDigestType("gost_r_34_11_94")
 463  	// Code 4, digest type: 'SHA_384'.
 464  	DSRecordDigestTypeSha384 = DSRecordDigestType("sha_384")
 465  )
 466  
 467  func (enum DSRecordDigestType) String() string {
 468  	if enum == "" {
 469  		// return default value if empty
 470  		return string(DSRecordDigestTypeSha1)
 471  	}
 472  	return string(enum)
 473  }
 474  
 475  func (enum DSRecordDigestType) Values() []DSRecordDigestType {
 476  	return []DSRecordDigestType{
 477  		"sha_1",
 478  		"sha_256",
 479  		"gost_r_34_11_94",
 480  		"sha_384",
 481  	}
 482  }
 483  
 484  func (enum DSRecordDigestType) MarshalJSON() ([]byte, error) {
 485  	return []byte(fmt.Sprintf(`"%s"`, enum)), nil
 486  }
 487  
 488  func (enum *DSRecordDigestType) UnmarshalJSON(data []byte) error {
 489  	tmp := ""
 490  
 491  	if err := json.Unmarshal(data, &tmp); err != nil {
 492  		return err
 493  	}
 494  
 495  	*enum = DSRecordDigestType(DSRecordDigestType(tmp).String())
 496  	return nil
 497  }
 498  
 499  type DomainFeatureStatus string
 500  
 501  const (
 502  	// Default unknown status.
 503  	DomainFeatureStatusFeatureStatusUnknown = DomainFeatureStatus("feature_status_unknown")
 504  	// A feature (auto renew, DNSSEC) is being enabled.
 505  	DomainFeatureStatusEnabling = DomainFeatureStatus("enabling")
 506  	// A feature (auto renew, DNSSEC) has been enabled.
 507  	DomainFeatureStatusEnabled = DomainFeatureStatus("enabled")
 508  	// A feature (auto renew, DNSSEC) is being disabled.
 509  	DomainFeatureStatusDisabling = DomainFeatureStatus("disabling")
 510  	// A feature (auto renew, DNSSEC) has been disabled.
 511  	DomainFeatureStatusDisabled = DomainFeatureStatus("disabled")
 512  )
 513  
 514  func (enum DomainFeatureStatus) String() string {
 515  	if enum == "" {
 516  		// return default value if empty
 517  		return string(DomainFeatureStatusFeatureStatusUnknown)
 518  	}
 519  	return string(enum)
 520  }
 521  
 522  func (enum DomainFeatureStatus) Values() []DomainFeatureStatus {
 523  	return []DomainFeatureStatus{
 524  		"feature_status_unknown",
 525  		"enabling",
 526  		"enabled",
 527  		"disabling",
 528  		"disabled",
 529  	}
 530  }
 531  
 532  func (enum DomainFeatureStatus) MarshalJSON() ([]byte, error) {
 533  	return []byte(fmt.Sprintf(`"%s"`, enum)), nil
 534  }
 535  
 536  func (enum *DomainFeatureStatus) UnmarshalJSON(data []byte) error {
 537  	tmp := ""
 538  
 539  	if err := json.Unmarshal(data, &tmp); err != nil {
 540  		return err
 541  	}
 542  
 543  	*enum = DomainFeatureStatus(DomainFeatureStatus(tmp).String())
 544  	return nil
 545  }
 546  
 547  type DomainRegistrationStatusTransferStatus string
 548  
 549  const (
 550  	// If unspecified, the status is unknown by default.
 551  	DomainRegistrationStatusTransferStatusStatusUnknown = DomainRegistrationStatusTransferStatus("status_unknown")
 552  	// The domain transfer is being initialized.
 553  	DomainRegistrationStatusTransferStatusPending = DomainRegistrationStatusTransferStatus("pending")
 554  	// The domain transfer has started. The process can be accelerated if you accept the vote.
 555  	DomainRegistrationStatusTransferStatusWaitingVote = DomainRegistrationStatusTransferStatus("waiting_vote")
 556  	// The domain transfer has been rejected.
 557  	DomainRegistrationStatusTransferStatusRejected = DomainRegistrationStatusTransferStatus("rejected")
 558  	// The domain transfer has been accepted. Your resources are being created.
 559  	DomainRegistrationStatusTransferStatusProcessing = DomainRegistrationStatusTransferStatus("processing")
 560  	// The domain transfer is complete.
 561  	DomainRegistrationStatusTransferStatusDone = DomainRegistrationStatusTransferStatus("done")
 562  )
 563  
 564  func (enum DomainRegistrationStatusTransferStatus) String() string {
 565  	if enum == "" {
 566  		// return default value if empty
 567  		return string(DomainRegistrationStatusTransferStatusStatusUnknown)
 568  	}
 569  	return string(enum)
 570  }
 571  
 572  func (enum DomainRegistrationStatusTransferStatus) Values() []DomainRegistrationStatusTransferStatus {
 573  	return []DomainRegistrationStatusTransferStatus{
 574  		"status_unknown",
 575  		"pending",
 576  		"waiting_vote",
 577  		"rejected",
 578  		"processing",
 579  		"done",
 580  	}
 581  }
 582  
 583  func (enum DomainRegistrationStatusTransferStatus) MarshalJSON() ([]byte, error) {
 584  	return []byte(fmt.Sprintf(`"%s"`, enum)), nil
 585  }
 586  
 587  func (enum *DomainRegistrationStatusTransferStatus) UnmarshalJSON(data []byte) error {
 588  	tmp := ""
 589  
 590  	if err := json.Unmarshal(data, &tmp); err != nil {
 591  		return err
 592  	}
 593  
 594  	*enum = DomainRegistrationStatusTransferStatus(DomainRegistrationStatusTransferStatus(tmp).String())
 595  	return nil
 596  }
 597  
 598  type DomainStatus string
 599  
 600  const (
 601  	// If unspecified, the status is unknown by default.
 602  	DomainStatusStatusUnknown = DomainStatus("status_unknown")
 603  	// The domain is active.
 604  	DomainStatusActive = DomainStatus("active")
 605  	// The domain is in the process of being created.
 606  	DomainStatusCreating = DomainStatus("creating")
 607  	// An error occurred during the domain's creation process.
 608  	DomainStatusCreateError = DomainStatus("create_error")
 609  	// The domain is being renewed.
 610  	DomainStatusRenewing = DomainStatus("renewing")
 611  	// An error occurred during the domain's renewal process.
 612  	DomainStatusRenewError = DomainStatus("renew_error")
 613  	// The domain is being transferred to Scaleway Domains and DNS.
 614  	DomainStatusXfering = DomainStatus("xfering")
 615  	// An error occurred during the domain's transfer process.
 616  	DomainStatusXferError = DomainStatus("xfer_error")
 617  	// The domain is expired but it can be renewed.
 618  	DomainStatusExpired = DomainStatus("expired")
 619  	// The domain is expiring but it is still renewable.
 620  	DomainStatusExpiring = DomainStatus("expiring")
 621  	// The domain's information is updating.
 622  	DomainStatusUpdating = DomainStatus("updating")
 623  	// The external domain has not yet been validated. It will be automatically removed after 48 hours if it still has not been validated by then.
 624  	DomainStatusChecking = DomainStatus("checking")
 625  	// The domain is locked. Contact Scaleway's support team for more information.
 626  	DomainStatusLocked = DomainStatus("locked")
 627  	// The domain will be deleted soon. This process cannot be canceled.
 628  	DomainStatusDeleting = DomainStatus("deleting")
 629  )
 630  
 631  func (enum DomainStatus) String() string {
 632  	if enum == "" {
 633  		// return default value if empty
 634  		return string(DomainStatusStatusUnknown)
 635  	}
 636  	return string(enum)
 637  }
 638  
 639  func (enum DomainStatus) Values() []DomainStatus {
 640  	return []DomainStatus{
 641  		"status_unknown",
 642  		"active",
 643  		"creating",
 644  		"create_error",
 645  		"renewing",
 646  		"renew_error",
 647  		"xfering",
 648  		"xfer_error",
 649  		"expired",
 650  		"expiring",
 651  		"updating",
 652  		"checking",
 653  		"locked",
 654  		"deleting",
 655  	}
 656  }
 657  
 658  func (enum DomainStatus) MarshalJSON() ([]byte, error) {
 659  	return []byte(fmt.Sprintf(`"%s"`, enum)), nil
 660  }
 661  
 662  func (enum *DomainStatus) UnmarshalJSON(data []byte) error {
 663  	tmp := ""
 664  
 665  	if err := json.Unmarshal(data, &tmp); err != nil {
 666  		return err
 667  	}
 668  
 669  	*enum = DomainStatus(DomainStatus(tmp).String())
 670  	return nil
 671  }
 672  
 673  type HostStatus string
 674  
 675  const (
 676  	// If unspecified, the status is unknown by default.
 677  	HostStatusUnknownStatus = HostStatus("unknown_status")
 678  	// The host is active.
 679  	HostStatusActive = HostStatus("active")
 680  	// The host is being updated.
 681  	HostStatusUpdating = HostStatus("updating")
 682  	// The host is being deleted.
 683  	HostStatusDeleting = HostStatus("deleting")
 684  )
 685  
 686  func (enum HostStatus) String() string {
 687  	if enum == "" {
 688  		// return default value if empty
 689  		return string(HostStatusUnknownStatus)
 690  	}
 691  	return string(enum)
 692  }
 693  
 694  func (enum HostStatus) Values() []HostStatus {
 695  	return []HostStatus{
 696  		"unknown_status",
 697  		"active",
 698  		"updating",
 699  		"deleting",
 700  	}
 701  }
 702  
 703  func (enum HostStatus) MarshalJSON() ([]byte, error) {
 704  	return []byte(fmt.Sprintf(`"%s"`, enum)), nil
 705  }
 706  
 707  func (enum *HostStatus) UnmarshalJSON(data []byte) error {
 708  	tmp := ""
 709  
 710  	if err := json.Unmarshal(data, &tmp); err != nil {
 711  		return err
 712  	}
 713  
 714  	*enum = HostStatus(HostStatus(tmp).String())
 715  	return nil
 716  }
 717  
 718  type InboundTransferStatus string
 719  
 720  const (
 721  	// Unknown status.
 722  	InboundTransferStatusUnknown = InboundTransferStatus("unknown")
 723  	// Domain transfer in progress.
 724  	InboundTransferStatusInProgress = InboundTransferStatus("in_progress")
 725  	// Domain successfully transferred.
 726  	InboundTransferStatusDone = InboundTransferStatus("done")
 727  	// Internal error.
 728  	InboundTransferStatusErrInternal = InboundTransferStatus("err_internal")
 729  	// Domain is in a pending status.
 730  	InboundTransferStatusErrDomainPending = InboundTransferStatus("err_domain_pending")
 731  	// Domain is already being transferred.
 732  	InboundTransferStatusErrAlreadyTransferring = InboundTransferStatus("err_already_transferring")
 733  	// Domain transfer is prohibited (transfer/update prohibited status or is currently locked).
 734  	InboundTransferStatusErrTransferProhibited = InboundTransferStatus("err_transfer_prohibited")
 735  	// Transfer is not supported for this TLD or the domain is premium.
 736  	InboundTransferStatusErrTransferImpossible = InboundTransferStatus("err_transfer_impossible")
 737  	// Invalid authcode.
 738  	InboundTransferStatusErrInvalidAuthcode = InboundTransferStatus("err_invalid_authcode")
 739  	// Domain name was created less than 60 days ago.
 740  	InboundTransferStatusErrDomainTooYoung = InboundTransferStatus("err_domain_too_young")
 741  	// Too many transfer requests for this domain name.
 742  	InboundTransferStatusErrTooManyRequests = InboundTransferStatus("err_too_many_requests")
 743  )
 744  
 745  func (enum InboundTransferStatus) String() string {
 746  	if enum == "" {
 747  		// return default value if empty
 748  		return string(InboundTransferStatusUnknown)
 749  	}
 750  	return string(enum)
 751  }
 752  
 753  func (enum InboundTransferStatus) Values() []InboundTransferStatus {
 754  	return []InboundTransferStatus{
 755  		"unknown",
 756  		"in_progress",
 757  		"done",
 758  		"err_internal",
 759  		"err_domain_pending",
 760  		"err_already_transferring",
 761  		"err_transfer_prohibited",
 762  		"err_transfer_impossible",
 763  		"err_invalid_authcode",
 764  		"err_domain_too_young",
 765  		"err_too_many_requests",
 766  	}
 767  }
 768  
 769  func (enum InboundTransferStatus) MarshalJSON() ([]byte, error) {
 770  	return []byte(fmt.Sprintf(`"%s"`, enum)), nil
 771  }
 772  
 773  func (enum *InboundTransferStatus) UnmarshalJSON(data []byte) error {
 774  	tmp := ""
 775  
 776  	if err := json.Unmarshal(data, &tmp); err != nil {
 777  		return err
 778  	}
 779  
 780  	*enum = InboundTransferStatus(InboundTransferStatus(tmp).String())
 781  	return nil
 782  }
 783  
 784  type LinkedProduct string
 785  
 786  const (
 787  	// If unspecified, no Scaleway product uses the resources.
 788  	LinkedProductUnknownProduct = LinkedProduct("unknown_product")
 789  	// Resources are used by Scaleway VPC.
 790  	LinkedProductVpc = LinkedProduct("vpc")
 791  )
 792  
 793  func (enum LinkedProduct) String() string {
 794  	if enum == "" {
 795  		// return default value if empty
 796  		return string(LinkedProductUnknownProduct)
 797  	}
 798  	return string(enum)
 799  }
 800  
 801  func (enum LinkedProduct) Values() []LinkedProduct {
 802  	return []LinkedProduct{
 803  		"unknown_product",
 804  		"vpc",
 805  	}
 806  }
 807  
 808  func (enum LinkedProduct) MarshalJSON() ([]byte, error) {
 809  	return []byte(fmt.Sprintf(`"%s"`, enum)), nil
 810  }
 811  
 812  func (enum *LinkedProduct) UnmarshalJSON(data []byte) error {
 813  	tmp := ""
 814  
 815  	if err := json.Unmarshal(data, &tmp); err != nil {
 816  		return err
 817  	}
 818  
 819  	*enum = LinkedProduct(LinkedProduct(tmp).String())
 820  	return nil
 821  }
 822  
 823  type ListContactsRequestRole string
 824  
 825  const (
 826  	ListContactsRequestRoleUnknownRole = ListContactsRequestRole("unknown_role")
 827  	// The contact is a domain's owner.
 828  	ListContactsRequestRoleOwner = ListContactsRequestRole("owner")
 829  	// The contact is a domain's administrative contact.
 830  	ListContactsRequestRoleAdministrative = ListContactsRequestRole("administrative")
 831  	// The contact is a domain's technical contact.
 832  	ListContactsRequestRoleTechnical = ListContactsRequestRole("technical")
 833  )
 834  
 835  func (enum ListContactsRequestRole) String() string {
 836  	if enum == "" {
 837  		// return default value if empty
 838  		return string(ListContactsRequestRoleUnknownRole)
 839  	}
 840  	return string(enum)
 841  }
 842  
 843  func (enum ListContactsRequestRole) Values() []ListContactsRequestRole {
 844  	return []ListContactsRequestRole{
 845  		"unknown_role",
 846  		"owner",
 847  		"administrative",
 848  		"technical",
 849  	}
 850  }
 851  
 852  func (enum ListContactsRequestRole) MarshalJSON() ([]byte, error) {
 853  	return []byte(fmt.Sprintf(`"%s"`, enum)), nil
 854  }
 855  
 856  func (enum *ListContactsRequestRole) UnmarshalJSON(data []byte) error {
 857  	tmp := ""
 858  
 859  	if err := json.Unmarshal(data, &tmp); err != nil {
 860  		return err
 861  	}
 862  
 863  	*enum = ListContactsRequestRole(ListContactsRequestRole(tmp).String())
 864  	return nil
 865  }
 866  
 867  type ListDNSZoneRecordsRequestOrderBy string
 868  
 869  const (
 870  	// Order by record name (ascending).
 871  	ListDNSZoneRecordsRequestOrderByNameAsc = ListDNSZoneRecordsRequestOrderBy("name_asc")
 872  	// Order by record name (descending).
 873  	ListDNSZoneRecordsRequestOrderByNameDesc = ListDNSZoneRecordsRequestOrderBy("name_desc")
 874  )
 875  
 876  func (enum ListDNSZoneRecordsRequestOrderBy) String() string {
 877  	if enum == "" {
 878  		// return default value if empty
 879  		return string(ListDNSZoneRecordsRequestOrderByNameAsc)
 880  	}
 881  	return string(enum)
 882  }
 883  
 884  func (enum ListDNSZoneRecordsRequestOrderBy) Values() []ListDNSZoneRecordsRequestOrderBy {
 885  	return []ListDNSZoneRecordsRequestOrderBy{
 886  		"name_asc",
 887  		"name_desc",
 888  	}
 889  }
 890  
 891  func (enum ListDNSZoneRecordsRequestOrderBy) MarshalJSON() ([]byte, error) {
 892  	return []byte(fmt.Sprintf(`"%s"`, enum)), nil
 893  }
 894  
 895  func (enum *ListDNSZoneRecordsRequestOrderBy) UnmarshalJSON(data []byte) error {
 896  	tmp := ""
 897  
 898  	if err := json.Unmarshal(data, &tmp); err != nil {
 899  		return err
 900  	}
 901  
 902  	*enum = ListDNSZoneRecordsRequestOrderBy(ListDNSZoneRecordsRequestOrderBy(tmp).String())
 903  	return nil
 904  }
 905  
 906  type ListDNSZonesRequestOrderBy string
 907  
 908  const (
 909  	// Order by domain name (ascending).
 910  	ListDNSZonesRequestOrderByDomainAsc = ListDNSZonesRequestOrderBy("domain_asc")
 911  	// Order by domain name (descending).
 912  	ListDNSZonesRequestOrderByDomainDesc = ListDNSZonesRequestOrderBy("domain_desc")
 913  	// Order by subdomain name (ascending).
 914  	ListDNSZonesRequestOrderBySubdomainAsc = ListDNSZonesRequestOrderBy("subdomain_asc")
 915  	// Order by subdomain name (descending).
 916  	ListDNSZonesRequestOrderBySubdomainDesc = ListDNSZonesRequestOrderBy("subdomain_desc")
 917  	// Order by created date (ascending).
 918  	ListDNSZonesRequestOrderByCreatedAtAsc = ListDNSZonesRequestOrderBy("created_at_asc")
 919  	// Order by created date (descending).
 920  	ListDNSZonesRequestOrderByCreatedAtDesc = ListDNSZonesRequestOrderBy("created_at_desc")
 921  	// Order by updated date (ascending).
 922  	ListDNSZonesRequestOrderByUpdatedAtAsc = ListDNSZonesRequestOrderBy("updated_at_asc")
 923  	// Order by updated date (descending).
 924  	ListDNSZonesRequestOrderByUpdatedAtDesc = ListDNSZonesRequestOrderBy("updated_at_desc")
 925  )
 926  
 927  func (enum ListDNSZonesRequestOrderBy) String() string {
 928  	if enum == "" {
 929  		// return default value if empty
 930  		return string(ListDNSZonesRequestOrderByDomainAsc)
 931  	}
 932  	return string(enum)
 933  }
 934  
 935  func (enum ListDNSZonesRequestOrderBy) Values() []ListDNSZonesRequestOrderBy {
 936  	return []ListDNSZonesRequestOrderBy{
 937  		"domain_asc",
 938  		"domain_desc",
 939  		"subdomain_asc",
 940  		"subdomain_desc",
 941  		"created_at_asc",
 942  		"created_at_desc",
 943  		"updated_at_asc",
 944  		"updated_at_desc",
 945  	}
 946  }
 947  
 948  func (enum ListDNSZonesRequestOrderBy) MarshalJSON() ([]byte, error) {
 949  	return []byte(fmt.Sprintf(`"%s"`, enum)), nil
 950  }
 951  
 952  func (enum *ListDNSZonesRequestOrderBy) UnmarshalJSON(data []byte) error {
 953  	tmp := ""
 954  
 955  	if err := json.Unmarshal(data, &tmp); err != nil {
 956  		return err
 957  	}
 958  
 959  	*enum = ListDNSZonesRequestOrderBy(ListDNSZonesRequestOrderBy(tmp).String())
 960  	return nil
 961  }
 962  
 963  type ListDomainsRequestOrderBy string
 964  
 965  const (
 966  	// Order by domain name (ascending).
 967  	ListDomainsRequestOrderByDomainAsc = ListDomainsRequestOrderBy("domain_asc")
 968  	// Order by domain name (descending).
 969  	ListDomainsRequestOrderByDomainDesc = ListDomainsRequestOrderBy("domain_desc")
 970  )
 971  
 972  func (enum ListDomainsRequestOrderBy) String() string {
 973  	if enum == "" {
 974  		// return default value if empty
 975  		return string(ListDomainsRequestOrderByDomainAsc)
 976  	}
 977  	return string(enum)
 978  }
 979  
 980  func (enum ListDomainsRequestOrderBy) Values() []ListDomainsRequestOrderBy {
 981  	return []ListDomainsRequestOrderBy{
 982  		"domain_asc",
 983  		"domain_desc",
 984  	}
 985  }
 986  
 987  func (enum ListDomainsRequestOrderBy) MarshalJSON() ([]byte, error) {
 988  	return []byte(fmt.Sprintf(`"%s"`, enum)), nil
 989  }
 990  
 991  func (enum *ListDomainsRequestOrderBy) UnmarshalJSON(data []byte) error {
 992  	tmp := ""
 993  
 994  	if err := json.Unmarshal(data, &tmp); err != nil {
 995  		return err
 996  	}
 997  
 998  	*enum = ListDomainsRequestOrderBy(ListDomainsRequestOrderBy(tmp).String())
 999  	return nil
1000  }
1001  
1002  type ListRenewableDomainsRequestOrderBy string
1003  
1004  const (
1005  	// Order by domain name (ascending).
1006  	ListRenewableDomainsRequestOrderByDomainAsc = ListRenewableDomainsRequestOrderBy("domain_asc")
1007  	// Order by domain name (descending).
1008  	ListRenewableDomainsRequestOrderByDomainDesc = ListRenewableDomainsRequestOrderBy("domain_desc")
1009  )
1010  
1011  func (enum ListRenewableDomainsRequestOrderBy) String() string {
1012  	if enum == "" {
1013  		// return default value if empty
1014  		return string(ListRenewableDomainsRequestOrderByDomainAsc)
1015  	}
1016  	return string(enum)
1017  }
1018  
1019  func (enum ListRenewableDomainsRequestOrderBy) Values() []ListRenewableDomainsRequestOrderBy {
1020  	return []ListRenewableDomainsRequestOrderBy{
1021  		"domain_asc",
1022  		"domain_desc",
1023  	}
1024  }
1025  
1026  func (enum ListRenewableDomainsRequestOrderBy) MarshalJSON() ([]byte, error) {
1027  	return []byte(fmt.Sprintf(`"%s"`, enum)), nil
1028  }
1029  
1030  func (enum *ListRenewableDomainsRequestOrderBy) UnmarshalJSON(data []byte) error {
1031  	tmp := ""
1032  
1033  	if err := json.Unmarshal(data, &tmp); err != nil {
1034  		return err
1035  	}
1036  
1037  	*enum = ListRenewableDomainsRequestOrderBy(ListRenewableDomainsRequestOrderBy(tmp).String())
1038  	return nil
1039  }
1040  
1041  type ListTasksRequestOrderBy string
1042  
1043  const (
1044  	// Order by domain name (descending).
1045  	ListTasksRequestOrderByDomainDesc = ListTasksRequestOrderBy("domain_desc")
1046  	// Order by domain name (ascending).
1047  	ListTasksRequestOrderByDomainAsc = ListTasksRequestOrderBy("domain_asc")
1048  	// Order by type (ascending).
1049  	ListTasksRequestOrderByTypeAsc = ListTasksRequestOrderBy("type_asc")
1050  	// Order by type (descending).
1051  	ListTasksRequestOrderByTypeDesc = ListTasksRequestOrderBy("type_desc")
1052  	// Order by status (ascending).
1053  	ListTasksRequestOrderByStatusAsc = ListTasksRequestOrderBy("status_asc")
1054  	// Order by status (descending).
1055  	ListTasksRequestOrderByStatusDesc = ListTasksRequestOrderBy("status_desc")
1056  	// Order by updated date (ascending).
1057  	ListTasksRequestOrderByUpdatedAtAsc = ListTasksRequestOrderBy("updated_at_asc")
1058  	// Order by updated date (descending).
1059  	ListTasksRequestOrderByUpdatedAtDesc = ListTasksRequestOrderBy("updated_at_desc")
1060  )
1061  
1062  func (enum ListTasksRequestOrderBy) String() string {
1063  	if enum == "" {
1064  		// return default value if empty
1065  		return string(ListTasksRequestOrderByDomainDesc)
1066  	}
1067  	return string(enum)
1068  }
1069  
1070  func (enum ListTasksRequestOrderBy) Values() []ListTasksRequestOrderBy {
1071  	return []ListTasksRequestOrderBy{
1072  		"domain_desc",
1073  		"domain_asc",
1074  		"type_asc",
1075  		"type_desc",
1076  		"status_asc",
1077  		"status_desc",
1078  		"updated_at_asc",
1079  		"updated_at_desc",
1080  	}
1081  }
1082  
1083  func (enum ListTasksRequestOrderBy) MarshalJSON() ([]byte, error) {
1084  	return []byte(fmt.Sprintf(`"%s"`, enum)), nil
1085  }
1086  
1087  func (enum *ListTasksRequestOrderBy) UnmarshalJSON(data []byte) error {
1088  	tmp := ""
1089  
1090  	if err := json.Unmarshal(data, &tmp); err != nil {
1091  		return err
1092  	}
1093  
1094  	*enum = ListTasksRequestOrderBy(ListTasksRequestOrderBy(tmp).String())
1095  	return nil
1096  }
1097  
1098  type ListTldsRequestOrderBy string
1099  
1100  const (
1101  	// Order by TLD name (ascending).
1102  	ListTldsRequestOrderByNameAsc = ListTldsRequestOrderBy("name_asc")
1103  	// Order by TLD name (descending).
1104  	ListTldsRequestOrderByNameDesc = ListTldsRequestOrderBy("name_desc")
1105  )
1106  
1107  func (enum ListTldsRequestOrderBy) String() string {
1108  	if enum == "" {
1109  		// return default value if empty
1110  		return string(ListTldsRequestOrderByNameAsc)
1111  	}
1112  	return string(enum)
1113  }
1114  
1115  func (enum ListTldsRequestOrderBy) Values() []ListTldsRequestOrderBy {
1116  	return []ListTldsRequestOrderBy{
1117  		"name_asc",
1118  		"name_desc",
1119  	}
1120  }
1121  
1122  func (enum ListTldsRequestOrderBy) MarshalJSON() ([]byte, error) {
1123  	return []byte(fmt.Sprintf(`"%s"`, enum)), nil
1124  }
1125  
1126  func (enum *ListTldsRequestOrderBy) UnmarshalJSON(data []byte) error {
1127  	tmp := ""
1128  
1129  	if err := json.Unmarshal(data, &tmp); err != nil {
1130  		return err
1131  	}
1132  
1133  	*enum = ListTldsRequestOrderBy(ListTldsRequestOrderBy(tmp).String())
1134  	return nil
1135  }
1136  
1137  type RawFormat string
1138  
1139  const (
1140  	// If unspecified, the format is unknown by default.
1141  	RawFormatUnknownRawFormat = RawFormat("unknown_raw_format")
1142  	// Export the DNS zone in text bind format.
1143  	RawFormatBind = RawFormat("bind")
1144  )
1145  
1146  func (enum RawFormat) String() string {
1147  	if enum == "" {
1148  		// return default value if empty
1149  		return string(RawFormatUnknownRawFormat)
1150  	}
1151  	return string(enum)
1152  }
1153  
1154  func (enum RawFormat) Values() []RawFormat {
1155  	return []RawFormat{
1156  		"unknown_raw_format",
1157  		"bind",
1158  	}
1159  }
1160  
1161  func (enum RawFormat) MarshalJSON() ([]byte, error) {
1162  	return []byte(fmt.Sprintf(`"%s"`, enum)), nil
1163  }
1164  
1165  func (enum *RawFormat) UnmarshalJSON(data []byte) error {
1166  	tmp := ""
1167  
1168  	if err := json.Unmarshal(data, &tmp); err != nil {
1169  		return err
1170  	}
1171  
1172  	*enum = RawFormat(RawFormat(tmp).String())
1173  	return nil
1174  }
1175  
1176  type RecordHTTPServiceConfigStrategy string
1177  
1178  const (
1179  	// Returns a random IP based of the list of IPs available.
1180  	RecordHTTPServiceConfigStrategyRandom = RecordHTTPServiceConfigStrategy("random")
1181  	// Based on the hash of bestwho, returns a random functioning IP out of the best IPs available.
1182  	RecordHTTPServiceConfigStrategyHashed = RecordHTTPServiceConfigStrategy("hashed")
1183  	// Return all functioning IPs available.
1184  	RecordHTTPServiceConfigStrategyAll = RecordHTTPServiceConfigStrategy("all")
1185  )
1186  
1187  func (enum RecordHTTPServiceConfigStrategy) String() string {
1188  	if enum == "" {
1189  		// return default value if empty
1190  		return string(RecordHTTPServiceConfigStrategyRandom)
1191  	}
1192  	return string(enum)
1193  }
1194  
1195  func (enum RecordHTTPServiceConfigStrategy) Values() []RecordHTTPServiceConfigStrategy {
1196  	return []RecordHTTPServiceConfigStrategy{
1197  		"random",
1198  		"hashed",
1199  		"all",
1200  	}
1201  }
1202  
1203  func (enum RecordHTTPServiceConfigStrategy) MarshalJSON() ([]byte, error) {
1204  	return []byte(fmt.Sprintf(`"%s"`, enum)), nil
1205  }
1206  
1207  func (enum *RecordHTTPServiceConfigStrategy) UnmarshalJSON(data []byte) error {
1208  	tmp := ""
1209  
1210  	if err := json.Unmarshal(data, &tmp); err != nil {
1211  		return err
1212  	}
1213  
1214  	*enum = RecordHTTPServiceConfigStrategy(RecordHTTPServiceConfigStrategy(tmp).String())
1215  	return nil
1216  }
1217  
1218  type RecordType string
1219  
1220  const (
1221  	// If unspecified, the record's type is unknown by default.
1222  	RecordTypeUnknown = RecordType("unknown")
1223  	// An A record contains an IP address. Example: '203.0.113.210'.
1224  	RecordTypeA = RecordType("A")
1225  	// An AAAA record contains an IPv6 address. Example: '2001:DB8:2000:bf0::1'.
1226  	RecordTypeAAAA = RecordType("AAAA")
1227  	// A CNAME record specifies the canonical name of a record. Example 'webserver-01.yourcompany.com'.
1228  	RecordTypeCNAME = RecordType("CNAME")
1229  	// A TXT record can be used to attach textual data to a domain. Example 'v=spf1 include:_spf.tem.scw.cloud -all'.
1230  	RecordTypeTXT = RecordType("TXT")
1231  	// SRV records can be used to encode the location and port of services on a domain name. Example : '20 443 sipdir.scaleway.example.com'.
1232  	RecordTypeSRV = RecordType("SRV")
1233  	// TLSA records are used to bind SSL/TLS certificates to named hosts and ports.
1234  	RecordTypeTLSA = RecordType("TLSA")
1235  	// An MX record specifies a mail exchanger host for a domain. Example '10 mx.example.net.'.
1236  	RecordTypeMX = RecordType("MX")
1237  	// Specifies nameservers for a domain. Example: 'ns1.yourcompany.com'.
1238  	RecordTypeNS = RecordType("NS")
1239  	// A reverse pointer is used to specify the hostname that belongs to an IP or an IPv6 address. Example: 'www.yourcompany.com.'.
1240  	RecordTypePTR = RecordType("PTR")
1241  	// A 'Certification Authority Authorization' record is used to specify certificate authorities that may issue certificates for a domain. Example: '0 issue ca.yourcompany.com'.
1242  	RecordTypeCAA = RecordType("CAA")
1243  	// The ALIAS pseudo-record type is supported to provide CNAME-like mechanisms on a zone's apex.
1244  	RecordTypeALIAS = RecordType("ALIAS")
1245  	// A LOC record is a way of expressing geographic location information for a domain name. It contains WGS84 latitude, longitude and altitude. Example: '51 56 0.123 N 5 54 0.000 E 4.00m 1.00m 10000.00m 10.00m'.
1246  	RecordTypeLOC = RecordType("LOC")
1247  	// An SSHFP record type is used for storing Secure Shell (SSH) fingerprints. Example: '2 1 123456789abcdef67890123456789abcdef67890'.
1248  	RecordTypeSSHFP = RecordType("SSHFP")
1249  	// A Hardware Info record is used to specify the CPU and operating system you are using. Example: 'i386 Linux'.
1250  	RecordTypeHINFO = RecordType("HINFO")
1251  	// A Responsible Person record stores the mailbox name and the more-information pointer. Example: 'michel.yourcompany.com michel.people.yourcompany.com', to indicate that michel@yourcompany.com is responsible and that more information about Michel is available by querying the `TXT` record of 'michel.people.yourcompany.com'.
1252  	RecordTypeRP = RecordType("RP")
1253  	// A URI record, is used to publish mappings from hostnames to URIs. Example: '10 1 'ftp://ftp.yourcompany.com/public'.
1254  	RecordTypeURI = RecordType("URI")
1255  	// DS records (Delegation Signer) are used to secure delegations (DNSSEC). Example: '2371 13 2 1F987CC6583E92DF0890718C42'.
1256  	RecordTypeDS = RecordType("DS")
1257  	// A Naming Authority Pointer record is used to set rules for how websites process requests. Example: '100 50 "s" "z3950+I2L+I2C" "" _z3950._tcp.yourcompany.com'.
1258  	RecordTypeNAPTR = RecordType("NAPTR")
1259  	// A DNAME record provides redirection from one part of the DNS name tree to another part of the DNS name tree. DNAME and CNAME records both cause a lookup to (potentially) return data corresponding to a different domain name from the queried domain name. Example: 'yourcompany.com'.
1260  	RecordTypeDNAME = RecordType("DNAME")
1261  	// A SVCB (Service Binding) record provides information about a service endpoint associated with a domain name.
1262  	RecordTypeSVCB = RecordType("SVCB")
1263  	// An HTTPS record is a special type of SVCB record for HTTPS service endpoints.
1264  	RecordTypeHTTPS = RecordType("HTTPS")
1265  )
1266  
1267  func (enum RecordType) String() string {
1268  	if enum == "" {
1269  		// return default value if empty
1270  		return string(RecordTypeUnknown)
1271  	}
1272  	return string(enum)
1273  }
1274  
1275  func (enum RecordType) Values() []RecordType {
1276  	return []RecordType{
1277  		"unknown",
1278  		"A",
1279  		"AAAA",
1280  		"CNAME",
1281  		"TXT",
1282  		"SRV",
1283  		"TLSA",
1284  		"MX",
1285  		"NS",
1286  		"PTR",
1287  		"CAA",
1288  		"ALIAS",
1289  		"LOC",
1290  		"SSHFP",
1291  		"HINFO",
1292  		"RP",
1293  		"URI",
1294  		"DS",
1295  		"NAPTR",
1296  		"DNAME",
1297  		"SVCB",
1298  		"HTTPS",
1299  	}
1300  }
1301  
1302  func (enum RecordType) MarshalJSON() ([]byte, error) {
1303  	return []byte(fmt.Sprintf(`"%s"`, enum)), nil
1304  }
1305  
1306  func (enum *RecordType) UnmarshalJSON(data []byte) error {
1307  	tmp := ""
1308  
1309  	if err := json.Unmarshal(data, &tmp); err != nil {
1310  		return err
1311  	}
1312  
1313  	*enum = RecordType(RecordType(tmp).String())
1314  	return nil
1315  }
1316  
1317  type RenewableDomainStatus string
1318  
1319  const (
1320  	// If unspecified, the status is unknown by default.
1321  	RenewableDomainStatusUnknown = RenewableDomainStatus("unknown")
1322  	// The domain can be renewed.
1323  	RenewableDomainStatusRenewable = RenewableDomainStatus("renewable")
1324  	// The domain is expired, but it still can be late renewed.
1325  	RenewableDomainStatusLateReneweable = RenewableDomainStatus("late_reneweable")
1326  	// The domain cannot be renewed.
1327  	RenewableDomainStatusNotRenewable = RenewableDomainStatus("not_renewable")
1328  )
1329  
1330  func (enum RenewableDomainStatus) String() string {
1331  	if enum == "" {
1332  		// return default value if empty
1333  		return string(RenewableDomainStatusUnknown)
1334  	}
1335  	return string(enum)
1336  }
1337  
1338  func (enum RenewableDomainStatus) Values() []RenewableDomainStatus {
1339  	return []RenewableDomainStatus{
1340  		"unknown",
1341  		"renewable",
1342  		"late_reneweable",
1343  		"not_renewable",
1344  	}
1345  }
1346  
1347  func (enum RenewableDomainStatus) MarshalJSON() ([]byte, error) {
1348  	return []byte(fmt.Sprintf(`"%s"`, enum)), nil
1349  }
1350  
1351  func (enum *RenewableDomainStatus) UnmarshalJSON(data []byte) error {
1352  	tmp := ""
1353  
1354  	if err := json.Unmarshal(data, &tmp); err != nil {
1355  		return err
1356  	}
1357  
1358  	*enum = RenewableDomainStatus(RenewableDomainStatus(tmp).String())
1359  	return nil
1360  }
1361  
1362  type SSLCertificateStatus string
1363  
1364  const (
1365  	// If unspecified, the SSL certificate's status is unknown by default.
1366  	SSLCertificateStatusUnknown = SSLCertificateStatus("unknown")
1367  	// The SSL certificate has been created but it has not been processed yet.
1368  	SSLCertificateStatusNew = SSLCertificateStatus("new")
1369  	// The SSL certificate's status is pending.
1370  	SSLCertificateStatusPending = SSLCertificateStatus("pending")
1371  	// The SSL certificate has been created and processed.
1372  	SSLCertificateStatusSuccess = SSLCertificateStatus("success")
1373  	// An error occurred during the SSL certificate's creation.
1374  	SSLCertificateStatusError = SSLCertificateStatus("error")
1375  )
1376  
1377  func (enum SSLCertificateStatus) String() string {
1378  	if enum == "" {
1379  		// return default value if empty
1380  		return string(SSLCertificateStatusUnknown)
1381  	}
1382  	return string(enum)
1383  }
1384  
1385  func (enum SSLCertificateStatus) Values() []SSLCertificateStatus {
1386  	return []SSLCertificateStatus{
1387  		"unknown",
1388  		"new",
1389  		"pending",
1390  		"success",
1391  		"error",
1392  	}
1393  }
1394  
1395  func (enum SSLCertificateStatus) MarshalJSON() ([]byte, error) {
1396  	return []byte(fmt.Sprintf(`"%s"`, enum)), nil
1397  }
1398  
1399  func (enum *SSLCertificateStatus) UnmarshalJSON(data []byte) error {
1400  	tmp := ""
1401  
1402  	if err := json.Unmarshal(data, &tmp); err != nil {
1403  		return err
1404  	}
1405  
1406  	*enum = SSLCertificateStatus(SSLCertificateStatus(tmp).String())
1407  	return nil
1408  }
1409  
1410  type TaskStatus string
1411  
1412  const (
1413  	// If unspecified, the status is unavailable by default.
1414  	TaskStatusUnavailable = TaskStatus("unavailable")
1415  	// The task has been created but it has not yet started.
1416  	TaskStatusNew = TaskStatus("new")
1417  	// The task is waiting for a payment to be validated.
1418  	TaskStatusWaitingPayment = TaskStatus("waiting_payment")
1419  	// The task is pending.
1420  	TaskStatusPending = TaskStatus("pending")
1421  	// The task has been completed.
1422  	TaskStatusSuccess = TaskStatus("success")
1423  	// The task is in an error state.
1424  	TaskStatusError = TaskStatus("error")
1425  )
1426  
1427  func (enum TaskStatus) String() string {
1428  	if enum == "" {
1429  		// return default value if empty
1430  		return string(TaskStatusUnavailable)
1431  	}
1432  	return string(enum)
1433  }
1434  
1435  func (enum TaskStatus) Values() []TaskStatus {
1436  	return []TaskStatus{
1437  		"unavailable",
1438  		"new",
1439  		"waiting_payment",
1440  		"pending",
1441  		"success",
1442  		"error",
1443  	}
1444  }
1445  
1446  func (enum TaskStatus) MarshalJSON() ([]byte, error) {
1447  	return []byte(fmt.Sprintf(`"%s"`, enum)), nil
1448  }
1449  
1450  func (enum *TaskStatus) UnmarshalJSON(data []byte) error {
1451  	tmp := ""
1452  
1453  	if err := json.Unmarshal(data, &tmp); err != nil {
1454  		return err
1455  	}
1456  
1457  	*enum = TaskStatus(TaskStatus(tmp).String())
1458  	return nil
1459  }
1460  
1461  type TaskType string
1462  
1463  const (
1464  	// If unspecified, the status is unknown by default.
1465  	TaskTypeUnknown = TaskType("unknown")
1466  	// Create a new internal domain.
1467  	TaskTypeCreateDomain = TaskType("create_domain")
1468  	// Create a new external domain.
1469  	TaskTypeCreateExternalDomain = TaskType("create_external_domain")
1470  	// Renew a domain.
1471  	TaskTypeRenewDomain = TaskType("renew_domain")
1472  	// Transfer a domain to Scaleway Domains and DNS.
1473  	TaskTypeTransferDomain = TaskType("transfer_domain")
1474  	// Trade a domain to a new owner.
1475  	TaskTypeTradeDomain = TaskType("trade_domain")
1476  	// Lock the transfer of a domain for protection.
1477  	TaskTypeLockDomainTransfer = TaskType("lock_domain_transfer")
1478  	// Unlock the transfer of a domain.
1479  	TaskTypeUnlockDomainTransfer = TaskType("unlock_domain_transfer")
1480  	// Enable DNSSEC for a domain.
1481  	TaskTypeEnableDnssec = TaskType("enable_dnssec")
1482  	// Disable DNSSEC for a domain.
1483  	TaskTypeDisableDnssec = TaskType("disable_dnssec")
1484  	// Update the domain's information.
1485  	TaskTypeUpdateDomain = TaskType("update_domain")
1486  	// Change the technical or administrative contact.
1487  	TaskTypeUpdateContact = TaskType("update_contact")
1488  	// Delete a domain and destroy its zone versions, zones, and SSL certificates.
1489  	TaskTypeDeleteDomain = TaskType("delete_domain")
1490  	// Cancel a task that has not yet started.
1491  	TaskTypeCancelTask = TaskType("cancel_task")
1492  	// Generate a new SSL certificate.
1493  	TaskTypeGenerateSslCertificate = TaskType("generate_ssl_certificate")
1494  	// Renew an SSL certificate.
1495  	TaskTypeRenewSslCertificate = TaskType("renew_ssl_certificate")
1496  	// Send a message. For most cases, it will be followed by an email.
1497  	TaskTypeSendMessage = TaskType("send_message")
1498  	// Delete a domain that has expired and not been restored for at least 3 months.
1499  	TaskTypeDeleteDomainExpired = TaskType("delete_domain_expired")
1500  	// Delete a newly registered external domain that has not been validated after 48 hours or when the external domain fails to point to our name servers for more than 14 days.
1501  	TaskTypeDeleteExternalDomain = TaskType("delete_external_domain")
1502  	// Create domain's hostname with glue IPs.
1503  	TaskTypeCreateHost = TaskType("create_host")
1504  	// Update domain's hostname with glue IPs.
1505  	TaskTypeUpdateHost = TaskType("update_host")
1506  	// Delete domain's hostname.
1507  	TaskTypeDeleteHost = TaskType("delete_host")
1508  	// Move a domain to another Project.
1509  	TaskTypeMoveProject = TaskType("move_project")
1510  	// Transfer a domain from Online to Scaleway Domains and DNS.
1511  	TaskTypeTransferOnlineDomain = TaskType("transfer_online_domain")
1512  )
1513  
1514  func (enum TaskType) String() string {
1515  	if enum == "" {
1516  		// return default value if empty
1517  		return string(TaskTypeUnknown)
1518  	}
1519  	return string(enum)
1520  }
1521  
1522  func (enum TaskType) Values() []TaskType {
1523  	return []TaskType{
1524  		"unknown",
1525  		"create_domain",
1526  		"create_external_domain",
1527  		"renew_domain",
1528  		"transfer_domain",
1529  		"trade_domain",
1530  		"lock_domain_transfer",
1531  		"unlock_domain_transfer",
1532  		"enable_dnssec",
1533  		"disable_dnssec",
1534  		"update_domain",
1535  		"update_contact",
1536  		"delete_domain",
1537  		"cancel_task",
1538  		"generate_ssl_certificate",
1539  		"renew_ssl_certificate",
1540  		"send_message",
1541  		"delete_domain_expired",
1542  		"delete_external_domain",
1543  		"create_host",
1544  		"update_host",
1545  		"delete_host",
1546  		"move_project",
1547  		"transfer_online_domain",
1548  	}
1549  }
1550  
1551  func (enum TaskType) MarshalJSON() ([]byte, error) {
1552  	return []byte(fmt.Sprintf(`"%s"`, enum)), nil
1553  }
1554  
1555  func (enum *TaskType) UnmarshalJSON(data []byte) error {
1556  	tmp := ""
1557  
1558  	if err := json.Unmarshal(data, &tmp); err != nil {
1559  		return err
1560  	}
1561  
1562  	*enum = TaskType(TaskType(tmp).String())
1563  	return nil
1564  }
1565  
1566  // RecordGeoIPConfigMatch: record geo ip config match.
1567  type RecordGeoIPConfigMatch struct {
1568  	Countries []string `json:"countries"`
1569  
1570  	Continents []string `json:"continents"`
1571  
1572  	Data string `json:"data"`
1573  }
1574  
1575  // RecordViewConfigView: record view config view.
1576  type RecordViewConfigView struct {
1577  	Subnet string `json:"subnet"`
1578  
1579  	Data string `json:"data"`
1580  }
1581  
1582  // RecordWeightedConfigWeightedIP: record weighted config weighted ip.
1583  type RecordWeightedConfigWeightedIP struct {
1584  	IP net.IP `json:"ip"`
1585  
1586  	Weight uint32 `json:"weight"`
1587  }
1588  
1589  // DSRecordPublicKey: ds record public key.
1590  type DSRecordPublicKey struct {
1591  	Key string `json:"key"`
1592  }
1593  
1594  // RecordGeoIPConfig: record geo ip config.
1595  type RecordGeoIPConfig struct {
1596  	Matches []*RecordGeoIPConfigMatch `json:"matches"`
1597  
1598  	Default string `json:"default"`
1599  }
1600  
1601  // RecordHTTPServiceConfig: record http service config.
1602  type RecordHTTPServiceConfig struct {
1603  	IPs []net.IP `json:"ips"`
1604  
1605  	MustContain *string `json:"must_contain"`
1606  
1607  	URL string `json:"url"`
1608  
1609  	UserAgent *string `json:"user_agent"`
1610  
1611  	// Strategy: default value: random
1612  	Strategy RecordHTTPServiceConfigStrategy `json:"strategy"`
1613  }
1614  
1615  // RecordViewConfig: record view config.
1616  type RecordViewConfig struct {
1617  	Views []*RecordViewConfigView `json:"views"`
1618  }
1619  
1620  // RecordWeightedConfig: record weighted config.
1621  type RecordWeightedConfig struct {
1622  	WeightedIPs []*RecordWeightedConfigWeightedIP `json:"weighted_ips"`
1623  }
1624  
1625  // ContactExtensionFRAssociationInfo: contact extension fr association info.
1626  type ContactExtensionFRAssociationInfo struct {
1627  	PublicationJo *time.Time `json:"publication_jo"`
1628  
1629  	PublicationJoPage uint32 `json:"publication_jo_page"`
1630  }
1631  
1632  // ContactExtensionFRCodeAuthAfnicInfo: contact extension fr code auth afnic info.
1633  type ContactExtensionFRCodeAuthAfnicInfo struct {
1634  	CodeAuthAfnic string `json:"code_auth_afnic"`
1635  }
1636  
1637  // ContactExtensionFRDunsInfo: contact extension fr duns info.
1638  type ContactExtensionFRDunsInfo struct {
1639  	DunsID string `json:"duns_id"`
1640  
1641  	LocalID string `json:"local_id"`
1642  }
1643  
1644  // ContactExtensionFRIndividualInfo: contact extension fr individual info.
1645  type ContactExtensionFRIndividualInfo struct {
1646  	WhoisOptIn bool `json:"whois_opt_in"`
1647  }
1648  
1649  // ContactExtensionFRTrademarkInfo: contact extension fr trademark info.
1650  type ContactExtensionFRTrademarkInfo struct {
1651  	TrademarkInpi string `json:"trademark_inpi"`
1652  }
1653  
1654  // DSRecordDigest: ds record digest.
1655  type DSRecordDigest struct {
1656  	// Type: default value: sha_1
1657  	Type DSRecordDigestType `json:"type"`
1658  
1659  	Digest string `json:"digest"`
1660  
1661  	PublicKey *DSRecordPublicKey `json:"public_key"`
1662  }
1663  
1664  // Record: record.
1665  type Record struct {
1666  	Data string `json:"data"`
1667  
1668  	Name string `json:"name"`
1669  
1670  	Priority uint32 `json:"priority"`
1671  
1672  	TTL uint32 `json:"ttl"`
1673  
1674  	// Type: default value: unknown
1675  	Type RecordType `json:"type"`
1676  
1677  	Comment *string `json:"comment"`
1678  
1679  	// Precisely one of GeoIPConfig, HTTPServiceConfig, WeightedConfig, ViewConfig must be set.
1680  	GeoIPConfig *RecordGeoIPConfig `json:"geo_ip_config,omitempty"`
1681  
1682  	// Precisely one of GeoIPConfig, HTTPServiceConfig, WeightedConfig, ViewConfig must be set.
1683  	HTTPServiceConfig *RecordHTTPServiceConfig `json:"http_service_config,omitempty"`
1684  
1685  	// Precisely one of GeoIPConfig, HTTPServiceConfig, WeightedConfig, ViewConfig must be set.
1686  	WeightedConfig *RecordWeightedConfig `json:"weighted_config,omitempty"`
1687  
1688  	// Precisely one of GeoIPConfig, HTTPServiceConfig, WeightedConfig, ViewConfig must be set.
1689  	ViewConfig *RecordViewConfig `json:"view_config,omitempty"`
1690  
1691  	ID string `json:"id"`
1692  }
1693  
1694  // RecordIdentifier: record identifier.
1695  type RecordIdentifier struct {
1696  	Name string `json:"name"`
1697  
1698  	// Type: default value: unknown
1699  	Type RecordType `json:"type"`
1700  
1701  	Data *string `json:"data"`
1702  
1703  	TTL *uint32 `json:"ttl"`
1704  }
1705  
1706  // ContactExtensionEU: contact extension eu.
1707  type ContactExtensionEU struct {
1708  	EuropeanCitizenship string `json:"european_citizenship"`
1709  }
1710  
1711  // ContactExtensionFR: contact extension fr.
1712  type ContactExtensionFR struct {
1713  	// Mode: default value: mode_unknown
1714  	Mode ContactExtensionFRMode `json:"mode"`
1715  
1716  	// Precisely one of IndividualInfo, DunsInfo, AssociationInfo, TrademarkInfo, CodeAuthAfnicInfo must be set.
1717  	IndividualInfo *ContactExtensionFRIndividualInfo `json:"individual_info,omitempty"`
1718  
1719  	// Precisely one of IndividualInfo, DunsInfo, AssociationInfo, TrademarkInfo, CodeAuthAfnicInfo must be set.
1720  	DunsInfo *ContactExtensionFRDunsInfo `json:"duns_info,omitempty"`
1721  
1722  	// Precisely one of IndividualInfo, DunsInfo, AssociationInfo, TrademarkInfo, CodeAuthAfnicInfo must be set.
1723  	AssociationInfo *ContactExtensionFRAssociationInfo `json:"association_info,omitempty"`
1724  
1725  	// Precisely one of IndividualInfo, DunsInfo, AssociationInfo, TrademarkInfo, CodeAuthAfnicInfo must be set.
1726  	TrademarkInfo *ContactExtensionFRTrademarkInfo `json:"trademark_info,omitempty"`
1727  
1728  	// Precisely one of IndividualInfo, DunsInfo, AssociationInfo, TrademarkInfo, CodeAuthAfnicInfo must be set.
1729  	CodeAuthAfnicInfo *ContactExtensionFRCodeAuthAfnicInfo `json:"code_auth_afnic_info,omitempty"`
1730  }
1731  
1732  // ContactExtensionIT: contact extension it.
1733  type ContactExtensionIT struct {
1734  	// Deprecated
1735  	EuropeanCitizenship *string `json:"european_citizenship,omitempty"`
1736  
1737  	// Deprecated
1738  	TaxCode *string `json:"tax_code,omitempty"`
1739  
1740  	Pin string `json:"pin"`
1741  }
1742  
1743  // ContactExtensionNL: contact extension nl.
1744  type ContactExtensionNL struct {
1745  	// LegalForm: default value: legal_form_unknown
1746  	LegalForm ContactExtensionNLLegalForm `json:"legal_form"`
1747  
1748  	LegalFormRegistrationNumber string `json:"legal_form_registration_number"`
1749  }
1750  
1751  // ContactQuestion: contact question.
1752  type ContactQuestion struct {
1753  	Question string `json:"question"`
1754  
1755  	Answer string `json:"answer"`
1756  }
1757  
1758  // TldOffer: tld offer.
1759  type TldOffer struct {
1760  	Action string `json:"action"`
1761  
1762  	OperationPath string `json:"operation_path"`
1763  
1764  	Price *scw.Money `json:"price"`
1765  }
1766  
1767  // DSRecord: ds record.
1768  type DSRecord struct {
1769  	KeyID uint32 `json:"key_id"`
1770  
1771  	// Algorithm: default value: rsamd5
1772  	Algorithm DSRecordAlgorithm `json:"algorithm"`
1773  
1774  	// Precisely one of Digest, PublicKey must be set.
1775  	Digest *DSRecordDigest `json:"digest,omitempty"`
1776  
1777  	// Precisely one of Digest, PublicKey must be set.
1778  	PublicKey *DSRecordPublicKey `json:"public_key,omitempty"`
1779  }
1780  
1781  // RecordChangeAdd: record change add.
1782  type RecordChangeAdd struct {
1783  	Records []*Record `json:"records"`
1784  }
1785  
1786  // RecordChangeClear: record change clear.
1787  type RecordChangeClear struct{}
1788  
1789  // RecordChangeDelete: record change delete.
1790  type RecordChangeDelete struct {
1791  	// Precisely one of ID, IDFields must be set.
1792  	ID *string `json:"id,omitempty"`
1793  
1794  	// Precisely one of ID, IDFields must be set.
1795  	IDFields *RecordIdentifier `json:"id_fields,omitempty"`
1796  }
1797  
1798  // RecordChangeSet: record change set.
1799  type RecordChangeSet struct {
1800  	// Precisely one of ID, IDFields must be set.
1801  	ID *string `json:"id,omitempty"`
1802  
1803  	// Precisely one of ID, IDFields must be set.
1804  	IDFields *RecordIdentifier `json:"id_fields,omitempty"`
1805  
1806  	Records []*Record `json:"records"`
1807  }
1808  
1809  // ImportRawDNSZoneRequestTsigKey: import raw dns zone request tsig key.
1810  type ImportRawDNSZoneRequestTsigKey struct {
1811  	Name string `json:"name"`
1812  
1813  	Key string `json:"key"`
1814  
1815  	Algorithm string `json:"algorithm"`
1816  }
1817  
1818  // Contact: contact.
1819  type Contact struct {
1820  	ID string `json:"id"`
1821  
1822  	// LegalForm: default value: legal_form_unknown
1823  	LegalForm ContactLegalForm `json:"legal_form"`
1824  
1825  	Firstname string `json:"firstname"`
1826  
1827  	Lastname string `json:"lastname"`
1828  
1829  	CompanyName string `json:"company_name"`
1830  
1831  	Email string `json:"email"`
1832  
1833  	EmailAlt string `json:"email_alt"`
1834  
1835  	PhoneNumber string `json:"phone_number"`
1836  
1837  	FaxNumber string `json:"fax_number"`
1838  
1839  	AddressLine1 string `json:"address_line_1"`
1840  
1841  	AddressLine2 string `json:"address_line_2"`
1842  
1843  	Zip string `json:"zip"`
1844  
1845  	City string `json:"city"`
1846  
1847  	Country string `json:"country"`
1848  
1849  	VatIDentificationCode string `json:"vat_identification_code"`
1850  
1851  	CompanyIDentificationCode string `json:"company_identification_code"`
1852  
1853  	// Lang: default value: unknown_language_code
1854  	Lang std.LanguageCode `json:"lang"`
1855  
1856  	Resale bool `json:"resale"`
1857  
1858  	// Deprecated
1859  	Questions *[]*ContactQuestion `json:"questions,omitempty"`
1860  
1861  	ExtensionFr *ContactExtensionFR `json:"extension_fr"`
1862  
1863  	ExtensionEu *ContactExtensionEU `json:"extension_eu"`
1864  
1865  	WhoisOptIn bool `json:"whois_opt_in"`
1866  
1867  	// EmailStatus: default value: email_status_unknown
1868  	EmailStatus ContactEmailStatus `json:"email_status"`
1869  
1870  	State string `json:"state"`
1871  
1872  	ExtensionNl *ContactExtensionNL `json:"extension_nl"`
1873  
1874  	// Status: default value: status_unknown
1875  	Status ContactStatus `json:"status"`
1876  
1877  	ExtensionIt *ContactExtensionIT `json:"extension_it"`
1878  }
1879  
1880  // ContactRolesRoles: contact roles roles.
1881  type ContactRolesRoles struct {
1882  	IsOwner bool `json:"is_owner"`
1883  
1884  	IsAdministrative bool `json:"is_administrative"`
1885  
1886  	IsTechnical bool `json:"is_technical"`
1887  }
1888  
1889  // DomainRegistrationStatusExternalDomain: domain registration status external domain.
1890  type DomainRegistrationStatusExternalDomain struct {
1891  	ValidationToken string `json:"validation_token"`
1892  }
1893  
1894  // DomainRegistrationStatusTransfer: domain registration status transfer.
1895  type DomainRegistrationStatusTransfer struct {
1896  	// Status: default value: status_unknown
1897  	Status DomainRegistrationStatusTransferStatus `json:"status"`
1898  
1899  	VoteCurrentOwner bool `json:"vote_current_owner"`
1900  
1901  	VoteNewOwner bool `json:"vote_new_owner"`
1902  }
1903  
1904  // Tld: tld.
1905  type Tld struct {
1906  	Name string `json:"name"`
1907  
1908  	DnssecSupport bool `json:"dnssec_support"`
1909  
1910  	DurationInYearsMin uint32 `json:"duration_in_years_min"`
1911  
1912  	DurationInYearsMax uint32 `json:"duration_in_years_max"`
1913  
1914  	IDnSupport bool `json:"idn_support"`
1915  
1916  	Offers map[string]*TldOffer `json:"offers"`
1917  
1918  	Specifications map[string]string `json:"specifications"`
1919  }
1920  
1921  // NewContact: new contact.
1922  type NewContact struct {
1923  	// LegalForm: default value: legal_form_unknown
1924  	LegalForm ContactLegalForm `json:"legal_form"`
1925  
1926  	Firstname string `json:"firstname"`
1927  
1928  	Lastname string `json:"lastname"`
1929  
1930  	CompanyName *string `json:"company_name"`
1931  
1932  	Email string `json:"email"`
1933  
1934  	EmailAlt *string `json:"email_alt"`
1935  
1936  	PhoneNumber string `json:"phone_number"`
1937  
1938  	FaxNumber *string `json:"fax_number"`
1939  
1940  	AddressLine1 string `json:"address_line_1"`
1941  
1942  	AddressLine2 *string `json:"address_line_2"`
1943  
1944  	Zip string `json:"zip"`
1945  
1946  	City string `json:"city"`
1947  
1948  	Country string `json:"country"`
1949  
1950  	VatIDentificationCode *string `json:"vat_identification_code"`
1951  
1952  	CompanyIDentificationCode *string `json:"company_identification_code"`
1953  
1954  	// Lang: default value: unknown_language_code
1955  	Lang std.LanguageCode `json:"lang"`
1956  
1957  	Resale bool `json:"resale"`
1958  
1959  	// Deprecated
1960  	Questions *[]*ContactQuestion `json:"questions,omitempty"`
1961  
1962  	ExtensionFr *ContactExtensionFR `json:"extension_fr"`
1963  
1964  	ExtensionEu *ContactExtensionEU `json:"extension_eu"`
1965  
1966  	WhoisOptIn bool `json:"whois_opt_in"`
1967  
1968  	State *string `json:"state"`
1969  
1970  	ExtensionNl *ContactExtensionNL `json:"extension_nl"`
1971  
1972  	ExtensionIt *ContactExtensionIT `json:"extension_it"`
1973  }
1974  
1975  // CheckContactsCompatibilityResponseContactCheckResult: check contacts compatibility response contact check result.
1976  type CheckContactsCompatibilityResponseContactCheckResult struct {
1977  	Compatible bool `json:"compatible"`
1978  
1979  	ErrorMessage *string `json:"error_message"`
1980  }
1981  
1982  // DNSZone: dns zone.
1983  type DNSZone struct {
1984  	Domain string `json:"domain"`
1985  
1986  	Subdomain string `json:"subdomain"`
1987  
1988  	Ns []string `json:"ns"`
1989  
1990  	NsDefault []string `json:"ns_default"`
1991  
1992  	NsMaster []string `json:"ns_master"`
1993  
1994  	// Status: default value: unknown
1995  	Status DNSZoneStatus `json:"status"`
1996  
1997  	Message *string `json:"message"`
1998  
1999  	UpdatedAt *time.Time `json:"updated_at"`
2000  
2001  	ProjectID string `json:"project_id"`
2002  
2003  	LinkedProducts []LinkedProduct `json:"linked_products"`
2004  }
2005  
2006  // DomainDNSSEC: domain dnssec.
2007  type DomainDNSSEC struct {
2008  	// Status: default value: feature_status_unknown
2009  	Status DomainFeatureStatus `json:"status"`
2010  
2011  	DsRecords []*DSRecord `json:"ds_records"`
2012  }
2013  
2014  // RecordChange: record change.
2015  type RecordChange struct {
2016  	// Precisely one of Add, Set, Delete, Clear must be set.
2017  	Add *RecordChangeAdd `json:"add,omitempty"`
2018  
2019  	// Precisely one of Add, Set, Delete, Clear must be set.
2020  	Set *RecordChangeSet `json:"set,omitempty"`
2021  
2022  	// Precisely one of Add, Set, Delete, Clear must be set.
2023  	Delete *RecordChangeDelete `json:"delete,omitempty"`
2024  
2025  	// Precisely one of Add, Set, Delete, Clear must be set.
2026  	Clear *RecordChangeClear `json:"clear,omitempty"`
2027  }
2028  
2029  // ImportProviderDNSZoneRequestOnlineV1: import provider dns zone request online v1.
2030  type ImportProviderDNSZoneRequestOnlineV1 struct {
2031  	Token string `json:"token"`
2032  }
2033  
2034  // ImportRawDNSZoneRequestAXFRSource: import raw dns zone request axfr source.
2035  type ImportRawDNSZoneRequestAXFRSource struct {
2036  	NameServer string `json:"name_server"`
2037  
2038  	TsigKey *ImportRawDNSZoneRequestTsigKey `json:"tsig_key"`
2039  }
2040  
2041  // ImportRawDNSZoneRequestBindSource: import raw dns zone request bind source.
2042  type ImportRawDNSZoneRequestBindSource struct {
2043  	Content string `json:"content"`
2044  }
2045  
2046  // ContactRoles: contact roles.
2047  type ContactRoles struct {
2048  	Contact *Contact `json:"contact"`
2049  
2050  	Roles map[string]*ContactRolesRoles `json:"roles"`
2051  }
2052  
2053  // Nameserver: nameserver.
2054  type Nameserver struct {
2055  	Name string `json:"name"`
2056  
2057  	IP []string `json:"ip"`
2058  }
2059  
2060  // DNSZoneVersion: dns zone version.
2061  type DNSZoneVersion struct {
2062  	ID string `json:"id"`
2063  
2064  	CreatedAt *time.Time `json:"created_at"`
2065  }
2066  
2067  // Host: host.
2068  type Host struct {
2069  	Domain string `json:"domain"`
2070  
2071  	Name string `json:"name"`
2072  
2073  	IPs []net.IP `json:"ips"`
2074  
2075  	// Status: default value: unknown_status
2076  	Status HostStatus `json:"status"`
2077  }
2078  
2079  // DomainSummary: domain summary.
2080  type DomainSummary struct {
2081  	Domain string `json:"domain"`
2082  
2083  	ProjectID string `json:"project_id"`
2084  
2085  	// AutoRenewStatus: default value: feature_status_unknown
2086  	AutoRenewStatus DomainFeatureStatus `json:"auto_renew_status"`
2087  
2088  	// DnssecStatus: default value: feature_status_unknown
2089  	DnssecStatus DomainFeatureStatus `json:"dnssec_status"`
2090  
2091  	EppCode []string `json:"epp_code"`
2092  
2093  	ExpiredAt *time.Time `json:"expired_at"`
2094  
2095  	UpdatedAt *time.Time `json:"updated_at"`
2096  
2097  	Registrar string `json:"registrar"`
2098  
2099  	IsExternal bool `json:"is_external"`
2100  
2101  	// Status: default value: status_unknown
2102  	Status DomainStatus `json:"status"`
2103  
2104  	// Precisely one of ExternalDomainRegistrationStatus, TransferRegistrationStatus must be set.
2105  	ExternalDomainRegistrationStatus *DomainRegistrationStatusExternalDomain `json:"external_domain_registration_status,omitempty"`
2106  
2107  	// Precisely one of ExternalDomainRegistrationStatus, TransferRegistrationStatus must be set.
2108  	TransferRegistrationStatus *DomainRegistrationStatusTransfer `json:"transfer_registration_status,omitempty"`
2109  
2110  	OrganizationID string `json:"organization_id"`
2111  
2112  	CreatedAt *time.Time `json:"created_at"`
2113  
2114  	PendingTrade bool `json:"pending_trade"`
2115  }
2116  
2117  // InboundTransfer: inbound transfer.
2118  type InboundTransfer struct {
2119  	// ID: the unique identifier of the inbound transfer.
2120  	ID string `json:"id"`
2121  
2122  	// CreatedAt: the creation date of the inbound transfer.
2123  	CreatedAt *time.Time `json:"created_at"`
2124  
2125  	// LastUpdatedAt: the last modification date of the inbound transfer.
2126  	LastUpdatedAt *time.Time `json:"last_updated_at"`
2127  
2128  	// ProjectID: the project ID associated with the inbound transfer.
2129  	ProjectID string `json:"project_id"`
2130  
2131  	// Domain: the domain associated with the inbound transfer.
2132  	Domain string `json:"domain"`
2133  
2134  	// Status: inbound transfer status.
2135  	// Default value: unknown
2136  	Status InboundTransferStatus `json:"status"`
2137  
2138  	// Message: human-friendly message to describe the current inbound transfer status.
2139  	Message string `json:"message"`
2140  
2141  	// TaskID: the unique identifier of the associated task.
2142  	TaskID string `json:"task_id"`
2143  }
2144  
2145  // RenewableDomain: renewable domain.
2146  type RenewableDomain struct {
2147  	Domain string `json:"domain"`
2148  
2149  	ProjectID string `json:"project_id"`
2150  
2151  	OrganizationID string `json:"organization_id"`
2152  
2153  	// Status: default value: unknown
2154  	Status RenewableDomainStatus `json:"status"`
2155  
2156  	RenewableDurationInYears *int32 `json:"renewable_duration_in_years"`
2157  
2158  	ExpiredAt *time.Time `json:"expired_at"`
2159  
2160  	LimitRenewAt *time.Time `json:"limit_renew_at"`
2161  
2162  	LimitRedemptionAt *time.Time `json:"limit_redemption_at"`
2163  
2164  	EstimatedDeleteAt *time.Time `json:"estimated_delete_at"`
2165  
2166  	Tld *Tld `json:"tld"`
2167  }
2168  
2169  // SSLCertificate: ssl certificate.
2170  type SSLCertificate struct {
2171  	DNSZone string `json:"dns_zone"`
2172  
2173  	AlternativeDNSZones []string `json:"alternative_dns_zones"`
2174  
2175  	// Status: default value: unknown
2176  	Status SSLCertificateStatus `json:"status"`
2177  
2178  	PrivateKey string `json:"private_key"`
2179  
2180  	CertificateChain string `json:"certificate_chain"`
2181  
2182  	CreatedAt *time.Time `json:"created_at"`
2183  
2184  	ExpiredAt *time.Time `json:"expired_at"`
2185  }
2186  
2187  // Task: task.
2188  type Task struct {
2189  	// ID: the unique identifier of the task.
2190  	ID string `json:"id"`
2191  
2192  	// ProjectID: the project ID associated to the task.
2193  	ProjectID string `json:"project_id"`
2194  
2195  	// OrganizationID: the organization ID associated to the task.
2196  	OrganizationID string `json:"organization_id"`
2197  
2198  	// Domain: the domain name associated to the task.
2199  	Domain *string `json:"domain"`
2200  
2201  	// Type: the type of the task.
2202  	// Default value: unknown
2203  	Type TaskType `json:"type"`
2204  
2205  	// Status: the status of the task.
2206  	// Default value: unavailable
2207  	Status TaskStatus `json:"status"`
2208  
2209  	// StartedAt: start date of the task.
2210  	StartedAt *time.Time `json:"started_at"`
2211  
2212  	// UpdatedAt: last update of the task.
2213  	UpdatedAt *time.Time `json:"updated_at"`
2214  
2215  	// Message: error message associated to the task.
2216  	Message *string `json:"message"`
2217  
2218  	// ContactIDentifier: human-friendly contact identifier used when the task concerns a contact.
2219  	ContactIDentifier *string `json:"contact_identifier"`
2220  }
2221  
2222  // TransferInDomainRequestTransferRequest: transfer in domain request transfer request.
2223  type TransferInDomainRequestTransferRequest struct {
2224  	Domain string `json:"domain"`
2225  
2226  	AuthCode string `json:"auth_code"`
2227  }
2228  
2229  // UpdateContactRequestQuestion: update contact request question.
2230  type UpdateContactRequestQuestion struct {
2231  	Question *string `json:"question"`
2232  
2233  	Answer *string `json:"answer"`
2234  }
2235  
2236  // AvailableDomain: available domain.
2237  type AvailableDomain struct {
2238  	Domain string `json:"domain"`
2239  
2240  	Available bool `json:"available"`
2241  
2242  	Tld *Tld `json:"tld"`
2243  }
2244  
2245  // CheckContactsCompatibilityResponse: check contacts compatibility response.
2246  type CheckContactsCompatibilityResponse struct {
2247  	Compatible bool `json:"compatible"`
2248  
2249  	OwnerCheckResult *CheckContactsCompatibilityResponseContactCheckResult `json:"owner_check_result"`
2250  
2251  	AdministrativeCheckResult *CheckContactsCompatibilityResponseContactCheckResult `json:"administrative_check_result"`
2252  
2253  	TechnicalCheckResult *CheckContactsCompatibilityResponseContactCheckResult `json:"technical_check_result"`
2254  }
2255  
2256  // ClearDNSZoneRecordsRequest: clear dns zone records request.
2257  type ClearDNSZoneRecordsRequest struct {
2258  	// DNSZone: DNS zone to clear.
2259  	DNSZone string `json:"-"`
2260  }
2261  
2262  // ClearDNSZoneRecordsResponse: clear dns zone records response.
2263  type ClearDNSZoneRecordsResponse struct{}
2264  
2265  // CloneDNSZoneRequest: clone dns zone request.
2266  type CloneDNSZoneRequest struct {
2267  	// DNSZone: DNS zone to clone.
2268  	DNSZone string `json:"-"`
2269  
2270  	// DestDNSZone: destination DNS zone in which to clone the chosen DNS zone.
2271  	DestDNSZone string `json:"dest_dns_zone"`
2272  
2273  	// Overwrite: specifies whether or not the destination DNS zone will be overwritten.
2274  	Overwrite bool `json:"overwrite"`
2275  
2276  	// ProjectID: project ID of the destination DNS zone.
2277  	ProjectID *string `json:"project_id,omitempty"`
2278  }
2279  
2280  // CreateDNSZoneRequest: create dns zone request.
2281  type CreateDNSZoneRequest struct {
2282  	// Domain: domain in which to crreate the DNS zone.
2283  	Domain string `json:"domain"`
2284  
2285  	// Subdomain: subdomain of the DNS zone to create.
2286  	Subdomain string `json:"subdomain"`
2287  
2288  	// ProjectID: project ID in which to create the DNS zone.
2289  	ProjectID string `json:"project_id"`
2290  }
2291  
2292  // CreateSSLCertificateRequest: create ssl certificate request.
2293  type CreateSSLCertificateRequest struct {
2294  	DNSZone string `json:"dns_zone"`
2295  
2296  	AlternativeDNSZones []string `json:"alternative_dns_zones"`
2297  }
2298  
2299  // DeleteDNSZoneRequest: delete dns zone request.
2300  type DeleteDNSZoneRequest struct {
2301  	// DNSZone: DNS zone to delete.
2302  	DNSZone string `json:"-"`
2303  
2304  	// ProjectID: project ID of the DNS zone to delete.
2305  	ProjectID string `json:"-"`
2306  }
2307  
2308  // DeleteDNSZoneResponse: delete dns zone response.
2309  type DeleteDNSZoneResponse struct{}
2310  
2311  // DeleteDNSZoneTsigKeyRequest: delete dns zone tsig key request.
2312  type DeleteDNSZoneTsigKeyRequest struct {
2313  	DNSZone string `json:"-"`
2314  }
2315  
2316  // DeleteExternalDomainResponse: delete external domain response.
2317  type DeleteExternalDomainResponse struct{}
2318  
2319  // DeleteSSLCertificateRequest: delete ssl certificate request.
2320  type DeleteSSLCertificateRequest struct {
2321  	DNSZone string `json:"-"`
2322  }
2323  
2324  // DeleteSSLCertificateResponse: delete ssl certificate response.
2325  type DeleteSSLCertificateResponse struct{}
2326  
2327  // Domain: domain.
2328  type Domain struct {
2329  	Domain string `json:"domain"`
2330  
2331  	OrganizationID string `json:"organization_id"`
2332  
2333  	ProjectID string `json:"project_id"`
2334  
2335  	// AutoRenewStatus: status of the automatic renewal of the domain.
2336  	// Default value: feature_status_unknown
2337  	AutoRenewStatus DomainFeatureStatus `json:"auto_renew_status"`
2338  
2339  	// Dnssec: status of the DNSSEC configuration of the domain.
2340  	Dnssec *DomainDNSSEC `json:"dnssec"`
2341  
2342  	// EppCode: list of the domain's EPP codes.
2343  	EppCode []string `json:"epp_code"`
2344  
2345  	// ExpiredAt: date of expiration of the domain.
2346  	ExpiredAt *time.Time `json:"expired_at"`
2347  
2348  	// UpdatedAt: domain's last modification date.
2349  	UpdatedAt *time.Time `json:"updated_at"`
2350  
2351  	Registrar string `json:"registrar"`
2352  
2353  	// IsExternal: indicates whether Scaleway is the domain's registrar.
2354  	IsExternal bool `json:"is_external"`
2355  
2356  	// Status: status of the domain.
2357  	// Default value: status_unknown
2358  	Status DomainStatus `json:"status"`
2359  
2360  	// DNSZones: list of the domain's DNS zones.
2361  	DNSZones []*DNSZone `json:"dns_zones"`
2362  
2363  	// OwnerContact: contact information of the domain's owner.
2364  	OwnerContact *Contact `json:"owner_contact"`
2365  
2366  	// TechnicalContact: contact information of the domain's technical contact.
2367  	TechnicalContact *Contact `json:"technical_contact"`
2368  
2369  	// AdministrativeContact: contact information of the domain's administrative contact.
2370  	AdministrativeContact *Contact `json:"administrative_contact"`
2371  
2372  	// ExternalDomainRegistrationStatus: registration status of an external domain, if available.
2373  	// Precisely one of ExternalDomainRegistrationStatus, TransferRegistrationStatus must be set.
2374  	ExternalDomainRegistrationStatus *DomainRegistrationStatusExternalDomain `json:"external_domain_registration_status,omitempty"`
2375  
2376  	// TransferRegistrationStatus: status of a domain, when available for transfer.
2377  	// Precisely one of ExternalDomainRegistrationStatus, TransferRegistrationStatus must be set.
2378  	TransferRegistrationStatus *DomainRegistrationStatusTransfer `json:"transfer_registration_status,omitempty"`
2379  
2380  	// Tld: domain's TLD information.
2381  	Tld *Tld `json:"tld"`
2382  
2383  	// LinkedProducts: list of Scaleway resources linked to the domain.
2384  	LinkedProducts []LinkedProduct `json:"linked_products"`
2385  
2386  	// PendingTrade: indicates if a trade is ongoing.
2387  	PendingTrade bool `json:"pending_trade"`
2388  }
2389  
2390  // ExportRawDNSZoneRequest: export raw dns zone request.
2391  type ExportRawDNSZoneRequest struct {
2392  	// DNSZone: DNS zone to export.
2393  	DNSZone string `json:"-"`
2394  
2395  	// Format: DNS zone format.
2396  	// Default value: unknown_raw_format
2397  	Format RawFormat `json:"-"`
2398  }
2399  
2400  // GetDNSZoneTsigKeyRequest: get dns zone tsig key request.
2401  type GetDNSZoneTsigKeyRequest struct {
2402  	DNSZone string `json:"-"`
2403  }
2404  
2405  // GetDNSZoneTsigKeyResponse: get dns zone tsig key response.
2406  type GetDNSZoneTsigKeyResponse struct {
2407  	Name string `json:"name"`
2408  
2409  	Key string `json:"key"`
2410  
2411  	Algorithm string `json:"algorithm"`
2412  }
2413  
2414  // GetDNSZoneVersionDiffRequest: get dns zone version diff request.
2415  type GetDNSZoneVersionDiffRequest struct {
2416  	DNSZoneVersionID string `json:"-"`
2417  }
2418  
2419  // GetDNSZoneVersionDiffResponse: get dns zone version diff response.
2420  type GetDNSZoneVersionDiffResponse struct {
2421  	Changes []*RecordChange `json:"changes"`
2422  }
2423  
2424  // GetDomainAuthCodeResponse: get domain auth code response.
2425  type GetDomainAuthCodeResponse struct {
2426  	AuthCode string `json:"auth_code"`
2427  }
2428  
2429  // GetSSLCertificateRequest: get ssl certificate request.
2430  type GetSSLCertificateRequest struct {
2431  	DNSZone string `json:"-"`
2432  }
2433  
2434  // ImportProviderDNSZoneRequest: import provider dns zone request.
2435  type ImportProviderDNSZoneRequest struct {
2436  	DNSZone string `json:"-"`
2437  
2438  	// Precisely one of OnlineV1 must be set.
2439  	OnlineV1 *ImportProviderDNSZoneRequestOnlineV1 `json:"online_v1,omitempty"`
2440  }
2441  
2442  // ImportProviderDNSZoneResponse: import provider dns zone response.
2443  type ImportProviderDNSZoneResponse struct {
2444  	Records []*Record `json:"records"`
2445  }
2446  
2447  // ImportRawDNSZoneRequest: import raw dns zone request.
2448  type ImportRawDNSZoneRequest struct {
2449  	// DNSZone: DNS zone to import.
2450  	DNSZone string `json:"-"`
2451  
2452  	// Deprecated
2453  	Content *string `json:"content,omitempty"`
2454  
2455  	ProjectID string `json:"project_id"`
2456  
2457  	// Deprecated: Format: default value: unknown_raw_format
2458  	Format *RawFormat `json:"format,omitempty"`
2459  
2460  	// BindSource: import a bind file format.
2461  	// Precisely one of BindSource, AxfrSource must be set.
2462  	BindSource *ImportRawDNSZoneRequestBindSource `json:"bind_source,omitempty"`
2463  
2464  	// AxfrSource: import from the name server given with TSIG, to use or not.
2465  	// Precisely one of BindSource, AxfrSource must be set.
2466  	AxfrSource *ImportRawDNSZoneRequestAXFRSource `json:"axfr_source,omitempty"`
2467  }
2468  
2469  // ImportRawDNSZoneResponse: import raw dns zone response.
2470  type ImportRawDNSZoneResponse struct {
2471  	Records []*Record `json:"records"`
2472  }
2473  
2474  // ListContactsResponse: list contacts response.
2475  type ListContactsResponse struct {
2476  	TotalCount uint32 `json:"total_count"`
2477  
2478  	Contacts []*ContactRoles `json:"contacts"`
2479  }
2480  
2481  // UnsafeGetTotalCount should not be used
2482  // Internal usage only
2483  func (r *ListContactsResponse) UnsafeGetTotalCount() uint32 {
2484  	return r.TotalCount
2485  }
2486  
2487  // UnsafeAppend should not be used
2488  // Internal usage only
2489  func (r *ListContactsResponse) UnsafeAppend(res any) (uint32, error) {
2490  	results, ok := res.(*ListContactsResponse)
2491  	if !ok {
2492  		return 0, errors.New("%T type cannot be appended to type %T", res, r)
2493  	}
2494  
2495  	r.Contacts = append(r.Contacts, results.Contacts...)
2496  	r.TotalCount += uint32(len(results.Contacts))
2497  	return uint32(len(results.Contacts)), nil
2498  }
2499  
2500  // ListDNSZoneNameserversRequest: list dns zone nameservers request.
2501  type ListDNSZoneNameserversRequest struct {
2502  	// DNSZone: DNS zone on which to filter the returned DNS zone name servers.
2503  	DNSZone string `json:"-"`
2504  
2505  	// ProjectID: project ID on which to filter the returned DNS zone name servers.
2506  	ProjectID *string `json:"-"`
2507  }
2508  
2509  // ListDNSZoneNameserversResponse: list dns zone nameservers response.
2510  type ListDNSZoneNameserversResponse struct {
2511  	// Ns: DNS zone name servers returned.
2512  	Ns []*Nameserver `json:"ns"`
2513  }
2514  
2515  // ListDNSZoneRecordsRequest: list dns zone records request.
2516  type ListDNSZoneRecordsRequest struct {
2517  	// DNSZone: DNS zone on which to filter the returned DNS zone records.
2518  	DNSZone string `json:"-"`
2519  
2520  	// ProjectID: project ID on which to filter the returned DNS zone records.
2521  	ProjectID *string `json:"-"`
2522  
2523  	// OrderBy: sort order of the returned DNS zone records.
2524  	// Default value: name_asc
2525  	OrderBy ListDNSZoneRecordsRequestOrderBy `json:"-"`
2526  
2527  	// Page: page number to return, from the paginated results.
2528  	Page *int32 `json:"-"`
2529  
2530  	// PageSize: maximum number of DNS zone records per page.
2531  	PageSize *uint32 `json:"-"`
2532  
2533  	// Name: name on which to filter the returned DNS zone records.
2534  	Name string `json:"-"`
2535  
2536  	// Type: record type on which to filter the returned DNS zone records.
2537  	// Default value: unknown
2538  	Type RecordType `json:"-"`
2539  
2540  	// ID: record ID on which to filter the returned DNS zone records.
2541  	ID *string `json:"-"`
2542  }
2543  
2544  // ListDNSZoneRecordsResponse: list dns zone records response.
2545  type ListDNSZoneRecordsResponse struct {
2546  	// TotalCount: total number of DNS zone records.
2547  	TotalCount uint32 `json:"total_count"`
2548  
2549  	// Records: paginated returned DNS zone records.
2550  	Records []*Record `json:"records"`
2551  }
2552  
2553  // UnsafeGetTotalCount should not be used
2554  // Internal usage only
2555  func (r *ListDNSZoneRecordsResponse) UnsafeGetTotalCount() uint32 {
2556  	return r.TotalCount
2557  }
2558  
2559  // UnsafeAppend should not be used
2560  // Internal usage only
2561  func (r *ListDNSZoneRecordsResponse) UnsafeAppend(res any) (uint32, error) {
2562  	results, ok := res.(*ListDNSZoneRecordsResponse)
2563  	if !ok {
2564  		return 0, errors.New("%T type cannot be appended to type %T", res, r)
2565  	}
2566  
2567  	r.Records = append(r.Records, results.Records...)
2568  	r.TotalCount += uint32(len(results.Records))
2569  	return uint32(len(results.Records)), nil
2570  }
2571  
2572  // ListDNSZoneVersionRecordsRequest: list dns zone version records request.
2573  type ListDNSZoneVersionRecordsRequest struct {
2574  	DNSZoneVersionID string `json:"-"`
2575  
2576  	// Page: page number to return, from the paginated results.
2577  	Page *int32 `json:"-"`
2578  
2579  	// PageSize: maximum number of DNS zones versions records per page.
2580  	PageSize *uint32 `json:"-"`
2581  }
2582  
2583  // ListDNSZoneVersionRecordsResponse: list dns zone version records response.
2584  type ListDNSZoneVersionRecordsResponse struct {
2585  	// TotalCount: total number of DNS zones versions records.
2586  	TotalCount uint32 `json:"total_count"`
2587  
2588  	Records []*Record `json:"records"`
2589  }
2590  
2591  // UnsafeGetTotalCount should not be used
2592  // Internal usage only
2593  func (r *ListDNSZoneVersionRecordsResponse) UnsafeGetTotalCount() uint32 {
2594  	return r.TotalCount
2595  }
2596  
2597  // UnsafeAppend should not be used
2598  // Internal usage only
2599  func (r *ListDNSZoneVersionRecordsResponse) UnsafeAppend(res any) (uint32, error) {
2600  	results, ok := res.(*ListDNSZoneVersionRecordsResponse)
2601  	if !ok {
2602  		return 0, errors.New("%T type cannot be appended to type %T", res, r)
2603  	}
2604  
2605  	r.Records = append(r.Records, results.Records...)
2606  	r.TotalCount += uint32(len(results.Records))
2607  	return uint32(len(results.Records)), nil
2608  }
2609  
2610  // ListDNSZoneVersionsRequest: list dns zone versions request.
2611  type ListDNSZoneVersionsRequest struct {
2612  	DNSZone string `json:"-"`
2613  
2614  	// Page: page number to return, from the paginated results.
2615  	Page *int32 `json:"-"`
2616  
2617  	// PageSize: maximum number of DNS zones versions per page.
2618  	PageSize *uint32 `json:"-"`
2619  }
2620  
2621  // ListDNSZoneVersionsResponse: list dns zone versions response.
2622  type ListDNSZoneVersionsResponse struct {
2623  	// TotalCount: total number of DNS zones versions.
2624  	TotalCount uint32 `json:"total_count"`
2625  
2626  	Versions []*DNSZoneVersion `json:"versions"`
2627  }
2628  
2629  // UnsafeGetTotalCount should not be used
2630  // Internal usage only
2631  func (r *ListDNSZoneVersionsResponse) UnsafeGetTotalCount() uint32 {
2632  	return r.TotalCount
2633  }
2634  
2635  // UnsafeAppend should not be used
2636  // Internal usage only
2637  func (r *ListDNSZoneVersionsResponse) UnsafeAppend(res any) (uint32, error) {
2638  	results, ok := res.(*ListDNSZoneVersionsResponse)
2639  	if !ok {
2640  		return 0, errors.New("%T type cannot be appended to type %T", res, r)
2641  	}
2642  
2643  	r.Versions = append(r.Versions, results.Versions...)
2644  	r.TotalCount += uint32(len(results.Versions))
2645  	return uint32(len(results.Versions)), nil
2646  }
2647  
2648  // ListDNSZonesRequest: list dns zones request.
2649  type ListDNSZonesRequest struct {
2650  	// OrganizationID: organization ID on which to filter the returned DNS zones.
2651  	OrganizationID *string `json:"-"`
2652  
2653  	// ProjectID: project ID on which to filter the returned DNS zones.
2654  	ProjectID *string `json:"-"`
2655  
2656  	// OrderBy: sort order of the returned DNS zones.
2657  	// Default value: domain_asc
2658  	OrderBy ListDNSZonesRequestOrderBy `json:"-"`
2659  
2660  	// Page: page number to return, from the paginated results.
2661  	Page *int32 `json:"-"`
2662  
2663  	// PageSize: maximum number of DNS zones to return per page.
2664  	PageSize *uint32 `json:"-"`
2665  
2666  	// Domain: domain on which to filter the returned DNS zones.
2667  	Domain string `json:"-"`
2668  
2669  	// Deprecated: DNSZone: DNS zone on which to filter the returned DNS zones.
2670  	DNSZone *string `json:"-"`
2671  
2672  	// DNSZones: DNS zones on which to filter the returned DNS zones.
2673  	DNSZones []string `json:"-"`
2674  
2675  	// CreatedAfter: only list DNS zones created after this date.
2676  	CreatedAfter *time.Time `json:"-"`
2677  
2678  	// CreatedBefore: only list DNS zones created before this date.
2679  	CreatedBefore *time.Time `json:"-"`
2680  
2681  	// UpdatedAfter: only list DNS zones updated after this date.
2682  	UpdatedAfter *time.Time `json:"-"`
2683  
2684  	// UpdatedBefore: only list DNS zones updated before this date.
2685  	UpdatedBefore *time.Time `json:"-"`
2686  }
2687  
2688  // ListDNSZonesResponse: list dns zones response.
2689  type ListDNSZonesResponse struct {
2690  	// TotalCount: total number of DNS zones matching the requested criteria.
2691  	TotalCount uint32 `json:"total_count"`
2692  
2693  	// DNSZones: paginated returned DNS zones.
2694  	DNSZones []*DNSZone `json:"dns_zones"`
2695  }
2696  
2697  // UnsafeGetTotalCount should not be used
2698  // Internal usage only
2699  func (r *ListDNSZonesResponse) UnsafeGetTotalCount() uint32 {
2700  	return r.TotalCount
2701  }
2702  
2703  // UnsafeAppend should not be used
2704  // Internal usage only
2705  func (r *ListDNSZonesResponse) UnsafeAppend(res any) (uint32, error) {
2706  	results, ok := res.(*ListDNSZonesResponse)
2707  	if !ok {
2708  		return 0, errors.New("%T type cannot be appended to type %T", res, r)
2709  	}
2710  
2711  	r.DNSZones = append(r.DNSZones, results.DNSZones...)
2712  	r.TotalCount += uint32(len(results.DNSZones))
2713  	return uint32(len(results.DNSZones)), nil
2714  }
2715  
2716  // ListDomainHostsResponse: list domain hosts response.
2717  type ListDomainHostsResponse struct {
2718  	TotalCount uint32 `json:"total_count"`
2719  
2720  	Hosts []*Host `json:"hosts"`
2721  }
2722  
2723  // UnsafeGetTotalCount should not be used
2724  // Internal usage only
2725  func (r *ListDomainHostsResponse) UnsafeGetTotalCount() uint32 {
2726  	return r.TotalCount
2727  }
2728  
2729  // UnsafeAppend should not be used
2730  // Internal usage only
2731  func (r *ListDomainHostsResponse) UnsafeAppend(res any) (uint32, error) {
2732  	results, ok := res.(*ListDomainHostsResponse)
2733  	if !ok {
2734  		return 0, errors.New("%T type cannot be appended to type %T", res, r)
2735  	}
2736  
2737  	r.Hosts = append(r.Hosts, results.Hosts...)
2738  	r.TotalCount += uint32(len(results.Hosts))
2739  	return uint32(len(results.Hosts)), nil
2740  }
2741  
2742  // ListDomainsResponse: list domains response.
2743  type ListDomainsResponse struct {
2744  	TotalCount uint32 `json:"total_count"`
2745  
2746  	Domains []*DomainSummary `json:"domains"`
2747  }
2748  
2749  // UnsafeGetTotalCount should not be used
2750  // Internal usage only
2751  func (r *ListDomainsResponse) UnsafeGetTotalCount() uint32 {
2752  	return r.TotalCount
2753  }
2754  
2755  // UnsafeAppend should not be used
2756  // Internal usage only
2757  func (r *ListDomainsResponse) UnsafeAppend(res any) (uint32, error) {
2758  	results, ok := res.(*ListDomainsResponse)
2759  	if !ok {
2760  		return 0, errors.New("%T type cannot be appended to type %T", res, r)
2761  	}
2762  
2763  	r.Domains = append(r.Domains, results.Domains...)
2764  	r.TotalCount += uint32(len(results.Domains))
2765  	return uint32(len(results.Domains)), nil
2766  }
2767  
2768  // ListInboundTransfersResponse: list inbound transfers response.
2769  type ListInboundTransfersResponse struct {
2770  	TotalCount uint32 `json:"total_count"`
2771  
2772  	InboundTransfers []*InboundTransfer `json:"inbound_transfers"`
2773  }
2774  
2775  // UnsafeGetTotalCount should not be used
2776  // Internal usage only
2777  func (r *ListInboundTransfersResponse) UnsafeGetTotalCount() uint32 {
2778  	return r.TotalCount
2779  }
2780  
2781  // UnsafeAppend should not be used
2782  // Internal usage only
2783  func (r *ListInboundTransfersResponse) UnsafeAppend(res any) (uint32, error) {
2784  	results, ok := res.(*ListInboundTransfersResponse)
2785  	if !ok {
2786  		return 0, errors.New("%T type cannot be appended to type %T", res, r)
2787  	}
2788  
2789  	r.InboundTransfers = append(r.InboundTransfers, results.InboundTransfers...)
2790  	r.TotalCount += uint32(len(results.InboundTransfers))
2791  	return uint32(len(results.InboundTransfers)), nil
2792  }
2793  
2794  // ListRenewableDomainsResponse: list renewable domains response.
2795  type ListRenewableDomainsResponse struct {
2796  	TotalCount uint32 `json:"total_count"`
2797  
2798  	Domains []*RenewableDomain `json:"domains"`
2799  }
2800  
2801  // UnsafeGetTotalCount should not be used
2802  // Internal usage only
2803  func (r *ListRenewableDomainsResponse) UnsafeGetTotalCount() uint32 {
2804  	return r.TotalCount
2805  }
2806  
2807  // UnsafeAppend should not be used
2808  // Internal usage only
2809  func (r *ListRenewableDomainsResponse) UnsafeAppend(res any) (uint32, error) {
2810  	results, ok := res.(*ListRenewableDomainsResponse)
2811  	if !ok {
2812  		return 0, errors.New("%T type cannot be appended to type %T", res, r)
2813  	}
2814  
2815  	r.Domains = append(r.Domains, results.Domains...)
2816  	r.TotalCount += uint32(len(results.Domains))
2817  	return uint32(len(results.Domains)), nil
2818  }
2819  
2820  // ListSSLCertificatesRequest: list ssl certificates request.
2821  type ListSSLCertificatesRequest struct {
2822  	DNSZone string `json:"-"`
2823  
2824  	Page *int32 `json:"-"`
2825  
2826  	PageSize *uint32 `json:"-"`
2827  
2828  	ProjectID *string `json:"-"`
2829  }
2830  
2831  // ListSSLCertificatesResponse: list ssl certificates response.
2832  type ListSSLCertificatesResponse struct {
2833  	TotalCount uint32 `json:"total_count"`
2834  
2835  	Certificates []*SSLCertificate `json:"certificates"`
2836  }
2837  
2838  // UnsafeGetTotalCount should not be used
2839  // Internal usage only
2840  func (r *ListSSLCertificatesResponse) UnsafeGetTotalCount() uint32 {
2841  	return r.TotalCount
2842  }
2843  
2844  // UnsafeAppend should not be used
2845  // Internal usage only
2846  func (r *ListSSLCertificatesResponse) UnsafeAppend(res any) (uint32, error) {
2847  	results, ok := res.(*ListSSLCertificatesResponse)
2848  	if !ok {
2849  		return 0, errors.New("%T type cannot be appended to type %T", res, r)
2850  	}
2851  
2852  	r.Certificates = append(r.Certificates, results.Certificates...)
2853  	r.TotalCount += uint32(len(results.Certificates))
2854  	return uint32(len(results.Certificates)), nil
2855  }
2856  
2857  // ListTasksResponse: list tasks response.
2858  type ListTasksResponse struct {
2859  	TotalCount uint32 `json:"total_count"`
2860  
2861  	Tasks []*Task `json:"tasks"`
2862  }
2863  
2864  // UnsafeGetTotalCount should not be used
2865  // Internal usage only
2866  func (r *ListTasksResponse) UnsafeGetTotalCount() uint32 {
2867  	return r.TotalCount
2868  }
2869  
2870  // UnsafeAppend should not be used
2871  // Internal usage only
2872  func (r *ListTasksResponse) UnsafeAppend(res any) (uint32, error) {
2873  	results, ok := res.(*ListTasksResponse)
2874  	if !ok {
2875  		return 0, errors.New("%T type cannot be appended to type %T", res, r)
2876  	}
2877  
2878  	r.Tasks = append(r.Tasks, results.Tasks...)
2879  	r.TotalCount += uint32(len(results.Tasks))
2880  	return uint32(len(results.Tasks)), nil
2881  }
2882  
2883  // ListTldsResponse: list tlds response.
2884  type ListTldsResponse struct {
2885  	// Tlds: array of TLDs.
2886  	Tlds []*Tld `json:"tlds"`
2887  
2888  	// TotalCount: total count of TLDs returned.
2889  	TotalCount uint64 `json:"total_count"`
2890  }
2891  
2892  // UnsafeGetTotalCount should not be used
2893  // Internal usage only
2894  func (r *ListTldsResponse) UnsafeGetTotalCount() uint64 {
2895  	return r.TotalCount
2896  }
2897  
2898  // UnsafeAppend should not be used
2899  // Internal usage only
2900  func (r *ListTldsResponse) UnsafeAppend(res any) (uint64, error) {
2901  	results, ok := res.(*ListTldsResponse)
2902  	if !ok {
2903  		return 0, errors.New("%T type cannot be appended to type %T", res, r)
2904  	}
2905  
2906  	r.Tlds = append(r.Tlds, results.Tlds...)
2907  	r.TotalCount += uint64(len(results.Tlds))
2908  	return uint64(len(results.Tlds)), nil
2909  }
2910  
2911  // OrderResponse: order response.
2912  type OrderResponse struct {
2913  	Domains []string `json:"domains"`
2914  
2915  	OrganizationID string `json:"organization_id"`
2916  
2917  	ProjectID string `json:"project_id"`
2918  
2919  	TaskID string `json:"task_id"`
2920  
2921  	CreatedAt *time.Time `json:"created_at"`
2922  }
2923  
2924  // RefreshDNSZoneRequest: refresh dns zone request.
2925  type RefreshDNSZoneRequest struct {
2926  	// DNSZone: DNS zone to refresh.
2927  	DNSZone string `json:"-"`
2928  
2929  	// RecreateDNSZone: specifies whether or not to recreate the DNS zone.
2930  	RecreateDNSZone bool `json:"recreate_dns_zone"`
2931  
2932  	// RecreateSubDNSZone: specifies whether or not to recreate the sub DNS zone.
2933  	RecreateSubDNSZone bool `json:"recreate_sub_dns_zone"`
2934  }
2935  
2936  // RefreshDNSZoneResponse: refresh dns zone response.
2937  type RefreshDNSZoneResponse struct {
2938  	// DNSZones: DNS zones returned.
2939  	DNSZones []*DNSZone `json:"dns_zones"`
2940  }
2941  
2942  // RegisterExternalDomainResponse: register external domain response.
2943  type RegisterExternalDomainResponse struct {
2944  	Domain string `json:"domain"`
2945  
2946  	OrganizationID string `json:"organization_id"`
2947  
2948  	ValidationToken string `json:"validation_token"`
2949  
2950  	CreatedAt *time.Time `json:"created_at"`
2951  
2952  	ProjectID string `json:"project_id"`
2953  }
2954  
2955  // RegistrarAPIBuyDomainsRequest: registrar api buy domains request.
2956  type RegistrarAPIBuyDomainsRequest struct {
2957  	Domains []string `json:"domains"`
2958  
2959  	DurationInYears uint32 `json:"duration_in_years"`
2960  
2961  	ProjectID string `json:"project_id"`
2962  
2963  	// Precisely one of OwnerContactID, OwnerContact must be set.
2964  	OwnerContactID *string `json:"owner_contact_id,omitempty"`
2965  
2966  	// Precisely one of OwnerContactID, OwnerContact must be set.
2967  	OwnerContact *NewContact `json:"owner_contact,omitempty"`
2968  
2969  	// Precisely one of AdministrativeContactID, AdministrativeContact must be set.
2970  	AdministrativeContactID *string `json:"administrative_contact_id,omitempty"`
2971  
2972  	// Precisely one of AdministrativeContactID, AdministrativeContact must be set.
2973  	AdministrativeContact *NewContact `json:"administrative_contact,omitempty"`
2974  
2975  	// Precisely one of TechnicalContactID, TechnicalContact must be set.
2976  	TechnicalContactID *string `json:"technical_contact_id,omitempty"`
2977  
2978  	// Precisely one of TechnicalContactID, TechnicalContact must be set.
2979  	TechnicalContact *NewContact `json:"technical_contact,omitempty"`
2980  }
2981  
2982  // RegistrarAPICheckContactsCompatibilityRequest: registrar api check contacts compatibility request.
2983  type RegistrarAPICheckContactsCompatibilityRequest struct {
2984  	Domains []string `json:"domains"`
2985  
2986  	Tlds []string `json:"tlds"`
2987  
2988  	// Precisely one of OwnerContactID, OwnerContact must be set.
2989  	OwnerContactID *string `json:"owner_contact_id,omitempty"`
2990  
2991  	// Precisely one of OwnerContactID, OwnerContact must be set.
2992  	OwnerContact *NewContact `json:"owner_contact,omitempty"`
2993  
2994  	// Precisely one of AdministrativeContactID, AdministrativeContact must be set.
2995  	AdministrativeContactID *string `json:"administrative_contact_id,omitempty"`
2996  
2997  	// Precisely one of AdministrativeContactID, AdministrativeContact must be set.
2998  	AdministrativeContact *NewContact `json:"administrative_contact,omitempty"`
2999  
3000  	// Precisely one of TechnicalContactID, TechnicalContact must be set.
3001  	TechnicalContactID *string `json:"technical_contact_id,omitempty"`
3002  
3003  	// Precisely one of TechnicalContactID, TechnicalContact must be set.
3004  	TechnicalContact *NewContact `json:"technical_contact,omitempty"`
3005  }
3006  
3007  // RegistrarAPICreateDomainHostRequest: registrar api create domain host request.
3008  type RegistrarAPICreateDomainHostRequest struct {
3009  	Domain string `json:"-"`
3010  
3011  	Name string `json:"name"`
3012  
3013  	IPs []net.IP `json:"ips"`
3014  }
3015  
3016  // RegistrarAPIDeleteDomainHostRequest: registrar api delete domain host request.
3017  type RegistrarAPIDeleteDomainHostRequest struct {
3018  	Domain string `json:"-"`
3019  
3020  	Name string `json:"-"`
3021  }
3022  
3023  // RegistrarAPIDeleteExternalDomainRequest: registrar api delete external domain request.
3024  type RegistrarAPIDeleteExternalDomainRequest struct {
3025  	Domain string `json:"-"`
3026  }
3027  
3028  // RegistrarAPIDisableDomainAutoRenewRequest: registrar api disable domain auto renew request.
3029  type RegistrarAPIDisableDomainAutoRenewRequest struct {
3030  	Domain string `json:"-"`
3031  }
3032  
3033  // RegistrarAPIDisableDomainDNSSECRequest: registrar api disable domain dnssec request.
3034  type RegistrarAPIDisableDomainDNSSECRequest struct {
3035  	Domain string `json:"-"`
3036  }
3037  
3038  // RegistrarAPIEnableDomainAutoRenewRequest: registrar api enable domain auto renew request.
3039  type RegistrarAPIEnableDomainAutoRenewRequest struct {
3040  	Domain string `json:"-"`
3041  }
3042  
3043  // RegistrarAPIEnableDomainDNSSECRequest: registrar api enable domain dnssec request.
3044  type RegistrarAPIEnableDomainDNSSECRequest struct {
3045  	Domain string `json:"-"`
3046  
3047  	DsRecord *DSRecord `json:"ds_record,omitempty"`
3048  }
3049  
3050  // RegistrarAPIGetContactRequest: registrar api get contact request.
3051  type RegistrarAPIGetContactRequest struct {
3052  	ContactID string `json:"-"`
3053  }
3054  
3055  // RegistrarAPIGetDomainAuthCodeRequest: registrar api get domain auth code request.
3056  type RegistrarAPIGetDomainAuthCodeRequest struct {
3057  	Domain string `json:"-"`
3058  }
3059  
3060  // RegistrarAPIGetDomainRequest: registrar api get domain request.
3061  type RegistrarAPIGetDomainRequest struct {
3062  	Domain string `json:"-"`
3063  }
3064  
3065  // RegistrarAPIListContactsRequest: registrar api list contacts request.
3066  type RegistrarAPIListContactsRequest struct {
3067  	Page *int32 `json:"-"`
3068  
3069  	PageSize *uint32 `json:"-"`
3070  
3071  	Domain *string `json:"-"`
3072  
3073  	ProjectID *string `json:"-"`
3074  
3075  	OrganizationID *string `json:"-"`
3076  
3077  	// Role: default value: unknown_role
3078  	Role ListContactsRequestRole `json:"-"`
3079  
3080  	// EmailStatus: default value: email_status_unknown
3081  	EmailStatus ContactEmailStatus `json:"-"`
3082  }
3083  
3084  // RegistrarAPIListDomainHostsRequest: registrar api list domain hosts request.
3085  type RegistrarAPIListDomainHostsRequest struct {
3086  	Domain string `json:"-"`
3087  
3088  	Page *int32 `json:"-"`
3089  
3090  	PageSize *uint32 `json:"-"`
3091  }
3092  
3093  // RegistrarAPIListDomainsRequest: registrar api list domains request.
3094  type RegistrarAPIListDomainsRequest struct {
3095  	Page *int32 `json:"-"`
3096  
3097  	PageSize *uint32 `json:"-"`
3098  
3099  	// OrderBy: default value: domain_asc
3100  	OrderBy ListDomainsRequestOrderBy `json:"-"`
3101  
3102  	Registrar *string `json:"-"`
3103  
3104  	// Status: default value: status_unknown
3105  	Status DomainStatus `json:"-"`
3106  
3107  	ProjectID *string `json:"-"`
3108  
3109  	OrganizationID *string `json:"-"`
3110  
3111  	IsExternal *bool `json:"-"`
3112  
3113  	Domain *string `json:"-"`
3114  }
3115  
3116  // RegistrarAPIListInboundTransfersRequest: registrar api list inbound transfers request.
3117  type RegistrarAPIListInboundTransfersRequest struct {
3118  	Page int32 `json:"-"`
3119  
3120  	PageSize *uint32 `json:"-"`
3121  
3122  	ProjectID string `json:"-"`
3123  
3124  	OrganizationID string `json:"-"`
3125  
3126  	Domain string `json:"-"`
3127  }
3128  
3129  // RegistrarAPIListRenewableDomainsRequest: registrar api list renewable domains request.
3130  type RegistrarAPIListRenewableDomainsRequest struct {
3131  	Page *int32 `json:"-"`
3132  
3133  	PageSize *uint32 `json:"-"`
3134  
3135  	// OrderBy: default value: domain_asc
3136  	OrderBy ListRenewableDomainsRequestOrderBy `json:"-"`
3137  
3138  	ProjectID *string `json:"-"`
3139  
3140  	OrganizationID *string `json:"-"`
3141  }
3142  
3143  // RegistrarAPIListTasksRequest: registrar api list tasks request.
3144  type RegistrarAPIListTasksRequest struct {
3145  	Page *int32 `json:"-"`
3146  
3147  	PageSize *uint32 `json:"-"`
3148  
3149  	ProjectID *string `json:"-"`
3150  
3151  	OrganizationID *string `json:"-"`
3152  
3153  	Domain *string `json:"-"`
3154  
3155  	Types []TaskType `json:"-"`
3156  
3157  	Statuses []TaskStatus `json:"-"`
3158  
3159  	// OrderBy: default value: domain_desc
3160  	OrderBy ListTasksRequestOrderBy `json:"-"`
3161  }
3162  
3163  // RegistrarAPIListTldsRequest: registrar api list tlds request.
3164  type RegistrarAPIListTldsRequest struct {
3165  	// Tlds: array of TLDs to return.
3166  	Tlds []string `json:"-"`
3167  
3168  	// Page: page number for the returned Projects.
3169  	Page *int32 `json:"-"`
3170  
3171  	// PageSize: maximum number of Project per page.
3172  	PageSize *uint32 `json:"-"`
3173  
3174  	// OrderBy: sort order of the returned TLDs.
3175  	// Default value: name_asc
3176  	OrderBy ListTldsRequestOrderBy `json:"-"`
3177  }
3178  
3179  // RegistrarAPILockDomainTransferRequest: registrar api lock domain transfer request.
3180  type RegistrarAPILockDomainTransferRequest struct {
3181  	Domain string `json:"-"`
3182  }
3183  
3184  // RegistrarAPIRegisterExternalDomainRequest: registrar api register external domain request.
3185  type RegistrarAPIRegisterExternalDomainRequest struct {
3186  	Domain string `json:"domain"`
3187  
3188  	ProjectID string `json:"project_id"`
3189  }
3190  
3191  // RegistrarAPIRenewDomainsRequest: registrar api renew domains request.
3192  type RegistrarAPIRenewDomainsRequest struct {
3193  	Domains []string `json:"domains"`
3194  
3195  	DurationInYears uint32 `json:"duration_in_years"`
3196  
3197  	ForceLateRenewal *bool `json:"force_late_renewal,omitempty"`
3198  }
3199  
3200  // RegistrarAPIRetryInboundTransferRequest: registrar api retry inbound transfer request.
3201  type RegistrarAPIRetryInboundTransferRequest struct {
3202  	// Domain: the domain being transferred.
3203  	Domain string `json:"domain"`
3204  
3205  	// ProjectID: the project ID to associated with the inbound transfer.
3206  	ProjectID string `json:"project_id"`
3207  
3208  	// AuthCode: an optional new auth code to replace the previous one for the retry.
3209  	AuthCode *string `json:"auth_code,omitempty"`
3210  }
3211  
3212  // RegistrarAPISearchAvailableDomainsRequest: registrar api search available domains request.
3213  type RegistrarAPISearchAvailableDomainsRequest struct {
3214  	// Domains: a list of domain to search, TLD is optional.
3215  	Domains []string `json:"-"`
3216  
3217  	// Tlds: array of tlds to search on.
3218  	Tlds []string `json:"-"`
3219  
3220  	// StrictSearch: search exact match.
3221  	StrictSearch bool `json:"-"`
3222  }
3223  
3224  // RegistrarAPITradeDomainRequest: registrar api trade domain request.
3225  type RegistrarAPITradeDomainRequest struct {
3226  	Domain string `json:"-"`
3227  
3228  	ProjectID *string `json:"project_id,omitempty"`
3229  
3230  	// Precisely one of NewOwnerContactID, NewOwnerContact must be set.
3231  	NewOwnerContactID *string `json:"new_owner_contact_id,omitempty"`
3232  
3233  	// Precisely one of NewOwnerContactID, NewOwnerContact must be set.
3234  	NewOwnerContact *NewContact `json:"new_owner_contact,omitempty"`
3235  }
3236  
3237  // RegistrarAPITransferInDomainRequest: registrar api transfer in domain request.
3238  type RegistrarAPITransferInDomainRequest struct {
3239  	Domains []*TransferInDomainRequestTransferRequest `json:"domains"`
3240  
3241  	ProjectID string `json:"project_id"`
3242  
3243  	// Precisely one of OwnerContactID, OwnerContact must be set.
3244  	OwnerContactID *string `json:"owner_contact_id,omitempty"`
3245  
3246  	// Precisely one of OwnerContactID, OwnerContact must be set.
3247  	OwnerContact *NewContact `json:"owner_contact,omitempty"`
3248  
3249  	// Precisely one of AdministrativeContactID, AdministrativeContact must be set.
3250  	AdministrativeContactID *string `json:"administrative_contact_id,omitempty"`
3251  
3252  	// Precisely one of AdministrativeContactID, AdministrativeContact must be set.
3253  	AdministrativeContact *NewContact `json:"administrative_contact,omitempty"`
3254  
3255  	// Precisely one of TechnicalContactID, TechnicalContact must be set.
3256  	TechnicalContactID *string `json:"technical_contact_id,omitempty"`
3257  
3258  	// Precisely one of TechnicalContactID, TechnicalContact must be set.
3259  	TechnicalContact *NewContact `json:"technical_contact,omitempty"`
3260  }
3261  
3262  // RegistrarAPIUnlockDomainTransferRequest: registrar api unlock domain transfer request.
3263  type RegistrarAPIUnlockDomainTransferRequest struct {
3264  	Domain string `json:"-"`
3265  }
3266  
3267  // RegistrarAPIUpdateContactRequest: registrar api update contact request.
3268  type RegistrarAPIUpdateContactRequest struct {
3269  	ContactID string `json:"-"`
3270  
3271  	Email *string `json:"email,omitempty"`
3272  
3273  	EmailAlt *string `json:"email_alt,omitempty"`
3274  
3275  	PhoneNumber *string `json:"phone_number,omitempty"`
3276  
3277  	FaxNumber *string `json:"fax_number,omitempty"`
3278  
3279  	AddressLine1 *string `json:"address_line_1,omitempty"`
3280  
3281  	AddressLine2 *string `json:"address_line_2,omitempty"`
3282  
3283  	Zip *string `json:"zip,omitempty"`
3284  
3285  	City *string `json:"city,omitempty"`
3286  
3287  	Country *string `json:"country,omitempty"`
3288  
3289  	VatIDentificationCode *string `json:"vat_identification_code,omitempty"`
3290  
3291  	CompanyIDentificationCode *string `json:"company_identification_code,omitempty"`
3292  
3293  	// Lang: default value: unknown_language_code
3294  	Lang std.LanguageCode `json:"lang"`
3295  
3296  	Resale *bool `json:"resale,omitempty"`
3297  
3298  	// Deprecated
3299  	Questions *[]*UpdateContactRequestQuestion `json:"questions,omitempty"`
3300  
3301  	ExtensionFr *ContactExtensionFR `json:"extension_fr,omitempty"`
3302  
3303  	ExtensionEu *ContactExtensionEU `json:"extension_eu,omitempty"`
3304  
3305  	WhoisOptIn *bool `json:"whois_opt_in,omitempty"`
3306  
3307  	State *string `json:"state,omitempty"`
3308  
3309  	ExtensionNl *ContactExtensionNL `json:"extension_nl,omitempty"`
3310  
3311  	ExtensionIt *ContactExtensionIT `json:"extension_it,omitempty"`
3312  }
3313  
3314  // RegistrarAPIUpdateDomainHostRequest: registrar api update domain host request.
3315  type RegistrarAPIUpdateDomainHostRequest struct {
3316  	Domain string `json:"-"`
3317  
3318  	Name string `json:"-"`
3319  
3320  	IPs *[]string `json:"ips,omitempty"`
3321  }
3322  
3323  // RegistrarAPIUpdateDomainRequest: registrar api update domain request.
3324  type RegistrarAPIUpdateDomainRequest struct {
3325  	Domain string `json:"-"`
3326  
3327  	// Precisely one of TechnicalContactID, TechnicalContact must be set.
3328  	TechnicalContactID *string `json:"technical_contact_id,omitempty"`
3329  
3330  	// Precisely one of TechnicalContactID, TechnicalContact must be set.
3331  	TechnicalContact *NewContact `json:"technical_contact,omitempty"`
3332  
3333  	// Deprecated
3334  	// Precisely one of OwnerContactID, OwnerContact must be set.
3335  	OwnerContactID *string `json:"owner_contact_id,omitempty"`
3336  
3337  	// Deprecated
3338  	// Precisely one of OwnerContactID, OwnerContact must be set.
3339  	OwnerContact *NewContact `json:"owner_contact,omitempty"`
3340  
3341  	// Precisely one of AdministrativeContactID, AdministrativeContact must be set.
3342  	AdministrativeContactID *string `json:"administrative_contact_id,omitempty"`
3343  
3344  	// Precisely one of AdministrativeContactID, AdministrativeContact must be set.
3345  	AdministrativeContact *NewContact `json:"administrative_contact,omitempty"`
3346  }
3347  
3348  // RestoreDNSZoneVersionRequest: restore dns zone version request.
3349  type RestoreDNSZoneVersionRequest struct {
3350  	DNSZoneVersionID string `json:"-"`
3351  }
3352  
3353  // RestoreDNSZoneVersionResponse: restore dns zone version response.
3354  type RestoreDNSZoneVersionResponse struct{}
3355  
3356  // RetryInboundTransferResponse: retry inbound transfer response.
3357  type RetryInboundTransferResponse struct{}
3358  
3359  // SearchAvailableDomainsConsoleResponse: search available domains console response.
3360  type SearchAvailableDomainsConsoleResponse struct {
3361  	ExactMatchDomain *AvailableDomain `json:"exact_match_domain"`
3362  
3363  	AvailableDomains []*AvailableDomain `json:"available_domains"`
3364  }
3365  
3366  // SearchAvailableDomainsResponse: search available domains response.
3367  type SearchAvailableDomainsResponse struct {
3368  	// AvailableDomains: array of available domains.
3369  	AvailableDomains []*AvailableDomain `json:"available_domains"`
3370  }
3371  
3372  // UnauthenticatedRegistrarAPISearchAvailableDomainsConsoleRequest: unauthenticated registrar api search available domains console request.
3373  type UnauthenticatedRegistrarAPISearchAvailableDomainsConsoleRequest struct {
3374  	Domain string `json:"-"`
3375  
3376  	Tlds []string `json:"-"`
3377  
3378  	StrictSearch bool `json:"-"`
3379  }
3380  
3381  // UpdateDNSZoneNameserversRequest: update dns zone nameservers request.
3382  type UpdateDNSZoneNameserversRequest struct {
3383  	// DNSZone: DNS zone in which to update the DNS zone name servers.
3384  	DNSZone string `json:"-"`
3385  
3386  	// Ns: new DNS zone name servers.
3387  	Ns []*Nameserver `json:"ns"`
3388  }
3389  
3390  // UpdateDNSZoneNameserversResponse: update dns zone nameservers response.
3391  type UpdateDNSZoneNameserversResponse struct {
3392  	// Ns: DNS zone name servers returned.
3393  	Ns []*Nameserver `json:"ns"`
3394  }
3395  
3396  // UpdateDNSZoneRecordsRequest: update dns zone records request.
3397  type UpdateDNSZoneRecordsRequest struct {
3398  	// DNSZone: DNS zone in which to update the DNS zone records.
3399  	DNSZone string `json:"-"`
3400  
3401  	// Changes: changes made to the records.
3402  	Changes []*RecordChange `json:"changes"`
3403  
3404  	// ReturnAllRecords: specifies whether or not to return all the records.
3405  	ReturnAllRecords *bool `json:"return_all_records,omitempty"`
3406  
3407  	// DisallowNewZoneCreation: disable the creation of the target zone if it does not exist. Target zone creation is disabled by default.
3408  	DisallowNewZoneCreation bool `json:"disallow_new_zone_creation"`
3409  
3410  	// Serial: use the provided serial (0) instead of the auto-increment serial.
3411  	Serial *uint64 `json:"serial,omitempty"`
3412  }
3413  
3414  // UpdateDNSZoneRecordsResponse: update dns zone records response.
3415  type UpdateDNSZoneRecordsResponse struct {
3416  	// Records: DNS zone records returned.
3417  	Records []*Record `json:"records"`
3418  }
3419  
3420  // UpdateDNSZoneRequest: update dns zone request.
3421  type UpdateDNSZoneRequest struct {
3422  	// DNSZone: DNS zone to update.
3423  	DNSZone string `json:"-"`
3424  
3425  	// NewDNSZone: name of the new DNS zone to create.
3426  	NewDNSZone *string `json:"new_dns_zone,omitempty"`
3427  
3428  	// ProjectID: project ID in which to create the new DNS zone.
3429  	ProjectID string `json:"project_id"`
3430  }
3431  
3432  // This API allows you to manage your domains, DNS zones and records.
3433  type API struct {
3434  	client *scw.Client
3435  }
3436  
3437  // NewAPI returns a API object from a Scaleway client.
3438  func NewAPI(client *scw.Client) *API {
3439  	return &API{
3440  		client: client,
3441  	}
3442  }
3443  
3444  // ListDNSZones: Retrieve the list of DNS zones you can manage and filter DNS zones associated with specific domain names.
3445  func (s *API) ListDNSZones(req *ListDNSZonesRequest, opts ...scw.RequestOption) (*ListDNSZonesResponse, error) {
3446  	var err error
3447  
3448  	defaultPageSize, exist := s.client.GetDefaultPageSize()
3449  	if (req.PageSize == nil || *req.PageSize == 0) && exist {
3450  		req.PageSize = &defaultPageSize
3451  	}
3452  
3453  	query := url.Values{}
3454  	parameter.AddToQuery(query, "organization_id", req.OrganizationID)
3455  	parameter.AddToQuery(query, "project_id", req.ProjectID)
3456  	parameter.AddToQuery(query, "order_by", req.OrderBy)
3457  	parameter.AddToQuery(query, "page", req.Page)
3458  	parameter.AddToQuery(query, "page_size", req.PageSize)
3459  	parameter.AddToQuery(query, "domain", req.Domain)
3460  	parameter.AddToQuery(query, "dns_zone", req.DNSZone)
3461  	parameter.AddToQuery(query, "dns_zones", req.DNSZones)
3462  	parameter.AddToQuery(query, "created_after", req.CreatedAfter)
3463  	parameter.AddToQuery(query, "created_before", req.CreatedBefore)
3464  	parameter.AddToQuery(query, "updated_after", req.UpdatedAfter)
3465  	parameter.AddToQuery(query, "updated_before", req.UpdatedBefore)
3466  
3467  	scwReq := &scw.ScalewayRequest{
3468  		Method: "GET",
3469  		Path:   "/domain/v2beta1/dns-zones",
3470  		Query:  query,
3471  	}
3472  
3473  	var resp ListDNSZonesResponse
3474  
3475  	err = s.client.Do(scwReq, &resp, opts...)
3476  	if err != nil {
3477  		return nil, err
3478  	}
3479  	return &resp, nil
3480  }
3481  
3482  // CreateDNSZone: Create a new DNS zone specified by the domain name, the subdomain and the Project ID.
3483  func (s *API) CreateDNSZone(req *CreateDNSZoneRequest, opts ...scw.RequestOption) (*DNSZone, error) {
3484  	var err error
3485  
3486  	if req.ProjectID == "" {
3487  		defaultProjectID, _ := s.client.GetDefaultProjectID()
3488  		req.ProjectID = defaultProjectID
3489  	}
3490  
3491  	scwReq := &scw.ScalewayRequest{
3492  		Method: "POST",
3493  		Path:   "/domain/v2beta1/dns-zones",
3494  	}
3495  
3496  	err = scwReq.SetBody(req)
3497  	if err != nil {
3498  		return nil, err
3499  	}
3500  
3501  	var resp DNSZone
3502  
3503  	err = s.client.Do(scwReq, &resp, opts...)
3504  	if err != nil {
3505  		return nil, err
3506  	}
3507  	return &resp, nil
3508  }
3509  
3510  // UpdateDNSZone: Update the name and/or the Organizations for a DNS zone.
3511  func (s *API) UpdateDNSZone(req *UpdateDNSZoneRequest, opts ...scw.RequestOption) (*DNSZone, error) {
3512  	var err error
3513  
3514  	if req.ProjectID == "" {
3515  		defaultProjectID, _ := s.client.GetDefaultProjectID()
3516  		req.ProjectID = defaultProjectID
3517  	}
3518  
3519  	if fmt.Sprint(req.DNSZone) == "" {
3520  		return nil, errors.New("field DNSZone cannot be empty in request")
3521  	}
3522  
3523  	scwReq := &scw.ScalewayRequest{
3524  		Method: "PATCH",
3525  		Path:   "/domain/v2beta1/dns-zones/" + fmt.Sprint(req.DNSZone) + "",
3526  	}
3527  
3528  	err = scwReq.SetBody(req)
3529  	if err != nil {
3530  		return nil, err
3531  	}
3532  
3533  	var resp DNSZone
3534  
3535  	err = s.client.Do(scwReq, &resp, opts...)
3536  	if err != nil {
3537  		return nil, err
3538  	}
3539  	return &resp, nil
3540  }
3541  
3542  // CloneDNSZone: Clone an existing DNS zone with all its records into a new DNS zone.
3543  func (s *API) CloneDNSZone(req *CloneDNSZoneRequest, opts ...scw.RequestOption) (*DNSZone, error) {
3544  	var err error
3545  
3546  	if fmt.Sprint(req.DNSZone) == "" {
3547  		return nil, errors.New("field DNSZone cannot be empty in request")
3548  	}
3549  
3550  	scwReq := &scw.ScalewayRequest{
3551  		Method: "POST",
3552  		Path:   "/domain/v2beta1/dns-zones/" + fmt.Sprint(req.DNSZone) + "/clone",
3553  	}
3554  
3555  	err = scwReq.SetBody(req)
3556  	if err != nil {
3557  		return nil, err
3558  	}
3559  
3560  	var resp DNSZone
3561  
3562  	err = s.client.Do(scwReq, &resp, opts...)
3563  	if err != nil {
3564  		return nil, err
3565  	}
3566  	return &resp, nil
3567  }
3568  
3569  // DeleteDNSZone: Delete a DNS zone and all its records.
3570  func (s *API) DeleteDNSZone(req *DeleteDNSZoneRequest, opts ...scw.RequestOption) (*DeleteDNSZoneResponse, error) {
3571  	var err error
3572  
3573  	if req.ProjectID == "" {
3574  		defaultProjectID, _ := s.client.GetDefaultProjectID()
3575  		req.ProjectID = defaultProjectID
3576  	}
3577  
3578  	query := url.Values{}
3579  	parameter.AddToQuery(query, "project_id", req.ProjectID)
3580  
3581  	if fmt.Sprint(req.DNSZone) == "" {
3582  		return nil, errors.New("field DNSZone cannot be empty in request")
3583  	}
3584  
3585  	scwReq := &scw.ScalewayRequest{
3586  		Method: "DELETE",
3587  		Path:   "/domain/v2beta1/dns-zones/" + fmt.Sprint(req.DNSZone) + "",
3588  		Query:  query,
3589  	}
3590  
3591  	var resp DeleteDNSZoneResponse
3592  
3593  	err = s.client.Do(scwReq, &resp, opts...)
3594  	if err != nil {
3595  		return nil, err
3596  	}
3597  	return &resp, nil
3598  }
3599  
3600  // ListDNSZoneRecords: Retrieve a list of DNS records within a DNS zone that has default name servers.
3601  // You can filter records by type and name.
3602  func (s *API) ListDNSZoneRecords(req *ListDNSZoneRecordsRequest, opts ...scw.RequestOption) (*ListDNSZoneRecordsResponse, error) {
3603  	var err error
3604  
3605  	defaultPageSize, exist := s.client.GetDefaultPageSize()
3606  	if (req.PageSize == nil || *req.PageSize == 0) && exist {
3607  		req.PageSize = &defaultPageSize
3608  	}
3609  
3610  	query := url.Values{}
3611  	parameter.AddToQuery(query, "project_id", req.ProjectID)
3612  	parameter.AddToQuery(query, "order_by", req.OrderBy)
3613  	parameter.AddToQuery(query, "page", req.Page)
3614  	parameter.AddToQuery(query, "page_size", req.PageSize)
3615  	parameter.AddToQuery(query, "name", req.Name)
3616  	parameter.AddToQuery(query, "type", req.Type)
3617  	parameter.AddToQuery(query, "id", req.ID)
3618  
3619  	if fmt.Sprint(req.DNSZone) == "" {
3620  		return nil, errors.New("field DNSZone cannot be empty in request")
3621  	}
3622  
3623  	scwReq := &scw.ScalewayRequest{
3624  		Method: "GET",
3625  		Path:   "/domain/v2beta1/dns-zones/" + fmt.Sprint(req.DNSZone) + "/records",
3626  		Query:  query,
3627  	}
3628  
3629  	var resp ListDNSZoneRecordsResponse
3630  
3631  	err = s.client.Do(scwReq, &resp, opts...)
3632  	if err != nil {
3633  		return nil, err
3634  	}
3635  	return &resp, nil
3636  }
3637  
3638  // UpdateDNSZoneRecords: Update records within a DNS zone that has default name servers and perform several actions on your records.
3639  //
3640  // Actions include:
3641  //   - add: allows you to add a new record or add a new IP to an existing A record, for example
3642  //   - set: allows you to edit a record or edit an IP from an existing A record, for example
3643  //   - delete: allows you to delete a record or delete an IP from an existing A record, for example
3644  //   - clear: allows you to delete all records from a DNS zone
3645  //
3646  // All edits will be versioned.
3647  func (s *API) UpdateDNSZoneRecords(req *UpdateDNSZoneRecordsRequest, opts ...scw.RequestOption) (*UpdateDNSZoneRecordsResponse, error) {
3648  	var err error
3649  
3650  	if fmt.Sprint(req.DNSZone) == "" {
3651  		return nil, errors.New("field DNSZone cannot be empty in request")
3652  	}
3653  
3654  	scwReq := &scw.ScalewayRequest{
3655  		Method: "PATCH",
3656  		Path:   "/domain/v2beta1/dns-zones/" + fmt.Sprint(req.DNSZone) + "/records",
3657  	}
3658  
3659  	err = scwReq.SetBody(req)
3660  	if err != nil {
3661  		return nil, err
3662  	}
3663  
3664  	var resp UpdateDNSZoneRecordsResponse
3665  
3666  	err = s.client.Do(scwReq, &resp, opts...)
3667  	if err != nil {
3668  		return nil, err
3669  	}
3670  	return &resp, nil
3671  }
3672  
3673  // ListDNSZoneNameservers: Retrieve a list of name servers within a DNS zone and their optional glue records.
3674  func (s *API) ListDNSZoneNameservers(req *ListDNSZoneNameserversRequest, opts ...scw.RequestOption) (*ListDNSZoneNameserversResponse, error) {
3675  	var err error
3676  
3677  	query := url.Values{}
3678  	parameter.AddToQuery(query, "project_id", req.ProjectID)
3679  
3680  	if fmt.Sprint(req.DNSZone) == "" {
3681  		return nil, errors.New("field DNSZone cannot be empty in request")
3682  	}
3683  
3684  	scwReq := &scw.ScalewayRequest{
3685  		Method: "GET",
3686  		Path:   "/domain/v2beta1/dns-zones/" + fmt.Sprint(req.DNSZone) + "/nameservers",
3687  		Query:  query,
3688  	}
3689  
3690  	var resp ListDNSZoneNameserversResponse
3691  
3692  	err = s.client.Do(scwReq, &resp, opts...)
3693  	if err != nil {
3694  		return nil, err
3695  	}
3696  	return &resp, nil
3697  }
3698  
3699  // UpdateDNSZoneNameservers: Update name servers within a DNS zone and set optional glue records.
3700  func (s *API) UpdateDNSZoneNameservers(req *UpdateDNSZoneNameserversRequest, opts ...scw.RequestOption) (*UpdateDNSZoneNameserversResponse, error) {
3701  	var err error
3702  
3703  	if fmt.Sprint(req.DNSZone) == "" {
3704  		return nil, errors.New("field DNSZone cannot be empty in request")
3705  	}
3706  
3707  	scwReq := &scw.ScalewayRequest{
3708  		Method: "PUT",
3709  		Path:   "/domain/v2beta1/dns-zones/" + fmt.Sprint(req.DNSZone) + "/nameservers",
3710  	}
3711  
3712  	err = scwReq.SetBody(req)
3713  	if err != nil {
3714  		return nil, err
3715  	}
3716  
3717  	var resp UpdateDNSZoneNameserversResponse
3718  
3719  	err = s.client.Do(scwReq, &resp, opts...)
3720  	if err != nil {
3721  		return nil, err
3722  	}
3723  	return &resp, nil
3724  }
3725  
3726  // ClearDNSZoneRecords: Delete all records within a DNS zone that has default name servers.<br/>
3727  // All edits will be versioned.
3728  func (s *API) ClearDNSZoneRecords(req *ClearDNSZoneRecordsRequest, opts ...scw.RequestOption) (*ClearDNSZoneRecordsResponse, error) {
3729  	var err error
3730  
3731  	if fmt.Sprint(req.DNSZone) == "" {
3732  		return nil, errors.New("field DNSZone cannot be empty in request")
3733  	}
3734  
3735  	scwReq := &scw.ScalewayRequest{
3736  		Method: "DELETE",
3737  		Path:   "/domain/v2beta1/dns-zones/" + fmt.Sprint(req.DNSZone) + "/records",
3738  	}
3739  
3740  	var resp ClearDNSZoneRecordsResponse
3741  
3742  	err = s.client.Do(scwReq, &resp, opts...)
3743  	if err != nil {
3744  		return nil, err
3745  	}
3746  	return &resp, nil
3747  }
3748  
3749  // ExportRawDNSZone: Export a DNS zone with default name servers, in a specific format.
3750  func (s *API) ExportRawDNSZone(req *ExportRawDNSZoneRequest, opts ...scw.RequestOption) (*scw.File, error) {
3751  	var err error
3752  
3753  	query := url.Values{}
3754  	parameter.AddToQuery(query, "format", req.Format)
3755  
3756  	if fmt.Sprint(req.DNSZone) == "" {
3757  		return nil, errors.New("field DNSZone cannot be empty in request")
3758  	}
3759  
3760  	scwReq := &scw.ScalewayRequest{
3761  		Method: "GET",
3762  		Path:   "/domain/v2beta1/dns-zones/" + fmt.Sprint(req.DNSZone) + "/raw",
3763  		Query:  query,
3764  	}
3765  
3766  	var resp scw.File
3767  
3768  	err = s.client.Do(scwReq, &resp, opts...)
3769  	if err != nil {
3770  		return nil, err
3771  	}
3772  	return &resp, nil
3773  }
3774  
3775  // ImportRawDNSZone: Import and replace the format of records from a given provider, with default name servers.
3776  func (s *API) ImportRawDNSZone(req *ImportRawDNSZoneRequest, opts ...scw.RequestOption) (*ImportRawDNSZoneResponse, error) {
3777  	var err error
3778  
3779  	if req.ProjectID == "" {
3780  		defaultProjectID, _ := s.client.GetDefaultProjectID()
3781  		req.ProjectID = defaultProjectID
3782  	}
3783  
3784  	if fmt.Sprint(req.DNSZone) == "" {
3785  		return nil, errors.New("field DNSZone cannot be empty in request")
3786  	}
3787  
3788  	scwReq := &scw.ScalewayRequest{
3789  		Method: "POST",
3790  		Path:   "/domain/v2beta1/dns-zones/" + fmt.Sprint(req.DNSZone) + "/raw",
3791  	}
3792  
3793  	err = scwReq.SetBody(req)
3794  	if err != nil {
3795  		return nil, err
3796  	}
3797  
3798  	var resp ImportRawDNSZoneResponse
3799  
3800  	err = s.client.Do(scwReq, &resp, opts...)
3801  	if err != nil {
3802  		return nil, err
3803  	}
3804  	return &resp, nil
3805  }
3806  
3807  // ImportProviderDNSZone: Import and replace the format of records from a given provider, with default name servers.
3808  func (s *API) ImportProviderDNSZone(req *ImportProviderDNSZoneRequest, opts ...scw.RequestOption) (*ImportProviderDNSZoneResponse, error) {
3809  	var err error
3810  
3811  	if fmt.Sprint(req.DNSZone) == "" {
3812  		return nil, errors.New("field DNSZone cannot be empty in request")
3813  	}
3814  
3815  	scwReq := &scw.ScalewayRequest{
3816  		Method: "POST",
3817  		Path:   "/domain/v2beta1/dns-zones/" + fmt.Sprint(req.DNSZone) + "/import-provider",
3818  	}
3819  
3820  	err = scwReq.SetBody(req)
3821  	if err != nil {
3822  		return nil, err
3823  	}
3824  
3825  	var resp ImportProviderDNSZoneResponse
3826  
3827  	err = s.client.Do(scwReq, &resp, opts...)
3828  	if err != nil {
3829  		return nil, err
3830  	}
3831  	return &resp, nil
3832  }
3833  
3834  // RefreshDNSZone: Refresh an SOA DNS zone to reload the records in the DNS zone and update the SOA serial.
3835  // You can recreate the given DNS zone and its sub DNS zone if needed.
3836  func (s *API) RefreshDNSZone(req *RefreshDNSZoneRequest, opts ...scw.RequestOption) (*RefreshDNSZoneResponse, error) {
3837  	var err error
3838  
3839  	if fmt.Sprint(req.DNSZone) == "" {
3840  		return nil, errors.New("field DNSZone cannot be empty in request")
3841  	}
3842  
3843  	scwReq := &scw.ScalewayRequest{
3844  		Method: "POST",
3845  		Path:   "/domain/v2beta1/dns-zones/" + fmt.Sprint(req.DNSZone) + "/refresh",
3846  	}
3847  
3848  	err = scwReq.SetBody(req)
3849  	if err != nil {
3850  		return nil, err
3851  	}
3852  
3853  	var resp RefreshDNSZoneResponse
3854  
3855  	err = s.client.Do(scwReq, &resp, opts...)
3856  	if err != nil {
3857  		return nil, err
3858  	}
3859  	return &resp, nil
3860  }
3861  
3862  // ListDNSZoneVersions: Retrieve a list of a DNS zone's versions.<br/>
3863  // The maximum version count is 100. If the count reaches this limit, the oldest version will be deleted after each new modification.
3864  func (s *API) ListDNSZoneVersions(req *ListDNSZoneVersionsRequest, opts ...scw.RequestOption) (*ListDNSZoneVersionsResponse, error) {
3865  	var err error
3866  
3867  	defaultPageSize, exist := s.client.GetDefaultPageSize()
3868  	if (req.PageSize == nil || *req.PageSize == 0) && exist {
3869  		req.PageSize = &defaultPageSize
3870  	}
3871  
3872  	query := url.Values{}
3873  	parameter.AddToQuery(query, "page", req.Page)
3874  	parameter.AddToQuery(query, "page_size", req.PageSize)
3875  
3876  	if fmt.Sprint(req.DNSZone) == "" {
3877  		return nil, errors.New("field DNSZone cannot be empty in request")
3878  	}
3879  
3880  	scwReq := &scw.ScalewayRequest{
3881  		Method: "GET",
3882  		Path:   "/domain/v2beta1/dns-zones/" + fmt.Sprint(req.DNSZone) + "/versions",
3883  		Query:  query,
3884  	}
3885  
3886  	var resp ListDNSZoneVersionsResponse
3887  
3888  	err = s.client.Do(scwReq, &resp, opts...)
3889  	if err != nil {
3890  		return nil, err
3891  	}
3892  	return &resp, nil
3893  }
3894  
3895  // ListDNSZoneVersionRecords: Retrieve a list of records from a specific DNS zone version.
3896  func (s *API) ListDNSZoneVersionRecords(req *ListDNSZoneVersionRecordsRequest, opts ...scw.RequestOption) (*ListDNSZoneVersionRecordsResponse, error) {
3897  	var err error
3898  
3899  	defaultPageSize, exist := s.client.GetDefaultPageSize()
3900  	if (req.PageSize == nil || *req.PageSize == 0) && exist {
3901  		req.PageSize = &defaultPageSize
3902  	}
3903  
3904  	query := url.Values{}
3905  	parameter.AddToQuery(query, "page", req.Page)
3906  	parameter.AddToQuery(query, "page_size", req.PageSize)
3907  
3908  	if fmt.Sprint(req.DNSZoneVersionID) == "" {
3909  		return nil, errors.New("field DNSZoneVersionID cannot be empty in request")
3910  	}
3911  
3912  	scwReq := &scw.ScalewayRequest{
3913  		Method: "GET",
3914  		Path:   "/domain/v2beta1/dns-zones/version/" + fmt.Sprint(req.DNSZoneVersionID) + "",
3915  		Query:  query,
3916  	}
3917  
3918  	var resp ListDNSZoneVersionRecordsResponse
3919  
3920  	err = s.client.Do(scwReq, &resp, opts...)
3921  	if err != nil {
3922  		return nil, err
3923  	}
3924  	return &resp, nil
3925  }
3926  
3927  // GetDNSZoneVersionDiff: Access a previous DNS zone version to see the differences from another specific version.
3928  func (s *API) GetDNSZoneVersionDiff(req *GetDNSZoneVersionDiffRequest, opts ...scw.RequestOption) (*GetDNSZoneVersionDiffResponse, error) {
3929  	var err error
3930  
3931  	if fmt.Sprint(req.DNSZoneVersionID) == "" {
3932  		return nil, errors.New("field DNSZoneVersionID cannot be empty in request")
3933  	}
3934  
3935  	scwReq := &scw.ScalewayRequest{
3936  		Method: "GET",
3937  		Path:   "/domain/v2beta1/dns-zones/version/" + fmt.Sprint(req.DNSZoneVersionID) + "/diff",
3938  	}
3939  
3940  	var resp GetDNSZoneVersionDiffResponse
3941  
3942  	err = s.client.Do(scwReq, &resp, opts...)
3943  	if err != nil {
3944  		return nil, err
3945  	}
3946  	return &resp, nil
3947  }
3948  
3949  // RestoreDNSZoneVersion: Restore and activate a version of a specific DNS zone.
3950  func (s *API) RestoreDNSZoneVersion(req *RestoreDNSZoneVersionRequest, opts ...scw.RequestOption) (*RestoreDNSZoneVersionResponse, error) {
3951  	var err error
3952  
3953  	if fmt.Sprint(req.DNSZoneVersionID) == "" {
3954  		return nil, errors.New("field DNSZoneVersionID cannot be empty in request")
3955  	}
3956  
3957  	scwReq := &scw.ScalewayRequest{
3958  		Method: "POST",
3959  		Path:   "/domain/v2beta1/dns-zones/version/" + fmt.Sprint(req.DNSZoneVersionID) + "/restore",
3960  	}
3961  
3962  	err = scwReq.SetBody(req)
3963  	if err != nil {
3964  		return nil, err
3965  	}
3966  
3967  	var resp RestoreDNSZoneVersionResponse
3968  
3969  	err = s.client.Do(scwReq, &resp, opts...)
3970  	if err != nil {
3971  		return nil, err
3972  	}
3973  	return &resp, nil
3974  }
3975  
3976  // GetSSLCertificate: Get the DNS zone's TLS certificate. If you do not have a certificate, the output returns `no certificate found`.
3977  func (s *API) GetSSLCertificate(req *GetSSLCertificateRequest, opts ...scw.RequestOption) (*SSLCertificate, error) {
3978  	var err error
3979  
3980  	if fmt.Sprint(req.DNSZone) == "" {
3981  		return nil, errors.New("field DNSZone cannot be empty in request")
3982  	}
3983  
3984  	scwReq := &scw.ScalewayRequest{
3985  		Method: "GET",
3986  		Path:   "/domain/v2beta1/ssl-certificates/" + fmt.Sprint(req.DNSZone) + "",
3987  	}
3988  
3989  	var resp SSLCertificate
3990  
3991  	err = s.client.Do(scwReq, &resp, opts...)
3992  	if err != nil {
3993  		return nil, err
3994  	}
3995  	return &resp, nil
3996  }
3997  
3998  // WaitForSSLCertificateRequest is used by WaitForSSLCertificate method.
3999  type WaitForSSLCertificateRequest struct {
4000  	DNSZone       string
4001  	Timeout       *time.Duration
4002  	RetryInterval *time.Duration
4003  }
4004  
4005  // WaitForSSLCertificate waits for the SSLCertificate to reach a terminal state.
4006  func (s *API) WaitForSSLCertificate(req *WaitForSSLCertificateRequest, opts ...scw.RequestOption) (*SSLCertificate, error) {
4007  	timeout := defaultDomainTimeout
4008  	if req.Timeout != nil {
4009  		timeout = *req.Timeout
4010  	}
4011  
4012  	retryInterval := defaultDomainRetryInterval
4013  	if req.RetryInterval != nil {
4014  		retryInterval = *req.RetryInterval
4015  	}
4016  	transientStatuses := map[SSLCertificateStatus]struct{}{
4017  		SSLCertificateStatusPending: {},
4018  	}
4019  
4020  	res, err := async.WaitSync(&async.WaitSyncConfig{
4021  		Get: func() (any, bool, error) {
4022  			res, err := s.GetSSLCertificate(&GetSSLCertificateRequest{
4023  				DNSZone: req.DNSZone,
4024  			}, opts...)
4025  			if err != nil {
4026  				return nil, false, err
4027  			}
4028  
4029  			_, isTransient := transientStatuses[res.Status]
4030  
4031  			return res, !isTransient, nil
4032  		},
4033  		IntervalStrategy: async.LinearIntervalStrategy(retryInterval),
4034  		Timeout:          timeout,
4035  	})
4036  	if err != nil {
4037  		return nil, errors.Wrap(err, "waiting for SSLCertificate failed")
4038  	}
4039  
4040  	return res.(*SSLCertificate), nil
4041  }
4042  
4043  // CreateSSLCertificate: Create a new TLS certificate or retrieve information about an existing TLS certificate.
4044  func (s *API) CreateSSLCertificate(req *CreateSSLCertificateRequest, opts ...scw.RequestOption) (*SSLCertificate, error) {
4045  	var err error
4046  
4047  	scwReq := &scw.ScalewayRequest{
4048  		Method: "POST",
4049  		Path:   "/domain/v2beta1/ssl-certificates",
4050  	}
4051  
4052  	err = scwReq.SetBody(req)
4053  	if err != nil {
4054  		return nil, err
4055  	}
4056  
4057  	var resp SSLCertificate
4058  
4059  	err = s.client.Do(scwReq, &resp, opts...)
4060  	if err != nil {
4061  		return nil, err
4062  	}
4063  	return &resp, nil
4064  }
4065  
4066  // ListSSLCertificates: List all the TLS certificates a user has created, specified by the user's Project ID and the DNS zone.
4067  func (s *API) ListSSLCertificates(req *ListSSLCertificatesRequest, opts ...scw.RequestOption) (*ListSSLCertificatesResponse, error) {
4068  	var err error
4069  
4070  	defaultPageSize, exist := s.client.GetDefaultPageSize()
4071  	if (req.PageSize == nil || *req.PageSize == 0) && exist {
4072  		req.PageSize = &defaultPageSize
4073  	}
4074  
4075  	query := url.Values{}
4076  	parameter.AddToQuery(query, "dns_zone", req.DNSZone)
4077  	parameter.AddToQuery(query, "page", req.Page)
4078  	parameter.AddToQuery(query, "page_size", req.PageSize)
4079  	parameter.AddToQuery(query, "project_id", req.ProjectID)
4080  
4081  	scwReq := &scw.ScalewayRequest{
4082  		Method: "GET",
4083  		Path:   "/domain/v2beta1/ssl-certificates",
4084  		Query:  query,
4085  	}
4086  
4087  	var resp ListSSLCertificatesResponse
4088  
4089  	err = s.client.Do(scwReq, &resp, opts...)
4090  	if err != nil {
4091  		return nil, err
4092  	}
4093  	return &resp, nil
4094  }
4095  
4096  // DeleteSSLCertificate: Delete an existing TLS certificate specified by its DNS zone. Deleting a TLS certificate is permanent and cannot be undone.
4097  func (s *API) DeleteSSLCertificate(req *DeleteSSLCertificateRequest, opts ...scw.RequestOption) (*DeleteSSLCertificateResponse, error) {
4098  	var err error
4099  
4100  	if fmt.Sprint(req.DNSZone) == "" {
4101  		return nil, errors.New("field DNSZone cannot be empty in request")
4102  	}
4103  
4104  	scwReq := &scw.ScalewayRequest{
4105  		Method: "DELETE",
4106  		Path:   "/domain/v2beta1/ssl-certificates/" + fmt.Sprint(req.DNSZone) + "",
4107  	}
4108  
4109  	var resp DeleteSSLCertificateResponse
4110  
4111  	err = s.client.Do(scwReq, &resp, opts...)
4112  	if err != nil {
4113  		return nil, err
4114  	}
4115  	return &resp, nil
4116  }
4117  
4118  // GetDNSZoneTsigKey: Retrieve information about the TSIG key of a given DNS zone to allow AXFR requests.
4119  func (s *API) GetDNSZoneTsigKey(req *GetDNSZoneTsigKeyRequest, opts ...scw.RequestOption) (*GetDNSZoneTsigKeyResponse, error) {
4120  	var err error
4121  
4122  	if fmt.Sprint(req.DNSZone) == "" {
4123  		return nil, errors.New("field DNSZone cannot be empty in request")
4124  	}
4125  
4126  	scwReq := &scw.ScalewayRequest{
4127  		Method: "GET",
4128  		Path:   "/domain/v2beta1/dns-zones/" + fmt.Sprint(req.DNSZone) + "/tsig-key",
4129  	}
4130  
4131  	var resp GetDNSZoneTsigKeyResponse
4132  
4133  	err = s.client.Do(scwReq, &resp, opts...)
4134  	if err != nil {
4135  		return nil, err
4136  	}
4137  	return &resp, nil
4138  }
4139  
4140  // DeleteDNSZoneTsigKey: Delete an existing TSIG key specified by its DNS zone. Deleting a TSIG key is permanent and cannot be undone.
4141  func (s *API) DeleteDNSZoneTsigKey(req *DeleteDNSZoneTsigKeyRequest, opts ...scw.RequestOption) error {
4142  	var err error
4143  
4144  	if fmt.Sprint(req.DNSZone) == "" {
4145  		return errors.New("field DNSZone cannot be empty in request")
4146  	}
4147  
4148  	scwReq := &scw.ScalewayRequest{
4149  		Method: "DELETE",
4150  		Path:   "/domain/v2beta1/dns-zones/" + fmt.Sprint(req.DNSZone) + "/tsig-key",
4151  	}
4152  
4153  	err = s.client.Do(scwReq, nil, opts...)
4154  	if err != nil {
4155  		return err
4156  	}
4157  	return nil
4158  }
4159  
4160  // Manage your domains and contacts.
4161  type RegistrarAPI struct {
4162  	client *scw.Client
4163  }
4164  
4165  // NewRegistrarAPI returns a RegistrarAPI object from a Scaleway client.
4166  func NewRegistrarAPI(client *scw.Client) *RegistrarAPI {
4167  	return &RegistrarAPI{
4168  		client: client,
4169  	}
4170  }
4171  
4172  // ListTasks: List all operations performed on the account.
4173  // You can filter the list of tasks by domain name.
4174  func (s *RegistrarAPI) ListTasks(req *RegistrarAPIListTasksRequest, opts ...scw.RequestOption) (*ListTasksResponse, error) {
4175  	var err error
4176  
4177  	defaultPageSize, exist := s.client.GetDefaultPageSize()
4178  	if (req.PageSize == nil || *req.PageSize == 0) && exist {
4179  		req.PageSize = &defaultPageSize
4180  	}
4181  
4182  	query := url.Values{}
4183  	parameter.AddToQuery(query, "page", req.Page)
4184  	parameter.AddToQuery(query, "page_size", req.PageSize)
4185  	parameter.AddToQuery(query, "project_id", req.ProjectID)
4186  	parameter.AddToQuery(query, "organization_id", req.OrganizationID)
4187  	parameter.AddToQuery(query, "domain", req.Domain)
4188  	parameter.AddToQuery(query, "types", req.Types)
4189  	parameter.AddToQuery(query, "statuses", req.Statuses)
4190  	parameter.AddToQuery(query, "order_by", req.OrderBy)
4191  
4192  	scwReq := &scw.ScalewayRequest{
4193  		Method: "GET",
4194  		Path:   "/domain/v2beta1/tasks",
4195  		Query:  query,
4196  	}
4197  
4198  	var resp ListTasksResponse
4199  
4200  	err = s.client.Do(scwReq, &resp, opts...)
4201  	if err != nil {
4202  		return nil, err
4203  	}
4204  	return &resp, nil
4205  }
4206  
4207  // ListInboundTransfers: List all inbound transfer operations on the account.
4208  // You can filter the list of inbound transfers by domain name.
4209  func (s *RegistrarAPI) ListInboundTransfers(req *RegistrarAPIListInboundTransfersRequest, opts ...scw.RequestOption) (*ListInboundTransfersResponse, error) {
4210  	var err error
4211  
4212  	defaultPageSize, exist := s.client.GetDefaultPageSize()
4213  	if (req.PageSize == nil || *req.PageSize == 0) && exist {
4214  		req.PageSize = &defaultPageSize
4215  	}
4216  
4217  	if req.ProjectID == "" {
4218  		defaultProjectID, _ := s.client.GetDefaultProjectID()
4219  		req.ProjectID = defaultProjectID
4220  	}
4221  
4222  	if req.OrganizationID == "" {
4223  		defaultOrganizationID, _ := s.client.GetDefaultOrganizationID()
4224  		req.OrganizationID = defaultOrganizationID
4225  	}
4226  
4227  	query := url.Values{}
4228  	parameter.AddToQuery(query, "page", req.Page)
4229  	parameter.AddToQuery(query, "page_size", req.PageSize)
4230  	parameter.AddToQuery(query, "project_id", req.ProjectID)
4231  	parameter.AddToQuery(query, "organization_id", req.OrganizationID)
4232  	parameter.AddToQuery(query, "domain", req.Domain)
4233  
4234  	scwReq := &scw.ScalewayRequest{
4235  		Method: "GET",
4236  		Path:   "/domain/v2beta1/inbound-transfers",
4237  		Query:  query,
4238  	}
4239  
4240  	var resp ListInboundTransfersResponse
4241  
4242  	err = s.client.Do(scwReq, &resp, opts...)
4243  	if err != nil {
4244  		return nil, err
4245  	}
4246  	return &resp, nil
4247  }
4248  
4249  // RetryInboundTransfer: Request a retry for the transfer of a domain from another registrar to Scaleway Domains and DNS.
4250  func (s *RegistrarAPI) RetryInboundTransfer(req *RegistrarAPIRetryInboundTransferRequest, opts ...scw.RequestOption) (*RetryInboundTransferResponse, error) {
4251  	var err error
4252  
4253  	if req.ProjectID == "" {
4254  		defaultProjectID, _ := s.client.GetDefaultProjectID()
4255  		req.ProjectID = defaultProjectID
4256  	}
4257  
4258  	scwReq := &scw.ScalewayRequest{
4259  		Method: "POST",
4260  		Path:   "/domain/v2beta1/retry-inbound-transfer",
4261  	}
4262  
4263  	err = scwReq.SetBody(req)
4264  	if err != nil {
4265  		return nil, err
4266  	}
4267  
4268  	var resp RetryInboundTransferResponse
4269  
4270  	err = s.client.Do(scwReq, &resp, opts...)
4271  	if err != nil {
4272  		return nil, err
4273  	}
4274  	return &resp, nil
4275  }
4276  
4277  // BuyDomains: Request the registration of domain names.
4278  // You can provide a domain's already existing contact or a new contact.
4279  func (s *RegistrarAPI) BuyDomains(req *RegistrarAPIBuyDomainsRequest, opts ...scw.RequestOption) (*OrderResponse, error) {
4280  	var err error
4281  
4282  	if req.ProjectID == "" {
4283  		defaultProjectID, _ := s.client.GetDefaultProjectID()
4284  		req.ProjectID = defaultProjectID
4285  	}
4286  
4287  	scwReq := &scw.ScalewayRequest{
4288  		Method: "POST",
4289  		Path:   "/domain/v2beta1/buy-domains",
4290  	}
4291  
4292  	err = scwReq.SetBody(req)
4293  	if err != nil {
4294  		return nil, err
4295  	}
4296  
4297  	var resp OrderResponse
4298  
4299  	err = s.client.Do(scwReq, &resp, opts...)
4300  	if err != nil {
4301  		return nil, err
4302  	}
4303  	return &resp, nil
4304  }
4305  
4306  // RenewDomains: Request the renewal of one or more domain names.
4307  func (s *RegistrarAPI) RenewDomains(req *RegistrarAPIRenewDomainsRequest, opts ...scw.RequestOption) (*OrderResponse, error) {
4308  	var err error
4309  
4310  	scwReq := &scw.ScalewayRequest{
4311  		Method: "POST",
4312  		Path:   "/domain/v2beta1/renew-domains",
4313  	}
4314  
4315  	err = scwReq.SetBody(req)
4316  	if err != nil {
4317  		return nil, err
4318  	}
4319  
4320  	var resp OrderResponse
4321  
4322  	err = s.client.Do(scwReq, &resp, opts...)
4323  	if err != nil {
4324  		return nil, err
4325  	}
4326  	return &resp, nil
4327  }
4328  
4329  // TransferInDomain: Request the transfer of a domain from another registrar to Scaleway Domains and DNS.
4330  func (s *RegistrarAPI) TransferInDomain(req *RegistrarAPITransferInDomainRequest, opts ...scw.RequestOption) (*OrderResponse, error) {
4331  	var err error
4332  
4333  	if req.ProjectID == "" {
4334  		defaultProjectID, _ := s.client.GetDefaultProjectID()
4335  		req.ProjectID = defaultProjectID
4336  	}
4337  
4338  	scwReq := &scw.ScalewayRequest{
4339  		Method: "POST",
4340  		Path:   "/domain/v2beta1/domains/transfer-domains",
4341  	}
4342  
4343  	err = scwReq.SetBody(req)
4344  	if err != nil {
4345  		return nil, err
4346  	}
4347  
4348  	var resp OrderResponse
4349  
4350  	err = s.client.Do(scwReq, &resp, opts...)
4351  	if err != nil {
4352  		return nil, err
4353  	}
4354  	return &resp, nil
4355  }
4356  
4357  // TradeDomain: Request to change a domain's contact owner.<br/>
4358  // If you specify the `organization_id` of the domain's new owner, the contact will change from the current owner's Scaleway account to the new owner's Scaleway account.<br/>
4359  // If the new owner's current contact information is not available, the first ever contact they have created for previous domains is taken into account to operate the change.<br/>
4360  // If the new owner has never created a contact to register domains before, an error message displays.
4361  func (s *RegistrarAPI) TradeDomain(req *RegistrarAPITradeDomainRequest, opts ...scw.RequestOption) (*OrderResponse, error) {
4362  	var err error
4363  
4364  	if fmt.Sprint(req.Domain) == "" {
4365  		return nil, errors.New("field Domain cannot be empty in request")
4366  	}
4367  
4368  	scwReq := &scw.ScalewayRequest{
4369  		Method: "POST",
4370  		Path:   "/domain/v2beta1/domains/" + fmt.Sprint(req.Domain) + "/trade",
4371  	}
4372  
4373  	err = scwReq.SetBody(req)
4374  	if err != nil {
4375  		return nil, err
4376  	}
4377  
4378  	var resp OrderResponse
4379  
4380  	err = s.client.Do(scwReq, &resp, opts...)
4381  	if err != nil {
4382  		return nil, err
4383  	}
4384  	return &resp, nil
4385  }
4386  
4387  // RegisterExternalDomain: Request the registration of an external domain name.
4388  func (s *RegistrarAPI) RegisterExternalDomain(req *RegistrarAPIRegisterExternalDomainRequest, opts ...scw.RequestOption) (*RegisterExternalDomainResponse, error) {
4389  	var err error
4390  
4391  	if req.ProjectID == "" {
4392  		defaultProjectID, _ := s.client.GetDefaultProjectID()
4393  		req.ProjectID = defaultProjectID
4394  	}
4395  
4396  	scwReq := &scw.ScalewayRequest{
4397  		Method: "POST",
4398  		Path:   "/domain/v2beta1/external-domains",
4399  	}
4400  
4401  	err = scwReq.SetBody(req)
4402  	if err != nil {
4403  		return nil, err
4404  	}
4405  
4406  	var resp RegisterExternalDomainResponse
4407  
4408  	err = s.client.Do(scwReq, &resp, opts...)
4409  	if err != nil {
4410  		return nil, err
4411  	}
4412  	return &resp, nil
4413  }
4414  
4415  // DeleteExternalDomain: Delete an external domain name.
4416  func (s *RegistrarAPI) DeleteExternalDomain(req *RegistrarAPIDeleteExternalDomainRequest, opts ...scw.RequestOption) (*DeleteExternalDomainResponse, error) {
4417  	var err error
4418  
4419  	if fmt.Sprint(req.Domain) == "" {
4420  		return nil, errors.New("field Domain cannot be empty in request")
4421  	}
4422  
4423  	scwReq := &scw.ScalewayRequest{
4424  		Method: "DELETE",
4425  		Path:   "/domain/v2beta1/external-domains/" + fmt.Sprint(req.Domain) + "",
4426  	}
4427  
4428  	var resp DeleteExternalDomainResponse
4429  
4430  	err = s.client.Do(scwReq, &resp, opts...)
4431  	if err != nil {
4432  		return nil, err
4433  	}
4434  	return &resp, nil
4435  }
4436  
4437  // CheckContactsCompatibility: Check whether contacts are compatible with a domain or a TLD.
4438  // If contacts are not compatible with either the domain or the TLD, the information that needs to be corrected is returned.
4439  func (s *RegistrarAPI) CheckContactsCompatibility(req *RegistrarAPICheckContactsCompatibilityRequest, opts ...scw.RequestOption) (*CheckContactsCompatibilityResponse, error) {
4440  	var err error
4441  
4442  	scwReq := &scw.ScalewayRequest{
4443  		Method: "POST",
4444  		Path:   "/domain/v2beta1/check-contacts-compatibility",
4445  	}
4446  
4447  	err = scwReq.SetBody(req)
4448  	if err != nil {
4449  		return nil, err
4450  	}
4451  
4452  	var resp CheckContactsCompatibilityResponse
4453  
4454  	err = s.client.Do(scwReq, &resp, opts...)
4455  	if err != nil {
4456  		return nil, err
4457  	}
4458  	return &resp, nil
4459  }
4460  
4461  // ListContacts: Retrieve the list of contacts and their associated domains and roles.
4462  // You can filter the list by domain name.
4463  func (s *RegistrarAPI) ListContacts(req *RegistrarAPIListContactsRequest, opts ...scw.RequestOption) (*ListContactsResponse, error) {
4464  	var err error
4465  
4466  	defaultPageSize, exist := s.client.GetDefaultPageSize()
4467  	if (req.PageSize == nil || *req.PageSize == 0) && exist {
4468  		req.PageSize = &defaultPageSize
4469  	}
4470  
4471  	query := url.Values{}
4472  	parameter.AddToQuery(query, "page", req.Page)
4473  	parameter.AddToQuery(query, "page_size", req.PageSize)
4474  	parameter.AddToQuery(query, "domain", req.Domain)
4475  	parameter.AddToQuery(query, "project_id", req.ProjectID)
4476  	parameter.AddToQuery(query, "organization_id", req.OrganizationID)
4477  	parameter.AddToQuery(query, "role", req.Role)
4478  	parameter.AddToQuery(query, "email_status", req.EmailStatus)
4479  
4480  	scwReq := &scw.ScalewayRequest{
4481  		Method: "GET",
4482  		Path:   "/domain/v2beta1/contacts",
4483  		Query:  query,
4484  	}
4485  
4486  	var resp ListContactsResponse
4487  
4488  	err = s.client.Do(scwReq, &resp, opts...)
4489  	if err != nil {
4490  		return nil, err
4491  	}
4492  	return &resp, nil
4493  }
4494  
4495  // GetContact: Retrieve a contact's details from the registrar using the given contact's ID.
4496  func (s *RegistrarAPI) GetContact(req *RegistrarAPIGetContactRequest, opts ...scw.RequestOption) (*Contact, error) {
4497  	var err error
4498  
4499  	if fmt.Sprint(req.ContactID) == "" {
4500  		return nil, errors.New("field ContactID cannot be empty in request")
4501  	}
4502  
4503  	scwReq := &scw.ScalewayRequest{
4504  		Method: "GET",
4505  		Path:   "/domain/v2beta1/contacts/" + fmt.Sprint(req.ContactID) + "",
4506  	}
4507  
4508  	var resp Contact
4509  
4510  	err = s.client.Do(scwReq, &resp, opts...)
4511  	if err != nil {
4512  		return nil, err
4513  	}
4514  	return &resp, nil
4515  }
4516  
4517  // UpdateContact: Edit the contact's information.
4518  func (s *RegistrarAPI) UpdateContact(req *RegistrarAPIUpdateContactRequest, opts ...scw.RequestOption) (*Contact, error) {
4519  	var err error
4520  
4521  	if fmt.Sprint(req.ContactID) == "" {
4522  		return nil, errors.New("field ContactID cannot be empty in request")
4523  	}
4524  
4525  	scwReq := &scw.ScalewayRequest{
4526  		Method: "PATCH",
4527  		Path:   "/domain/v2beta1/contacts/" + fmt.Sprint(req.ContactID) + "",
4528  	}
4529  
4530  	err = scwReq.SetBody(req)
4531  	if err != nil {
4532  		return nil, err
4533  	}
4534  
4535  	var resp Contact
4536  
4537  	err = s.client.Do(scwReq, &resp, opts...)
4538  	if err != nil {
4539  		return nil, err
4540  	}
4541  	return &resp, nil
4542  }
4543  
4544  // ListDomains: Retrieve the list of domains you own.
4545  func (s *RegistrarAPI) ListDomains(req *RegistrarAPIListDomainsRequest, opts ...scw.RequestOption) (*ListDomainsResponse, error) {
4546  	var err error
4547  
4548  	defaultPageSize, exist := s.client.GetDefaultPageSize()
4549  	if (req.PageSize == nil || *req.PageSize == 0) && exist {
4550  		req.PageSize = &defaultPageSize
4551  	}
4552  
4553  	query := url.Values{}
4554  	parameter.AddToQuery(query, "page", req.Page)
4555  	parameter.AddToQuery(query, "page_size", req.PageSize)
4556  	parameter.AddToQuery(query, "order_by", req.OrderBy)
4557  	parameter.AddToQuery(query, "registrar", req.Registrar)
4558  	parameter.AddToQuery(query, "status", req.Status)
4559  	parameter.AddToQuery(query, "project_id", req.ProjectID)
4560  	parameter.AddToQuery(query, "organization_id", req.OrganizationID)
4561  	parameter.AddToQuery(query, "is_external", req.IsExternal)
4562  	parameter.AddToQuery(query, "domain", req.Domain)
4563  
4564  	scwReq := &scw.ScalewayRequest{
4565  		Method: "GET",
4566  		Path:   "/domain/v2beta1/domains",
4567  		Query:  query,
4568  	}
4569  
4570  	var resp ListDomainsResponse
4571  
4572  	err = s.client.Do(scwReq, &resp, opts...)
4573  	if err != nil {
4574  		return nil, err
4575  	}
4576  	return &resp, nil
4577  }
4578  
4579  // ListRenewableDomains: Retrieve the list of domains you own that can be renewed. You can also see the maximum renewal duration in years for your domains that are renewable.
4580  func (s *RegistrarAPI) ListRenewableDomains(req *RegistrarAPIListRenewableDomainsRequest, opts ...scw.RequestOption) (*ListRenewableDomainsResponse, error) {
4581  	var err error
4582  
4583  	defaultPageSize, exist := s.client.GetDefaultPageSize()
4584  	if (req.PageSize == nil || *req.PageSize == 0) && exist {
4585  		req.PageSize = &defaultPageSize
4586  	}
4587  
4588  	query := url.Values{}
4589  	parameter.AddToQuery(query, "page", req.Page)
4590  	parameter.AddToQuery(query, "page_size", req.PageSize)
4591  	parameter.AddToQuery(query, "order_by", req.OrderBy)
4592  	parameter.AddToQuery(query, "project_id", req.ProjectID)
4593  	parameter.AddToQuery(query, "organization_id", req.OrganizationID)
4594  
4595  	scwReq := &scw.ScalewayRequest{
4596  		Method: "GET",
4597  		Path:   "/domain/v2beta1/renewable-domains",
4598  		Query:  query,
4599  	}
4600  
4601  	var resp ListRenewableDomainsResponse
4602  
4603  	err = s.client.Do(scwReq, &resp, opts...)
4604  	if err != nil {
4605  		return nil, err
4606  	}
4607  	return &resp, nil
4608  }
4609  
4610  // GetDomain: Retrieve a specific domain and display the domain's information.
4611  func (s *RegistrarAPI) GetDomain(req *RegistrarAPIGetDomainRequest, opts ...scw.RequestOption) (*Domain, error) {
4612  	var err error
4613  
4614  	if fmt.Sprint(req.Domain) == "" {
4615  		return nil, errors.New("field Domain cannot be empty in request")
4616  	}
4617  
4618  	scwReq := &scw.ScalewayRequest{
4619  		Method: "GET",
4620  		Path:   "/domain/v2beta1/domains/" + fmt.Sprint(req.Domain) + "",
4621  	}
4622  
4623  	var resp Domain
4624  
4625  	err = s.client.Do(scwReq, &resp, opts...)
4626  	if err != nil {
4627  		return nil, err
4628  	}
4629  	return &resp, nil
4630  }
4631  
4632  // WaitForDomainRequest is used by WaitForDomain method.
4633  type WaitForDomainRequest struct {
4634  	Domain        string
4635  	Timeout       *time.Duration
4636  	RetryInterval *time.Duration
4637  }
4638  
4639  // WaitForDomain waits for the Domain to reach a terminal state.
4640  func (s *RegistrarAPI) WaitForDomain(req *WaitForDomainRequest, opts ...scw.RequestOption) (*Domain, error) {
4641  	timeout := defaultDomainTimeout
4642  	if req.Timeout != nil {
4643  		timeout = *req.Timeout
4644  	}
4645  
4646  	retryInterval := defaultDomainRetryInterval
4647  	if req.RetryInterval != nil {
4648  		retryInterval = *req.RetryInterval
4649  	}
4650  	transientStatuses := map[DomainStatus]struct{}{
4651  		DomainStatusCreating: {},
4652  		DomainStatusRenewing: {},
4653  		DomainStatusXfering:  {},
4654  		DomainStatusExpiring: {},
4655  		DomainStatusUpdating: {},
4656  		DomainStatusChecking: {},
4657  		DomainStatusDeleting: {},
4658  	}
4659  
4660  	res, err := async.WaitSync(&async.WaitSyncConfig{
4661  		Get: func() (any, bool, error) {
4662  			res, err := s.GetDomain(&RegistrarAPIGetDomainRequest{
4663  				Domain: req.Domain,
4664  			}, opts...)
4665  			if err != nil {
4666  				return nil, false, err
4667  			}
4668  
4669  			_, isTransient := transientStatuses[res.Status]
4670  
4671  			return res, !isTransient, nil
4672  		},
4673  		IntervalStrategy: async.LinearIntervalStrategy(retryInterval),
4674  		Timeout:          timeout,
4675  	})
4676  	if err != nil {
4677  		return nil, errors.Wrap(err, "waiting for Domain failed")
4678  	}
4679  
4680  	return res.(*Domain), nil
4681  }
4682  
4683  // UpdateDomain: Update contacts for a specific domain or create a new contact.<br/>
4684  // If you add the same contact for multiple roles (owner, administrative, technical), only one ID will be created and used for all of the roles.
4685  func (s *RegistrarAPI) UpdateDomain(req *RegistrarAPIUpdateDomainRequest, opts ...scw.RequestOption) (*Domain, error) {
4686  	var err error
4687  
4688  	if fmt.Sprint(req.Domain) == "" {
4689  		return nil, errors.New("field Domain cannot be empty in request")
4690  	}
4691  
4692  	scwReq := &scw.ScalewayRequest{
4693  		Method: "PATCH",
4694  		Path:   "/domain/v2beta1/domains/" + fmt.Sprint(req.Domain) + "",
4695  	}
4696  
4697  	err = scwReq.SetBody(req)
4698  	if err != nil {
4699  		return nil, err
4700  	}
4701  
4702  	var resp Domain
4703  
4704  	err = s.client.Do(scwReq, &resp, opts...)
4705  	if err != nil {
4706  		return nil, err
4707  	}
4708  	return &resp, nil
4709  }
4710  
4711  // LockDomainTransfer: Lock the transfer of a domain. This means that the domain cannot be transferred and the authorization code cannot be requested to your current registrar.
4712  func (s *RegistrarAPI) LockDomainTransfer(req *RegistrarAPILockDomainTransferRequest, opts ...scw.RequestOption) (*Domain, error) {
4713  	var err error
4714  
4715  	if fmt.Sprint(req.Domain) == "" {
4716  		return nil, errors.New("field Domain cannot be empty in request")
4717  	}
4718  
4719  	scwReq := &scw.ScalewayRequest{
4720  		Method: "POST",
4721  		Path:   "/domain/v2beta1/domains/" + fmt.Sprint(req.Domain) + "/lock-transfer",
4722  	}
4723  
4724  	err = scwReq.SetBody(req)
4725  	if err != nil {
4726  		return nil, err
4727  	}
4728  
4729  	var resp Domain
4730  
4731  	err = s.client.Do(scwReq, &resp, opts...)
4732  	if err != nil {
4733  		return nil, err
4734  	}
4735  	return &resp, nil
4736  }
4737  
4738  // UnlockDomainTransfer: Unlock the transfer of a domain. This means that the domain can be transferred and the authorization code can be requested to your current registrar.
4739  func (s *RegistrarAPI) UnlockDomainTransfer(req *RegistrarAPIUnlockDomainTransferRequest, opts ...scw.RequestOption) (*Domain, error) {
4740  	var err error
4741  
4742  	if fmt.Sprint(req.Domain) == "" {
4743  		return nil, errors.New("field Domain cannot be empty in request")
4744  	}
4745  
4746  	scwReq := &scw.ScalewayRequest{
4747  		Method: "POST",
4748  		Path:   "/domain/v2beta1/domains/" + fmt.Sprint(req.Domain) + "/unlock-transfer",
4749  	}
4750  
4751  	err = scwReq.SetBody(req)
4752  	if err != nil {
4753  		return nil, err
4754  	}
4755  
4756  	var resp Domain
4757  
4758  	err = s.client.Do(scwReq, &resp, opts...)
4759  	if err != nil {
4760  		return nil, err
4761  	}
4762  	return &resp, nil
4763  }
4764  
4765  // EnableDomainAutoRenew: Enable the `auto renew` feature for a domain. This means the domain will be automatically renewed before its expiry date.
4766  func (s *RegistrarAPI) EnableDomainAutoRenew(req *RegistrarAPIEnableDomainAutoRenewRequest, opts ...scw.RequestOption) (*Domain, error) {
4767  	var err error
4768  
4769  	if fmt.Sprint(req.Domain) == "" {
4770  		return nil, errors.New("field Domain cannot be empty in request")
4771  	}
4772  
4773  	scwReq := &scw.ScalewayRequest{
4774  		Method: "POST",
4775  		Path:   "/domain/v2beta1/domains/" + fmt.Sprint(req.Domain) + "/enable-auto-renew",
4776  	}
4777  
4778  	err = scwReq.SetBody(req)
4779  	if err != nil {
4780  		return nil, err
4781  	}
4782  
4783  	var resp Domain
4784  
4785  	err = s.client.Do(scwReq, &resp, opts...)
4786  	if err != nil {
4787  		return nil, err
4788  	}
4789  	return &resp, nil
4790  }
4791  
4792  // DisableDomainAutoRenew: Disable the `auto renew` feature for a domain. This means the domain will not be renewed before its expiry date.
4793  func (s *RegistrarAPI) DisableDomainAutoRenew(req *RegistrarAPIDisableDomainAutoRenewRequest, opts ...scw.RequestOption) (*Domain, error) {
4794  	var err error
4795  
4796  	if fmt.Sprint(req.Domain) == "" {
4797  		return nil, errors.New("field Domain cannot be empty in request")
4798  	}
4799  
4800  	scwReq := &scw.ScalewayRequest{
4801  		Method: "POST",
4802  		Path:   "/domain/v2beta1/domains/" + fmt.Sprint(req.Domain) + "/disable-auto-renew",
4803  	}
4804  
4805  	err = scwReq.SetBody(req)
4806  	if err != nil {
4807  		return nil, err
4808  	}
4809  
4810  	var resp Domain
4811  
4812  	err = s.client.Do(scwReq, &resp, opts...)
4813  	if err != nil {
4814  		return nil, err
4815  	}
4816  	return &resp, nil
4817  }
4818  
4819  // GetDomainAuthCode: Retrieve the authorization code to transfer an unlocked domain. The output returns an error if the domain is locked.
4820  // Some TLDs may have a different procedure to retrieve the authorization code. In that case, the information displays in the message field.
4821  func (s *RegistrarAPI) GetDomainAuthCode(req *RegistrarAPIGetDomainAuthCodeRequest, opts ...scw.RequestOption) (*GetDomainAuthCodeResponse, error) {
4822  	var err error
4823  
4824  	if fmt.Sprint(req.Domain) == "" {
4825  		return nil, errors.New("field Domain cannot be empty in request")
4826  	}
4827  
4828  	scwReq := &scw.ScalewayRequest{
4829  		Method: "GET",
4830  		Path:   "/domain/v2beta1/domains/" + fmt.Sprint(req.Domain) + "/auth-code",
4831  	}
4832  
4833  	var resp GetDomainAuthCodeResponse
4834  
4835  	err = s.client.Do(scwReq, &resp, opts...)
4836  	if err != nil {
4837  		return nil, err
4838  	}
4839  	return &resp, nil
4840  }
4841  
4842  // EnableDomainDNSSEC: If your domain uses another registrar and has the default Scaleway NS, you have to **update the DS record at your registrar**.
4843  func (s *RegistrarAPI) EnableDomainDNSSEC(req *RegistrarAPIEnableDomainDNSSECRequest, opts ...scw.RequestOption) (*Domain, error) {
4844  	var err error
4845  
4846  	if fmt.Sprint(req.Domain) == "" {
4847  		return nil, errors.New("field Domain cannot be empty in request")
4848  	}
4849  
4850  	scwReq := &scw.ScalewayRequest{
4851  		Method: "POST",
4852  		Path:   "/domain/v2beta1/domains/" + fmt.Sprint(req.Domain) + "/enable-dnssec",
4853  	}
4854  
4855  	err = scwReq.SetBody(req)
4856  	if err != nil {
4857  		return nil, err
4858  	}
4859  
4860  	var resp Domain
4861  
4862  	err = s.client.Do(scwReq, &resp, opts...)
4863  	if err != nil {
4864  		return nil, err
4865  	}
4866  	return &resp, nil
4867  }
4868  
4869  // DisableDomainDNSSEC: Disable DNSSEC for a domain.
4870  func (s *RegistrarAPI) DisableDomainDNSSEC(req *RegistrarAPIDisableDomainDNSSECRequest, opts ...scw.RequestOption) (*Domain, error) {
4871  	var err error
4872  
4873  	if fmt.Sprint(req.Domain) == "" {
4874  		return nil, errors.New("field Domain cannot be empty in request")
4875  	}
4876  
4877  	scwReq := &scw.ScalewayRequest{
4878  		Method: "POST",
4879  		Path:   "/domain/v2beta1/domains/" + fmt.Sprint(req.Domain) + "/disable-dnssec",
4880  	}
4881  
4882  	err = scwReq.SetBody(req)
4883  	if err != nil {
4884  		return nil, err
4885  	}
4886  
4887  	var resp Domain
4888  
4889  	err = s.client.Do(scwReq, &resp, opts...)
4890  	if err != nil {
4891  		return nil, err
4892  	}
4893  	return &resp, nil
4894  }
4895  
4896  // SearchAvailableDomains: Search a domain or a maximum of 10 domains that are available.
4897  //
4898  // If the TLD list is empty or not set, the search returns the results from the most popular TLDs.
4899  func (s *RegistrarAPI) SearchAvailableDomains(req *RegistrarAPISearchAvailableDomainsRequest, opts ...scw.RequestOption) (*SearchAvailableDomainsResponse, error) {
4900  	var err error
4901  
4902  	query := url.Values{}
4903  	parameter.AddToQuery(query, "domains", req.Domains)
4904  	parameter.AddToQuery(query, "tlds", req.Tlds)
4905  	parameter.AddToQuery(query, "strict_search", req.StrictSearch)
4906  
4907  	scwReq := &scw.ScalewayRequest{
4908  		Method: "GET",
4909  		Path:   "/domain/v2beta1/search-domains",
4910  		Query:  query,
4911  	}
4912  
4913  	var resp SearchAvailableDomainsResponse
4914  
4915  	err = s.client.Do(scwReq, &resp, opts...)
4916  	if err != nil {
4917  		return nil, err
4918  	}
4919  	return &resp, nil
4920  }
4921  
4922  // ListTlds: Retrieve the list of TLDs and offers associated with them.
4923  func (s *RegistrarAPI) ListTlds(req *RegistrarAPIListTldsRequest, opts ...scw.RequestOption) (*ListTldsResponse, error) {
4924  	var err error
4925  
4926  	defaultPageSize, exist := s.client.GetDefaultPageSize()
4927  	if (req.PageSize == nil || *req.PageSize == 0) && exist {
4928  		req.PageSize = &defaultPageSize
4929  	}
4930  
4931  	query := url.Values{}
4932  	parameter.AddToQuery(query, "tlds", req.Tlds)
4933  	parameter.AddToQuery(query, "page", req.Page)
4934  	parameter.AddToQuery(query, "page_size", req.PageSize)
4935  	parameter.AddToQuery(query, "order_by", req.OrderBy)
4936  
4937  	scwReq := &scw.ScalewayRequest{
4938  		Method: "GET",
4939  		Path:   "/domain/v2beta1/tlds",
4940  		Query:  query,
4941  	}
4942  
4943  	var resp ListTldsResponse
4944  
4945  	err = s.client.Do(scwReq, &resp, opts...)
4946  	if err != nil {
4947  		return nil, err
4948  	}
4949  	return &resp, nil
4950  }
4951  
4952  // CreateDomainHost: Create a hostname for a domain with glue IPs.
4953  func (s *RegistrarAPI) CreateDomainHost(req *RegistrarAPICreateDomainHostRequest, opts ...scw.RequestOption) (*Host, error) {
4954  	var err error
4955  
4956  	if fmt.Sprint(req.Domain) == "" {
4957  		return nil, errors.New("field Domain cannot be empty in request")
4958  	}
4959  
4960  	scwReq := &scw.ScalewayRequest{
4961  		Method: "POST",
4962  		Path:   "/domain/v2beta1/domains/" + fmt.Sprint(req.Domain) + "/hosts",
4963  	}
4964  
4965  	err = scwReq.SetBody(req)
4966  	if err != nil {
4967  		return nil, err
4968  	}
4969  
4970  	var resp Host
4971  
4972  	err = s.client.Do(scwReq, &resp, opts...)
4973  	if err != nil {
4974  		return nil, err
4975  	}
4976  	return &resp, nil
4977  }
4978  
4979  // ListDomainHosts: List a domain's hostnames using their glue IPs.
4980  func (s *RegistrarAPI) ListDomainHosts(req *RegistrarAPIListDomainHostsRequest, opts ...scw.RequestOption) (*ListDomainHostsResponse, error) {
4981  	var err error
4982  
4983  	defaultPageSize, exist := s.client.GetDefaultPageSize()
4984  	if (req.PageSize == nil || *req.PageSize == 0) && exist {
4985  		req.PageSize = &defaultPageSize
4986  	}
4987  
4988  	query := url.Values{}
4989  	parameter.AddToQuery(query, "page", req.Page)
4990  	parameter.AddToQuery(query, "page_size", req.PageSize)
4991  
4992  	if fmt.Sprint(req.Domain) == "" {
4993  		return nil, errors.New("field Domain cannot be empty in request")
4994  	}
4995  
4996  	scwReq := &scw.ScalewayRequest{
4997  		Method: "GET",
4998  		Path:   "/domain/v2beta1/domains/" + fmt.Sprint(req.Domain) + "/hosts",
4999  		Query:  query,
5000  	}
5001  
5002  	var resp ListDomainHostsResponse
5003  
5004  	err = s.client.Do(scwReq, &resp, opts...)
5005  	if err != nil {
5006  		return nil, err
5007  	}
5008  	return &resp, nil
5009  }
5010  
5011  // UpdateDomainHost: Update a domain's hostname with glue IPs.
5012  func (s *RegistrarAPI) UpdateDomainHost(req *RegistrarAPIUpdateDomainHostRequest, opts ...scw.RequestOption) (*Host, error) {
5013  	var err error
5014  
5015  	if fmt.Sprint(req.Domain) == "" {
5016  		return nil, errors.New("field Domain cannot be empty in request")
5017  	}
5018  
5019  	if fmt.Sprint(req.Name) == "" {
5020  		return nil, errors.New("field Name cannot be empty in request")
5021  	}
5022  
5023  	scwReq := &scw.ScalewayRequest{
5024  		Method: "PATCH",
5025  		Path:   "/domain/v2beta1/domains/" + fmt.Sprint(req.Domain) + "/hosts/" + fmt.Sprint(req.Name) + "",
5026  	}
5027  
5028  	err = scwReq.SetBody(req)
5029  	if err != nil {
5030  		return nil, err
5031  	}
5032  
5033  	var resp Host
5034  
5035  	err = s.client.Do(scwReq, &resp, opts...)
5036  	if err != nil {
5037  		return nil, err
5038  	}
5039  	return &resp, nil
5040  }
5041  
5042  // DeleteDomainHost: Delete a domain's hostname.
5043  func (s *RegistrarAPI) DeleteDomainHost(req *RegistrarAPIDeleteDomainHostRequest, opts ...scw.RequestOption) (*Host, error) {
5044  	var err error
5045  
5046  	if fmt.Sprint(req.Domain) == "" {
5047  		return nil, errors.New("field Domain cannot be empty in request")
5048  	}
5049  
5050  	if fmt.Sprint(req.Name) == "" {
5051  		return nil, errors.New("field Name cannot be empty in request")
5052  	}
5053  
5054  	scwReq := &scw.ScalewayRequest{
5055  		Method: "DELETE",
5056  		Path:   "/domain/v2beta1/domains/" + fmt.Sprint(req.Domain) + "/hosts/" + fmt.Sprint(req.Name) + "",
5057  	}
5058  
5059  	var resp Host
5060  
5061  	err = s.client.Do(scwReq, &resp, opts...)
5062  	if err != nil {
5063  		return nil, err
5064  	}
5065  	return &resp, nil
5066  }
5067  
5068  // Unauthenticated Domain search API.
5069  type UnauthenticatedRegistrarAPI struct {
5070  	client *scw.Client
5071  }
5072  
5073  // NewUnauthenticatedRegistrarAPI returns a UnauthenticatedRegistrarAPI object from a Scaleway client.
5074  func NewUnauthenticatedRegistrarAPI(client *scw.Client) *UnauthenticatedRegistrarAPI {
5075  	return &UnauthenticatedRegistrarAPI{
5076  		client: client,
5077  	}
5078  }
5079  
5080  // GetServiceInfo:
5081  func (s *UnauthenticatedRegistrarAPI) GetServiceInfo(opts ...scw.RequestOption) (*scw.ServiceInfo, error) {
5082  	var err error
5083  
5084  	scwReq := &scw.ScalewayRequest{
5085  		Method: "GET",
5086  		Path:   "/domain/v2beta1/search",
5087  	}
5088  
5089  	var resp scw.ServiceInfo
5090  
5091  	err = s.client.Do(scwReq, &resp, opts...)
5092  	if err != nil {
5093  		return nil, err
5094  	}
5095  	return &resp, nil
5096  }
5097  
5098  // SearchAvailableDomainsConsole:
5099  func (s *UnauthenticatedRegistrarAPI) SearchAvailableDomainsConsole(req *UnauthenticatedRegistrarAPISearchAvailableDomainsConsoleRequest, opts ...scw.RequestOption) (*SearchAvailableDomainsConsoleResponse, error) {
5100  	var err error
5101  
5102  	query := url.Values{}
5103  	parameter.AddToQuery(query, "domain", req.Domain)
5104  	parameter.AddToQuery(query, "tlds", req.Tlds)
5105  	parameter.AddToQuery(query, "strict_search", req.StrictSearch)
5106  
5107  	scwReq := &scw.ScalewayRequest{
5108  		Method: "GET",
5109  		Path:   "/domain/v2beta1/search-domains-console",
5110  		Query:  query,
5111  	}
5112  
5113  	var resp SearchAvailableDomainsConsoleResponse
5114  
5115  	err = s.client.Do(scwReq, &resp, opts...)
5116  	if err != nil {
5117  		return nil, err
5118  	}
5119  	return &resp, nil
5120  }
5121