sm

package
v1.6.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 24, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApprovalConnector

type ApprovalConnector interface {

	// Gets returns all approvals on a customer request.
	//
	// GET /rest/servicedeskapi/request/{issueKeyOrID}/approval
	//
	// https://docs.go-atlassian.io/jira-service-management-cloud/request/approval#get-approvals
	Gets(ctx context.Context, issueKeyOrID string, start, limit int) (*model.CustomerApprovalPageScheme, *model.ResponseScheme, error)

	// Get returns an approval. Use this method to determine the status of an approval and the list of approvers.
	//
	// GET /rest/servicedeskapi/request/{issueKeyOrID}/approval/{approvalID}
	//
	// https://docs.go-atlassian.io/jira-service-management-cloud/request/approval#get-approval-by-id
	Get(ctx context.Context, issueKeyOrID string, approvalID int) (*model.CustomerApprovalScheme, *model.ResponseScheme, error)

	// Answer enables a user to Approve or Decline an approval on a customer request.
	//
	// The approval is assumed to be owned by the user making the call.
	//
	// POST /rest/servicedeskapi/request/{issueKeyOrID}/approval/{approvalID}
	//
	// https://docs.go-atlassian.io/jira-service-management-cloud/request/approval#answer-approval
	Answer(ctx context.Context, issueKeyOrID string, approvalID int, approve bool) (*model.CustomerApprovalScheme, *model.ResponseScheme, error)
}

type AttachmentConnector

type AttachmentConnector interface {

	// Gets returns all the attachments for a customer requests.
	//
	// GET /rest/servicedeskapi/request/{issueKeyOrID}/attachment
	//
	// https://docs.go-atlassian.io/jira-service-management-cloud/request/attachment#get-attachments-for-request
	Gets(ctx context.Context, issueKeyOrID string, start, limit int) (*model.RequestAttachmentPageScheme, *model.ResponseScheme, error)

	// Create adds one or more temporary files (attached to the request's service desk using
	//
	// servicedesk/{serviceDeskID}/attachTemporaryFile) as attachments to a customer request
	//
	// POST /rest/servicedeskapi/request/{issueKeyOrID}/attachment
	//
	// https://docs.go-atlassian.io/jira-service-management-cloud/request/attachment#create-attachment
	Create(ctx context.Context, issueKeyOrID string, payload *model.RequestAttachmentCreationPayloadScheme) (*model.RequestAttachmentCreationScheme, *model.ResponseScheme, error)
}

type CommentConnector

type CommentConnector interface {

	// Gets returns all comments on a customer request.
	//
	// No permissions error is provided if, for example, the user doesn't have access to the service desk or request,
	//
	// the method simply returns an empty response.
	//
	// GET /rest/servicedeskapi/request/{issueKeyOrID}/comment
	//
	// https://docs.go-atlassian.io/jira-service-management-cloud/request/comments#get-request-comments
	Gets(ctx context.Context, issueKeyOrID string, options *model.RequestCommentOptionsScheme) (*model.RequestCommentPageScheme, *model.ResponseScheme, error)

	// Get returns details of a customer request's comment.
	//
	// GET /rest/servicedeskapi/request/{issueKeyOrID}/comment/{commentID}
	//
	// https://docs.go-atlassian.io/jira-service-management-cloud/request/comments#get-request-comment-by-id
	Get(ctx context.Context, issueKeyOrID string, commentID int, expand []string) (*model.RequestCommentScheme, *model.ResponseScheme, error)

	// Create creates a public or private (internal) comment on a customer request, with the comment visibility set by public.
	//
	// POST /rest/servicedeskapi/request/{issueKeyOrID}/comment
	//
	// https://docs.go-atlassian.io/jira-service-management-cloud/request/comments#create-request-comment
	Create(ctx context.Context, issueKeyOrID, body string, public bool) (*model.RequestCommentScheme, *model.ResponseScheme, error)

	// Attachments  returns the attachments referenced in a comment.
	//
	// GET /rest/servicedeskapi/request/{issueKeyOrID}/comment/{commentID}/attachment
	//
	// https://docs.go-atlassian.io/jira-service-management-cloud/request/comments#get-comment-attachments
	Attachments(ctx context.Context, issueKeyOrID string, commentID, start, limit int) (*model.RequestAttachmentPageScheme, *model.ResponseScheme, error)
}

