func (s *QualitygatesService) GetByProject(opt *QualitygatesGetByProjectOption) (v *QualitygatesGetByProjectObject, resp *http.Response, err error) {
	err = s.ValidateGetByProjectOpt(opt)
	if err != nil {
		return
	}
	req, err := s.client.NewRequest("GET", "qualitygates/get_by_project", opt)
	if err != nil {
		return
	}
	v = new(QualitygatesGetByProjectObject)
	resp, err = s.client.Do(req, v)
	if err != nil {
		return nil, resp, err
	}
	return
}
GetByProject Get the quality gate of a project.<br />Requires one of the following permissions:<ul><li>'Administer System'</li><li>'Administer' rights on the specified project</li><li>'Browse' on the specified project</li></ul>
package sonargo
import "net/http"
type QualitygatesService struct {
	client *Client
}
type QualityGatesCondition struct {
	Error        string `json:"error,omitempty"`
	ID           int    `json:"id,omitempty"`
	Metric       string `json:"metric,omitempty"`
	Op           string `json:"op,omitempty"`
	Warning      string `json:"warning,omitempty"`
	Organization string `url:"organization,omitempty"`  
	Period       string `url:"period,omitempty"`        
}
type QualitygatesGetByProjectObject struct {
	QualityGate *QualityGate `json:"qualityGate,omitempty"`
}
type QualityGate struct {
	Default bool   `json:"default,omitempty"`
	ID      int    `json:"id,omitempty"`
	Name    string `json:"name,omitempty"`
}
type QualitygatesListObject struct {
	Actions      *Actions         `json:"actions,omitempty"`
	Default      int64            `json:"default,omitempty"`
	Qualitygates []*QualityGateV2 `json:"qualitygates,omitempty"`
}
type Actions struct {
	Create            bool `json:"create,omitempty"`
	AssociateProjects bool `json:"associateProjects,omitempty"`
	Copy              bool `json:"copy,omitempty"`
	Delete            bool `json:"delete,omitempty"`
	Edit              bool `json:"edit,omitempty"`
	ManageConditions  bool `json:"manageConditions,omitempty"`
	Rename            bool `json:"rename,omitempty"`
	SetAsDefault      bool `json:"setAsDefault,omitempty"`
}
type QualityGateV2 struct {
	Actions    *Actions                 `json:"actions,omitempty"`
	Conditions []*QualityGatesCondition `json:"conditions,omitempty"`
	ID         int                      `json:"id,omitempty"`
	IsBuiltIn  bool                     `json:"isBuiltIn,omitempty"`
	IsDefault  bool                     `json:"isDefault,omitempty"`
	Name       string                   `json:"name,omitempty"`
}
type QualitygatesProjectStatusObject struct {
	ProjectStatus *ProjectStatus `json:"projectStatus,omitempty"`
}
type Condition struct {
	ActualValue      string `json:"actualValue,omitempty"`
	Comparator       string `json:"comparator,omitempty"`
	ErrorThreshold   string `json:"errorThreshold,omitempty"`
	MetricKey        string `json:"metricKey,omitempty"`
	PeriodIndex      int64  `json:"periodIndex,omitempty"`
	Status           string `json:"status,omitempty"`
	WarningThreshold string `json:"warningThreshold,omitempty"`
}
type ProjectStatus struct {
	Conditions        []*Condition `json:"conditions,omitempty"`
	IgnoredConditions bool         `json:"ignoredConditions,omitempty"`
	Periods           []*Period    `json:"periods,omitempty"`
	Status            string       `json:"status,omitempty"`
}
type QualitygatesSearchObject struct {
	Paging  *Paging   `json:"paging,omitempty"`
	More    bool      `json:"more,omitempty"`
	Results []*Result `json:"results,omitempty"`
}
type Result struct {
	ID       int    `json:"id,omitempty"`
	Name     string `json:"name,omitempty"`
	Selected bool   `json:"selected,omitempty"`
}
type QualitygatesCopyOption struct {
	Id           int    `url:"id,omitempty"`            
	Name         string `url:"name,omitempty"`          
	Organization string `url:"organization,omitempty"`  
}
func (s *QualitygatesService) Copy(opt *QualitygatesCopyOption) (v *QualityGate, resp *http.Response, err error) {
	err = s.ValidateCopyOpt(opt)
	if err != nil {
		return
	}
	req, err := s.client.NewRequest("POST", "qualitygates/copy", opt)
	if err != nil {
		return
	}
	v = new(QualityGate)
	resp, err = s.client.Do(req, v)
	if err != nil {
		return
	}
	return
}
type QualitygatesCreateOption struct {
	Name         string `url:"name,omitempty"`          
	Organization string `url:"organization,omitempty"`  
}
func (s *QualitygatesService) Create(opt *QualitygatesCreateOption) (v *QualityGate, resp *http.Response, err error) {
	err = s.ValidateCreateOpt(opt)
	if err != nil {
		return
	}
	req, err := s.client.NewRequest("POST", "qualitygates/create", opt)
	if err != nil {
		return
	}
	v = new(QualityGate)
	resp, err = s.client.Do(req, v)
	if err != nil {
		return nil, resp, err
	}
	return
}
type QualitygatesCreateConditionOption struct {
	Error        string `url:"error,omitempty"`         
	GateId       int    `url:"gateId,omitempty"`        
	Metric       string `url:"metric,omitempty"`        
	Op           string `url:"op,omitempty"`            
	Organization string `url:"organization,omitempty"`  
	Period       string `url:"period,omitempty"`        
	Warning      string `url:"warning,omitempty"`       
}
func (s *QualitygatesService) CreateCondition(opt *QualitygatesCreateConditionOption) (v *QualityGatesCondition, resp *http.Response, err error) {
	err = s.ValidateCreateConditionOpt(opt)
	if err != nil {
		return
	}
	req, err := s.client.NewRequest("POST", "qualitygates/create_condition", opt)
	if err != nil {
		return
	}
	v = new(QualityGatesCondition)
	resp, err = s.client.Do(req, v)
	if err != nil {
		return nil, resp, err
	}
	return
}
type QualitygatesDeleteConditionOption struct {
	ConditionID  int    `url:"id,omitempty"`            
	Organization string `url:"organization,omitempty"`  
}
func (s *QualitygatesService) DeleteCondition(opt *QualitygatesDeleteConditionOption) (resp *http.Response, err error) {
	err = s.ValidateDeleteConditionOpt(opt)
	if err != nil {
		return
	}
	req, err := s.client.NewRequest("POST", "qualitygates/delete_condition", opt)
	if err != nil {
		return
	}
	resp, err = s.client.Do(req, nil)
	if err != nil {
		return
	}
	return
}
type QualitygatesDeselectOption struct {
	Organization string `url:"organization,omitempty"`  
	ProjectId    string `url:"projectId,omitempty"`     
	ProjectKey   string `url:"projectKey,omitempty"`    
}
func (s *QualitygatesService) Deselect(opt *QualitygatesDeselectOption) (resp *http.Response, err error) {
	err = s.ValidateDeselectOpt(opt)
	if err != nil {
		return
	}
	req, err := s.client.NewRequest("POST", "qualitygates/deselect", opt)
	if err != nil {
		return
	}
	resp, err = s.client.Do(req, nil)
	if err != nil {
		return
	}
	return
}
type QualitygatesDestroyOption struct {
	Id           int    `url:"id,omitempty"`            
	Organization string `url:"organization,omitempty"`  
}
func (s *QualitygatesService) Destroy(opt *QualitygatesDestroyOption) (resp *http.Response, err error) {
	err = s.ValidateDestroyOpt(opt)
	if err != nil {
		return
	}
	req, err := s.client.NewRequest("POST", "qualitygates/destroy", opt)
	if err != nil {
		return
	}
	resp, err = s.client.Do(req, nil)
	if err != nil {
		return
	}
	return
}
type QualitygatesGetByProjectOption struct {
	Organization string `url:"organization,omitempty"`  
	Project      string `url:"project,omitempty"`       
}