/*
GetProfilesLibrary gets list of possible profiles

get list of possible profiles

*/
421722
func (a *Client) GetProfilesLibrary(params *GetProfilesLibraryParams, authInfo runtime.ClientAuthInfoWriter) (*GetProfilesLibraryOK, error) {
	// TODO: Validate the params before sending
	if params == nil {
		params = NewGetProfilesLibraryParams()
	}

	result, err := a.transport.Submit(&runtime.ClientOperation{
		ID:                 "GetProfilesLibrary",
		Method:             "GET",
		PathPattern:        "/profiles/library",
		ProducesMediaTypes: []string{"application/json", "application/x-gzip"},
		ConsumesMediaTypes: []string{"application/json"},
		Schemes:            []string{"http", "https"},
		Params:             params,
		Reader:             &GetProfilesLibraryReader{formats: a.formats},
		AuthInfo:           authInfo,
	})
	if err != nil {
		return nil, err
	}
	return result.(*GetProfilesLibraryOK), nil
}
1318175
func (p *Client) DiscoverProfile(force bool) (*ble.Profile, error) {
	if p.profile != nil && !force {
		return p.profile, nil
	}
	ss, err := p.DiscoverServices(nil)
	if err != nil {
		return nil, fmt.Errorf("can't discover services: %s\n", err)
	}
	for _, s := range ss {
		cs, err := p.DiscoverCharacteristics(nil, s)
		if err != nil {
			return nil, fmt.Errorf("can't discover characteristics: %s\n", err)
		}
		for _, c := range cs {
			_, err := p.DiscoverDescriptors(nil, c)
			if err != nil {
				return nil, fmt.Errorf("can't discover descriptors: %s\n", err)
			}
		}
	}
	p.profile = &ble.Profile{Services: ss}
	return p.profile, nil
}
326372
func (o *Gateway) IPFilterProfiles(info *bambou.FetchingInfo) (IPFilterProfilesList, *bambou.Error) {

	var list IPFilterProfilesList
	err := bambou.CurrentSession().FetchChildren(o, IPFilterProfileIdentity, &list, info)
	return list, err
}
528610
func (r Layout_Profile_Containers) GetLayoutProfile() (resp datatypes.Layout_Profile, err error) {
	err = r.Session.DoRequest("SoftLayer_Layout_Profile_Containers", "getLayoutProfile", nil, &r.Options, &resp)
	return
}
1260238
func UserProfile(c *MyContext) {

	id := c.Param("id")

	var profile string

	// profile = c.AppContext.DB.find(user profile by .....)

	c.AppContext.Log.Println("Found User Profile")

	c.Response().Write([]byte("Here's your profile " + profile + " user " + id))
}
904339
func (s profileService) DefineProfile(request *Profile) (*ProfileResponse, error) {
	var response ProfileResponse
	req, err := s.client.NewRequest("POST", defineProfilePath, request)
	if err != nil {
		return nil, err
	}
	err = s.client.Do(req, &response)
	if err != nil {
		return nil, err
	}
	return &response, nil
}
305497
func (s *userProfileService) Get(ctx context.Context, accessToken string, profileURL string) (*provider.OAuthUserProfileResponse, error) {

	userProfileResponse := provider.OAuthUserProfileResponse{}

	req, err := http.NewRequest("GET", profileURL, nil)
	if err != nil {
		return nil, errors.NewInternalError(ctx, err)
	}
	req.Header.Add("Authorization", "Bearer "+accessToken)
	req.Header.Add("Content-Type", "application/json")
	req.Header.Add("Accept", "application/json, text/plain, */*")

	resp, err := s.client.Do(req)

	if err != nil {
		log.Error(ctx, map[string]interface{}{
			"user_profile_url": profileURL,
			"err":              err,
		}, "Unable to fetch oauth user profile")
		return nil, errors.NewInternalError(ctx, err)
	} else if resp != nil {
		defer rest.CloseResponse(resp)
	}

	if resp.StatusCode != http.StatusOK {
		bodyString := rest.ReadBody(resp.Body)
		log.Error(ctx, map[string]interface{}{
			"response_status":  resp.Status,
			"response_body":    bodyString,
			"user_profile_url": profileURL,
		}, "Unable to fetch oauth user profile")
		if resp.StatusCode == 400 {
			return nil, errors.NewUnauthorizedError(bodyString)
		}
		return nil, errors.NewInternalError(ctx, errs.Errorf("received a non-200 response %s while fetching oauth user profile %s", resp.Status, profileURL))
	}

	err = json.NewDecoder(resp.Body).Decode(&userProfileResponse)
	return &userProfileResponse, err
}
970550
func WithProfile(profile string) oci.SpecOpts {
	return func(_ context.Context, _ oci.Client, _ *containers.Container, s *specs.Spec) error {
		s.Process.ApparmorProfile = profile
		return nil
	}
}
558118
func (o *Enterprise) OverlayManagementProfiles(info *bambou.FetchingInfo) (OverlayManagementProfilesList, *bambou.Error) {

	var list OverlayManagementProfilesList
	err := bambou.CurrentSession().FetchChildren(o, OverlayManagementProfileIdentity, &list, info)
	return list, err
}
596853
func (m *containerManager) LXDProfileNames(containerName string) ([]string, error) {
	return m.server.GetContainerProfiles(containerName)
}
1133042
func (c *ContivClient) NetprofileList() (*[]*Netprofile, error) {
	// build key and URL
	url := c.baseURL + "/api/v1/netprofiles/"

	// http get the object
	var objList []*Netprofile
	err := c.httpGet(url, &objList)
	if err != nil {
		log.Debugf("Error getting netprofiles. Err: %v", err)
		return nil, err
	}

	return &objList, nil
}
35677
func (e Endpoints) GetProfile(ctx context.Context, id string) (Profile, error) {
	request := getProfileRequest{ID: id}
	response, err := e.GetProfileEndpoint(ctx, request)
	if err != nil {
		return Profile{}, err
	}
	resp := response.(getProfileResponse)
	return resp.Profile, resp.Err
}
1343083
func (c *Manager) GetLibraryItems(ctx context.Context, libraryID string) ([]Item, error) {
	ids, err := c.ListLibraryItems(ctx, libraryID)
	if err != nil {
		return nil, fmt.Errorf("get library items failed for: %s", err)
	}
	var items []Item
	for _, id := range ids {
		item, err := c.GetLibraryItem(ctx, id)
		if err != nil {
			return nil, fmt.Errorf("get library item for %s failed for %s", id, err)
		}
		items = append(items, *item)
	}
	return items, nil
}
52780
func (client *Client) GetGroupMemberProfile(groupID, userID string) *GetGroupMemberProfileCall {
	return &GetGroupMemberProfileCall{
		c:       client,
		groupID: groupID,
		userID:  userID,
	}
}
184255
func (_m *DBClient) GetDeviceProfilesWithLabel(l string) ([]models.DeviceProfile, error) {
	ret := _m.Called(l)

	var r0 []models.DeviceProfile
	if rf, ok := ret.Get(0).(func(string) []models.DeviceProfile); ok {
		r0 = rf(l)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).([]models.DeviceProfile)
		}
	}

	var r1 error
	if rf, ok := ret.Get(1).(func(string) error); ok {
		r1 = rf(l)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}
1144965
func (o *Enterprise) IKEGatewayProfiles(info *bambou.FetchingInfo) (IKEGatewayProfilesList, *bambou.Error) {

	var list IKEGatewayProfilesList
	err := bambou.CurrentSession().FetchChildren(o, IKEGatewayProfileIdentity, &list, info)
	return list, err
}
1135830
func (b *BigIP) GetClientSSLProfile(name string) (*ClientSSLProfile, error) {
	var clientSSLProfile ClientSSLProfile
	err, ok := b.getForEntity(&clientSSLProfile, uriLtm, uriProfile, uriClientSSL, name)
	if err != nil {
		return nil, err
	}
	if !ok {
		return nil, nil
	}

	return &clientSSLProfile, nil
}