CommentConnector defines the interface for the Comment methods of the Jira Service Management REST API.

type CustomerConnector

type CustomerConnector interface {

	// Create adds a customer to the Jira Service Management
	//
	// instance by passing a JSON file including an email address and display name.
	//
	// The display name does not need to be unique. The record's identifiers,
	//
	// name and key, are automatically generated from the request details.
	//
	// POST /rest/servicedeskapi/customer
	//
	// https://docs.go-atlassian.io/jira-service-management-cloud/customer#create-customer
	Create(ctx context.Context, email, displayName string) (*model.CustomerScheme, *model.ResponseScheme, error)

	// Gets  returns a list of the customers on a service desk.
	//
	// GET /rest/servicedeskapi/servicedesk/{serviceDeskID}/customer
	//
	// https://docs.go-atlassian.io/jira-service-management-cloud/customer#get-customers
	Gets(ctx context.Context, serviceDeskID string, query string, start, limit int) (*model.CustomerPageScheme, *model.ResponseScheme, error)

	// Add adds one or more customers to a service desk.
	//
	// POST /rest/servicedeskapi/servicedesk/{serviceDeskID}/customer
	//
	// https://docs.go-atlassian.io/jira-service-management-cloud/customer#add-customers
	Add(ctx context.Context, serviceDeskID string, accountIDs []string) (*model.ResponseScheme, error)

	// Remove removes one or more customers from a service desk. The service desk must have closed access
	//
	// DELETE /rest/servicedeskapi/servicedesk/{serviceDeskID}/customer
	//
	// https://docs.go-atlassian.io/jira-service-management-cloud/customer#remove-customers
	Remove(ctx context.Context, serviceDeskID string, accountIDs []string) (*model.ResponseScheme, error)
}

type FeedbackConnector

type FeedbackConnector interface {

	// Get retrieves a feedback of a request using it's request key or request id
	//
	// GET /rest/servicedeskapi/request/{requestIDOrKey}/feedback
	//
	// https://docs.go-atlassian.io/jira-service-management-cloud/request/feedback#get-feedback
	Get(ctx context.Context, requestIDOrKey string) (*model.CustomerFeedbackScheme, *model.ResponseScheme, error)

	// Post adds a feedback on a request using its request key or request id
	//
	// POST /rest/servicedeskapi/request/{requestIDOrKey}/feedback
	//
	// https://docs.go-atlassian.io/jira-service-management-cloud/request/feedback#post-feedback
	Post(ctx context.Context, requestIDOrKey string, rating int, comment string) (*model.CustomerFeedbackScheme, *model.ResponseScheme, error)

	// Delete deletes the feedback of request using its request key or request id
	//
	// DELETE /rest/servicedeskapi/request/{requestIDOrKey}/feedback
	//
	// https://docs.go-atlassian.io/jira-service-management-cloud/request/feedback#delete-feedback
	Delete(ctx context.Context, requestIDOrKey string) (*model.ResponseScheme, error)
}

type InfoConnector

type InfoConnector interface {

	// Get retrieves information about the Jira Service Management instance such as software version, builds, and related links.
	//
	// GET /rest/servicedeskapi/info
	//
	// https://docs.go-atlassian.io/jira-service-management-cloud/info#get-info
	Get(ctx context.Context) (*model.InfoScheme, *model.ResponseScheme, error)
}

type KnowledgeBaseConnector

