// DomainType creates the type definition.
193972
func (g *Generator) DomainType(d proto.Domain, t proto.AnyType) {
	g.hasContent = true

	var comment string
	if d.Name() == "Page" && (t.Name(d) == "FrameID") {
		comment = "//"
		g.Printf(`
// %[1]s %[2]s
//
// Provided as an alias to prevent circular dependencies.
type %[1]s = internal.Page%[1]s
`, t.Name(d), t.Desc(0, len(t.Name(d))+1))
	}
	desc := t.Desc(0, len(t.Name(d))+1)
	if t.Deprecated {
		desc = "\n//\n// Deprecated: " + t.Desc(0, 12)
	}
	if t.Experimental {
		desc = desc + "\n//\n// Note: This type is experimental."
	}
	g.Printf(`
// %[1]s %[2]s
%[3]stype %[1]s `, t.Name(d), desc, comment)

	typ := t.GoType(g.pkg, d)
	switch typ {
	case "struct":
		g.domainTypeStruct(d, t)
	case "enum":
		g.domainTypeEnum(d, t)
	case "time.Time":
		g.domainTypeTime(d, t)
	case "RawMessage":
		g.domainTypeRawMessage(d, t)
	default:
		g.Printf(typ)
	}
	g.Printf("\n\n")
}
622043
func (inv *Investigate) DomainTags(domain string) ([]DomainTag, error) {
	var resp []DomainTag
	err := inv.GetParse(fmt.Sprintf(urls["tags"], domain), &resp)
	if err != nil {
		return nil, err
	}
	return resp, nil
}
669809
func Domain(named Named) string {
	if r, ok := named.(namedRepository); ok {
		return r.Domain()
	}
	domain, _ := splitDomain(named.Name())
	return domain
}
1214831
func (internet Internet) DomainName(v reflect.Value) (interface{}, error) {
	return internet.domainName(), nil
}
366046
func (org *Organization) Domain(domain string) (*Domain, error) {
	var d domainsResponse
	err := org.PPE.get(fmt.Sprintf("/domains/%s/%s", org.PrimaryDomain, domain), &d)
	if err != nil {
		return &Domain{}, err
	}
	return domainFromDomainResponse(org, d.Domains[0]), nil
}
355265
func NewDomainInvitesSetInviteNewUserPrefToNoType(Description string) *DomainInvitesSetInviteNewUserPrefToNoType {
	s := new(DomainInvitesSetInviteNewUserPrefToNoType)
	s.Description = Description
	return s
}
941691
func (r *Request) Type() string {
	if r.Req == nil {
		return ""
	}
	if len(r.Req.Question) == 0 {
		return ""
	}

	return dns.Type(r.Req.Question[0].Qtype).String()
}
1153436
func (domain *Domain) BuildTypeForDefinition(
	typeName string,
	propertyName string,
	schema *jsonschema.Schema) *TypeModel {
	if (schema.Type == nil) || (*schema.Type.String == "object") {
		return domain.buildTypeForDefinitionObject(typeName, propertyName, schema)
	}
	return nil
}
541471
func (s *ExplainService) Type(typ string) *ExplainService {
	s.typ = typ
	return s
}
158950
func (r *BulkDeleteRequest) Type(typ string) *BulkDeleteRequest {
	r.typ = typ
	r.source = nil
	return r
}
916716
func (s *DeleteService) Type(typ string) *DeleteService {
	s.typ = typ
	return s
}
173789
func (s *ValidateService) Type(typ ...string) *ValidateService {
	s.typ = append(s.typ, typ...)
	return s
}
454507
func (d *Domain) handleType(newType *Type, typeProperties []*ProtoProperty) {
	// loop over properties of this new type
	for _, protoProp := range typeProperties {
		// It's a reference, see if it points to a base type or not
		newProp := NewTypeProperties(protoProp)
		// base type, add it and fix up description
		if isBaseType(protoProp) {
			goType := getGoType(newProp)
			d.createBase(newProp, goType)
			newType.Properties = append(newType.Properties, newProp)
			continue
		}

		if ok := d.resolveReference(newProp); ok {
			newType.Properties = append(newType.Properties, newProp)
			continue
		}

		// is this a subType?
		if isSubType(protoProp) {
			fmt.Printf("issubtype true for: %s\n", protoProp.Name)
			d.createSubType(newType, protoProp)
		}
	}
}
1370449
func (r *BulkIndexRequest) Type(typ string) *BulkIndexRequest {
	r.typ = typ
	r.source = nil
	return r
}
794800
func (d *DNS) GetResourcesByType(domainID int, res_type string) ([]*Resource, error) {
	resources, err := d.GetDomainResources(domainID)
	if err != nil {
		return nil, err
	}

	list := []*Resource{}
	for _, r := range resources {
		if strings.EqualFold(r.Type, res_type) {
			list = append(list, r)
		}
	}

	return list, nil
}
716295
func dnsDomainIs(host, domain string) bool {
	if len(host) < len(domain) {
		return false
	}

	return strings.HasSuffix(host, domain)
}
1008684
func (gce *Cloud) InstanceType(nodeName types.NodeName) (string, error) {
	instanceName := mapNodeNameToInstanceName(nodeName)
	if gce.useMetadataServer {
		// Use metadata, if possible, to fetch ID. See issue #12000
		if gce.isCurrentInstance(instanceName) {
			mType, err := getCurrentMachineTypeViaMetadata()
			if err == nil {
				return mType, nil
			}
		}
	}
	instance, err := gce.getInstanceByName(instanceName)
	if err != nil {
		return "", err
	}
	return instance.Type, nil
}