// GetDomain gets a domain
512637
func (c *Client) GetDomain(authZone string) (*Domain, error) {
	domainName := authZone[0 : len(authZone)-1]
	resource := fmt.Sprintf("%s%s", "/dns/managed/name?domainname=", domainName)

	resp, err := c.sendRequest(http.MethodGet, resource, nil)
	if err != nil {
		return nil, err
	}
	defer resp.Body.Close()

	domain := &Domain{}
	err = json.NewDecoder(resp.Body).Decode(&domain)
	if err != nil {
		return nil, err
	}

	return domain, nil
}
1370364
func (a *SetCookieArgs) SetDomain(domain string) *SetCookieArgs {
	a.Domain = &domain
	return a
}
977838
func (c *Client) GetDomainInformation(fqdn string) (*Data, error) {
	authZone, err := dns01.FindZoneByFqdn(fqdn)
	if err != nil {
		return nil, err
	}

	result, err := c.doRequest(http.MethodGet, "domain", nil)
	if err != nil {
		return nil, err
	}

	var domains []Data
	if len(result) > 0 {
		err = json.Unmarshal(result, &domains)
		if err != nil {
			return nil, fmt.Errorf("CloudXNS: domains unmarshaling error: %v", err)
		}
	}

	for _, data := range domains {
		if data.Domain == authZone {
			return &data, nil
		}
	}

	return nil, fmt.Errorf("CloudXNS: zone %s not found for domain %s", authZone, fqdn)
}
278687
func GetDomain(store kv.Storage) (*domain.Domain, error) {
	return domap.Get(store)
}
602868
func (a *AuthServer) GetDomainName() (string, error) {
	clusterName, err := a.GetClusterName()
	if err != nil {
		return "", trace.Wrap(err)
	}
	return clusterName.GetClusterName(), nil
}
159957
func (p Protos) GetDomain() (string, error) {
	req, err := http.NewRequest("GET", p.createURL("info/domain"), nil)
	if err != nil {
		return "", err
	}
	domain := struct{ Domain string }{}

	payload, err := p.makeRequest(req)
	if err != nil {
		return "", err
	}

	err = json.Unmarshal(payload, &domain)
	if err != nil {
		return "", err
	}

	return domain.Domain, nil
}
471046
func (s *ListWorkflowTypesInput) SetDomain(v string) *ListWorkflowTypesInput {
	s.Domain = &v
	return s
}
1269922
func (c *Client) GetDomains() ([]Domain, error) {
	req, err := c.NewRequest(nil, "GET", "/domains")
	if err != nil {
		return nil, err
	}
	resp, err := c.Http.Do(req)
	if err != nil {
		return nil, err
	}
	defer resp.Body.Close()
	domainResponses := []DomainResponse{}
	err = decode(resp.Body, &domainResponses)
	if err != nil {
		return nil, err
	}
	domains := make([]Domain, len(domainResponses))
	for i, dr := range domainResponses {
		domains[i] = dr.Domain
	}
	return domains, nil
}
552979
func (d *DNSProvider) getZone(domain string) (*response, error) {
	if d.config.AuthSid == "" {
		return nil, fmt.Errorf("must be logged in to get zone")
	}

	return d.postRequest("dns-zone-get", url.Values{"domain": {dns01.UnFqdn(domain)}})
}
894333
func (ppe *PPE) Domain(domain string) (*Domain, error) {
	var d domainsResponse
	err := ppe.get(fmt.Sprintf("/domains/%s", domain), &d)
	if err != nil {
		return &Domain{}, err
	}
	drs := d.Domains
	var dom *Domain
	for _, dr := range drs {
		if dr.DomainName == domain {
			org, err := ppe.Organization(domain)
			if err != nil {
				return &Domain{}, err
			}
			dom = domainFromDomainResponse(org, dr)
			break
		}
	}
	return dom, nil
}
1025458
func (s *ResendValidationEmailInput) SetDomain(v string) *ResendValidationEmailInput {
	s.Domain = &v
	return s
}
1094431
func (api *Client) GetDomainEndpoint(id string, endpointID string) (*DomainEndpoint, error) {
	result, _, err := api.makeRequest(http.MethodGet, fmt.Sprintf("%s/%s/%s/%s", api.concatUserPath(domainsPath), id, endpointsPath, endpointID), &DomainEndpoint{})
	if err != nil {
		return nil, err
	}
	return result.(*DomainEndpoint), nil
}
463219
func (h *Hostlist) ContainsDomain(domain string) bool {
	for _, hostname := range *h {
		if hostname.Domain == domain {
			return true
		}
	}
	return false
}
1227419
func (s *GetDomainStatisticsReportInput) SetDomain(v string) *GetDomainStatisticsReportInput {
	s.Domain = &v
	return s
}
601949
func (s *ListClosedWorkflowExecutionsInput) SetDomain(v string) *ListClosedWorkflowExecutionsInput {
	s.Domain = &v
	return s
}
683808
func (c *Connect) LookupDomainByUUIDString(uuid string) (*Domain, error) {
	cUuid := C.CString(uuid)
	defer C.free(unsafe.Pointer(cUuid))
	var err C.virError
	ptr := C.virDomainLookupByUUIDStringWrapper(c.ptr, cUuid, &err)
	if ptr == nil {
		return nil, makeError(&err)
	}
	return &Domain{ptr: ptr}, nil
}
677065
func (d *DNS) GetDomainResources(domainID int) ([]*Resource, error) {
	params := linode.Parameters{
		"DomainID": strconv.Itoa(domainID),
	}

	var list []*Resource
	_, err := d.linode.Request("domain.resource.list", params, &list)
	if err != nil {
		return nil, err
	}
	return list, nil
}