type KnowledgeBaseConnector interface {

	// Search returns articles which match the given query string across all service desks.
	//
	// GET /rest/servicedeskapi/knowledgebase/article
	//
	// https://docs.go-atlassian.io/jira-service-management-cloud/knowledgebase#search-articles
	Search(ctx context.Context, query string, highlight bool, start, limit int) (*model.ArticlePageScheme, *model.ResponseScheme, error)

	// Gets returns articles which match the given query string across all service desks.
	//
	// GET /rest/servicedeskapi/servicedesk/{serviceDeskID}/knowledgebase/article
	//
	// https://docs.go-atlassian.io/jira-service-management-cloud/knowledgebase#get-articles
	Gets(ctx context.Context, serviceDeskID int, query string, highlight bool, start, limit int) (*model.ArticlePageScheme, *model.ResponseScheme, error)
}

type OrganizationConnector

type OrganizationConnector interface {

	// Gets returns a list of organizations in the Jira Service Management instance.
	//
	// Use this method when you want to present a list of organizations or want to locate an organization by name.
	//
	// GET /rest/servicedeskapi/organization
	//
	// https://docs.go-atlassian.io/jira-service-management-cloud/organization#get-organizations
	Gets(ctx context.Context, accountID string, start, limit int) (*model.OrganizationPageScheme, *model.ResponseScheme, error)

	// Get returns details of an organization.
	//
	// Use this method to get organization details whenever your application component is passed an organization ID
	//
	// but needs to display other organization details.
	//
	// GET /rest/servicedeskapi/organization/{organizationID}
	//
	// https://docs.go-atlassian.io/jira-service-management-cloud/organization#get-organization
	Get(ctx context.Context, organizationID int) (*model.OrganizationScheme, *model.ResponseScheme, error)

	// Delete deletes an organization.
	//
	// Note that the organization is deleted regardless of other associations it may have.
	//
	// For example, associations with service desks.
	//
	// DELETE /rest/servicedeskapi/organization/{organizationID}
	//
	// https://docs.go-atlassian.io/jira-service-management/organization#delete-organization
	Delete(ctx context.Context, organizationID int) (*model.ResponseScheme, error)

	// Create creates an organization by passing the name of the organization.
	//
	// POST /rest/servicedeskapi/organization
	//
	// https://docs.go-atlassian.io/jira-service-management-cloud/organization#create-organization
	Create(ctx context.Context, name string) (*model.OrganizationScheme, *model.ResponseScheme, error)

	// Users returns all the users associated with an organization.
	//
	// Use this method where you want to provide a list of users for an
	//
	// organization or determine if a user is associated with an organization.
	//
	// GET /rest/servicedeskapi/organization/{organizationID}/user
	//
	// https://docs.go-atlassian.io/jira-service-management-cloud/organization#get-users-in-organization
	Users(ctx context.Context, organizationID, start, limit int) (*model.OrganizationUsersPageScheme, *model.ResponseScheme, error)

	// Add adds users to an organization.
	//
	// POST /rest/servicedeskapi/organization/{organizationID}/user
	//
	// https://docs.go-atlassian.io/jira-service-management-cloud/organization#add-users-to-organization
	Add(ctx context.Context, organizationID int, accountIDs []string) (*model.ResponseScheme, error)

	// Remove removes users from an organization.
	//
	// DELETE /rest/servicedeskapi/organization/{organizationID}/user
	//
	// https://docs.go-atlassian.io/jira-service-management-cloud/organization#remove-users-from-organization
	Remove(ctx context.Context, organizationID int, accountIDs []string) (*model.ResponseScheme, error)

	// Project returns a list of all organizations associated with a service desk.
	//
	// GET /rest/servicedeskapi/servicedesk/{organizationID}/organization
	//
	// https://docs.go-atlassian.io/jira-service-management/organization#get-project-organizations
	Project(ctx context.Context, accountID string, serviceDeskID, start, limit int) (*model.OrganizationPageScheme, *model.ResponseScheme, error)

	// Associate adds an organization to a service desk.
	//
	// If the organization ID is already associated with the service desk,
	//
	// no change is made and the resource returns a 204 success code.
	//
	// POST /rest/servicedeskapi/servicedesk/{organizationID}/organization
	//
	// https://docs.go-atlassian.io/jira-service-management-cloud/organization#associate-organization
	Associate(ctx context.Context, serviceDeskID, organizationID int) (*model.ResponseScheme, error)

	// Detach removes an organization from a service desk.
	//
	// If the organization ID does not match an organization associated with the service desk,
	//
	// no change is made and the resource returns a 204 success code.
	//
	// DELETE /rest/servicedeskapi/servicedesk/{organizationID}/organization
	//
	// https://docs.go-atlassian.io/jira-service-management-cloud/organization#detach-organization
	Detach(ctx context.Context, serviceDeskID, organizationID int) (*model.ResponseScheme, error)
}

