// Create a new domain.
//
// appIdentity is the unique identifier of the Domain's App. hostname is the
// full hostname.
3749
func (c *Client) DomainCreate(appIdentity string, hostname string) (*Domain, error) {
	params := struct {
		Hostname string `json:"hostname"`
	}{
		Hostname: hostname,
	}
	var domainRes Domain
	return &domainRes, c.Post(&domainRes, "/apps/"+appIdentity+"/domains", params)
}
486159
func (c *Client) DomainDelete(appIdentity string, domainIdentity string) error {
	return c.Delete("/apps/" + appIdentity + "/domains/" + domainIdentity)
}
351446
func (o *Enterprise) CreateWebDomainName(child *WebDomainName) *bambou.Error {

	return bambou.CurrentSession().CreateChild(o, child)
}
154465
func (s *Service) AppWebhookCreate(ctx context.Context, appIdentity string, o AppWebhookCreateOpts) (*AppWebhookCreateResult, error) {
	var appWebhook AppWebhookCreateResult
	return &appWebhook, s.Post(ctx, &appWebhook, fmt.Sprintf("/apps/%v/webhooks", appIdentity), o)
}
1142306
func (c *ACLCaches) GetIdentity(id string) *IdentityCacheEntry {
	if c == nil || c.identities == nil {
		return nil
	}

	if raw, ok := c.identities.Get(id); ok {
		return raw.(*IdentityCacheEntry)
	}

	return nil
}
87021
func GenerateIdentity(a *AuthServer, id IdentityID, additionalPrincipals, dnsNames []string) (*Identity, error) {
	keys, err := a.GenerateServerKeys(GenerateServerKeysRequest{
		HostID:               id.HostUUID,
		NodeName:             id.NodeName,
		Roles:                teleport.Roles{id.Role},
		AdditionalPrincipals: additionalPrincipals,
		DNSNames:             dnsNames,
	})
	if err != nil {
		return nil, trace.Wrap(err)
	}
	return ReadIdentityFromKeyPair(keys)
}
673260
func (ed *eventDescriptor) identity() uint32 {
	return (uint32(ed.version) << 16) | uint32(ed.id)
}
1004554
func (c *userIdentityMappings) Create(userIdentityMapping *user.UserIdentityMapping) (result *user.UserIdentityMapping, err error) {
	result = &user.UserIdentityMapping{}
	err = c.client.Post().
		Resource("useridentitymappings").
		Body(userIdentityMapping).
		Do().
		Into(result)
	return
}
649138
func (id *IdentityID) HostID() (string, error) {
	parts := strings.Split(id.HostUUID, ".")
	if len(parts) < 2 {
		return "", trace.BadParameter("expected 2 parts in %q", id.HostUUID)
	}
	return parts[0], nil
}
1073490
func NewDCESecurity(domain Domain) (UUID, error) {
	u, err := dcesecurity.NewUUID(dcesecurity.Domain(domain))
	if err != nil {
		return Nil, err
	}

	uuid := UUID{}
	copy(uuid[:], u)

	return uuid, nil
}
46034
func MakeIdentity(identity string) (Identity, error) {
	id := Identity(identity)
	if err := id.Validate(); err != nil {
		return "", err
	}
	return id, nil
}
148693
func (c *Client) RemoveIdentity(request *RemoveIdentityRequest) (*IdentityResponse, error) {

	ca, err := newCAClient(c.ctx, c.orgName)
	if err != nil {
		return nil, err
	}

	req := &mspapi.RemoveIdentityRequest{
		ID:     request.ID,
		Force:  request.Force,
		CAName: request.CAName,
	}

	response, err := ca.RemoveIdentity(req)
	if err != nil {
		return nil, err
	}

	return getIdentityResponse(response), nil
}
1314407
func (s *DomainsService) Create(domainAttributes Domain) (Domain, *Response, error) {
	path := domainAction("Create")
	returnedDomain := domainWrapper{}

	payload := newPayLoad(s.client.CommonParams)
	payload.Set("domain", domainAttributes.Name)
	payload.Set("group_id", domainAttributes.GroupID.String())
	payload.Set("is_mark", domainAttributes.IsMark)

	res, err := s.client.post(path, payload, &returnedDomain)
	if err != nil {
		return Domain{}, res, err
	}

	return returnedDomain.Domain, res, nil
}
144572
func NewDomainVerificationAddDomainFailDetails(DomainName string) *DomainVerificationAddDomainFailDetails {
	s := new(DomainVerificationAddDomainFailDetails)
	s.DomainName = DomainName
	return s
}
981081
func (self *Domain) Create(name, contactHandle string, years int64) (*operation.OperationInfo, error) {
	var res map[string]interface{}
	createArgs := map[string]interface{}{
		"admin":    contactHandle,
		"bill":     contactHandle,
		"owner":    contactHandle,
		"tech":     contactHandle,
		"duration": years,
	}
	params := []interface{}{self.Key, name, createArgs}
	if err := self.Call("domain.create", params, &res); err != nil {
		return nil, err
	}
	return operation.ToOperationInfo(res), nil
}
235836
func (s *IdentityUsage) SetIdentityId(v string) *IdentityUsage {
	s.IdentityId = &v
	return s
}
1259049
func updateIdentity(set *apps.StatefulSet, pod *v1.Pod) {
	pod.Name = getPodName(set, getOrdinal(pod))
	pod.Namespace = set.Namespace
	if pod.Labels == nil {
		pod.Labels = make(map[string]string)
	}
	pod.Labels[apps.StatefulSetPodNameLabel] = pod.Name
}