// WaitUntilRoleExists uses the IAM API operation
// GetRole to wait for a condition to be met before returning.
// If the condition is not met within the max attempt window, an error will
// be returned.
774081
func (c *IAM) WaitUntilRoleExists(input *GetRoleInput) error {
	return c.WaitUntilRoleExistsWithContext(aws.BackgroundContext(), input)
}
702554
func (c *Client) GetRoles() ([]services.Role, error) {
	out, err := c.Get(c.Endpoint("roles"), url.Values{})
	if err != nil {
		return nil, trace.Wrap(err)
	}
	var items []json.RawMessage
	if err := json.Unmarshal(out.Bytes(), &items); err != nil {
		return nil, trace.Wrap(err)
	}
	roles := make([]services.Role, len(items))
	for i, roleBytes := range items {
		role, err := services.GetRoleMarshaler().UnmarshalRole(roleBytes, services.SkipValidation())
		if err != nil {
			return nil, trace.Wrap(err)
		}
		roles[i] = role
	}
	return roles, nil
}
451116
func (c *IAM) WaitUntilUserExists(input *GetUserInput) error {
	return c.WaitUntilUserExistsWithContext(aws.BackgroundContext(), input)
}
1314050
func (b *backend) pathRoleExistenceCheck(ctx context.Context, req *logical.Request, data *framework.FieldData) (bool, error) {
	entry, err := b.lockedAWSRole(ctx, req.Storage, strings.ToLower(data.Get("role").(string)))
	if err != nil {
		return false, err
	}
	return entry != nil, nil
}
918803
func (c *OpsWorks) WaitUntilInstanceTerminated(input *DescribeInstancesInput) error {
	return c.WaitUntilInstanceTerminatedWithContext(aws.BackgroundContext(), input)
}
753491
func (c *EKS) WaitUntilClusterActive(input *DescribeClusterInput) error {
	return c.WaitUntilClusterActiveWithContext(aws.BackgroundContext(), input)
}
849175
func (c *AutoScaling) WaitUntilGroupExists(input *DescribeAutoScalingGroupsInput) error {
	return c.WaitUntilGroupExistsWithContext(aws.BackgroundContext(), input)
}
1302647
func (m *Membership) GetRole() string {
	if m == nil || m.Role == nil {
		return ""
	}
	return *m.Role
}
1224498
func (sem *Sem) TryWait() error {
	ret := int(C.SDL_SemTryWait(sem.cptr()))
	if ret != 0 {
		return GetError()
	}
	return nil
}
635537
func (c *SageMaker) WaitUntilEndpointInService(input *DescribeEndpointInput) error {
	return c.WaitUntilEndpointInServiceWithContext(aws.BackgroundContext(), input)
}
711228
func (s *IndicesRolloverService) WaitForActiveShards(waitForActiveShards string) *IndicesRolloverService {
	s.waitForActiveShards = waitForActiveShards
	return s
}
245391
func (c *Client) WaitUntilCRDEstablished(reader io.Reader, timeout time.Duration) error {
	infos, err := c.BuildUnstructured(metav1.NamespaceAll, reader)
	if err != nil {
		return err
	}

	return perform(infos, c.pollCRDEstablished(timeout))
}
1285214
func (e *Job) CheckRole(c context.Context, role acl.Role) error {
	switch yep, err := e.Acls.CallerHasRole(logging.SetField(c, "JobID", e.JobID), role); {
	case err != nil:
		return err
	case !yep:
		return ErrNoPermission
	}
	return nil
}
223151
func (c *Call) WaitUntil(w <-chan time.Time) *Call {
	c.lock()
	defer c.unlock()
	c.WaitFor = w
	return c
}
350065
func (s *clusterRoleLister) Get(name string) (*v1alpha1.ClusterRole, error) {
	obj, exists, err := s.indexer.GetByKey(name)
	if err != nil {
		return nil, err
	}
	if !exists {
		return nil, errors.NewNotFound(v1alpha1.Resource("clusterrole"), name)
	}
	return obj.(*v1alpha1.ClusterRole), nil
}
1280119
func (c *OpsWorks) WaitUntilInstanceRegistered(input *DescribeInstancesInput) error {
	return c.WaitUntilInstanceRegisteredWithContext(aws.BackgroundContext(), input)
}
551960
func WaitForLeader(ctx context.Context, n *Node) error {
	_, err := n.Leader()
	if err == nil {
		return nil
	}
	ticker := time.NewTicker(50 * time.Millisecond)
	defer ticker.Stop()
	for err != nil {
		select {
		case <-ticker.C:
		case <-ctx.Done():
			return ctx.Err()
		}
		_, err = n.Leader()
	}
	return nil
}