type ParticipantConnector

type ParticipantConnector interface {

	// Gets returns a list of all the participants on a customer request.
	//
	// GET /rest/servicedeskapi/request/{issueKeyOrID}/participant
	//
	// https://docs.go-atlassian.io/jira-service-management-cloud/request/participants#get-request-participants
	Gets(ctx context.Context, issueKeyOrID string, start, limit int) (*model.RequestParticipantPageScheme, *model.ResponseScheme, error)

	// Add adds participants to a customer request.
	//
	// POST /rest/servicedeskapi/request/{issueKeyOrID}/participant
	//
	// https://docs.go-atlassian.io/jira-service-management-cloud/request/participants#add-request-participants
	Add(ctx context.Context, issueKeyOrID string, accountIDs []string) (*model.RequestParticipantPageScheme, *model.ResponseScheme, error)

	// Remove removes participants from a customer request.
	//
	// DELETE /rest/servicedeskapi/request/{issueKeyOrID}/participant
	//
	// https://docs.go-atlassian.io/jira-service-management-cloud/request/participants#remove-request-participants
	Remove(ctx context.Context, issueKeyOrID string, accountIDs []string) (*model.RequestParticipantPageScheme, *model.ResponseScheme, error)
}

type QueueConnector

type QueueConnector interface {

	// Gets returns the queues in a service desk
	//
	// GET /rest/servicedeskapi/servicedesk/{serviceDeskID}/queue
	//
	// https://docs.go-atlassian.io/jira-service-management-cloud/request/service-desk/queue#get-queues
	Gets(ctx context.Context, serviceDeskID int, includeCount bool, start, limit int) (*model.ServiceDeskQueuePageScheme, *model.ResponseScheme, error)

	// Get returns a specific queues in a service desk.
	//
	// GET /rest/servicedeskapi/servicedesk/{serviceDeskID}/queue/{queueID}
	//
	// https://docs.go-atlassian.io/jira-service-management-cloud/request/service-desk/queue#get-queue
	Get(ctx context.Context, serviceDeskID, queueID int, includeCount bool) (*model.ServiceDeskQueueScheme, *model.ResponseScheme, error)

	// Issues returns the customer requests in a queue
	//
	// GET /rest/servicedeskapi/servicedesk/{serviceDeskID}/queue/{queueID}/issue
	//
	// https://docs.go-atlassian.io/jira-service-management-cloud/request/service-desk/queue#get-issues-in-queue
	Issues(ctx context.Context, serviceDeskID, queueID, start, limit int) (*model.ServiceDeskIssueQueueScheme, *model.ResponseScheme, error)
}

type RequestConnector

