// PgDefaultACLByDefaclroleDefaclnamespaceDefaclobjtype retrieves a row from 'pg_catalog.pg_default_acl' as a PgDefaultACL.
//
// Generated from index 'pg_default_acl_role_nsp_obj_index'.
971131
func PgDefaultACLByDefaclroleDefaclnamespaceDefaclobjtype(db XODB, defaclrole pgtypes.Oid, defaclnamespace pgtypes.Oid, defaclobjtype uint8) (*PgDefaultACL, error) {
	var err error

	// sql query
	const sqlstr = `SELECT ` +
		`tableoid, cmax, xmax, cmin, xmin, oid, ctid, defaclrole, defaclnamespace, defaclobjtype, defaclacl ` +
		`FROM pg_catalog.pg_default_acl ` +
		`WHERE defaclrole = $1 AND defaclnamespace = $2 AND defaclobjtype = $3`

	// run query
	XOLog(sqlstr, defaclrole, defaclnamespace, defaclobjtype)
	pda := PgDefaultACL{}

	err = db.QueryRow(sqlstr, defaclrole, defaclnamespace, defaclobjtype).Scan(&pda.Tableoid, &pda.Cmax, &pda.Xmax, &pda.Cmin, &pda.Xmin, &pda.Oid, &pda.Ctid, &pda.Defaclrole, &pda.Defaclnamespace, &pda.Defaclobjtype, &pda.Defaclacl)
	if err != nil {
		return nil, err
	}

	return &pda, nil
}
1177579
func (c *MockAWSCloud) DefaultInstanceType(cluster *kops.Cluster, ig *kops.InstanceGroup) (string, error) {
	switch ig.Spec.Role {
	case kops.InstanceGroupRoleMaster:
		return "m3.medium", nil
	case kops.InstanceGroupRoleNode:
		return "t2.medium", nil
	case kops.InstanceGroupRoleBastion:
		return "t2.micro", nil
	default:
		return "", fmt.Errorf("MockAWSCloud DefaultInstanceType does not handle %s", ig.Spec.Role)
	}
}
793886
func Acldefault(db XODB, v0 uint8, v1 pgtypes.Oid) ([]pgtypes.Aclitem, error) {
	var err error

	// sql query
	const sqlstr = `SELECT pg_catalog.acldefault($1, $2)`

	// run query
	var ret []pgtypes.Aclitem
	XOLog(sqlstr, v0, v1)
	err = db.QueryRow(sqlstr, v0, v1).Scan(&ret)
	if err != nil {
		return nil, err
	}

	return ret, nil
}
735884
func (s *DistributionConfig) SetDefaultRootObject(v string) *DistributionConfig {
	s.DefaultRootObject = &v
	return s
}
639847
func GetDefaultCertList() Certificates {
	return Certificates{
		&KubeadmCertRootCA,
		&KubeadmCertAPIServer,
		&KubeadmCertKubeletClient,
		// Front Proxy certs
		&KubeadmCertFrontProxyCA,
		&KubeadmCertFrontProxyClient,
		// etcd certs
		&KubeadmCertEtcdCA,
		&KubeadmCertEtcdServer,
		&KubeadmCertEtcdPeer,
		&KubeadmCertEtcdHealthcheck,
		&KubeadmCertEtcdAPIClient,
	}
}
1089419
func DefaultAuthorization(src *chronograf.Source) Authorizer {
	// Optionally, add the shared secret JWT token creation
	if src.Username != "" && src.SharedSecret != "" {
		return &BearerJWT{
			Username:     src.Username,
			SharedSecret: src.SharedSecret,
		}
	} else if src.Username != "" && src.Password != "" {
		return &BasicAuth{
			Username: src.Username,
			Password: src.Password,
		}
	}
	return &NoAuthorization{}
}
313639
func WithDefaultNamespace(ns string) ClientOpt {
	return func(c *clientOpts) error {
		c.defaultns = ns
		return nil
	}
}
1027704
func NewAuthorizerFromCLI() (autorest.Authorizer, error) {
	settings, err := GetSettingsFromEnvironment()
	if err != nil {
		return nil, err
	}

	if settings.Values[Resource] == "" {
		settings.Values[Resource] = settings.Environment.ResourceManagerEndpoint
	}

	return NewAuthorizerFromCLIWithResource(settings.Values[Resource])
}
1344237
func (s *CloneStackInput) SetDefaultRootDeviceType(v string) *CloneStackInput {
	s.DefaultRootDeviceType = &v
	return s
}
88254
func parseDefaultIfNameFromIPCmd(routeOut string) (string, error) {
	parsedLines := parseIfNameFromIPCmd(routeOut)
	for _, parsedLine := range parsedLines {
		if parsedLine[0] == "default" &&
			parsedLine[1] == "via" &&
			parsedLine[3] == "dev" {
			ifName := strings.TrimSpace(parsedLine[4])
			return ifName, nil
		}
	}

	return "", errors.New("No default interface found")
}
1339971
func (s *Stack) SetDefaultRootDeviceType(v string) *Stack {
	s.DefaultRootDeviceType = &v
	return s
}
485669
func (i *i2cConfig) GetAddressOrDefault(a int) int {
	if i.address == AddressNotInitialized {
		return a
	}

	return i.address
}
931436
func PgAmprocByAmprocfamilyAmproclefttypeAmprocrighttypeAmprocnum(db XODB, amprocfamily pgtypes.Oid, amproclefttype pgtypes.Oid, amprocrighttype pgtypes.Oid, amprocnum int16) (*PgAmproc, error) {
	var err error

	// sql query
	const sqlstr = `SELECT ` +
		`tableoid, cmax, xmax, cmin, xmin, oid, ctid, amprocfamily, amproclefttype, amprocrighttype, amprocnum, amproc ` +
		`FROM pg_catalog.pg_amproc ` +
		`WHERE amprocfamily = $1 AND amproclefttype = $2 AND amprocrighttype = $3 AND amprocnum = $4`

	// run query
	XOLog(sqlstr, amprocfamily, amproclefttype, amprocrighttype, amprocnum)
	pa := PgAmproc{}

	err = db.QueryRow(sqlstr, amprocfamily, amproclefttype, amprocrighttype, amprocnum).Scan(&pa.Tableoid, &pa.Cmax, &pa.Xmax, &pa.Cmin, &pa.Xmin, &pa.Oid, &pa.Ctid, &pa.Amprocfamily, &pa.Amproclefttype, &pa.Amprocrighttype, &pa.Amprocnum, &pa.Amproc)
	if err != nil {
		return nil, err
	}

	return &pa, nil
}
910727
func (cc *ClientConn) fallbackToDefaultServiceConfig(sc string) bool {
	if cc.dopts.disableServiceConfig {
		return true
	}
	// The logic below is temporary, will be removed once we change the resolver.State ServiceConfig field type.
	// Right now, we assume that empty service config string means resolver does not return a config.
	if sc == "" {
		return true
	}
	// TODO: the logic below is temporary. Once we finish the logic to validate service config
	// in resolver, we will replace the logic below.
	_, err := parseServiceConfig(sc)
	return err != nil
}
758835
func NewDefaultClientConfigLoadingRules() *ClientConfigLoadingRules {
	chain := []string{}
	migrationRules := map[string]string{}

	envVarFiles := os.Getenv(RecommendedConfigPathEnvVar)
	if len(envVarFiles) != 0 {
		chain = append(chain, filepath.SplitList(envVarFiles)...)

	} else {
		chain = append(chain, RecommendedHomeFile)
		migrationRules[RecommendedHomeFile] = OldRecommendedHomeFile

	}

	return &ClientConfigLoadingRules{
		Precedence:     chain,
		MigrationRules: migrationRules,
	}
}
754190
func (s *CreateStackInput) SetDefaultRootDeviceType(v string) *CreateStackInput {
	s.DefaultRootDeviceType = &v
	return s
}
1023191
func GetDefaultSigner() (msp.SigningIdentity, error) {
	signer, err := mspmgmt.GetLocalMSP().GetDefaultSigningIdentity()
	if err != nil {
		return nil, errors.WithMessage(err, "error obtaining the default signing identity")
	}

	return signer, err
}