// RemovePermissionWithContext mocks base method
1808
func (m *MockLambdaAPI) RemovePermissionWithContext(arg0 aws.Context, arg1 *lambda.RemovePermissionInput, arg2 ...request.Option) (*lambda.RemovePermissionOutput, error) {
	varargs := []interface{}{arg0, arg1}
	for _, a := range arg2 {
		varargs = append(varargs, a)
	}
	ret := m.ctrl.Call(m, "RemovePermissionWithContext", varargs...)
	ret0, _ := ret[0].(*lambda.RemovePermissionOutput)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}
898851
func (o *ListSubjectConsentSessionsParams) WithContext(ctx context.Context) *ListSubjectConsentSessionsParams {
	o.SetContext(ctx)
	return o
}
1257785
func (o *AcceptLogoutRequestParams) WithContext(ctx context.Context) *AcceptLogoutRequestParams {
	o.SetContext(ctx)
	return o
}
50755
func (o *DeleteEndpointIDParams) WithContext(ctx context.Context) *DeleteEndpointIDParams {
	o.SetContext(ctx)
	return o
}
563307
func (c *Cloud) removeSecurityGroupIngress(securityGroupID string, removePermissions []*ec2.IpPermission) (bool, error) {
	// We do not want to make changes to the Global defined SG
	if securityGroupID == c.cfg.Global.ElbSecurityGroup {
		return false, nil
	}

	group, err := c.findSecurityGroup(securityGroupID)
	if err != nil {
		klog.Warningf("Error retrieving security group: %q", err)
		return false, err
	}

	if group == nil {
		klog.Warning("Security group not found: ", securityGroupID)
		return false, nil
	}

	changes := []*ec2.IpPermission{}
	for _, removePermission := range removePermissions {
		hasUserID := false
		for i := range removePermission.UserIdGroupPairs {
			if removePermission.UserIdGroupPairs[i].UserId != nil {
				hasUserID = true
			}
		}

		var found *ec2.IpPermission
		for _, groupPermission := range group.IpPermissions {
			if ipPermissionExists(removePermission, groupPermission, hasUserID) {
				found = removePermission
				break
			}
		}

		if found != nil {
			changes = append(changes, found)
		}
	}

	if len(changes) == 0 {
		return false, nil
	}

	klog.V(2).Infof("Removing security group ingress: %s %v", securityGroupID, changes)

	request := &ec2.RevokeSecurityGroupIngressInput{}
	request.GroupId = &securityGroupID
	request.IpPermissions = changes
	_, err = c.ec2.RevokeSecurityGroupIngress(request)
	if err != nil {
		klog.Warningf("Error revoking security group ingress: %q", err)
		return false, err
	}

	return true, nil
}
219630
func (u *user) Remove(ctx context.Context) error {
	req, err := u.conn.NewRequest("DELETE", u.relPath())
	if err != nil {
		return WithStack(err)
	}
	resp, err := u.conn.Do(ctx, req)
	if err != nil {
		return WithStack(err)
	}
	if err := resp.CheckStatus(202); err != nil {
		return WithStack(err)
	}
	return nil
}
715217
func (o *ListOAuth2ClientsParams) WithContext(ctx context.Context) *ListOAuth2ClientsParams {
	o.SetContext(ctx)
	return o
}
1218483
func (s *Server) RemoveServiceTemplate(templateID string,  _ *struct{}) error  {
	return s.f.RemoveServiceTemplate(s.context(), templateID)
}
394127
func (s *Session) ChannelPermissionDelete(channelID, targetID string) (err error) {

	_, err = s.RequestWithBucketID("DELETE", EndpointChannelPermission(channelID, targetID), nil, EndpointChannelPermission(channelID, ""))
	return
}
1002191
func (o *OauthAuthParams) WithContext(ctx context.Context) *OauthAuthParams {
	o.SetContext(ctx)
	return o
}
836662
func (m *MetaClient) RemoveUserPerms(ctx context.Context, name string, perms Permissions) error {
	a := &UserAction{
		Action: "remove-permissions",
		User: &User{
			Name:        name,
			Permissions: perms,
		},
	}
	return m.Post(ctx, "/user", a, nil)
}
213974
func (call *DeleteLIFFCall) WithContext(ctx context.Context) *DeleteLIFFCall {
	call.ctx = ctx
	return call
}
556452
func (m *MockLambdaAPI) AddPermission(arg0 *lambda.AddPermissionInput) (*lambda.AddPermissionOutput, error) {
	ret := m.ctrl.Call(m, "AddPermission", arg0)
	ret0, _ := ret[0].(*lambda.AddPermissionOutput)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}
213398
func (res *Resource) HasPermission(mode roles.PermissionMode, context *qor.Context) bool {
	if res == nil || res.Permission == nil {
		return true
	}

	var roles = []interface{}{}
	for _, role := range context.Roles {
		roles = append(roles, role)
	}
	return res.Permission.HasPermission(mode, roles...)
}
608183
func (o *DisconnectUserParams) WithContext(ctx context.Context) *DisconnectUserParams {
	o.SetContext(ctx)
	return o
}
592547
func (client *Client) ClearContext() {
	client.mu.Lock()
	defer client.mu.Unlock()
	client.context.clear()
}
546670
func (o *CreateOAuth2ClientParams) WithContext(ctx context.Context) *CreateOAuth2ClientParams {
	o.SetContext(ctx)
	return o
}