type RequestConnector interface {

	// Create creates a customer request in a service desk.
	//
	// The JSON request must include the service desk and customer request type, as well as any fields that are required for the request type.
	//
	// POST /rest/servicedeskapi/request
	//
	// https://docs.go-atlassian.io/jira-service-management/request#create-customer-request
	Create(ctx context.Context, payload *model.CreateCustomerRequestPayloadScheme) (*model.CustomerRequestScheme, *model.ResponseScheme, error)

	// Gets returns all customer requests for the user executing the query.
	//
	// The returned customer requests are ordered chronologically by the latest activity on each request. For example, the latest status transition or comment.
	//
	// GET /rest/servicedeskapi/request
	//
	// https://docs.go-atlassian.io/jira-service-management-cloud/request#get-customer-requests
	Gets(ctx context.Context, options *model.ServiceRequestOptionScheme, start, limit int) (*model.CustomerRequestPageScheme, *model.ResponseScheme, error)

	// Get returns a customer request.
	//
	// GET /rest/servicedeskapi/request/{issueKeyOrID}
	//
	// https://docs.go-atlassian.io/jira-service-management-cloud/request#get-customer-request-by-id-or-key
	Get(ctx context.Context, issueKeyOrID string, expand []string) (*model.CustomerRequestScheme, *model.ResponseScheme, error)

	// Subscribe subscribes the user to receiving notifications from a customer request.
	//
	// PUT /rest/servicedeskapi/request/{issueKeyOrID}/notification
	//
	// https://docs.go-atlassian.io/jira-service-management-cloud/request#subscribe
	Subscribe(ctx context.Context, issueKeyOrID string) (*model.ResponseScheme, error)

	// Unsubscribe unsubscribes the user from notifications from a customer request.
	//
	// DELETE /rest/servicedeskapi/request/{issueKeyOrID}/notification
	//
	// https://docs.go-atlassian.io/jira-service-management-cloud/request#unsubscribe
	Unsubscribe(ctx context.Context, issueKeyOrID string) (*model.ResponseScheme, error)

	// Transitions returns a list of transitions, the workflow processes that moves a customer request from one status to another, that the user can perform on a request.
	//
	// GET /rest/servicedeskapi/request/{issueKeyOrID}/transition
	//
	// https://docs.go-atlassian.io/jira-service-management-cloud/request#get-customer-transitions
	Transitions(ctx context.Context, issueKeyOrID string, start, limit int) (*model.CustomerRequestTransitionPageScheme, *model.ResponseScheme, error)

	// Transition performs a customer transition for a given request and transition.
	//
	// An optional comment can be included to provide a reason for the transition.
	//
	// POST /rest/servicedeskapi/request/{issueKeyOrID}/transition
	//
	// https://docs.go-atlassian.io/jira-service-management-cloud/request#perform-customer-transition
	Transition(ctx context.Context, issueKeyOrID, transitionID, comment string) (*model.ResponseScheme, error)
}

type ServiceDeskConnector

type ServiceDeskConnector interface {

	// Gets returns all the service desks in the Jira Service Management instance that the user has permission to access.
	//
	// GET /rest/servicedeskapi/servicedesk
	//
	// https://docs.go-atlassian.io/jira-service-management-cloud/request/service-desk#get-service-desks
	Gets(ctx context.Context, start, limit int) (*model.ServiceDeskPageScheme, *model.ResponseScheme, error)

	// Get returns a service desk.
	//
	// Use this method to get service desk details whenever your application component is passed a service desk ID
	//
	// but needs to display other service desk details.
	//
	// GET /rest/servicedeskapi/servicedesk/{serviceDeskID}
	//
	// https://docs.go-atlassian.io/jira-service-management-cloud/request/service-desk#get-service-desk-by-id
	Get(ctx context.Context, serviceDeskID string) (*model.ServiceDeskScheme, *model.ResponseScheme, error)

	// Attach one temporary attachments to a service desk
	//
	// POST /rest/servicedeskapi/servicedesk/{serviceDeskID}/attachTemporaryFile
	//
	// https://docs.go-atlassian.io/jira-service-management-cloud/request/service-desk#attach-temporary-file
	Attach(ctx context.Context, serviceDeskID string, fileName string, file io.Reader) (*model.ServiceDeskTemporaryFileScheme, *model.ResponseScheme, error)
}

type ServiceLevelAgreementConnector

type ServiceLevelAgreementConnector interface {

	// Gets  returns all the SLA records on a customer request.
	//
	// A customer request can have zero or more SLAs. Each SLA can have recordings for zero or more "completed cycles" and zero or 1 "ongoing cycle".
	//
	// GET /rest/servicedeskapi/request/{issueKeyOrID}/sla
	//
	// https://docs.go-atlassian.io/jira-service-management-cloud/request/sla#get-sla-information
	Gets(ctx context.Context, issueKeyOrID string, start, limit int) (*model.RequestSLAPageScheme, *model.ResponseScheme, error)

	// Get returns the details for an SLA on a customer request.
	//
	// GET /rest/servicedeskapi/request/{issueKeyOrID}/sla/{metricID}
	//
	// https://docs.go-atlassian.io/jira-service-management-cloud/request/sla#get-sla-information-by-id
	Get(ctx context.Context, issueKeyOrID string, metricID int) (*model.RequestSLAScheme, *model.ResponseScheme, error)
}

