func (client *ClientImpl) ListConsumers(ctx context.Context, args ListConsumersArgs) (*[]Consumer, error) {
	queryParams := url.Values{}
	if args.PublisherId != nil {
		queryParams.Add("publisherId", *args.PublisherId)
	}
	locationId, _ := uuid.Parse("4301c514-5f34-4f5d-a145-f0ea7b5b7d19")
	resp, err := client.Client.Send(ctx, http.MethodGet, locationId, "5.1", nil, queryParams, nil, "", "application/json", nil)
	if err != nil {
		return nil, err
	}
	var responseValue []Consumer
	err = client.Client.UnmarshalCollectionBody(resp, &responseValue)
	return &responseValue, err
}
Get a list of available service hook consumer services. Optionally filter by consumers that support at least one event type from the specific publisher.
package servicehooks
import (
	"bytes"
	"context"
	"encoding/json"
	"github.com/google/uuid"
	"github.com/microsoft/azure-devops-go-api/azuredevops"
	"github.com/microsoft/azure-devops-go-api/azuredevops/forminput"
	"github.com/microsoft/azure-devops-go-api/azuredevops/notification"
	"net/http"
	"net/url"
	"strconv"
)
type Client interface {
	CreateSubscription(context.Context, CreateSubscriptionArgs) (*Subscription, error)
	CreateSubscriptionsQuery(context.Context, CreateSubscriptionsQueryArgs) (*SubscriptionsQuery, error)
	CreateTestNotification(context.Context, CreateTestNotificationArgs) (*Notification, error)
	DeleteSubscription(context.Context, DeleteSubscriptionArgs) error
	GetConsumer(context.Context, GetConsumerArgs) (*Consumer, error)
	GetConsumerAction(context.Context, GetConsumerActionArgs) (*ConsumerAction, error)
	GetEventType(context.Context, GetEventTypeArgs) (*EventTypeDescriptor, error)
	GetNotification(context.Context, GetNotificationArgs) (*Notification, error)
	GetNotifications(context.Context, GetNotificationsArgs) (*[]Notification, error)
	GetPublisher(context.Context, GetPublisherArgs) (*Publisher, error)
	GetSubscription(context.Context, GetSubscriptionArgs) (*Subscription, error)
	GetSubscriptionDiagnostics(context.Context, GetSubscriptionDiagnosticsArgs) (*notification.SubscriptionDiagnostics, error)
	ListConsumerActions(context.Context, ListConsumerActionsArgs) (*[]ConsumerAction, error)
	ListConsumers(context.Context, ListConsumersArgs) (*[]Consumer, error)
	ListEventTypes(context.Context, ListEventTypesArgs) (*[]EventTypeDescriptor, error)
	ListPublishers(context.Context, ListPublishersArgs) (*[]Publisher, error)
	ListSubscriptions(context.Context, ListSubscriptionsArgs) (*[]Subscription, error)
	QueryInputValues(context.Context, QueryInputValuesArgs) (*forminput.InputValuesQuery, error)
	QueryNotifications(context.Context, QueryNotificationsArgs) (*NotificationsQuery, error)
	QueryPublishers(context.Context, QueryPublishersArgs) (*PublishersQuery, error)
	ReplaceSubscription(context.Context, ReplaceSubscriptionArgs) (*Subscription, error)
	UpdateSubscriptionDiagnostics(context.Context, UpdateSubscriptionDiagnosticsArgs) (*notification.SubscriptionDiagnostics, error)
}
type ClientImpl struct {
	Client azuredevops.Client
}
func NewClient(ctx context.Context, connection *azuredevops.Connection) Client {
	client := connection.GetClientByUrl(connection.BaseUrl)
	return &ClientImpl{
		Client: *client,
	}
}
func (client *ClientImpl) CreateSubscription(ctx context.Context, args CreateSubscriptionArgs) (*Subscription, error) {
	if args.Subscription == nil {
		return nil, &azuredevops.ArgumentNilError{ArgumentName: "args.Subscription"}
	}
	body, marshalErr := json.Marshal(*args.Subscription)
	if marshalErr != nil {
		return nil, marshalErr
	}
	locationId, _ := uuid.Parse("fc50d02a-849f-41fb-8af1-0a5216103269")
	resp, err := client.Client.Send(ctx, http.MethodPost, locationId, "5.1", nil, nil, bytes.NewReader(body), "application/json", "application/json", nil)
	if err != nil {
		return nil, err
	}
	var responseValue Subscription
	err = client.Client.UnmarshalBody(resp, &responseValue)
	return &responseValue, err
}
type CreateSubscriptionArgs struct {
	Subscription *Subscription
}
func (client *ClientImpl) CreateSubscriptionsQuery(ctx context.Context, args CreateSubscriptionsQueryArgs) (*SubscriptionsQuery, error) {
	if args.Query == nil {
		return nil, &azuredevops.ArgumentNilError{ArgumentName: "args.Query"}
	}
	body, marshalErr := json.Marshal(*args.Query)
	if marshalErr != nil {
		return nil, marshalErr
	}
	locationId, _ := uuid.Parse("c7c3c1cf-9e05-4c0d-a425-a0f922c2c6ed")
	resp, err := client.Client.Send(ctx, http.MethodPost, locationId, "5.1", nil, nil, bytes.NewReader(body), "application/json", "application/json", nil)
	if err != nil {
		return nil, err
	}
	var responseValue SubscriptionsQuery
	err = client.Client.UnmarshalBody(resp, &responseValue)
	return &responseValue, err
}
type CreateSubscriptionsQueryArgs struct {
	Query *SubscriptionsQuery
}
func (client *ClientImpl) CreateTestNotification(ctx context.Context, args CreateTestNotificationArgs) (*Notification, error) {
	if args.TestNotification == nil {
		return nil, &azuredevops.ArgumentNilError{ArgumentName: "args.TestNotification"}
	}
	queryParams := url.Values{}
	if args.UseRealData != nil {
		queryParams.Add("useRealData", strconv.FormatBool(*args.UseRealData))
	}
	body, marshalErr := json.Marshal(*args.TestNotification)
	if marshalErr != nil {
		return nil, marshalErr
	}
	locationId, _ := uuid.Parse("1139462c-7e27-4524-a997-31b9b73551fe")
	resp, err := client.Client.Send(ctx, http.MethodPost, locationId, "5.1", nil, queryParams, bytes.NewReader(body), "application/json", "application/json", nil)
	if err != nil {
		return nil, err
	}
	var responseValue Notification
	err = client.Client.UnmarshalBody(resp, &responseValue)
	return &responseValue, err
}
type CreateTestNotificationArgs struct {
	TestNotification *Notification
	UseRealData *bool
}
func (client *ClientImpl) DeleteSubscription(ctx context.Context, args DeleteSubscriptionArgs) error {
	routeValues := make(map[string]string)
	if args.SubscriptionId == nil {
		return &azuredevops.ArgumentNilError{ArgumentName: "args.SubscriptionId"}
	}
	routeValues["subscriptionId"] = (*args.SubscriptionId).String()
	locationId, _ := uuid.Parse("fc50d02a-849f-41fb-8af1-0a5216103269")
	_, err := client.Client.Send(ctx, http.MethodDelete, locationId, "5.1", routeValues, nil, nil, "", "application/json", nil)
	if err != nil {
		return err
	}
	return nil
}
type DeleteSubscriptionArgs struct {
	SubscriptionId *uuid.UUID
}
func (client *ClientImpl) GetConsumer(ctx context.Context, args GetConsumerArgs) (*Consumer, error) {
	routeValues := make(map[string]string)
	if args.ConsumerId == nil || *args.ConsumerId == "" {
		return nil, &azuredevops.ArgumentNilOrEmptyError{ArgumentName: "args.ConsumerId"}
	}
	routeValues["consumerId"] = *args.ConsumerId
	queryParams := url.Values{}
	if args.PublisherId != nil {
		queryParams.Add("publisherId", *args.PublisherId)
	}
	locationId, _ := uuid.Parse("4301c514-5f34-4f5d-a145-f0ea7b5b7d19")
	resp, err := client.Client.Send(ctx, http.MethodGet, locationId, "5.1", routeValues, queryParams, nil, "", "application/json", nil)
	if err != nil {
		return nil, err
	}
	var responseValue Consumer
	err = client.Client.UnmarshalBody(resp, &responseValue)
	return &responseValue, err
}
type GetConsumerArgs struct {
	ConsumerId *string
	PublisherId *string
}
func (client *ClientImpl) GetConsumerAction(ctx context.Context, args GetConsumerActionArgs) (*ConsumerAction, error) {
	routeValues := make(map[string]string)
	if args.ConsumerId == nil || *args.ConsumerId == "" {
		return nil, &azuredevops.ArgumentNilOrEmptyError{ArgumentName: "args.ConsumerId"}
	}
	routeValues["consumerId"] = *args.ConsumerId
	if args.ConsumerActionId == nil || *args.ConsumerActionId == "" {
		return nil, &azuredevops.ArgumentNilOrEmptyError{ArgumentName: "args.ConsumerActionId"}
	}
	routeValues["consumerActionId"] = *args.ConsumerActionId
	queryParams := url.Values{}
	if args.PublisherId != nil {
		queryParams.Add("publisherId", *args.PublisherId)
	}
	locationId, _ := uuid.Parse("c3428e90-7a69-4194-8ed8-0f153185ee0d")
	resp, err := client.Client.Send(ctx, http.MethodGet, locationId, "5.1", routeValues, queryParams, nil, "", "application/json", nil)
	if err != nil {
		return nil, err
	}
	var responseValue ConsumerAction
	err = client.Client.UnmarshalBody(resp, &responseValue)
	return &responseValue, err
}
type GetConsumerActionArgs struct {
	ConsumerId *string
	ConsumerActionId *string
	PublisherId *string
}
func (client *ClientImpl) GetEventType(ctx context.Context, args GetEventTypeArgs) (*EventTypeDescriptor, error) {
	routeValues := make(map[string]string)
	if args.PublisherId == nil || *args.PublisherId == "" {
		return nil, &azuredevops.ArgumentNilOrEmptyError{ArgumentName: "args.PublisherId"}
	}
	routeValues["publisherId"] = *args.PublisherId
	if args.EventTypeId == nil || *args.EventTypeId == "" {
		return nil, &azuredevops.ArgumentNilOrEmptyError{ArgumentName: "args.EventTypeId"}
	}
	routeValues["eventTypeId"] = *args.EventTypeId
	locationId, _ := uuid.Parse("db4777cd-8e08-4a84-8ba3-c974ea033718")
	resp, err := client.Client.Send(ctx, http.MethodGet, locationId, "5.1", routeValues, nil, nil, "", "application/json", nil)
	if err != nil {
		return nil, err
	}
	var responseValue EventTypeDescriptor
	err = client.Client.UnmarshalBody(resp, &responseValue)
	return &responseValue, err
}
type GetEventTypeArgs struct {
	PublisherId *string
	EventTypeId *string
}
func (client *ClientImpl) GetNotification(ctx context.Context, args GetNotificationArgs) (*Notification, error) {
	routeValues := make(map[string]string)
	if args.SubscriptionId == nil {
		return nil, &azuredevops.ArgumentNilError{ArgumentName: "args.SubscriptionId"}
	}
	routeValues["subscriptionId"] = (*args.SubscriptionId).String()
	if args.NotificationId == nil {
		return nil, &azuredevops.ArgumentNilError{ArgumentName: "args.NotificationId"}
	}
	routeValues["notificationId"] = strconv.Itoa(*args.NotificationId)
	locationId, _ := uuid.Parse("0c62d343-21b0-4732-997b-017fde84dc28")
	resp, err := client.Client.Send(ctx, http.MethodGet, locationId, "5.1", routeValues, nil, nil, "", "application/json", nil)
	if err != nil {
		return nil, err
	}
	var responseValue Notification
	err = client.Client.UnmarshalBody(resp, &responseValue)
	return &responseValue, err
}
type GetNotificationArgs struct {
	SubscriptionId *uuid.UUID
	NotificationId *int
}
func (client *ClientImpl) GetNotifications(ctx context.Context, args GetNotificationsArgs) (*[]Notification, error) {
	routeValues := make(map[string]string)
	if args.SubscriptionId == nil {
		return nil, &azuredevops.ArgumentNilError{ArgumentName: "args.SubscriptionId"}
	}
	routeValues["subscriptionId"] = (*args.SubscriptionId).String()
	queryParams := url.Values{}
	if args.MaxResults != nil {
		queryParams.Add("maxResults", strconv.Itoa(*args.MaxResults))
	}
	if args.Status != nil {
		queryParams.Add("status", string(*args.Status))
	}
	if args.Result != nil {
		queryParams.Add("result", string(*args.Result))
	}
	locationId, _ := uuid.Parse("0c62d343-21b0-4732-997b-017fde84dc28")
	resp, err := client.Client.Send(ctx, http.MethodGet, locationId, "5.1", routeValues, queryParams, nil, "", "application/json", nil)
	if err != nil {
		return nil, err
	}
	var responseValue []Notification
	err = client.Client.UnmarshalCollectionBody(resp, &responseValue)
	return &responseValue, err
}
type GetNotificationsArgs struct {
	SubscriptionId *uuid.UUID
	MaxResults *int
	Status *NotificationStatus
	Result *NotificationResult
}
func (client *ClientImpl) GetPublisher(ctx context.Context, args GetPublisherArgs) (*Publisher, error) {
	routeValues := make(map[string]string)
	if args.PublisherId == nil || *args.PublisherId == "" {
		return nil, &azuredevops.ArgumentNilOrEmptyError{ArgumentName: "args.PublisherId"}
	}
	routeValues["publisherId"] = *args.PublisherId
	locationId, _ := uuid.Parse("1e83a210-5b53-43bc-90f0-d476a4e5d731")
	resp, err := client.Client.Send(ctx, http.MethodGet, locationId, "5.1", routeValues, nil, nil, "", "application/json", nil)
	if err != nil {
		return nil, err
	}
	var responseValue Publisher
	err = client.Client.UnmarshalBody(resp, &responseValue)
	return &responseValue, err
}
type GetPublisherArgs struct {
	PublisherId *string
}
func (client *ClientImpl) GetSubscription(ctx context.Context, args GetSubscriptionArgs) (*Subscription, error) {
	routeValues := make(map[string]string)
	if args.SubscriptionId == nil {
		return nil, &azuredevops.ArgumentNilError{ArgumentName: "args.SubscriptionId"}
	}
	routeValues["subscriptionId"] = (*args.SubscriptionId).String()
	locationId, _ := uuid.Parse("fc50d02a-849f-41fb-8af1-0a5216103269")
	resp, err := client.Client.Send(ctx, http.MethodGet, locationId, "5.1", routeValues, nil, nil, "", "application/json", nil)
	if err != nil {
		return nil, err
	}
	var responseValue Subscription
	err = client.Client.UnmarshalBody(resp, &responseValue)
	return &responseValue, err
}
type GetSubscriptionArgs struct {
	SubscriptionId *uuid.UUID
}
func (client *ClientImpl) GetSubscriptionDiagnostics(ctx context.Context, args GetSubscriptionDiagnosticsArgs) (*notification.SubscriptionDiagnostics, error) {
	routeValues := make(map[string]string)
	if args.SubscriptionId == nil || *args.SubscriptionId == "" {
		return nil, &azuredevops.ArgumentNilOrEmptyError{ArgumentName: "args.SubscriptionId"}
	}
	routeValues["subscriptionId"] = *args.SubscriptionId
	locationId, _ := uuid.Parse("3b36bcb5-02ad-43c6-bbfa-6dfc6f8e9d68")
	resp, err := client.Client.Send(ctx, http.MethodGet, locationId, "5.1-preview.1", routeValues, nil, nil, "", "application/json", nil)
	if err != nil {
		return nil, err
	}
	var responseValue notification.SubscriptionDiagnostics
	err = client.Client.UnmarshalBody(resp, &responseValue)
	return &responseValue, err
}
type GetSubscriptionDiagnosticsArgs struct {
	SubscriptionId *string
}
func (client *ClientImpl) ListConsumerActions(ctx context.Context, args ListConsumerActionsArgs) (*[]ConsumerAction, error) {
	routeValues := make(map[string]string)
	if args.ConsumerId == nil || *args.ConsumerId == "" {
		return nil, &azuredevops.ArgumentNilOrEmptyError{ArgumentName: "args.ConsumerId"}
	}
	routeValues["consumerId"] = *args.ConsumerId
	queryParams := url.Values{}
	if args.PublisherId != nil {
		queryParams.Add("publisherId", *args.PublisherId)
	}
	locationId, _ := uuid.Parse("c3428e90-7a69-4194-8ed8-0f153185ee0d")
	resp, err := client.Client.Send(ctx, http.MethodGet, locationId, "5.1", routeValues, queryParams, nil, "", "application/json", nil)
	if err != nil {
		return nil, err
	}
	var responseValue []ConsumerAction
	err = client.Client.UnmarshalCollectionBody(resp, &responseValue)
	return &responseValue, err
}
type ListConsumerActionsArgs struct {
	ConsumerId *string
	PublisherId *string
}