type TypeConnector

type TypeConnector interface {

	// Search returns all customer request types used in the Jira Service Management instance,
	// optionally filtered by a query string.
	//
	// GET /rest/servicedeskapi/requesttype
	//
	// https://docs.go-atlassian.io/jira-service-management-cloud/request/types#get-all-request-types
	Search(ctx context.Context, query string, start, limit int) (*model.RequestTypePageScheme, *model.ResponseScheme, error)

	// Gets returns all customer request types from a service desk.
	//
	// GET /rest/servicedeskapi/servicedesk/{serviceDeskID}/requesttype
	//
	// https://docs.go-atlassian.io/jira-service-management-cloud/request/types#get-request-types
	Gets(ctx context.Context, serviceDeskID, groupID, start, limit int) (*model.ProjectRequestTypePageScheme, *model.ResponseScheme, error)

	// Create enables a customer request type to be added to a service desk based on an issue type.
	//
	// POST /rest/servicedeskapi/servicedesk/{serviceDeskID}/requesttype
	//
	// https://docs.go-atlassian.io/jira-service-management-cloud/request/types#create-request-type
	Create(ctx context.Context, serviceDeskID int, payload *model.RequestTypePayloadScheme) (*model.RequestTypeScheme, *model.ResponseScheme, error)

	// Get returns a customer request type from a service desk.
	//
	// GET /rest/servicedeskapi/servicedesk/{serviceDeskID}/requesttype/{requestTypeID}
	//
	// https://docs.go-atlassian.io/jira-service-management-cloud/request/types#get-request-type-by-id
	Get(ctx context.Context, serviceDeskID, requestTypeID int) (*model.RequestTypeScheme, *model.ResponseScheme, error)

	// Delete deletes a customer request type from a service desk, and removes it from all customer requests.
	//
	// DELETE /rest/servicedeskapi/servicedesk/{serviceDeskID}/requesttype/{requestTypeID}
	//
	// https://docs.go-atlassian.io/jira-service-management-cloud/request/types#delete-request-type
	Delete(ctx context.Context, serviceDeskID, requestTypeID int) (*model.ResponseScheme, error)

	// Fields returns the fields for a service desk's customer request type.
	//
	// GET /rest/servicedeskapi/servicedesk/{serviceDeskID}/requesttype/{requestTypeID}/field
	//
	// https://docs.go-atlassian.io/jira-service-management-cloud/request/types#get-request-type-fields
	Fields(ctx context.Context, serviceDeskID, requestTypeID int) (*model.RequestTypeFieldsScheme, *model.ResponseScheme, error)

	// Groups returns the groups for a service desk's customer request types.
	//
	// GET /rest/servicedeskapi/servicedesk/{serviceDeskID}/requesttypegroup
	//
	// https://docs.go-atlassian.io/jira-service-management-cloud/request/types#get-request-type-groups
	Groups(ctx context.Context, serviceDeskID int) (*model.RequestTypeGroupPageScheme, *model.ResponseScheme, error)
}

type WorkSpaceConnector

type WorkSpaceConnector interface {

	// Gets retrieves workspace assets
	//
	// This endpoint is used to fetch the assets associated with a workspace.
	//
	// These assets may include knowledge base articles, request types, request fields, customer portals, queues, etc.
	//
	// GET /rest/servicedeskapi/assets/workspace
	//
	// https://docs.go-atlassian.io/jira-service-management/workspaces#get-workspaces
	Gets(ctx context.Context) (*models.WorkSpacePageScheme, *models.ResponseScheme, error)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL