diff --git a/admin/api_client_impl.go b/admin/api_client_impl.go index 7231b581..7e9ec459 100644 --- a/admin/api_client_impl.go +++ b/admin/api_client_impl.go @@ -15,58 +15,79 @@ import ( const defaultApiEndpoint = "https://api.atlassian.com/" +// New creates a new instance of Client. +// It takes a common.HttpClient as input and returns a pointer to Client and an error. func New(httpClient common.HttpClient) (*Client, error) { + // If no HTTP client is provided, use the default HTTP client. if httpClient == nil { httpClient = http.DefaultClient } + // Parse the default API endpoint URL. u, err := url.Parse(defaultApiEndpoint) if err != nil { return nil, err } + // Initialize the Client struct with the provided HTTP client and parsed URL. client := &Client{ HTTP: httpClient, Site: u, } + // Initialize the Authentication service. client.Auth = internal.NewAuthenticationService(client) + // Initialize the SCIM service with user, group, and schema services. client.SCIM = &internal.SCIMService{ User: internal.NewSCIMUserService(client), Group: internal.NewSCIMGroupService(client), Schema: internal.NewSCIMSchemaService(client), } + // Initialize the Organization service with policy and directory services. client.Organization = internal.NewOrganizationService( client, internal.NewOrganizationPolicyService(client), internal.NewOrganizationDirectoryService(client)) + // Initialize the User service with a user token service. client.User = internal.NewUserService(client, internal.NewUserTokenService(client)) return client, nil } +// Client represents a client for interacting with the Atlassian Administration API. type Client struct { - HTTP common.HttpClient - Site *url.URL - Auth common.Authentication + // HTTP is the HTTP client used for making requests. + HTTP common.HttpClient + // Site is the base URL for the API. + Site *url.URL + // Auth is the authentication service. + Auth common.Authentication + // Organization is the service for organization-related operations. Organization *internal.OrganizationService - User *internal.UserService - SCIM *internal.SCIMService + // User is the service for user-related operations. + User *internal.UserService + // SCIM is the service for SCIM-related operations. + SCIM *internal.SCIMService } +// NewRequest creates a new HTTP request with the given context, method, URL string, content type, and body. +// It returns an HTTP request and an error. func (c *Client) NewRequest(ctx context.Context, method, urlStr, type_ string, body interface{}) (*http.Request, error) { + // Parse the relative URL. rel, err := url.Parse(urlStr) if err != nil { return nil, err } + // Resolve the relative URL to an absolute URL. u := c.Site.ResolveReference(rel) + // Encode the body to JSON if provided. buf := new(bytes.Buffer) if body != nil { if err = json.NewEncoder(buf).Encode(body); err != nil { @@ -74,12 +95,14 @@ func (c *Client) NewRequest(ctx context.Context, method, urlStr, type_ string, b } } + // Create a new HTTP request with the given context, method, and URL. req, err := http.NewRequestWithContext(ctx, method, u.String(), buf) if err != nil { return nil, err } req.Header.Set("Accept", "application/json") + // Set the Content-Type header if a body is provided. if body != nil && type_ == "" { req.Header.Set("Content-Type", "application/json") } @@ -88,10 +111,12 @@ func (c *Client) NewRequest(ctx context.Context, method, urlStr, type_ string, b req.Header.Set("Content-Type", type_) } + // Add the Authorization header if a bearer token is available. if c.Auth.GetBearerToken() != "" { req.Header.Add("Authorization", fmt.Sprintf("Bearer %v", c.Auth.GetBearerToken())) } + // Set the User-Agent header if available. if c.Auth.HasUserAgent() { req.Header.Set("User-Agent", c.Auth.GetUserAgent()) } @@ -99,13 +124,18 @@ func (c *Client) NewRequest(ctx context.Context, method, urlStr, type_ string, b return req, nil } +// Call sends an HTTP request and processes the response. +// It takes an *http.Request and a structure to unmarshal the response into. +// It returns a pointer to model.ResponseScheme and an error. func (c *Client) Call(request *http.Request, structure interface{}) (*model.ResponseScheme, error) { + // Perform the HTTP request. response, err := c.HTTP.Do(request) if err != nil { return nil, err } + // Process the HTTP response. return c.processResponse(response, structure) } diff --git a/admin/internal/authentication_impl.go b/admin/internal/authentication_impl.go index 2bbe9ab8..7f164434 100644 --- a/admin/internal/authentication_impl.go +++ b/admin/internal/authentication_impl.go @@ -5,57 +5,75 @@ import ( "github.com/ctreminiom/go-atlassian/service/common" ) +// NewAuthenticationService creates a new instance of AuthenticationService. +// It takes a service.Connector as input and returns a common.Authentication interface. func NewAuthenticationService(client service.Connector) common.Authentication { return &AuthenticationService{c: client} } +// AuthenticationService provides methods for setting and getting authentication details. type AuthenticationService struct { c service.Connector + // basicAuthProvided indicates if basic authentication details have been provided. basicAuthProvided bool - mail, token string + // mail is the email address used for basic authentication. + // token is the token used for basic authentication. + mail, token string + // userAgentProvided indicates if a user agent has been provided. userAgentProvided bool - agent string + // agent is the user agent string. + agent string } +// SetBearerToken sets the bearer token for authentication. func (a *AuthenticationService) SetBearerToken(token string) { a.token = token } +// GetBearerToken returns the bearer token used for authentication. func (a *AuthenticationService) GetBearerToken() string { return a.token } + +// SetExperimentalFlag is a placeholder method for setting an experimental flag. func (a *AuthenticationService) SetExperimentalFlag() {} +// HasSetExperimentalFlag is a placeholder method that returns false. func (a *AuthenticationService) HasSetExperimentalFlag() bool { return false } +// SetBasicAuth sets the email and token for basic authentication. func (a *AuthenticationService) SetBasicAuth(mail, token string) { a.mail = mail a.token = token - a.basicAuthProvided = true } +// GetBasicAuth returns the email and token used for basic authentication. func (a *AuthenticationService) GetBasicAuth() (string, string) { return a.mail, a.token } +// HasBasicAuth returns true if basic authentication details have been provided. func (a *AuthenticationService) HasBasicAuth() bool { return a.basicAuthProvided } +// SetUserAgent sets the user agent string. func (a *AuthenticationService) SetUserAgent(agent string) { a.agent = agent a.userAgentProvided = true } +// GetUserAgent returns the user agent string. func (a *AuthenticationService) GetUserAgent() string { return a.agent } +// HasUserAgent returns true if a user agent has been provided. func (a *AuthenticationService) HasUserAgent() bool { return a.userAgentProvided } diff --git a/admin/internal/organization_directory_impl.go b/admin/internal/organization_directory_impl.go index a82e7dd0..62ac4eb7 100644 --- a/admin/internal/organization_directory_impl.go +++ b/admin/internal/organization_directory_impl.go @@ -9,11 +9,15 @@ import ( "net/http" ) +// NewOrganizationDirectoryService creates a new instance of OrganizationDirectoryService. +// It takes a service.Connector as input and returns a pointer to OrganizationDirectoryService. func NewOrganizationDirectoryService(client service.Connector) *OrganizationDirectoryService { return &OrganizationDirectoryService{internalClient: &internalOrganizationDirectoryServiceImpl{c: client}} } +// OrganizationDirectoryService provides methods to interact with the organization directory in Atlassian Administration. type OrganizationDirectoryService struct { + // internalClient is the connector interface for organization directory operations. internalClient admin.OrganizationDirectoryConnector } diff --git a/admin/internal/organization_policy_impl.go b/admin/internal/organization_policy_impl.go index 6d0a33db..6fc2d6b8 100644 --- a/admin/internal/organization_policy_impl.go +++ b/admin/internal/organization_policy_impl.go @@ -11,11 +11,15 @@ import ( "strings" ) +// NewOrganizationPolicyService creates a new instance of OrganizationPolicyService. +// It takes a service.Connector as input and returns a pointer to OrganizationPolicyService. func NewOrganizationPolicyService(client service.Connector) *OrganizationPolicyService { return &OrganizationPolicyService{internalClient: &internalOrganizationPolicyImpl{c: client}} } +// OrganizationPolicyService provides methods to interact with organization policies in Atlassian Administration. type OrganizationPolicyService struct { + // internalClient is the connector interface for organization policy operations. internalClient admin.OrganizationPolicyConnector } diff --git a/admin/internal/scim_group_impl.go b/admin/internal/scim_group_impl.go index f5a4ea7c..64cd3911 100644 --- a/admin/internal/scim_group_impl.go +++ b/admin/internal/scim_group_impl.go @@ -11,11 +11,15 @@ import ( "strconv" ) +// NewSCIMGroupService creates a new instance of SCIMGroupService. +// It takes a service.Connector as input and returns a pointer to SCIMGroupService. func NewSCIMGroupService(client service.Connector) *SCIMGroupService { return &SCIMGroupService{internalClient: &internalSCIMGroupImpl{c: client}} } +// SCIMGroupService provides methods to interact with SCIM groups in Atlassian Administration. type SCIMGroupService struct { + // internalClient is the connector interface for SCIM group operations. internalClient admin.SCIMGroupConnector } diff --git a/admin/internal/scim_impl.go b/admin/internal/scim_impl.go index a77312fb..a17ab5a5 100644 --- a/admin/internal/scim_impl.go +++ b/admin/internal/scim_impl.go @@ -1,7 +1,17 @@ package internal +// SCIMService encapsulates various SCIM-related services within a single structure. +// It provides a convenient way to access and manage different SCIM functionalities. type SCIMService struct { - User *SCIMUserService - Group *SCIMGroupService + // User is a pointer to an instance of SCIMUserService. + // It handles operations related to SCIM users. + User *SCIMUserService + + // Group is a pointer to an instance of SCIMGroupService. + // It manages SCIM group operations. + Group *SCIMGroupService + + // Schema is a pointer to an instance of SCIMSchemaService. + // It deals with SCIM schema operations. Schema *SCIMSchemaService } diff --git a/admin/internal/scim_schema_impl.go b/admin/internal/scim_schema_impl.go index 01ad1cef..2e52420a 100644 --- a/admin/internal/scim_schema_impl.go +++ b/admin/internal/scim_schema_impl.go @@ -9,11 +9,15 @@ import ( "net/http" ) +// NewSCIMSchemaService creates a new instance of SCIMSchemaService. +// It takes a service.Connector as input and returns a pointer to SCIMSchemaService. func NewSCIMSchemaService(client service.Connector) *SCIMSchemaService { return &SCIMSchemaService{internalClient: &internalSCIMSchemaImpl{c: client}} } +// SCIMSchemaService provides methods to interact with SCIM schemas in Atlassian Administration. type SCIMSchemaService struct { + // internalClient is the connector interface for SCIM schema operations. internalClient admin.SCIMSchemaConnector } diff --git a/admin/internal/scim_user_impl.go b/admin/internal/scim_user_impl.go index fbe21fdf..8b927869 100644 --- a/admin/internal/scim_user_impl.go +++ b/admin/internal/scim_user_impl.go @@ -12,11 +12,15 @@ import ( "strings" ) +// NewSCIMUserService creates a new instance of SCIMUserService. +// It takes a service.Connector as input and returns a pointer to SCIMUserService. func NewSCIMUserService(client service.Connector) *SCIMUserService { return &SCIMUserService{internalClient: &internalSCIMUserImpl{c: client}} } +// SCIMUserService provides methods to interact with SCIM users in Atlassian Administration. type SCIMUserService struct { + // internalClient is the connector interface for SCIM user operations. internalClient admin.SCIMUserConnector } diff --git a/admin/internal/user_impl.go b/admin/internal/user_impl.go index cbdda8f5..9017553d 100644 --- a/admin/internal/user_impl.go +++ b/admin/internal/user_impl.go @@ -11,6 +11,8 @@ import ( "strings" ) +// NewUserService creates a new instance of UserService. +// It takes a service.Connector and a UserTokenService as inputs and returns a pointer to UserService. func NewUserService(client service.Connector, token *UserTokenService) *UserService { return &UserService{ internalClient: &internalUserImpl{c: client}, @@ -18,9 +20,12 @@ func NewUserService(client service.Connector, token *UserTokenService) *UserServ } } +// UserService provides methods to interact with user-related operations in Atlassian Administration. type UserService struct { + // internalClient is the connector interface for user operations. internalClient admin.UserConnector - Token *UserTokenService + // Token is a service for managing user tokens. + Token *UserTokenService } // Permissions returns the set of permissions you have for managing the specified Atlassian account diff --git a/admin/internal/user_token_impl.go b/admin/internal/user_token_impl.go index fec69061..4dcfd730 100644 --- a/admin/internal/user_token_impl.go +++ b/admin/internal/user_token_impl.go @@ -9,11 +9,15 @@ import ( "net/http" ) +// NewUserTokenService creates a new instance of UserTokenService. +// It takes a service.Connector as input and returns a pointer to UserTokenService. func NewUserTokenService(client service.Connector) *UserTokenService { return &UserTokenService{internalClient: &internalUserTokenImpl{c: client}} } +// UserTokenService provides methods to interact with user token operations in Atlassian Administration. type UserTokenService struct { + // internalClient is the connector interface for user token operations. internalClient admin.UserTokenConnector } diff --git a/assets/api_client_impl.go b/assets/api_client_impl.go index b9bd7f97..f4c7b509 100644 --- a/assets/api_client_impl.go +++ b/assets/api_client_impl.go @@ -14,29 +14,36 @@ import ( const DefaultAssetsSite = "https://api.atlassian.com/" +// New creates a new instance of Client. +// It takes a common.HttpClient and a site URL as inputs and returns a pointer to Client and an error. func New(httpClient common.HttpClient, site string) (*Client, error) { + // If no HTTP client is provided, use the default HTTP client. if httpClient == nil { httpClient = http.DefaultClient } + // If no site URL is provided, use the default assets site URL. if site == "" { site = DefaultAssetsSite } + // Parse the site URL. u, err := url.Parse(site) if err != nil { return nil, err } + // Initialize the Client struct with the provided HTTP client and parsed URL. client := &Client{ HTTP: httpClient, Site: u, } + // Initialize the Authentication service. client.Auth = internal.NewAuthenticationService(client) - // Assets services + // Initialize the Assets services. client.AQL = internal.NewAQLService(client) client.Icon = internal.NewIconService(client) client.Object = internal.NewObjectService(client) @@ -47,27 +54,42 @@ func New(httpClient common.HttpClient, site string) (*Client, error) { return client, nil } +// Client represents a client for interacting with the Atlassian Assets API. type Client struct { - HTTP common.HttpClient - Site *url.URL - Auth common.Authentication - AQL *internal.AQLService - Icon *internal.IconService - Object *internal.ObjectService - ObjectSchema *internal.ObjectSchemaService - ObjectType *internal.ObjectTypeService + // HTTP is the HTTP client used for making requests. + HTTP common.HttpClient + // Site is the base URL for the API. + Site *url.URL + // Auth is the authentication service. + Auth common.Authentication + // AQL is the service for AQL-related operations. + AQL *internal.AQLService + // Icon is the service for icon-related operations. + Icon *internal.IconService + // Object is the service for object-related operations. + Object *internal.ObjectService + // ObjectSchema is the service for object schema-related operations. + ObjectSchema *internal.ObjectSchemaService + // ObjectType is the service for object type-related operations. + ObjectType *internal.ObjectTypeService + // ObjectTypeAttribute is the service for object type attribute-related operations. ObjectTypeAttribute *internal.ObjectTypeAttributeService } +// NewRequest creates a new HTTP request with the given context, method, URL string, content type, and body. +// It returns an HTTP request and an error. func (c *Client) NewRequest(ctx context.Context, method, urlStr, type_ string, body interface{}) (*http.Request, error) { + // Parse the relative URL. rel, err := url.Parse(urlStr) if err != nil { return nil, err } + // Resolve the relative URL to an absolute URL. u := c.Site.ResolveReference(rel) + // Encode the body to JSON if provided. buf := new(bytes.Buffer) if body != nil { if err = json.NewEncoder(buf).Encode(body); err != nil { @@ -75,12 +97,14 @@ func (c *Client) NewRequest(ctx context.Context, method, urlStr, type_ string, b } } + // Create a new HTTP request with the given context, method, and URL. req, err := http.NewRequestWithContext(ctx, method, u.String(), buf) if err != nil { return nil, err } req.Header.Set("Accept", "application/json") + // Set the Content-Type header if a body is provided. if body != nil && type_ == "" { req.Header.Set("Content-Type", "application/json") } @@ -89,10 +113,12 @@ func (c *Client) NewRequest(ctx context.Context, method, urlStr, type_ string, b req.Header.Set("Content-Type", type_) } + // Add the Basic Authentication header if available. if c.Auth.HasBasicAuth() { req.SetBasicAuth(c.Auth.GetBasicAuth()) } + // Set the User-Agent header if available. if c.Auth.HasUserAgent() { req.Header.Set("User-Agent", c.Auth.GetUserAgent()) } @@ -100,13 +126,18 @@ func (c *Client) NewRequest(ctx context.Context, method, urlStr, type_ string, b return req, nil } +// Call sends an HTTP request and processes the response. +// It takes an *http.Request and a structure to unmarshal the response into. +// It returns a pointer to model.ResponseScheme and an error. func (c *Client) Call(request *http.Request, structure interface{}) (*model.ResponseScheme, error) { + // Perform the HTTP request. response, err := c.HTTP.Do(request) if err != nil { return nil, err } + // Process the HTTP response. return c.processResponse(response, structure) } diff --git a/assets/internal/aql_impl.go b/assets/internal/aql_impl.go index 1f93c12e..c6f8fc2c 100644 --- a/assets/internal/aql_impl.go +++ b/assets/internal/aql_impl.go @@ -12,14 +12,17 @@ import ( "strings" ) +// NewAQLService creates a new instance of AQLService. +// It takes a service.Connector as input and returns a pointer to AQLService. func NewAQLService(client service.Connector) *AQLService { - return &AQLService{ internalClient: &internalAQLImpl{c: client}, } } +// AQLService provides methods to interact with the Assets Query Language (AQL) in Jira. type AQLService struct { + // internalClient is the connector interface for AQL operations. internalClient assets.AQLAssetConnector } diff --git a/assets/internal/authentication_impl.go b/assets/internal/authentication_impl.go index 2bbe9ab8..7f164434 100644 --- a/assets/internal/authentication_impl.go +++ b/assets/internal/authentication_impl.go @@ -5,57 +5,75 @@ import ( "github.com/ctreminiom/go-atlassian/service/common" ) +// NewAuthenticationService creates a new instance of AuthenticationService. +// It takes a service.Connector as input and returns a common.Authentication interface. func NewAuthenticationService(client service.Connector) common.Authentication { return &AuthenticationService{c: client} } +// AuthenticationService provides methods for setting and getting authentication details. type AuthenticationService struct { c service.Connector + // basicAuthProvided indicates if basic authentication details have been provided. basicAuthProvided bool - mail, token string + // mail is the email address used for basic authentication. + // token is the token used for basic authentication. + mail, token string + // userAgentProvided indicates if a user agent has been provided. userAgentProvided bool - agent string + // agent is the user agent string. + agent string } +// SetBearerToken sets the bearer token for authentication. func (a *AuthenticationService) SetBearerToken(token string) { a.token = token } +// GetBearerToken returns the bearer token used for authentication. func (a *AuthenticationService) GetBearerToken() string { return a.token } + +// SetExperimentalFlag is a placeholder method for setting an experimental flag. func (a *AuthenticationService) SetExperimentalFlag() {} +// HasSetExperimentalFlag is a placeholder method that returns false. func (a *AuthenticationService) HasSetExperimentalFlag() bool { return false } +// SetBasicAuth sets the email and token for basic authentication. func (a *AuthenticationService) SetBasicAuth(mail, token string) { a.mail = mail a.token = token - a.basicAuthProvided = true } +// GetBasicAuth returns the email and token used for basic authentication. func (a *AuthenticationService) GetBasicAuth() (string, string) { return a.mail, a.token } +// HasBasicAuth returns true if basic authentication details have been provided. func (a *AuthenticationService) HasBasicAuth() bool { return a.basicAuthProvided } +// SetUserAgent sets the user agent string. func (a *AuthenticationService) SetUserAgent(agent string) { a.agent = agent a.userAgentProvided = true } +// GetUserAgent returns the user agent string. func (a *AuthenticationService) GetUserAgent() string { return a.agent } +// HasUserAgent returns true if a user agent has been provided. func (a *AuthenticationService) HasUserAgent() bool { return a.userAgentProvided } diff --git a/assets/internal/icon_impl.go b/assets/internal/icon_impl.go index b97eb709..8d7c1fd1 100644 --- a/assets/internal/icon_impl.go +++ b/assets/internal/icon_impl.go @@ -9,14 +9,17 @@ import ( "net/http" ) +// NewIconService creates a new instance of IconService. +// It takes a service.Connector as input and returns a pointer to IconService. func NewIconService(client service.Connector) *IconService { - return &IconService{ internalClient: &internalIconImpl{c: client}, } } +// IconService provides methods to interact with asset icons in Jira. type IconService struct { + // internalClient is the connector interface for icon operations. internalClient assets.IconConnector } diff --git a/assets/internal/object_impl.go b/assets/internal/object_impl.go index fa5494f7..03c108c5 100644 --- a/assets/internal/object_impl.go +++ b/assets/internal/object_impl.go @@ -12,14 +12,17 @@ import ( "strings" ) +// NewObjectService creates a new instance of ObjectService. +// It takes a service.Connector as input and returns a pointer to ObjectService. func NewObjectService(client service.Connector) *ObjectService { - return &ObjectService{ internalClient: &internalObjectImpl{c: client}, } } +// ObjectService provides methods to interact with objects in Jira Assets. type ObjectService struct { + // internalClient is the connector interface for object operations. internalClient assets.ObjectConnector } diff --git a/assets/internal/object_schema_impl.go b/assets/internal/object_schema_impl.go index db3c4f3b..db196187 100644 --- a/assets/internal/object_schema_impl.go +++ b/assets/internal/object_schema_impl.go @@ -11,14 +11,17 @@ import ( "strings" ) +// NewObjectSchemaService creates a new instance of ObjectSchemaService. +// It takes a service.Connector as input and returns a pointer to ObjectSchemaService. func NewObjectSchemaService(client service.Connector) *ObjectSchemaService { - return &ObjectSchemaService{ internalClient: &internalObjectSchemaImpl{c: client}, } } +// ObjectSchemaService provides methods to interact with object schemas in Jira Assets. type ObjectSchemaService struct { + // internalClient is the connector interface for object schema operations. internalClient assets.ObjectSchemaConnector } diff --git a/assets/internal/object_type_attribute_impl.go b/assets/internal/object_type_attribute_impl.go index 0b6b8cca..80ed4a04 100644 --- a/assets/internal/object_type_attribute_impl.go +++ b/assets/internal/object_type_attribute_impl.go @@ -9,14 +9,17 @@ import ( "net/http" ) +// NewObjectTypeAttributeService creates a new instance of ObjectTypeAttributeService. +// It takes a service.Connector as input and returns a pointer to ObjectTypeAttributeService. func NewObjectTypeAttributeService(client service.Connector) *ObjectTypeAttributeService { - return &ObjectTypeAttributeService{ internalClient: &internalObjectTypeAttributeImpl{c: client}, } } +// ObjectTypeAttributeService provides methods to interact with object type attributes in Jira Assets. type ObjectTypeAttributeService struct { + // internalClient is the connector interface for object type attribute operations. internalClient assets.ObjectTypeAttributeConnector } diff --git a/assets/internal/object_type_impl.go b/assets/internal/object_type_impl.go index 53319d55..6b41df0e 100644 --- a/assets/internal/object_type_impl.go +++ b/assets/internal/object_type_impl.go @@ -11,14 +11,17 @@ import ( "strings" ) +// NewObjectTypeService creates a new instance of ObjectTypeService. +// It takes a service.Connector as input and returns a pointer to ObjectTypeService. func NewObjectTypeService(client service.Connector) *ObjectTypeService { - return &ObjectTypeService{ internalClient: &internalObjectTypeImpl{c: client}, } } +// ObjectTypeService provides methods to interact with object types in Jira Assets. type ObjectTypeService struct { + // internalClient is the connector interface for object type operations. internalClient assets.ObjectTypeConnector } diff --git a/bitbucket/internal/workspace_impl.go b/bitbucket/internal/workspace_impl.go index 1225eb1f..9ac9facc 100644 --- a/bitbucket/internal/workspace_impl.go +++ b/bitbucket/internal/workspace_impl.go @@ -116,17 +116,17 @@ func (i *internalWorkspaceServiceImpl) Members(ctx context.Context, workspace st } // Membership returns the workspace membership. -func (i *internalWorkspaceServiceImpl) Membership(ctx context.Context, workspace, memberId string) (*model.WorkspaceMembershipScheme, *model.ResponseScheme, error) { +func (i *internalWorkspaceServiceImpl) Membership(ctx context.Context, workspace, memberID string) (*model.WorkspaceMembershipScheme, *model.ResponseScheme, error) { if workspace == "" { return nil, nil, model.ErrNoWorkspaceError } - if memberId == "" { + if memberID == "" { return nil, nil, model.ErrNoMemberIDError } - endpoint := fmt.Sprintf("2.0/workspaces/%v/members/%v", workspace, memberId) + endpoint := fmt.Sprintf("2.0/workspaces/%v/members/%v", workspace, memberID) request, err := i.c.NewRequest(ctx, http.MethodGet, endpoint, "", nil) if err != nil { diff --git a/bitbucket/internal/workspace_permissions_impl.go b/bitbucket/internal/workspace_permissions_impl.go index 8b20034f..d4da8d85 100644 --- a/bitbucket/internal/workspace_permissions_impl.go +++ b/bitbucket/internal/workspace_permissions_impl.go @@ -11,6 +11,8 @@ import ( "strings" ) +// NewWorkspacePermissionService creates a new WorkspacePermissionService instance. +// It takes a service.Connector as input and returns a pointer to WorkspacePermissionService. func NewWorkspacePermissionService(client service.Connector) *WorkspacePermissionService { return &WorkspacePermissionService{ @@ -18,6 +20,7 @@ func NewWorkspacePermissionService(client service.Connector) *WorkspacePermissio } } +// WorkspacePermissionService provides methods to interact with workspace permissions in Bitbucket. type WorkspacePermissionService struct { internalClient bitbucket.WorkspacePermissionConnector } diff --git a/confluence/internal/analytics_impl.go b/confluence/internal/analytics_impl.go index b1b725e2..db0514b9 100644 --- a/confluence/internal/analytics_impl.go +++ b/confluence/internal/analytics_impl.go @@ -11,14 +11,17 @@ import ( "strings" ) +// NewAnalyticsService creates a new instance of AnalyticsService. +// It takes a service.Connector as input and returns a pointer to AnalyticsService. func NewAnalyticsService(client service.Connector) *AnalyticsService { - return &AnalyticsService{ internalClient: &internalAnalyticsServiceImpl{c: client}, } } +// AnalyticsService provides methods to interact with analytics operations in Confluence. type AnalyticsService struct { + // internalClient is the connector interface for analytics operations. internalClient confluence.AnalyticsConnector } @@ -27,8 +30,8 @@ type AnalyticsService struct { // GET /wiki/rest/api/analytics/content/{contentId}/views // // https://docs.go-atlassian.io/confluence-cloud/analytics#get-views -func (a *AnalyticsService) Get(ctx context.Context, contentId, fromDate string) (*model.ContentViewScheme, *model.ResponseScheme, error) { - return a.internalClient.Get(ctx, contentId, fromDate) +func (a *AnalyticsService) Get(ctx context.Context, contentID, fromDate string) (*model.ContentViewScheme, *model.ResponseScheme, error) { + return a.internalClient.Get(ctx, contentID, fromDate) } // Distinct get the total number of distinct viewers a piece of content has. @@ -36,22 +39,22 @@ func (a *AnalyticsService) Get(ctx context.Context, contentId, fromDate string) // GET /wiki/rest/api/analytics/content/{contentId}/viewers // // https://docs.go-atlassian.io/confluence-cloud/analytics#get-viewers -func (a *AnalyticsService) Distinct(ctx context.Context, contentId, fromDate string) (*model.ContentViewScheme, *model.ResponseScheme, error) { - return a.internalClient.Distinct(ctx, contentId, fromDate) +func (a *AnalyticsService) Distinct(ctx context.Context, contentID, fromDate string) (*model.ContentViewScheme, *model.ResponseScheme, error) { + return a.internalClient.Distinct(ctx, contentID, fromDate) } type internalAnalyticsServiceImpl struct { c service.Connector } -func (i *internalAnalyticsServiceImpl) Get(ctx context.Context, contentId, fromDate string) (*model.ContentViewScheme, *model.ResponseScheme, error) { +func (i *internalAnalyticsServiceImpl) Get(ctx context.Context, contentID, fromDate string) (*model.ContentViewScheme, *model.ResponseScheme, error) { - if contentId == "" { + if contentID == "" { return nil, nil, model.ErrNoContentIDError } var endpoint strings.Builder - endpoint.WriteString(fmt.Sprintf("wiki/rest/api/analytics/content/%v/views", contentId)) + endpoint.WriteString(fmt.Sprintf("wiki/rest/api/analytics/content/%v/views", contentID)) if fromDate != "" { query := url.Values{} @@ -74,14 +77,14 @@ func (i *internalAnalyticsServiceImpl) Get(ctx context.Context, contentId, fromD return views, response, nil } -func (i *internalAnalyticsServiceImpl) Distinct(ctx context.Context, contentId, fromDate string) (*model.ContentViewScheme, *model.ResponseScheme, error) { +func (i *internalAnalyticsServiceImpl) Distinct(ctx context.Context, contentID, fromDate string) (*model.ContentViewScheme, *model.ResponseScheme, error) { - if contentId == "" { + if contentID == "" { return nil, nil, model.ErrNoContentIDError } var endpoint strings.Builder - endpoint.WriteString(fmt.Sprintf("wiki/rest/api/analytics/content/%v/viewers", contentId)) + endpoint.WriteString(fmt.Sprintf("wiki/rest/api/analytics/content/%v/viewers", contentID)) if fromDate != "" { query := url.Values{} diff --git a/confluence/internal/attachment_content_impl.go b/confluence/internal/attachment_content_impl.go index d3d64c2c..eb23d9e7 100644 --- a/confluence/internal/attachment_content_impl.go +++ b/confluence/internal/attachment_content_impl.go @@ -15,6 +15,8 @@ import ( "strings" ) +// NewContentAttachmentService creates a new instance of ContentAttachmentService. +// It takes a service.Connector as input and returns a pointer to ContentAttachmentService. func NewContentAttachmentService(client service.Connector) *ContentAttachmentService { return &ContentAttachmentService{ @@ -22,7 +24,9 @@ func NewContentAttachmentService(client service.Connector) *ContentAttachmentSer } } +// ContentAttachmentService provides methods to interact with content attachment operations in Confluence. type ContentAttachmentService struct { + // internalClient is the connector interface for content attachment operations. internalClient confluence.ContentAttachmentConnector } diff --git a/confluence/internal/attachment_impl.go b/confluence/internal/attachment_impl.go index c71e9a37..53e3915e 100644 --- a/confluence/internal/attachment_impl.go +++ b/confluence/internal/attachment_impl.go @@ -12,7 +12,8 @@ import ( "strings" ) -// NewAttachmentService returns a new Confluence V2 Page service +// NewAttachmentService creates a new instance of AttachmentService. +// It takes a service.Connector and an AttachmentVersionService as inputs and returns a pointer to AttachmentService. func NewAttachmentService(client service.Connector, version *AttachmentVersionService) *AttachmentService { return &AttachmentService{ internalClient: &internalAttachmentImpl{c: client}, @@ -20,9 +21,12 @@ func NewAttachmentService(client service.Connector, version *AttachmentVersionSe } } +// AttachmentService provides methods to interact with attachment operations in Confluence. type AttachmentService struct { + // internalClient is the connector interface for attachment operations. internalClient confluence.AttachmentConnector - Version *AttachmentVersionService + // Version is the service for attachment version-related operations. + Version *AttachmentVersionService } // Get returns a specific attachment. diff --git a/confluence/internal/attachment_version_impl.go b/confluence/internal/attachment_version_impl.go index b344d8ff..8e02cd1a 100644 --- a/confluence/internal/attachment_version_impl.go +++ b/confluence/internal/attachment_version_impl.go @@ -11,14 +11,17 @@ import ( "strconv" ) -// NewAttachmentVersionService returns a new Confluence V2 Attachment Version service +// NewAttachmentVersionService creates a new instance of AttachmentVersionService. +// It takes a service.Connector as input and returns a pointer to AttachmentVersionService. func NewAttachmentVersionService(client service.Connector) *AttachmentVersionService { return &AttachmentVersionService{ internalClient: &internalAttachmentVersionImpl{c: client}, } } +// AttachmentVersionService provides methods to interact with attachment version operations in Confluence. type AttachmentVersionService struct { + // internalClient is the connector interface for attachment version operations. internalClient confluence.AttachmentVersionConnector } diff --git a/confluence/internal/authentication_impl.go b/confluence/internal/authentication_impl.go index 2bbe9ab8..1b9e8462 100644 --- a/confluence/internal/authentication_impl.go +++ b/confluence/internal/authentication_impl.go @@ -5,57 +5,77 @@ import ( "github.com/ctreminiom/go-atlassian/service/common" ) +// NewAuthenticationService creates a new instance of AuthenticationService. +// It takes a service.Connector as input and returns a common.Authentication interface. func NewAuthenticationService(client service.Connector) common.Authentication { return &AuthenticationService{c: client} } +// AuthenticationService provides methods to interact with authentication operations. type AuthenticationService struct { + // c is the connector interface for authentication operations. c service.Connector + // basicAuthProvided indicates if basic authentication has been provided. basicAuthProvided bool - mail, token string + // mail is the email used for basic authentication. + mail string + // token is the token used for basic authentication. + token string + // userAgentProvided indicates if a user agent has been provided. userAgentProvided bool - agent string + // agent is the user agent string. + agent string } +// SetBearerToken sets the bearer token for authentication. func (a *AuthenticationService) SetBearerToken(token string) { a.token = token } +// GetBearerToken returns the bearer token used for authentication. func (a *AuthenticationService) GetBearerToken() string { return a.token } + +// SetExperimentalFlag is a placeholder method for setting an experimental flag. func (a *AuthenticationService) SetExperimentalFlag() {} +// HasSetExperimentalFlag is a placeholder method that returns false. func (a *AuthenticationService) HasSetExperimentalFlag() bool { return false } +// SetBasicAuth sets the basic authentication credentials. func (a *AuthenticationService) SetBasicAuth(mail, token string) { a.mail = mail a.token = token - a.basicAuthProvided = true } +// GetBasicAuth returns the basic authentication credentials. func (a *AuthenticationService) GetBasicAuth() (string, string) { return a.mail, a.token } +// HasBasicAuth returns true if basic authentication has been provided. func (a *AuthenticationService) HasBasicAuth() bool { return a.basicAuthProvided } +// SetUserAgent sets the user agent string. func (a *AuthenticationService) SetUserAgent(agent string) { a.agent = agent a.userAgentProvided = true } +// GetUserAgent returns the user agent string. func (a *AuthenticationService) GetUserAgent() string { return a.agent } +// HasUserAgent returns true if a user agent has been provided. func (a *AuthenticationService) HasUserAgent() bool { return a.userAgentProvided } diff --git a/confluence/internal/children_descendants_content_impl.go b/confluence/internal/children_descendants_content_impl.go index da46d8ec..8744ba03 100644 --- a/confluence/internal/children_descendants_content_impl.go +++ b/confluence/internal/children_descendants_content_impl.go @@ -12,14 +12,16 @@ import ( "strings" ) +// NewChildrenDescandantsService creates a new instance of ChildrenDescandantsService. func NewChildrenDescandantsService(client service.Connector) *ChildrenDescandantsService { - return &ChildrenDescandantsService{ internalClient: &internalChildrenDescandantsImpl{c: client}, } } +// ChildrenDescandantsService provides methods to interact with children and descendants operations in Confluence. type ChildrenDescandantsService struct { + // internalClient is the connector interface for children and descendants operations. internalClient confluence.ChildrenDescendantConnector } diff --git a/confluence/internal/comment_content_impl.go b/confluence/internal/comment_content_impl.go index a55ce53c..a1dd7434 100644 --- a/confluence/internal/comment_content_impl.go +++ b/confluence/internal/comment_content_impl.go @@ -12,14 +12,17 @@ import ( "strings" ) +// NewCommentService creates a new instance of CommentService. +// It takes a service.Connector as input and returns a pointer to CommentService. func NewCommentService(client service.Connector) *CommentService { - return &CommentService{ internalClient: &internalCommentImpl{c: client}, } } +// CommentService provides methods to interact with comment operations in Confluence. type CommentService struct { + // internalClient is the connector interface for comment operations. internalClient confluence.CommentConnector } diff --git a/confluence/internal/content_impl.go b/confluence/internal/content_impl.go index 54fb304d..99ba9b8b 100644 --- a/confluence/internal/content_impl.go +++ b/confluence/internal/content_impl.go @@ -12,19 +12,29 @@ import ( "strings" ) +// ContentSubServices holds references to various sub-services related to content operations in Confluence. type ContentSubServices struct { - Attachment *ContentAttachmentService + // Attachment is the service for content attachment operations. + Attachment *ContentAttachmentService + // ChildrenDescendant is the service for children and descendants operations. ChildrenDescendant *ChildrenDescandantsService - Comment *CommentService - Permission *PermissionService - Label *ContentLabelService - Property *PropertyService - Restriction *RestrictionService - Version *VersionService + // Comment is the service for comment operations. + Comment *CommentService + // Permission is the service for permission operations. + Permission *PermissionService + // Label is the service for content label operations. + Label *ContentLabelService + // Property is the service for content property operations. + Property *PropertyService + // Restriction is the service for content restriction operations. + Restriction *RestrictionService + // Version is the service for content version operations. + Version *VersionService } +// NewContentService creates a new instance of ContentService. +// It takes a service.Connector and a ContentSubServices as inputs and returns a pointer to ContentService. func NewContentService(client service.Connector, subServices *ContentSubServices) *ContentService { - return &ContentService{ internalClient: &internalContentImpl{c: client}, Attachment: subServices.Attachment, @@ -38,16 +48,26 @@ func NewContentService(client service.Connector, subServices *ContentSubServices } } +// ContentService provides methods to interact with content operations in Confluence. type ContentService struct { - internalClient confluence.ContentConnector - Attachment *ContentAttachmentService + // internalClient is the connector interface for content operations. + internalClient confluence.ContentConnector + // Attachment is the service for content attachment operations. + Attachment *ContentAttachmentService + // ChildrenDescendant is the service for children and descendants operations. ChildrenDescendant *ChildrenDescandantsService - Comment *CommentService - Permission *PermissionService - Label *ContentLabelService - Property *PropertyService - Restriction *RestrictionService - Version *VersionService + // Comment is the service for comment operations. + Comment *CommentService + // Permission is the service for permission operations. + Permission *PermissionService + // Label is the service for content label operations. + Label *ContentLabelService + // Property is the service for content property operations. + Property *PropertyService + // Restriction is the service for content restriction operations. + Restriction *RestrictionService + // Version is the service for content version operations. + Version *VersionService } // Gets returns all content in a Confluence instance. diff --git a/confluence/internal/custom_content_impl.go b/confluence/internal/custom_content_impl.go index b5489ac9..15c94323 100644 --- a/confluence/internal/custom_content_impl.go +++ b/confluence/internal/custom_content_impl.go @@ -12,14 +12,17 @@ import ( "strings" ) +// NewCustomContentService creates a new instance of CustomContentService. +// It takes a service.Connector as input and returns a pointer to CustomContentService. func NewCustomContentService(client service.Connector) *CustomContentService { - return &CustomContentService{ internalClient: &internalCustomContentServiceImpl{c: client}, } } +// CustomContentService provides methods to interact with custom content operations in Confluence. type CustomContentService struct { + // internalClient is the connector interface for custom content operations. internalClient confluence.CustomContentConnector } diff --git a/confluence/internal/label_content_impl.go b/confluence/internal/label_content_impl.go index 1a726b75..213de82d 100644 --- a/confluence/internal/label_content_impl.go +++ b/confluence/internal/label_content_impl.go @@ -12,14 +12,17 @@ import ( "strings" ) +// NewContentLabelService creates a new instance of ContentLabelService. +// It takes a service.Connector as input and returns a pointer to ContentLabelService. func NewContentLabelService(client service.Connector) *ContentLabelService { - return &ContentLabelService{ internalClient: &internalContentLabelImpl{c: client}, } } +// ContentLabelService provides methods to interact with content label operations in Confluence. type ContentLabelService struct { + // internalClient is the connector interface for label operations. internalClient confluence.LabelsConnector } diff --git a/confluence/internal/label_impl.go b/confluence/internal/label_impl.go index a8e25c6e..5e9387d6 100644 --- a/confluence/internal/label_impl.go +++ b/confluence/internal/label_impl.go @@ -11,14 +11,16 @@ import ( "strconv" ) +// NewLabelService creates a new instance of LabelService. func NewLabelService(client service.Connector) *LabelService { - return &LabelService{ internalClient: &internalLabelImpl{c: client}, } } +// LabelService provides methods to interact with label operations in Confluence. type LabelService struct { + // internalClient is the connector interface for label operations. internalClient confluence.LabelConnector } diff --git a/confluence/internal/page_impl.go b/confluence/internal/page_impl.go index ec8831af..edf473a9 100644 --- a/confluence/internal/page_impl.go +++ b/confluence/internal/page_impl.go @@ -12,12 +12,15 @@ import ( "strings" ) -// NewPageService returns a new Confluence V2 Page service +// NewPageService creates a new instance of PageService. +// It takes a service.Connector as input and returns a pointer to PageService. func NewPageService(client service.Connector) *PageService { return &PageService{internalClient: &internalPageImpl{c: client}} } +// PageService provides methods to interact with page operations in Confluence. type PageService struct { + // internalClient is the connector interface for page operations. internalClient confluence.PageConnector } diff --git a/confluence/internal/permission_content_impl.go b/confluence/internal/permission_content_impl.go index e71a1f24..f3f95680 100644 --- a/confluence/internal/permission_content_impl.go +++ b/confluence/internal/permission_content_impl.go @@ -9,6 +9,8 @@ import ( "net/http" ) +// NewPermissionService creates a new instance of PermissionService. +// It takes a service.Connector as input and returns a pointer to PermissionService. func NewPermissionService(client service.Connector) *PermissionService { return &PermissionService{ @@ -16,6 +18,7 @@ func NewPermissionService(client service.Connector) *PermissionService { } } +// PermissionService provides methods to interact with content permission operations in Confluence. type PermissionService struct { internalClient confluence.ContentPermissionConnector } diff --git a/confluence/internal/permission_space_impl.go b/confluence/internal/permission_space_impl.go index 64431d2e..d6ce54a4 100644 --- a/confluence/internal/permission_space_impl.go +++ b/confluence/internal/permission_space_impl.go @@ -9,6 +9,8 @@ import ( "net/http" ) +// NewSpacePermissionService creates a new instance of SpacePermissionService. +// It takes a service.Connector as input and returns a pointer to SpacePermissionService. func NewSpacePermissionService(client service.Connector) *SpacePermissionService { return &SpacePermissionService{ @@ -16,7 +18,9 @@ func NewSpacePermissionService(client service.Connector) *SpacePermissionService } } +// SpacePermissionService provides methods to interact with space permission operations in Confluence. type SpacePermissionService struct { + // internalClient is the connector interface for space permission operations. internalClient confluence.SpacePermissionConnector } diff --git a/confluence/internal/properties_content_impl.go b/confluence/internal/properties_content_impl.go index 3ef7d80c..1569999e 100644 --- a/confluence/internal/properties_content_impl.go +++ b/confluence/internal/properties_content_impl.go @@ -12,14 +12,17 @@ import ( "strings" ) +// NewPropertyService creates a new instance of PropertyService. +// It takes a service.Connector as input and returns a pointer to PropertyService. func NewPropertyService(client service.Connector) *PropertyService { - return &PropertyService{ internalClient: &internalPropertyImpl{c: client}, } } +// PropertyService provides methods to interact with content property operations in Confluence. type PropertyService struct { + // internalClient is the connector interface for content property operations. internalClient confluence.ContentPropertyConnector } diff --git a/confluence/internal/restriction_content_impl.go b/confluence/internal/restriction_content_impl.go index 60f7bb4d..12493b2e 100644 --- a/confluence/internal/restriction_content_impl.go +++ b/confluence/internal/restriction_content_impl.go @@ -12,17 +12,21 @@ import ( "strings" ) +// NewRestrictionService creates a new instance of RestrictionService. +// It takes a service.Connector and a pointer to RestrictionOperationService as input and returns a pointer to RestrictionService. func NewRestrictionService(client service.Connector, operation *RestrictionOperationService) *RestrictionService { - return &RestrictionService{ internalClient: &internalRestrictionImpl{c: client}, Operation: operation, } } +// RestrictionService provides methods to interact with content restriction operations in Confluence. type RestrictionService struct { + // internalClient is the connector interface for content restriction operations. internalClient confluence.ContentRestrictionConnector - Operation *RestrictionOperationService + // Operation is a pointer to RestrictionOperationService for additional restriction operations. + Operation *RestrictionOperationService } // Gets returns the restrictions on a piece of content. diff --git a/confluence/internal/restriction_operation_content_impl.go b/confluence/internal/restriction_operation_content_impl.go index d014dbe5..62fdcd63 100644 --- a/confluence/internal/restriction_operation_content_impl.go +++ b/confluence/internal/restriction_operation_content_impl.go @@ -12,8 +12,10 @@ import ( "strings" ) +// NewRestrictionOperationService creates a new instance of RestrictionOperationService. +// It takes a service.Connector, a pointer to RestrictionOperationGroupService, and a pointer to RestrictionOperationUserService as input, +// and returns a pointer to RestrictionOperationService. func NewRestrictionOperationService(client service.Connector, group *RestrictionOperationGroupService, user *RestrictionOperationUserService) *RestrictionOperationService { - return &RestrictionOperationService{ internalClient: &internalRestrictionOperationImpl{c: client}, Group: group, @@ -21,10 +23,14 @@ func NewRestrictionOperationService(client service.Connector, group *Restriction } } +// RestrictionOperationService provides methods to interact with content restriction operations in Confluence. type RestrictionOperationService struct { + // internalClient is the connector interface for content restriction operations. internalClient confluence.RestrictionOperationConnector - Group *RestrictionOperationGroupService - User *RestrictionOperationUserService + // Group is a pointer to RestrictionOperationGroupService for group-related restriction operations. + Group *RestrictionOperationGroupService + // User is a pointer to RestrictionOperationUserService for user-related restriction operations. + User *RestrictionOperationUserService } // Gets returns restrictions on a piece of content by operation. diff --git a/confluence/internal/restriction_operation_group_content_impl.go b/confluence/internal/restriction_operation_group_content_impl.go index 5211ccec..c371ab52 100644 --- a/confluence/internal/restriction_operation_group_content_impl.go +++ b/confluence/internal/restriction_operation_group_content_impl.go @@ -11,14 +11,17 @@ import ( "strings" ) +// NewRestrictionOperationGroupService creates a new instance of RestrictionOperationGroupService. +// It takes a service.Connector as input and returns a pointer to RestrictionOperationGroupService. func NewRestrictionOperationGroupService(client service.Connector) *RestrictionOperationGroupService { - return &RestrictionOperationGroupService{ internalClient: &internalRestrictionOperationGroupImpl{c: client}, } } +// RestrictionOperationGroupService provides methods to interact with content restriction operations for groups in Confluence. type RestrictionOperationGroupService struct { + // internalClient is the connector interface for content restriction operations for groups. internalClient confluence.RestrictionGroupOperationConnector } diff --git a/confluence/internal/restriction_operation_user_content_impl.go b/confluence/internal/restriction_operation_user_content_impl.go index c1e66f6d..b193d9c9 100644 --- a/confluence/internal/restriction_operation_user_content_impl.go +++ b/confluence/internal/restriction_operation_user_content_impl.go @@ -10,14 +10,17 @@ import ( "net/url" ) +// NewRestrictionOperationUserService creates a new instance of RestrictionOperationUserService. +// It takes a service.Connector as input and returns a pointer to RestrictionOperationUserService. func NewRestrictionOperationUserService(client service.Connector) *RestrictionOperationUserService { - return &RestrictionOperationUserService{ internalClient: &internalRestrictionOperationUserImpl{c: client}, } } +// RestrictionOperationUserService provides methods to interact with content restriction operations for users in Confluence. type RestrictionOperationUserService struct { + // internalClient is the connector interface for content restriction operations for users. internalClient confluence.RestrictionUserOperationConnector } diff --git a/confluence/internal/search_impl.go b/confluence/internal/search_impl.go index 59c4f7aa..4c4d4d40 100644 --- a/confluence/internal/search_impl.go +++ b/confluence/internal/search_impl.go @@ -12,14 +12,17 @@ import ( "strings" ) +// NewSearchService creates a new instance of SearchService. +// It takes a service.Connector as input and returns a pointer to SearchService. func NewSearchService(client service.Connector) *SearchService { - return &SearchService{ internalClient: &internalSearchImpl{c: client}, } } +// SearchService provides methods to interact with search operations in Confluence. type SearchService struct { + // internalClient is the connector interface for search operations. internalClient confluence.SearchConnector } diff --git a/confluence/internal/space_impl.go b/confluence/internal/space_impl.go index 62eca75a..acd784d9 100644 --- a/confluence/internal/space_impl.go +++ b/confluence/internal/space_impl.go @@ -12,17 +12,21 @@ import ( "strings" ) +// NewSpaceService creates a new instance of SpaceService. +// It takes a service.Connector and a pointer to SpacePermissionService as input and returns a pointer to SpaceService. func NewSpaceService(client service.Connector, permission *SpacePermissionService) *SpaceService { - return &SpaceService{ internalClient: &internalSpaceImpl{c: client}, Permission: permission, } } +// SpaceService provides methods to interact with space operations in Confluence. type SpaceService struct { + // internalClient is the connector interface for space operations. internalClient confluence.SpaceConnector - Permission *SpacePermissionService + // Permission is a pointer to SpacePermissionService for additional permission operations. + Permission *SpacePermissionService } // Gets returns all spaces. diff --git a/confluence/internal/space_v2_impl.go b/confluence/internal/space_v2_impl.go index 9d2da516..b81c405e 100644 --- a/confluence/internal/space_v2_impl.go +++ b/confluence/internal/space_v2_impl.go @@ -12,7 +12,9 @@ import ( "strings" ) +// SpaceV2Service provides methods to interact with space operations in Confluence V2. type SpaceV2Service struct { + // internalClient is the connector interface for space operations. internalClient confluence.SpaceV2Connector } diff --git a/confluence/internal/task_impl.go b/confluence/internal/task_impl.go index eb9f3c4d..51d27528 100644 --- a/confluence/internal/task_impl.go +++ b/confluence/internal/task_impl.go @@ -11,14 +11,17 @@ import ( "strconv" ) +// NewTaskService creates a new instance of TaskService. +// It takes a service.Connector as input and returns a pointer to TaskService. func NewTaskService(client service.Connector) *TaskService { - return &TaskService{ internalClient: &internalTaskImpl{c: client}, } } +// TaskService provides methods to interact with long-running task operations in Confluence. type TaskService struct { + // internalClient is the connector interface for task operations. internalClient confluence.TaskConnector } diff --git a/confluence/internal/version_content.go b/confluence/internal/version_content.go index f459ef11..917ad1fd 100644 --- a/confluence/internal/version_content.go +++ b/confluence/internal/version_content.go @@ -12,14 +12,17 @@ import ( "strings" ) +// NewVersionService creates a new instance of VersionService. +// It takes a service.Connector as input and returns a pointer to VersionService. func NewVersionService(client service.Connector) *VersionService { - return &VersionService{ internalClient: &internalVersionImpl{c: client}, } } +// VersionService provides methods to interact with version operations in Confluence. type VersionService struct { + // internalClient is the connector interface for version operations. internalClient confluence.VersionConnector } diff --git a/jira/agile/internal/authentication_impl.go b/jira/agile/internal/authentication_impl.go index 2bbe9ab8..49c37eb7 100644 --- a/jira/agile/internal/authentication_impl.go +++ b/jira/agile/internal/authentication_impl.go @@ -5,33 +5,48 @@ import ( "github.com/ctreminiom/go-atlassian/service/common" ) +// NewAuthenticationService creates a new instance of AuthenticationService. +// It takes a service.Connector as input and returns a common.Authentication interface. func NewAuthenticationService(client service.Connector) common.Authentication { return &AuthenticationService{c: client} } +// AuthenticationService provides methods to handle authentication operations. type AuthenticationService struct { + // c is the connector interface for authentication operations. c service.Connector + // basicAuthProvided indicates if basic authentication credentials have been provided. basicAuthProvided bool - mail, token string + // mail is the email used for basic authentication. + // token is the token used for basic authentication. + mail, token string + // userAgentProvided indicates if a user agent has been provided. userAgentProvided bool - agent string + // agent is the user agent string. + agent string } +// SetBearerToken sets the bearer token for authentication. func (a *AuthenticationService) SetBearerToken(token string) { a.token = token } +// GetBearerToken returns the bearer token used for authentication. func (a *AuthenticationService) GetBearerToken() string { return a.token } + +// SetExperimentalFlag is a placeholder method for setting an experimental flag. func (a *AuthenticationService) SetExperimentalFlag() {} +// HasSetExperimentalFlag returns false indicating the experimental flag is not set. func (a *AuthenticationService) HasSetExperimentalFlag() bool { return false } +// SetBasicAuth sets the basic authentication credentials. func (a *AuthenticationService) SetBasicAuth(mail, token string) { a.mail = mail a.token = token @@ -39,23 +54,28 @@ func (a *AuthenticationService) SetBasicAuth(mail, token string) { a.basicAuthProvided = true } +// GetBasicAuth returns the email and token used for basic authentication. func (a *AuthenticationService) GetBasicAuth() (string, string) { return a.mail, a.token } +// HasBasicAuth returns true if basic authentication credentials have been provided. func (a *AuthenticationService) HasBasicAuth() bool { return a.basicAuthProvided } +// SetUserAgent sets the user agent string. func (a *AuthenticationService) SetUserAgent(agent string) { a.agent = agent a.userAgentProvided = true } +// GetUserAgent returns the user agent string. func (a *AuthenticationService) GetUserAgent() string { return a.agent } +// HasUserAgent returns true if a user agent string has been provided. func (a *AuthenticationService) HasUserAgent() bool { return a.userAgentProvided } diff --git a/jira/agile/internal/board_backlog_impl.go b/jira/agile/internal/board_backlog_impl.go index 546ba95e..cc344e68 100644 --- a/jira/agile/internal/board_backlog_impl.go +++ b/jira/agile/internal/board_backlog_impl.go @@ -9,14 +9,17 @@ import ( "net/http" ) +// NewBoardBacklogService creates a new instance of BoardBacklogService. +// It takes a service.Connector and a version string as input and returns a pointer to BoardBacklogService. func NewBoardBacklogService(client service.Connector, version string) *BoardBacklogService { - return &BoardBacklogService{ internalClient: &internalBoardBacklogImpl{c: client, version: version}, } } +// BoardBacklogService provides methods to interact with board backlog operations in Jira Agile. type BoardBacklogService struct { + // internalClient is the connector interface for board backlog operations. internalClient agile.BoardBacklogConnector } diff --git a/jira/agile/internal/board_impl.go b/jira/agile/internal/board_impl.go index ccd55188..e0719fa0 100644 --- a/jira/agile/internal/board_impl.go +++ b/jira/agile/internal/board_impl.go @@ -12,14 +12,17 @@ import ( "strings" ) +// NewBoardService creates a new instance of BoardService. +// It takes a service.Connector and a version string as input and returns a pointer to BoardService. func NewBoardService(client service.Connector, version string) *BoardService { - return &BoardService{ internalClient: &internalBoardImpl{c: client, version: version}, } } +// BoardService provides methods to interact with board operations in Jira Agile. type BoardService struct { + // internalClient is the connector interface for board operations. internalClient agile.BoardConnector } diff --git a/jira/agile/internal/epic_impl.go b/jira/agile/internal/epic_impl.go index 8a8f994a..9cf52da3 100644 --- a/jira/agile/internal/epic_impl.go +++ b/jira/agile/internal/epic_impl.go @@ -12,14 +12,17 @@ import ( "strings" ) +// NewEpicService creates a new instance of EpicService. +// It takes a service.Connector and a version string as input and returns a pointer to EpicService. func NewEpicService(client service.Connector, version string) *EpicService { - return &EpicService{ internalClient: &internalEpicImpl{c: client, version: version}, } } +// EpicService provides methods to interact with epic operations in Jira Agile. type EpicService struct { + // internalClient is the connector interface for epic operations. internalClient agile.EpicConnector } diff --git a/jira/agile/internal/sprint_impl.go b/jira/agile/internal/sprint_impl.go index b7b1c303..b38b87bd 100644 --- a/jira/agile/internal/sprint_impl.go +++ b/jira/agile/internal/sprint_impl.go @@ -12,14 +12,17 @@ import ( "strings" ) +// NewSprintService creates a new instance of SprintService. +// It takes a service.Connector and a version string as input and returns a pointer to SprintService. func NewSprintService(client service.Connector, version string) *SprintService { - return &SprintService{ internalClient: &internalSprintImpl{c: client, version: version}, } } +// SprintService provides methods to interact with sprint operations in Jira Agile. type SprintService struct { + // internalClient is the connector interface for sprint operations. internalClient agile.SprintConnector } diff --git a/jira/internal/announcement_banner_impl.go b/jira/internal/announcement_banner_impl.go index 81b9904f..396b563b 100644 --- a/jira/internal/announcement_banner_impl.go +++ b/jira/internal/announcement_banner_impl.go @@ -9,6 +9,8 @@ import ( "net/http" ) +// NewAnnouncementBannerService creates a new instance of AnnouncementBannerService. +// It takes a service.Connector and a version string as input and returns a pointer to AnnouncementBannerService. func NewAnnouncementBannerService(client service.Connector, version string) *AnnouncementBannerService { return &AnnouncementBannerService{ @@ -16,7 +18,9 @@ func NewAnnouncementBannerService(client service.Connector, version string) *Ann } } +// AnnouncementBannerService provides methods to interact with announcement banner operations in Jira Service Management. type AnnouncementBannerService struct { + // internalClient is the connector interface for announcement banner operations. internalClient jira.AnnouncementBannerConnector } diff --git a/jira/internal/application_role_impl.go b/jira/internal/application_role_impl.go index 497c8862..7cb02660 100644 --- a/jira/internal/application_role_impl.go +++ b/jira/internal/application_role_impl.go @@ -9,6 +9,9 @@ import ( "net/http" ) +// NewApplicationRoleService creates a new instance of ApplicationRoleService. +// It takes a service.Connector and a version string as input. +// Returns a pointer to ApplicationRoleService and an error if the version is not provided. func NewApplicationRoleService(client service.Connector, version string) (*ApplicationRoleService, error) { if version == "" { @@ -20,7 +23,9 @@ func NewApplicationRoleService(client service.Connector, version string) (*Appli }, nil } +// ApplicationRoleService provides methods to interact with application role operations in Jira Service Management. type ApplicationRoleService struct { + // internalClient is the connector interface for application role operations. internalClient jira.AppRoleConnector } diff --git a/jira/internal/attachment_impl.go b/jira/internal/attachment_impl.go index d268d328..7637d38d 100644 --- a/jira/internal/attachment_impl.go +++ b/jira/internal/attachment_impl.go @@ -15,6 +15,9 @@ import ( "github.com/ctreminiom/go-atlassian/service/jira" ) +// NewIssueAttachmentService creates a new instance of IssueAttachmentService. +// It takes a service.Connector and a version string as input. +// Returns a pointer to IssueAttachmentService and an error if the version is not provided. func NewIssueAttachmentService(client service.Connector, version string) (*IssueAttachmentService, error) { if version == "" { @@ -26,7 +29,9 @@ func NewIssueAttachmentService(client service.Connector, version string) (*Issue }, nil } +// IssueAttachmentService provides methods to interact with issue attachment operations in Jira Service Management. type IssueAttachmentService struct { + // internalClient is the connector interface for issue attachment operations. internalClient jira.AttachmentConnector } diff --git a/jira/internal/audit_impl.go b/jira/internal/audit_impl.go index 2ad065a1..c5830066 100644 --- a/jira/internal/audit_impl.go +++ b/jira/internal/audit_impl.go @@ -12,6 +12,9 @@ import ( "strings" ) +// NewAuditRecordService creates a new instance of AuditRecordService. +// It takes a service.Connector and a version string as input. +// Returns a pointer to AuditRecordService and an error if the version is not provided. func NewAuditRecordService(client service.Connector, version string) (*AuditRecordService, error) { if version == "" { @@ -23,7 +26,9 @@ func NewAuditRecordService(client service.Connector, version string) (*AuditReco }, nil } +// AuditRecordService provides methods to interact with audit record operations in Jira Service Management. type AuditRecordService struct { + // internalClient is the connector interface for audit record operations. internalClient jira.AuditRecordConnector } diff --git a/jira/internal/authentication_impl.go b/jira/internal/authentication_impl.go index 2bbe9ab8..fd7371f1 100644 --- a/jira/internal/authentication_impl.go +++ b/jira/internal/authentication_impl.go @@ -5,57 +5,76 @@ import ( "github.com/ctreminiom/go-atlassian/service/common" ) +// NewAuthenticationService creates a new instance of AuthenticationService. +// It takes a service.Connector as input and returns a common.Authentication interface. func NewAuthenticationService(client service.Connector) common.Authentication { return &AuthenticationService{c: client} } +// AuthenticationService provides methods to manage authentication in Jira Service Management. type AuthenticationService struct { + // c is the connector interface for authentication operations. c service.Connector + // basicAuthProvided indicates if basic authentication credentials have been provided. basicAuthProvided bool - mail, token string + // mail is the email address used for basic authentication. + // token is the token used for basic authentication. + mail, token string + // userAgentProvided indicates if a user agent has been provided. userAgentProvided bool - agent string + // agent is the user agent string. + agent string } +// SetBearerToken sets the bearer token for authentication. func (a *AuthenticationService) SetBearerToken(token string) { a.token = token } +// GetBearerToken returns the bearer token used for authentication. func (a *AuthenticationService) GetBearerToken() string { return a.token } + +// SetExperimentalFlag is a placeholder for setting an experimental flag. func (a *AuthenticationService) SetExperimentalFlag() {} +// HasSetExperimentalFlag returns false indicating the experimental flag is not set. func (a *AuthenticationService) HasSetExperimentalFlag() bool { return false } +// SetBasicAuth sets the basic authentication credentials. func (a *AuthenticationService) SetBasicAuth(mail, token string) { a.mail = mail a.token = token - a.basicAuthProvided = true } +// GetBasicAuth returns the email and token used for basic authentication. func (a *AuthenticationService) GetBasicAuth() (string, string) { return a.mail, a.token } +// HasBasicAuth returns true if basic authentication credentials have been provided. func (a *AuthenticationService) HasBasicAuth() bool { return a.basicAuthProvided } +// SetUserAgent sets the user agent string. func (a *AuthenticationService) SetUserAgent(agent string) { a.agent = agent a.userAgentProvided = true } +// GetUserAgent returns the user agent string. func (a *AuthenticationService) GetUserAgent() string { return a.agent } +// HasUserAgent returns true if a user agent has been provided. func (a *AuthenticationService) HasUserAgent() bool { return a.userAgentProvided } diff --git a/jira/internal/comment_impl.go b/jira/internal/comment_impl.go index 54745e68..5e9a0a92 100644 --- a/jira/internal/comment_impl.go +++ b/jira/internal/comment_impl.go @@ -5,6 +5,9 @@ import ( "github.com/ctreminiom/go-atlassian/service" ) +// NewCommentService creates a new instance of CommentADFService and CommentRichTextService. +// It takes a service.Connector and a version string as input. +// Returns pointers to CommentADFService and CommentRichTextService, and an error if the version is not provided. func NewCommentService(client service.Connector, version string) (*CommentADFService, *CommentRichTextService, error) { if version == "" { diff --git a/jira/internal/comment_impl_adf.go b/jira/internal/comment_impl_adf.go index bf8038d2..477d05d0 100644 --- a/jira/internal/comment_impl_adf.go +++ b/jira/internal/comment_impl_adf.go @@ -13,7 +13,9 @@ import ( "github.com/ctreminiom/go-atlassian/service/jira" ) +// CommentADFService provides methods to interact with comment operations in Jira Service Management using ADF format. type CommentADFService struct { + // internalClient is the connector interface for ADF comment operations. internalClient jira.CommentADFConnector } diff --git a/jira/internal/comment_impl_rich_text.go b/jira/internal/comment_impl_rich_text.go index cfaba746..664fabb7 100644 --- a/jira/internal/comment_impl_rich_text.go +++ b/jira/internal/comment_impl_rich_text.go @@ -12,7 +12,9 @@ import ( "strings" ) +// CommentRichTextService provides methods to interact with comment operations in Jira Service Management using Rich Text format. type CommentRichTextService struct { + // internalClient is the connector interface for Rich Text comment operations. internalClient jira.CommentRichTextConnector } diff --git a/jira/internal/dashboard_impl.go b/jira/internal/dashboard_impl.go index b44f94dd..053ae32d 100644 --- a/jira/internal/dashboard_impl.go +++ b/jira/internal/dashboard_impl.go @@ -13,6 +13,9 @@ import ( "github.com/ctreminiom/go-atlassian/service/jira" ) +// NewDashboardService creates a new instance of DashboardService. +// It takes a service.Connector and a version string as input. +// Returns a pointer to DashboardService and an error if the version is not provided. func NewDashboardService(client service.Connector, version string) (*DashboardService, error) { if version == "" { @@ -24,7 +27,9 @@ func NewDashboardService(client service.Connector, version string) (*DashboardSe }, nil } +// DashboardService provides methods to interact with dashboard operations in Jira Service Management. type DashboardService struct { + // internalClient is the connector interface for dashboard operations. internalClient jira.DashboardConnector } diff --git a/jira/internal/field_configuration_impl.go b/jira/internal/field_configuration_impl.go index f061bb5a..9c2f8336 100644 --- a/jira/internal/field_configuration_impl.go +++ b/jira/internal/field_configuration_impl.go @@ -11,6 +11,9 @@ import ( "strconv" ) +// NewIssueFieldConfigurationService creates a new instance of IssueFieldConfigService. +// It takes a service.Connector, a version string, an IssueFieldConfigItemService, and an IssueFieldConfigSchemeService as input. +// Returns a pointer to IssueFieldConfigService and an error if the version is not provided. func NewIssueFieldConfigurationService(client service.Connector, version string, item *IssueFieldConfigItemService, scheme *IssueFieldConfigSchemeService) (*IssueFieldConfigService, error) { @@ -25,10 +28,14 @@ func NewIssueFieldConfigurationService(client service.Connector, version string, }, nil } +// IssueFieldConfigService provides methods to manage field configurations in Jira Service Management. type IssueFieldConfigService struct { + // internalClient is the connector interface for field configuration operations. internalClient jira.FieldConfigConnector - Item *IssueFieldConfigItemService - Scheme *IssueFieldConfigSchemeService + // Item is the service for managing field configuration items. + Item *IssueFieldConfigItemService + // Scheme is the service for managing field configuration schemes. + Scheme *IssueFieldConfigSchemeService } // Gets Returns a paginated list of all field configurations. diff --git a/jira/internal/field_configuration_item_impl.go b/jira/internal/field_configuration_item_impl.go index 84ae6aa4..bc81bf4e 100644 --- a/jira/internal/field_configuration_item_impl.go +++ b/jira/internal/field_configuration_item_impl.go @@ -11,6 +11,9 @@ import ( "strconv" ) +// NewIssueFieldConfigurationItemService creates a new instance of IssueFieldConfigItemService. +// It takes a service.Connector and a version string as input. +// Returns a pointer to IssueFieldConfigItemService and an error if the version is not provided. func NewIssueFieldConfigurationItemService(client service.Connector, version string) (*IssueFieldConfigItemService, error) { if version == "" { @@ -22,7 +25,9 @@ func NewIssueFieldConfigurationItemService(client service.Connector, version str }, nil } +// IssueFieldConfigItemService provides methods to manage field configuration items in Jira Service Management. type IssueFieldConfigItemService struct { + // internalClient is the connector interface for field configuration item operations. internalClient jira.FieldConfigItemConnector } diff --git a/jira/internal/field_configuration_scheme.go b/jira/internal/field_configuration_scheme.go index 8591da0a..b0ed02a9 100644 --- a/jira/internal/field_configuration_scheme.go +++ b/jira/internal/field_configuration_scheme.go @@ -11,6 +11,9 @@ import ( "strconv" ) +// NewIssueFieldConfigurationSchemeService creates a new instance of IssueFieldConfigSchemeService. +// It takes a service.Connector and a version string as input. +// Returns a pointer to IssueFieldConfigSchemeService and an error if the version is not provided. func NewIssueFieldConfigurationSchemeService(client service.Connector, version string) (*IssueFieldConfigSchemeService, error) { if version == "" { @@ -22,7 +25,9 @@ func NewIssueFieldConfigurationSchemeService(client service.Connector, version s }, nil } +// IssueFieldConfigSchemeService provides methods to manage field configuration schemes in Jira Service Management. type IssueFieldConfigSchemeService struct { + // internalClient is the connector interface for field configuration scheme operations. internalClient jira.FieldConfigSchemeConnector } diff --git a/jira/internal/field_context_impl.go b/jira/internal/field_context_impl.go index 76aeb48d..26bb1b60 100644 --- a/jira/internal/field_context_impl.go +++ b/jira/internal/field_context_impl.go @@ -12,6 +12,9 @@ import ( "github.com/ctreminiom/go-atlassian/service/jira" ) +// NewIssueFieldContextService creates a new instance of IssueFieldContextService. +// It takes a service.Connector, a version string, and an IssueFieldContextOptionService as input. +// Returns a pointer to IssueFieldContextService and an error if the version is not provided. func NewIssueFieldContextService(client service.Connector, version string, option *IssueFieldContextOptionService) (*IssueFieldContextService, error) { if version == "" { @@ -24,9 +27,12 @@ func NewIssueFieldContextService(client service.Connector, version string, optio }, nil } +// IssueFieldContextService provides methods to manage field contexts in Jira Service Management. type IssueFieldContextService struct { + // internalClient is the connector interface for field context operations. internalClient jira.FieldContextConnector - Option *IssueFieldContextOptionService + // Option is the service for managing field context options. + Option *IssueFieldContextOptionService } // Gets returns a paginated list of contexts for a custom field. Contexts can be returned as follows: diff --git a/jira/internal/field_context_option_impl.go b/jira/internal/field_context_option_impl.go index 12366050..1ca4aaff 100644 --- a/jira/internal/field_context_option_impl.go +++ b/jira/internal/field_context_option_impl.go @@ -11,6 +11,9 @@ import ( "strconv" ) +// NewIssueFieldContextOptionService creates a new instance of IssueFieldContextOptionService. +// It takes a service.Connector and a version string as input. +// Returns a pointer to IssueFieldContextOptionService and an error if the version is not provided. func NewIssueFieldContextOptionService(client service.Connector, version string) (*IssueFieldContextOptionService, error) { if version == "" { @@ -22,7 +25,9 @@ func NewIssueFieldContextOptionService(client service.Connector, version string) }, nil } +// IssueFieldContextOptionService provides methods to manage field context options in Jira Service Management. type IssueFieldContextOptionService struct { + // internalClient is the connector interface for field context option operations. internalClient jira.FieldContextOptionConnector } diff --git a/jira/internal/field_impl.go b/jira/internal/field_impl.go index afae0358..eb37369d 100644 --- a/jira/internal/field_impl.go +++ b/jira/internal/field_impl.go @@ -13,6 +13,9 @@ import ( "github.com/ctreminiom/go-atlassian/service/jira" ) +// NewIssueFieldService creates a new instance of IssueFieldService. +// It takes a service.Connector, a version string, an IssueFieldConfigService, an IssueFieldContextService, and an IssueFieldTrashService as input. +// Returns a pointer to IssueFieldService and an error if the version is not provided. func NewIssueFieldService(client service.Connector, version string, configuration *IssueFieldConfigService, context *IssueFieldContextService, trash *IssueFieldTrashService) (*IssueFieldService, error) { @@ -28,11 +31,16 @@ func NewIssueFieldService(client service.Connector, version string, configuratio }, nil } +// IssueFieldService provides methods to manage issue fields in Jira Service Management. type IssueFieldService struct { + // internalClient is the connector interface for issue field operations. internalClient jira.FieldConnector - Configuration *IssueFieldConfigService - Context *IssueFieldContextService - Trash *IssueFieldTrashService + // Configuration is the service for managing field configurations. + Configuration *IssueFieldConfigService + // Context is the service for managing field contexts. + Context *IssueFieldContextService + // Trash is the service for managing trashed fields. + Trash *IssueFieldTrashService } // Gets returns system and custom issue fields according to the following rules: diff --git a/jira/internal/field_trash_impl.go b/jira/internal/field_trash_impl.go index d36d4cfa..4825da92 100644 --- a/jira/internal/field_trash_impl.go +++ b/jira/internal/field_trash_impl.go @@ -12,6 +12,9 @@ import ( "strings" ) +// NewIssueFieldTrashService creates a new instance of IssueFieldTrashService. +// It takes a service.Connector and a version string as input. +// Returns a pointer to IssueFieldTrashService and an error if the version is not provided. func NewIssueFieldTrashService(client service.Connector, version string) (*IssueFieldTrashService, error) { if version == "" { @@ -23,7 +26,9 @@ func NewIssueFieldTrashService(client service.Connector, version string) (*Issue }, nil } +// IssueFieldTrashService provides methods to manage trashed fields in Jira Service Management. type IssueFieldTrashService struct { + // internalClient is the connector interface for field trash operations. internalClient jira.FieldTrashConnector } diff --git a/jira/internal/filter_impl.go b/jira/internal/filter_impl.go index 692fb7eb..c5f0fdb6 100644 --- a/jira/internal/filter_impl.go +++ b/jira/internal/filter_impl.go @@ -13,6 +13,9 @@ import ( "github.com/ctreminiom/go-atlassian/service/jira" ) +// NewFilterService creates a new instance of FilterService. +// It takes a service.Connector, a version string, and a jira.FilterSharingConnector as input. +// Returns a pointer to FilterService and an error if the version is not provided. func NewFilterService(client service.Connector, version string, share jira.FilterSharingConnector) (*FilterService, error) { if version == "" { @@ -25,9 +28,12 @@ func NewFilterService(client service.Connector, version string, share jira.Filte }, nil } +// FilterService provides methods to manage filters in Jira Service Management. type FilterService struct { + // internalClient is the connector interface for filter operations. internalClient jira.FilterConnector - Share jira.FilterSharingConnector + // Share is the service for managing filter sharing. + Share jira.FilterSharingConnector } // Create creates a filter. The filter is shared according to the default share scope. diff --git a/jira/internal/filter_share_impl.go b/jira/internal/filter_share_impl.go index 1173339f..2166195d 100644 --- a/jira/internal/filter_share_impl.go +++ b/jira/internal/filter_share_impl.go @@ -10,6 +10,9 @@ import ( "github.com/ctreminiom/go-atlassian/service/jira" ) +// NewFilterShareService creates a new instance of FilterShareService. +// It takes a service.Connector and a version string as input. +// Returns a pointer to FilterShareService and an error if the version is not provided. func NewFilterShareService(client service.Connector, version string) (*FilterShareService, error) { if version == "" { @@ -21,7 +24,9 @@ func NewFilterShareService(client service.Connector, version string) (*FilterSha }, nil } +// FilterShareService provides methods to manage filter sharing in Jira Service Management. type FilterShareService struct { + // internalClient is the connector interface for filter sharing operations. internalClient jira.FilterSharingConnector } diff --git a/jira/internal/group_impl.go b/jira/internal/group_impl.go index 851b1823..8e9856c7 100644 --- a/jira/internal/group_impl.go +++ b/jira/internal/group_impl.go @@ -12,6 +12,9 @@ import ( "github.com/ctreminiom/go-atlassian/service/jira" ) +// NewGroupService creates a new instance of GroupService. +// It takes a service.Connector and a version string as input. +// Returns a pointer to GroupService and an error if the version is not provided. func NewGroupService(client service.Connector, version string) (*GroupService, error) { if version == "" { @@ -23,7 +26,9 @@ func NewGroupService(client service.Connector, version string) (*GroupService, e }, nil } +// GroupService provides methods to manage groups in Jira Service Management. type GroupService struct { + // internalClient is the connector interface for group operations. internalClient jira.GroupConnector } diff --git a/jira/internal/group_user_picker_impl.go b/jira/internal/group_user_picker_impl.go index 068fb7ba..613f6abf 100644 --- a/jira/internal/group_user_picker_impl.go +++ b/jira/internal/group_user_picker_impl.go @@ -12,6 +12,7 @@ import ( "github.com/ctreminiom/go-atlassian/service/jira" ) +// NewGroupUserPickerService creates a new GroupUserPickerService instance. func NewGroupUserPickerService(client service.Connector, version string) (*GroupUserPickerService, error) { if version == "" { diff --git a/jira/internal/issue_impl.go b/jira/internal/issue_impl.go index 1f959610..b2533171 100644 --- a/jira/internal/issue_impl.go +++ b/jira/internal/issue_impl.go @@ -10,27 +10,49 @@ import ( "github.com/ctreminiom/go-atlassian/service" ) +// IssueServices groups various services related to issue management in Jira Service Management. type IssueServices struct { - Attachment *IssueAttachmentService - CommentRT *CommentRichTextService - CommentADF *CommentADFService - Field *IssueFieldService - Label *LabelService - LinkRT *LinkRichTextService - LinkADF *LinkADFService - Metadata *MetadataService - Priority *PriorityService - Resolution *ResolutionService - SearchRT *SearchRichTextService - SearchADF *SearchADFService - Type *TypeService - Vote *VoteService - Watcher *WatcherService - WorklogAdf *WorklogADFService + // Attachment is the service for managing issue attachments. + Attachment *IssueAttachmentService + // CommentRT is the service for managing rich text comments. + CommentRT *CommentRichTextService + // CommentADF is the service for managing ADF comments. + CommentADF *CommentADFService + // Field is the service for managing issue fields. + Field *IssueFieldService + // Label is the service for managing issue labels. + Label *LabelService + // LinkRT is the service for managing rich text issue links. + LinkRT *LinkRichTextService + // LinkADF is the service for managing ADF issue links. + LinkADF *LinkADFService + // Metadata is the service for managing issue metadata. + Metadata *MetadataService + // Priority is the service for managing issue priorities. + Priority *PriorityService + // Resolution is the service for managing issue resolutions. + Resolution *ResolutionService + // SearchRT is the service for managing rich text issue searches. + SearchRT *SearchRichTextService + // SearchADF is the service for managing ADF issue searches. + SearchADF *SearchADFService + // Type is the service for managing issue types. + Type *TypeService + // Vote is the service for managing issue votes. + Vote *VoteService + // Watcher is the service for managing issue watchers. + Watcher *WatcherService + // WorklogAdf is the service for managing ADF worklogs. + WorklogAdf *WorklogADFService + // WorklogRichText is the service for managing rich text worklogs. WorklogRichText *WorklogRichTextService - Property *IssuePropertyService + // Property is the service for managing issue properties. + Property *IssuePropertyService } +// NewIssueService creates new instances of IssueRichTextService and IssueADFService. +// It takes a service.Connector, a version string, and an optional IssueServices struct as input. +// Returns pointers to IssueRichTextService and IssueADFService, and an error if the version is not provided. func NewIssueService(client service.Connector, version string, services *IssueServices) (*IssueRichTextService, *IssueADFService, error) { if version == "" { diff --git a/jira/internal/issue_impl_adf.go b/jira/internal/issue_impl_adf.go index 818af8b5..0662c92e 100644 --- a/jira/internal/issue_impl_adf.go +++ b/jira/internal/issue_impl_adf.go @@ -14,22 +14,38 @@ import ( "github.com/ctreminiom/go-atlassian/service/jira" ) +// IssueADFService provides methods to manage issues in Jira Service Management using the ADF format. type IssueADFService struct { + // internalClient is the connector interface for ADF issue operations. internalClient jira.IssueADFConnector - Attachment *IssueAttachmentService - Comment *CommentADFService - Field *IssueFieldService - Label *LabelService - Link *LinkADFService - Metadata *MetadataService - Priority *PriorityService - Resolution *ResolutionService - Search *SearchADFService - Type *TypeService - Vote *VoteService - Watcher *WatcherService - Worklog *WorklogADFService - Property *IssuePropertyService + // Attachment is the service for managing issue attachments. + Attachment *IssueAttachmentService + // Comment is the service for managing ADF comments. + Comment *CommentADFService + // Field is the service for managing issue fields. + Field *IssueFieldService + // Label is the service for managing issue labels. + Label *LabelService + // Link is the service for managing ADF issue links. + Link *LinkADFService + // Metadata is the service for managing issue metadata. + Metadata *MetadataService + // Priority is the service for managing issue priorities. + Priority *PriorityService + // Resolution is the service for managing issue resolutions. + Resolution *ResolutionService + // Search is the service for managing ADF issue searches. + Search *SearchADFService + // Type is the service for managing issue types. + Type *TypeService + // Vote is the service for managing issue votes. + Vote *VoteService + // Watcher is the service for managing issue watchers. + Watcher *WatcherService + // Worklog is the service for managing ADF worklogs. + Worklog *WorklogADFService + // Property is the service for managing issue properties. + Property *IssuePropertyService } // Delete deletes an issue. diff --git a/jira/internal/issue_impl_rich_text.go b/jira/internal/issue_impl_rich_text.go index ee27d30e..fc1b4ddd 100644 --- a/jira/internal/issue_impl_rich_text.go +++ b/jira/internal/issue_impl_rich_text.go @@ -14,22 +14,38 @@ import ( "github.com/ctreminiom/go-atlassian/service/jira" ) +// IssueRichTextService provides methods to manage issues in Jira Service Management using the rich text format. type IssueRichTextService struct { + // internalClient is the connector interface for rich text issue operations. internalClient jira.IssueRichTextConnector - Attachment *IssueAttachmentService - Comment *CommentRichTextService - Field *IssueFieldService - Label *LabelService - Link *LinkRichTextService - Metadata *MetadataService - Priority *PriorityService - Resolution *ResolutionService - Search *SearchRichTextService - Type *TypeService - Vote *VoteService - Watcher *WatcherService - Worklog *WorklogRichTextService - Property *IssuePropertyService + // Attachment is the service for managing issue attachments. + Attachment *IssueAttachmentService + // Comment is the service for managing rich text comments. + Comment *CommentRichTextService + // Field is the service for managing issue fields. + Field *IssueFieldService + // Label is the service for managing issue labels. + Label *LabelService + // Link is the service for managing rich text issue links. + Link *LinkRichTextService + // Metadata is the service for managing issue metadata. + Metadata *MetadataService + // Priority is the service for managing issue priorities. + Priority *PriorityService + // Resolution is the service for managing issue resolutions. + Resolution *ResolutionService + // Search is the service for managing rich text issue searches. + Search *SearchRichTextService + // Type is the service for managing issue types. + Type *TypeService + // Vote is the service for managing issue votes. + Vote *VoteService + // Watcher is the service for managing issue watchers. + Watcher *WatcherService + // Worklog is the service for managing rich text worklogs. + Worklog *WorklogRichTextService + // Property is the service for managing issue properties. + Property *IssuePropertyService } // Delete deletes an issue. diff --git a/jira/internal/jql_impl.go b/jira/internal/jql_impl.go index 634a60f4..88db4465 100644 --- a/jira/internal/jql_impl.go +++ b/jira/internal/jql_impl.go @@ -11,6 +11,7 @@ import ( "strings" ) +// NewJQLService creates a new instance of JQLService. func NewJQLService(client service.Connector, version string) (*JQLService, error) { if version == "" { @@ -22,7 +23,9 @@ func NewJQLService(client service.Connector, version string) (*JQLService, error }, nil } +// JQLService provides methods to manage JQL queries in Jira Service Management. type JQLService struct { + // internalClient is the connector interface for JQL operations. internalClient jira.JQLConnector } diff --git a/jira/internal/label_impl.go b/jira/internal/label_impl.go index 78df9e08..1c4cf491 100644 --- a/jira/internal/label_impl.go +++ b/jira/internal/label_impl.go @@ -11,6 +11,7 @@ import ( "strconv" ) +// NewLabelService creates a new instance of LabelService. func NewLabelService(client service.Connector, version string) (*LabelService, error) { if version == "" { @@ -22,7 +23,9 @@ func NewLabelService(client service.Connector, version string) (*LabelService, e }, nil } +// LabelService provides methods to manage labels in Jira Service Management. type LabelService struct { + // internalClient is the connector interface for label operations. internalClient jira.LabelConnector } diff --git a/jira/internal/link_impl.go b/jira/internal/link_impl.go index bf51051c..5298280f 100644 --- a/jira/internal/link_impl.go +++ b/jira/internal/link_impl.go @@ -5,6 +5,7 @@ import ( "github.com/ctreminiom/go-atlassian/service" ) +// NewLinkService creates new instances of LinkADFService and LinkRichTextService. func NewLinkService(client service.Connector, version string, type_ *LinkTypeService, remote *RemoteLinkService) (*LinkADFService, *LinkRichTextService, error) { if version == "" { diff --git a/jira/internal/link_impl_rich_text.go b/jira/internal/link_impl_rich_text.go index c542a280..460e8f69 100644 --- a/jira/internal/link_impl_rich_text.go +++ b/jira/internal/link_impl_rich_text.go @@ -10,10 +10,14 @@ import ( "github.com/ctreminiom/go-atlassian/service/jira" ) +// LinkRichTextService provides methods to manage issue links in Jira Service Management using the rich text format. type LinkRichTextService struct { + // internalClient is the connector interface for rich text issue link operations. internalClient jira.LinkRichTextConnector - Type *LinkTypeService - Remote *RemoteLinkService + // Type is the service for managing link types. + Type *LinkTypeService + // Remote is the service for managing remote links. + Remote *RemoteLinkService } type internalLinkRichTextServiceImpl struct { diff --git a/jira/internal/link_type_impl.go b/jira/internal/link_type_impl.go index 9d3e4d28..a5fc5159 100644 --- a/jira/internal/link_type_impl.go +++ b/jira/internal/link_type_impl.go @@ -10,6 +10,7 @@ import ( "github.com/ctreminiom/go-atlassian/service/jira" ) +// NewLinkTypeService creates a new instance of LinkTypeService. func NewLinkTypeService(client service.Connector, version string) (*LinkTypeService, error) { if version == "" { @@ -21,7 +22,9 @@ func NewLinkTypeService(client service.Connector, version string) (*LinkTypeServ }, nil } +// LinkTypeService provides methods to manage issue link types in Jira Service Management. type LinkTypeService struct { + // internalClient is the connector interface for issue link type operations. internalClient jira.LinkTypeConnector } diff --git a/jira/internal/metadata_impl.go b/jira/internal/metadata_impl.go index e23c2563..790e386d 100644 --- a/jira/internal/metadata_impl.go +++ b/jira/internal/metadata_impl.go @@ -13,6 +13,7 @@ import ( "github.com/ctreminiom/go-atlassian/service/jira" ) +// NewMetadataService creates a new instance of MetadataService. func NewMetadataService(client service.Connector, version string) (*MetadataService, error) { if version == "" { @@ -24,7 +25,9 @@ func NewMetadataService(client service.Connector, version string) (*MetadataServ }, nil } +// MetadataService provides methods to manage metadata in Jira Service Management. type MetadataService struct { + // internalClient is the connector interface for metadata operations. internalClient jira.MetadataConnector } diff --git a/jira/internal/myself_impl.go b/jira/internal/myself_impl.go index b9a3564b..f271cefb 100644 --- a/jira/internal/myself_impl.go +++ b/jira/internal/myself_impl.go @@ -11,6 +11,7 @@ import ( "strings" ) +// NewMySelfService creates a new instance of MySelfService. func NewMySelfService(client service.Connector, version string) (*MySelfService, error) { if version == "" { @@ -22,7 +23,9 @@ func NewMySelfService(client service.Connector, version string) (*MySelfService, }, nil } +// MySelfService provides methods to manage the current user's details in Jira Service Management. type MySelfService struct { + // internalClient is the connector interface for current user operations. internalClient jira.MySelfConnector } diff --git a/jira/internal/notification_scheme_impl.go b/jira/internal/notification_scheme_impl.go index 0ad18fdf..ce4b130e 100644 --- a/jira/internal/notification_scheme_impl.go +++ b/jira/internal/notification_scheme_impl.go @@ -12,6 +12,7 @@ import ( "strings" ) +// NewNotificationSchemeService creates a new instance of NotificationSchemeService. func NewNotificationSchemeService(client service.Connector, version string) (*NotificationSchemeService, error) { if version == "" { @@ -23,7 +24,9 @@ func NewNotificationSchemeService(client service.Connector, version string) (*No }, nil } +// NotificationSchemeService provides methods to manage notification schemes in Jira Service Management. type NotificationSchemeService struct { + // internalClient is the connector interface for notification scheme operations. internalClient jira.NotificationSchemeConnector } diff --git a/jira/internal/permission_impl.go b/jira/internal/permission_impl.go index fe1a198e..d5fc2ee1 100644 --- a/jira/internal/permission_impl.go +++ b/jira/internal/permission_impl.go @@ -10,6 +10,7 @@ import ( "net/http" ) +// NewPermissionService creates a new instance of PermissionService. func NewPermissionService(client service.Connector, version string, scheme *PermissionSchemeService) (*PermissionService, error) { if version == "" { @@ -22,9 +23,12 @@ func NewPermissionService(client service.Connector, version string, scheme *Perm }, nil } +// PermissionService provides methods to manage permissions in Jira Service Management. type PermissionService struct { + // internalClient is the connector interface for permission operations. internalClient jira.PermissionConnector - Scheme *PermissionSchemeService + // Scheme is the service for managing permission schemes. + Scheme *PermissionSchemeService } // Gets returns all permissions, including: global permissions, project permissions and global permissions added by plugins. diff --git a/jira/internal/permission_scheme_grant_impl.go b/jira/internal/permission_scheme_grant_impl.go index 47cd1dfd..79ea891d 100644 --- a/jira/internal/permission_scheme_grant_impl.go +++ b/jira/internal/permission_scheme_grant_impl.go @@ -11,6 +11,7 @@ import ( "strings" ) +// NewPermissionSchemeGrantService creates a new instance of PermissionSchemeGrantService. func NewPermissionSchemeGrantService(client service.Connector, version string) (*PermissionSchemeGrantService, error) { if version == "" { @@ -22,7 +23,9 @@ func NewPermissionSchemeGrantService(client service.Connector, version string) ( }, nil } +// PermissionSchemeGrantService provides methods to manage permission scheme grants in Jira Service Management. type PermissionSchemeGrantService struct { + // internalClient is the connector interface for permission scheme grant operations. internalClient jira.PermissionSchemeGrantConnector } diff --git a/jira/internal/permission_scheme_impl.go b/jira/internal/permission_scheme_impl.go index 4bb3843c..09c765f1 100644 --- a/jira/internal/permission_scheme_impl.go +++ b/jira/internal/permission_scheme_impl.go @@ -11,6 +11,7 @@ import ( "strings" ) +// NewPermissionSchemeService creates a new instance of PermissionSchemeService. func NewPermissionSchemeService(client service.Connector, version string, grant *PermissionSchemeGrantService) (*PermissionSchemeService, error) { if version == "" { @@ -23,9 +24,12 @@ func NewPermissionSchemeService(client service.Connector, version string, grant }, nil } +// PermissionSchemeService provides methods to manage permission schemes in Jira Service Management. type PermissionSchemeService struct { + // internalClient is the connector interface for permission scheme operations. internalClient jira.PermissionSchemeConnector - Grant *PermissionSchemeGrantService + // Grant is the service for managing permission scheme grants. + Grant *PermissionSchemeGrantService } // Gets returns all permission schemes. diff --git a/jira/internal/priority_impl.go b/jira/internal/priority_impl.go index 4a22acd5..89cb89c7 100644 --- a/jira/internal/priority_impl.go +++ b/jira/internal/priority_impl.go @@ -10,6 +10,7 @@ import ( "github.com/ctreminiom/go-atlassian/service/jira" ) +// NewPriorityService creates a new instance of PriorityService. func NewPriorityService(client service.Connector, version string) (*PriorityService, error) { if version == "" { @@ -21,7 +22,9 @@ func NewPriorityService(client service.Connector, version string) (*PriorityServ }, nil } +// PriorityService provides methods to manage issue priorities in Jira Service Management. type PriorityService struct { + // internalClient is the connector interface for priority operations. internalClient jira.PriorityConnector } diff --git a/jira/internal/project_category_impl.go b/jira/internal/project_category_impl.go index 2f01b79f..94ee9a39 100644 --- a/jira/internal/project_category_impl.go +++ b/jira/internal/project_category_impl.go @@ -10,6 +10,7 @@ import ( "github.com/ctreminiom/go-atlassian/service/jira" ) +// NewProjectCategoryService creates a new instance of ProjectCategoryService. func NewProjectCategoryService(client service.Connector, version string) (*ProjectCategoryService, error) { if version == "" { @@ -21,7 +22,9 @@ func NewProjectCategoryService(client service.Connector, version string) (*Proje }, nil } +// ProjectCategoryService provides methods to manage project categories in Jira Service Management. type ProjectCategoryService struct { + // internalClient is the connector interface for project category operations. internalClient jira.ProjectCategoryConnector } diff --git a/jira/internal/project_component_impl.go b/jira/internal/project_component_impl.go index 4bd52ac3..0662724a 100644 --- a/jira/internal/project_component_impl.go +++ b/jira/internal/project_component_impl.go @@ -9,6 +9,7 @@ import ( "net/http" ) +// NewProjectComponentService creates a new instance of ProjectComponentService. func NewProjectComponentService(client service.Connector, version string) (*ProjectComponentService, error) { if version == "" { @@ -20,7 +21,9 @@ func NewProjectComponentService(client service.Connector, version string) (*Proj }, nil } +// ProjectComponentService provides methods to manage project components in Jira Service Management. type ProjectComponentService struct { + // internalClient is the connector interface for project component operations. internalClient jira.ProjectComponentConnector } diff --git a/jira/internal/project_feature_impl.go b/jira/internal/project_feature_impl.go index 9c977bef..37ff5b33 100644 --- a/jira/internal/project_feature_impl.go +++ b/jira/internal/project_feature_impl.go @@ -10,6 +10,7 @@ import ( "github.com/ctreminiom/go-atlassian/service/jira" ) +// NewProjectFeatureService creates a new instance of ProjectFeatureService. func NewProjectFeatureService(client service.Connector, version string) (*ProjectFeatureService, error) { if version == "" { @@ -21,7 +22,9 @@ func NewProjectFeatureService(client service.Connector, version string) (*Projec }, nil } +// ProjectFeatureService provides methods to manage project features in Jira Service Management. type ProjectFeatureService struct { + // internalClient is the connector interface for project feature operations. internalClient jira.ProjectFeatureConnector } diff --git a/jira/internal/project_impl.go b/jira/internal/project_impl.go index b3edec22..a968fc2c 100644 --- a/jira/internal/project_impl.go +++ b/jira/internal/project_impl.go @@ -13,18 +13,29 @@ import ( "github.com/ctreminiom/go-atlassian/service/jira" ) +// ProjectChildServices holds various child services related to project management in Jira Service Management. type ProjectChildServices struct { - Category *ProjectCategoryService - Component *ProjectComponentService - Feature *ProjectFeatureService + // Category is the service for managing project categories. + Category *ProjectCategoryService + // Component is the service for managing project components. + Component *ProjectComponentService + // Feature is the service for managing project features. + Feature *ProjectFeatureService + // Permission is the service for managing project permission schemes. Permission *ProjectPermissionSchemeService - Property *ProjectPropertyService - Role *ProjectRoleService - Type *ProjectTypeService - Validator *ProjectValidatorService - Version *ProjectVersionService + // Property is the service for managing project properties. + Property *ProjectPropertyService + // Role is the service for managing project roles. + Role *ProjectRoleService + // Type is the service for managing project types. + Type *ProjectTypeService + // Validator is the service for managing project validators. + Validator *ProjectValidatorService + // Version is the service for managing project versions. + Version *ProjectVersionService } +// NewProjectService creates a new instance of ProjectService. func NewProjectService(client service.Connector, version string, subServices *ProjectChildServices) (*ProjectService, error) { if version == "" { @@ -45,17 +56,28 @@ func NewProjectService(client service.Connector, version string, subServices *Pr }, nil } +// ProjectService provides methods to manage projects in Jira Service Management. type ProjectService struct { + // internalClient is the connector interface for project operations. internalClient jira.ProjectConnector - Category *ProjectCategoryService - Component *ProjectComponentService - Feature *ProjectFeatureService - Permission *ProjectPermissionSchemeService - Property *ProjectPropertyService - Role *ProjectRoleService - Type *ProjectTypeService - Validator *ProjectValidatorService - Version *ProjectVersionService + // Category is the service for managing project categories. + Category *ProjectCategoryService + // Component is the service for managing project components. + Component *ProjectComponentService + // Feature is the service for managing project features. + Feature *ProjectFeatureService + // Permission is the service for managing project permission schemes. + Permission *ProjectPermissionSchemeService + // Property is the service for managing project properties. + Property *ProjectPropertyService + // Role is the service for managing project roles. + Role *ProjectRoleService + // Type is the service for managing project types. + Type *ProjectTypeService + // Validator is the service for managing project validators. + Validator *ProjectValidatorService + // Version is the service for managing project versions. + Version *ProjectVersionService } // Create creates a project based on a project type template diff --git a/jira/internal/project_permission_scheme_impl.go b/jira/internal/project_permission_scheme_impl.go index dd935fd0..9f503c50 100644 --- a/jira/internal/project_permission_scheme_impl.go +++ b/jira/internal/project_permission_scheme_impl.go @@ -11,6 +11,7 @@ import ( "strings" ) +// NewProjectPermissionSchemeService creates a new instance of ProjectPermissionSchemeService. func NewProjectPermissionSchemeService(client service.Connector, version string) (*ProjectPermissionSchemeService, error) { if version == "" { @@ -22,7 +23,9 @@ func NewProjectPermissionSchemeService(client service.Connector, version string) }, nil } +// ProjectPermissionSchemeService provides methods to manage project permission schemes in Jira Service Management. type ProjectPermissionSchemeService struct { + // internalClient is the connector interface for project permission scheme operations. internalClient jira.ProjectPermissionSchemeConnector } diff --git a/jira/internal/project_property_impl.go b/jira/internal/project_property_impl.go index bbf69b23..b0f70368 100644 --- a/jira/internal/project_property_impl.go +++ b/jira/internal/project_property_impl.go @@ -10,6 +10,7 @@ import ( "github.com/ctreminiom/go-atlassian/service/jira" ) +// NewProjectPropertyService creates a new instance of ProjectPropertyService. func NewProjectPropertyService(client service.Connector, version string) (*ProjectPropertyService, error) { if version == "" { @@ -21,7 +22,9 @@ func NewProjectPropertyService(client service.Connector, version string) (*Proje }, nil } +// ProjectPropertyService provides methods to manage project properties in Jira Service Management. type ProjectPropertyService struct { + // internalClient is the connector interface for project property operations. internalClient jira.ProjectPropertyConnector } diff --git a/jira/internal/project_role_actor_impl.go b/jira/internal/project_role_actor_impl.go index 74979a0b..8d78759a 100644 --- a/jira/internal/project_role_actor_impl.go +++ b/jira/internal/project_role_actor_impl.go @@ -11,6 +11,7 @@ import ( "strings" ) +// NewProjectRoleActorService creates a new instance of ProjectRoleActorService. func NewProjectRoleActorService(client service.Connector, version string) (*ProjectRoleActorService, error) { if version == "" { @@ -22,7 +23,9 @@ func NewProjectRoleActorService(client service.Connector, version string) (*Proj }, nil } +// ProjectRoleActorService provides methods to manage project role actors in Jira Service Management. type ProjectRoleActorService struct { + // internalClient is the connector interface for project role actor operations. internalClient jira.ProjectRoleActorConnector } diff --git a/jira/internal/project_role_impl.go b/jira/internal/project_role_impl.go index 1e01062a..fe865ded 100644 --- a/jira/internal/project_role_impl.go +++ b/jira/internal/project_role_impl.go @@ -14,6 +14,7 @@ import ( "github.com/ctreminiom/go-atlassian/service/jira" ) +// NewProjectRoleService creates a new instance of ProjectRoleService. func NewProjectRoleService(client service.Connector, version string, actor *ProjectRoleActorService) (*ProjectRoleService, error) { if version == "" { @@ -26,9 +27,12 @@ func NewProjectRoleService(client service.Connector, version string, actor *Proj }, nil } +// ProjectRoleService provides methods to manage project roles in Jira Service Management. type ProjectRoleService struct { + // internalClient is the connector interface for project role operations. internalClient jira.ProjectRoleConnector - Actor *ProjectRoleActorService + // Actor is the service for managing project role actors. + Actor *ProjectRoleActorService } // Gets returns a list of project roles for the project returning the name and self URL for each role. diff --git a/jira/internal/project_type_impl.go b/jira/internal/project_type_impl.go index 0589bebc..86fe73e3 100644 --- a/jira/internal/project_type_impl.go +++ b/jira/internal/project_type_impl.go @@ -9,6 +9,7 @@ import ( "net/http" ) +// NewProjectTypeService creates a new instance of ProjectTypeService. func NewProjectTypeService(client service.Connector, version string) (*ProjectTypeService, error) { if version == "" { @@ -20,7 +21,9 @@ func NewProjectTypeService(client service.Connector, version string) (*ProjectTy }, nil } +// ProjectTypeService provides methods to manage project types in Jira Service Management. type ProjectTypeService struct { + // internalClient is the connector interface for project type operations. internalClient jira.ProjectTypeConnector } diff --git a/jira/internal/project_validator_impl.go b/jira/internal/project_validator_impl.go index 8a4b2e45..8b24db06 100644 --- a/jira/internal/project_validator_impl.go +++ b/jira/internal/project_validator_impl.go @@ -10,6 +10,7 @@ import ( "net/url" ) +// NewProjectValidatorService creates a new instance of ProjectValidatorService. func NewProjectValidatorService(client service.Connector, version string) (*ProjectValidatorService, error) { if version == "" { @@ -21,7 +22,9 @@ func NewProjectValidatorService(client service.Connector, version string) (*Proj }, nil } +// ProjectValidatorService provides methods to validate project keys and names in Jira Service Management. type ProjectValidatorService struct { + // internalClient is the connector interface for project validation operations. internalClient jira.ProjectValidatorConnector } diff --git a/jira/internal/project_version_impl.go b/jira/internal/project_version_impl.go index 8d908dcc..a28f757a 100644 --- a/jira/internal/project_version_impl.go +++ b/jira/internal/project_version_impl.go @@ -13,6 +13,7 @@ import ( "github.com/ctreminiom/go-atlassian/service/jira" ) +// NewProjectVersionService creates a new instance of ProjectVersionService. func NewProjectVersionService(client service.Connector, version string) (*ProjectVersionService, error) { if version == "" { @@ -24,7 +25,9 @@ func NewProjectVersionService(client service.Connector, version string) (*Projec }, nil } +// ProjectVersionService provides methods to manage project versions in Jira Service Management. type ProjectVersionService struct { + // internalClient is the connector interface for project version operations. internalClient jira.ProjectVersionConnector } diff --git a/jira/internal/remote_link_impl.go b/jira/internal/remote_link_impl.go index 597f554a..36559504 100644 --- a/jira/internal/remote_link_impl.go +++ b/jira/internal/remote_link_impl.go @@ -12,6 +12,7 @@ import ( "github.com/ctreminiom/go-atlassian/service/jira" ) +// NewRemoteLinkService creates a new instance of RemoteLinkService. func NewRemoteLinkService(client service.Connector, version string) (*RemoteLinkService, error) { if version == "" { @@ -23,7 +24,9 @@ func NewRemoteLinkService(client service.Connector, version string) (*RemoteLink }, nil } +// RemoteLinkService provides methods to manage remote issue links in Jira Service Management. type RemoteLinkService struct { + // internalClient is the connector interface for remote link operations. internalClient jira.RemoteLinkConnector } diff --git a/jira/internal/resolution_impl.go b/jira/internal/resolution_impl.go index 1fe4dfe6..eb81de7f 100644 --- a/jira/internal/resolution_impl.go +++ b/jira/internal/resolution_impl.go @@ -10,6 +10,7 @@ import ( "github.com/ctreminiom/go-atlassian/service/jira" ) +// NewResolutionService creates a new instance of ResolutionService. func NewResolutionService(client service.Connector, version string) (*ResolutionService, error) { if version == "" { @@ -21,7 +22,9 @@ func NewResolutionService(client service.Connector, version string) (*Resolution }, nil } +// ResolutionService provides methods to manage issue resolutions in Jira Service Management. type ResolutionService struct { + // internalClient is the connector interface for resolution operations. internalClient jira.ResolutionConnector } diff --git a/jira/internal/screen_impl.go b/jira/internal/screen_impl.go index b62d8e18..5eadaafa 100644 --- a/jira/internal/screen_impl.go +++ b/jira/internal/screen_impl.go @@ -12,6 +12,7 @@ import ( "github.com/ctreminiom/go-atlassian/service/jira" ) +// NewScreenService creates a new instance of ScreenService. func NewScreenService(client service.Connector, version string, scheme *ScreenSchemeService, tab *ScreenTabService) (*ScreenService, error) { if version == "" { @@ -25,10 +26,14 @@ func NewScreenService(client service.Connector, version string, scheme *ScreenSc }, nil } +// ScreenService provides methods to manage screens in Jira Service Management. type ScreenService struct { + // internalClient is the connector interface for screen operations. internalClient jira.ScreenConnector - Scheme *ScreenSchemeService - Tab *ScreenTabService + // Scheme is the service for managing screen schemes. + Scheme *ScreenSchemeService + // Tab is the service for managing screen tabs. + Tab *ScreenTabService } // Fields returns a paginated list of the screens a field is used in. diff --git a/jira/internal/screen_scheme_impl.go b/jira/internal/screen_scheme_impl.go index db8e3ce6..9447abe1 100644 --- a/jira/internal/screen_scheme_impl.go +++ b/jira/internal/screen_scheme_impl.go @@ -13,6 +13,7 @@ import ( "github.com/ctreminiom/go-atlassian/service/jira" ) +// NewScreenSchemeService creates a new instance of ScreenSchemeService. func NewScreenSchemeService(client service.Connector, version string) (*ScreenSchemeService, error) { if version == "" { @@ -24,7 +25,9 @@ func NewScreenSchemeService(client service.Connector, version string) (*ScreenSc }, nil } +// ScreenSchemeService provides methods to manage screen schemes in Jira Service Management. type ScreenSchemeService struct { + // internalClient is the connector interface for screen scheme operations. internalClient jira.ScreenSchemeConnector } diff --git a/jira/internal/screen_tab_field_impl.go b/jira/internal/screen_tab_field_impl.go index 1f894e32..9a59d30b 100644 --- a/jira/internal/screen_tab_field_impl.go +++ b/jira/internal/screen_tab_field_impl.go @@ -9,6 +9,7 @@ import ( "net/http" ) +// NewScreenTabFieldService creates a new instance of ScreenTabFieldService. func NewScreenTabFieldService(client service.Connector, version string) (*ScreenTabFieldService, error) { if version == "" { @@ -20,7 +21,9 @@ func NewScreenTabFieldService(client service.Connector, version string) (*Screen }, nil } +// ScreenTabFieldService provides methods to manage screen tab fields in Jira Service Management. type ScreenTabFieldService struct { + // internalClient is the connector interface for screen tab field operations. internalClient jira.ScreenTabFieldConnector } diff --git a/jira/internal/screen_tab_impl.go b/jira/internal/screen_tab_impl.go index 4088347e..43f1f9cf 100644 --- a/jira/internal/screen_tab_impl.go +++ b/jira/internal/screen_tab_impl.go @@ -12,6 +12,7 @@ import ( "github.com/ctreminiom/go-atlassian/service/jira" ) +// NewScreenTabService creates a new instance of ScreenTabService. func NewScreenTabService(client service.Connector, version string, field *ScreenTabFieldService) (*ScreenTabService, error) { if version == "" { @@ -24,9 +25,12 @@ func NewScreenTabService(client service.Connector, version string, field *Screen }, nil } +// ScreenTabService provides methods to manage screen tabs in Jira Service Management. type ScreenTabService struct { + // internalClient is the connector interface for screen tab operations. internalClient jira.ScreenTabConnector - Field *ScreenTabFieldService + // Field is the service for managing screen tab fields. + Field *ScreenTabFieldService } // Gets returns the list of tabs for a screen. diff --git a/jira/internal/search_impl.go b/jira/internal/search_impl.go index 7e80e548..1a9fd7d4 100644 --- a/jira/internal/search_impl.go +++ b/jira/internal/search_impl.go @@ -5,6 +5,7 @@ import ( "github.com/ctreminiom/go-atlassian/service" ) +// NewSearchService creates a new instance of SearchADFService and SearchRichTextService. func NewSearchService(client service.Connector, version string) (*SearchADFService, *SearchRichTextService, error) { if version == "" { diff --git a/jira/internal/search_impl_adf.go b/jira/internal/search_impl_adf.go index fe696ac0..98f2f6af 100644 --- a/jira/internal/search_impl_adf.go +++ b/jira/internal/search_impl_adf.go @@ -12,7 +12,9 @@ import ( "strings" ) +// SearchADFService provides methods to manage advanced document format (ADF) searches in Jira Service Management. type SearchADFService struct { + // internalClient is the connector interface for ADF search operations. internalClient jira.SearchADFConnector } diff --git a/jira/internal/search_impl_rich_text.go b/jira/internal/search_impl_rich_text.go index b19ec92d..47d4a49a 100644 --- a/jira/internal/search_impl_rich_text.go +++ b/jira/internal/search_impl_rich_text.go @@ -12,7 +12,9 @@ import ( "strings" ) +// SearchRichTextService provides methods to manage rich text searches in Jira Service Management. type SearchRichTextService struct { + // internalClient is the connector interface for rich text search operations. internalClient jira.SearchRichTextConnector } diff --git a/jira/internal/server_impl.go b/jira/internal/server_impl.go index 5d36f4f1..93feb543 100644 --- a/jira/internal/server_impl.go +++ b/jira/internal/server_impl.go @@ -9,6 +9,7 @@ import ( "net/http" ) +// NewServerService creates a new instance of ServerService. func NewServerService(client service.Connector, version string) (*ServerService, error) { if version == "" { @@ -20,7 +21,9 @@ func NewServerService(client service.Connector, version string) (*ServerService, }, nil } +// ServerService provides methods to manage server information in Jira Service Management. type ServerService struct { + // internalClient is the connector interface for server operations. internalClient jira.ServerConnector } diff --git a/jira/internal/task_impl.go b/jira/internal/task_impl.go index a72ada81..9115d655 100644 --- a/jira/internal/task_impl.go +++ b/jira/internal/task_impl.go @@ -10,6 +10,7 @@ import ( "github.com/ctreminiom/go-atlassian/service/jira" ) +// NewTaskService creates a new instance of TaskService. func NewTaskService(client service.Connector, version string) (*TaskService, error) { if version == "" { @@ -21,7 +22,9 @@ func NewTaskService(client service.Connector, version string) (*TaskService, err }, nil } +// TaskService provides methods to manage tasks in Jira Service Management. type TaskService struct { + // internalClient is the connector interface for task operations. internalClient jira.TaskConnector } diff --git a/jira/internal/team_impl.go b/jira/internal/team_impl.go index 90f996cf..2ef7553c 100644 --- a/jira/internal/team_impl.go +++ b/jira/internal/team_impl.go @@ -8,6 +8,7 @@ import ( "net/http" ) +// NewTeamService creates a new instance of TeamService. func NewTeamService(client service.Connector) *TeamService { return &TeamService{ @@ -15,7 +16,9 @@ func NewTeamService(client service.Connector) *TeamService { } } +// TeamService provides methods to manage team information in Jira Advanced Roadmaps. type TeamService struct { + // internalClient is the connector interface for team operations. internalClient jira.TeamConnector } diff --git a/jira/internal/type_impl.go b/jira/internal/type_impl.go index 43347ad5..06138ea0 100644 --- a/jira/internal/type_impl.go +++ b/jira/internal/type_impl.go @@ -10,6 +10,7 @@ import ( "github.com/ctreminiom/go-atlassian/service/jira" ) +// NewTypeService creates a new instance of TypeService. func NewTypeService(client service.Connector, version string, scheme *TypeSchemeService, screenScheme *TypeScreenSchemeService) ( *TypeService, error) { @@ -24,10 +25,14 @@ func NewTypeService(client service.Connector, version string, scheme *TypeScheme }, nil } +// TypeService provides methods to manage issue types in Jira Service Management. type TypeService struct { + // internalClient is the connector interface for issue type operations. internalClient jira.TypeConnector - Scheme *TypeSchemeService - ScreenScheme *TypeScreenSchemeService + // Scheme is the service for managing type schemes. + Scheme *TypeSchemeService + // ScreenScheme is the service for managing type screen schemes. + ScreenScheme *TypeScreenSchemeService } // Gets returns all issue types. diff --git a/jira/internal/type_scheme_impl.go b/jira/internal/type_scheme_impl.go index 58b46ee1..b0a3bd8e 100644 --- a/jira/internal/type_scheme_impl.go +++ b/jira/internal/type_scheme_impl.go @@ -12,6 +12,7 @@ import ( "github.com/ctreminiom/go-atlassian/service/jira" ) +// NewTypeSchemeService creates a new instance of TypeSchemeService. func NewTypeSchemeService(client service.Connector, version string) (*TypeSchemeService, error) { if version == "" { @@ -23,7 +24,9 @@ func NewTypeSchemeService(client service.Connector, version string) (*TypeScheme }, nil } +// TypeSchemeService provides methods to manage issue type schemes in Jira Service Management. type TypeSchemeService struct { + // internalClient is the connector interface for issue type scheme operations. internalClient jira.TypeSchemeConnector } diff --git a/jira/internal/type_screen_scheme_impl.go b/jira/internal/type_screen_scheme_impl.go index 97fd3542..70979214 100644 --- a/jira/internal/type_screen_scheme_impl.go +++ b/jira/internal/type_screen_scheme_impl.go @@ -12,6 +12,7 @@ import ( "strings" ) +// NewTypeScreenSchemeService creates a new instance of TypeScreenSchemeService. func NewTypeScreenSchemeService(client service.Connector, version string) (*TypeScreenSchemeService, error) { if version == "" { @@ -23,7 +24,9 @@ func NewTypeScreenSchemeService(client service.Connector, version string) (*Type }, nil } +// TypeScreenSchemeService provides methods to manage issue type screen schemes in Jira Service Management. type TypeScreenSchemeService struct { + // internalClient is the connector interface for issue type screen scheme operations. internalClient jira.TypeScreenSchemeConnector } diff --git a/jira/internal/user_impl.go b/jira/internal/user_impl.go index 366bcf03..b0118674 100644 --- a/jira/internal/user_impl.go +++ b/jira/internal/user_impl.go @@ -13,6 +13,7 @@ import ( "github.com/ctreminiom/go-atlassian/service/jira" ) +// NewUserService creates a new instance of UserService. func NewUserService(client service.Connector, version string, connector *UserSearchService) (*UserService, error) { if version == "" { @@ -25,9 +26,12 @@ func NewUserService(client service.Connector, version string, connector *UserSea }, nil } +// UserService provides methods to manage users in Jira Service Management. type UserService struct { + // internalClient is the connector interface for user operations. internalClient jira.UserConnector - Search *UserSearchService + // Search is the service for searching users. + Search *UserSearchService } // Get returns a user diff --git a/jira/internal/user_search_impl.go b/jira/internal/user_search_impl.go index 825ab5dc..87489701 100644 --- a/jira/internal/user_search_impl.go +++ b/jira/internal/user_search_impl.go @@ -13,6 +13,7 @@ import ( "github.com/ctreminiom/go-atlassian/service/jira" ) +// NewUserSearchService creates a new instance of UserSearchService. func NewUserSearchService(client service.Connector, version string) (*UserSearchService, error) { if version == "" { @@ -24,7 +25,9 @@ func NewUserSearchService(client service.Connector, version string) (*UserSearch }, nil } +// UserSearchService provides methods to search for users in Jira Service Management. type UserSearchService struct { + // internalClient is the connector interface for user search operations. internalClient jira.UserSearchConnector } diff --git a/jira/internal/vote_impl.go b/jira/internal/vote_impl.go index a7fded13..5523795a 100644 --- a/jira/internal/vote_impl.go +++ b/jira/internal/vote_impl.go @@ -10,6 +10,7 @@ import ( "github.com/ctreminiom/go-atlassian/service/jira" ) +// NewVoteService creates a new instance of VoteService. func NewVoteService(client service.Connector, version string) (*VoteService, error) { if version == "" { @@ -21,7 +22,9 @@ func NewVoteService(client service.Connector, version string) (*VoteService, err }, nil } +// VoteService provides methods to manage votes on issues in Jira Service Management. type VoteService struct { + // internalClient is the connector interface for vote operations. internalClient jira.VoteConnector } diff --git a/jira/internal/watcher_impl.go b/jira/internal/watcher_impl.go index 0ecc7a77..7a739493 100644 --- a/jira/internal/watcher_impl.go +++ b/jira/internal/watcher_impl.go @@ -11,6 +11,7 @@ import ( "github.com/ctreminiom/go-atlassian/service/jira" ) +// NewWatcherService creates a new instance of WatcherService. func NewWatcherService(client service.Connector, version string) (*WatcherService, error) { if version == "" { @@ -22,7 +23,9 @@ func NewWatcherService(client service.Connector, version string) (*WatcherServic }, nil } +// WatcherService provides methods to manage watchers in Jira Service Management. type WatcherService struct { + // internalClient is the connector interface for watcher operations. internalClient jira.WatcherConnector } diff --git a/jira/internal/workflow_impl.go b/jira/internal/workflow_impl.go index 57235ec4..8e520353 100644 --- a/jira/internal/workflow_impl.go +++ b/jira/internal/workflow_impl.go @@ -13,6 +13,7 @@ import ( "github.com/ctreminiom/go-atlassian/service/jira" ) +// NewWorkflowService creates a new instance of WorkflowService. func NewWorkflowService(client service.Connector, version string, scheme *WorkflowSchemeService, status *WorkflowStatusService) (*WorkflowService, error) { if version == "" { @@ -26,10 +27,14 @@ func NewWorkflowService(client service.Connector, version string, scheme *Workfl }, nil } +// WorkflowService provides methods to manage workflows in Jira Service Management. type WorkflowService struct { + // internalClient is the connector interface for workflow operations. internalClient jira.WorkflowConnector - Scheme *WorkflowSchemeService - Status *WorkflowStatusService + // Scheme is the service for managing workflow schemes. + Scheme *WorkflowSchemeService + // Status is the service for managing workflow statuses. + Status *WorkflowStatusService } // Create creates a workflow. diff --git a/jira/internal/workflow_scheme_impl.go b/jira/internal/workflow_scheme_impl.go index 7d075c25..9c7be77c 100644 --- a/jira/internal/workflow_scheme_impl.go +++ b/jira/internal/workflow_scheme_impl.go @@ -13,6 +13,7 @@ import ( "github.com/ctreminiom/go-atlassian/service/jira" ) +// NewWorkflowSchemeService creates a new instance of WorkflowSchemeService. func NewWorkflowSchemeService(client service.Connector, version string, issueType *WorkflowSchemeIssueTypeService) *WorkflowSchemeService { return &WorkflowSchemeService{ @@ -21,9 +22,12 @@ func NewWorkflowSchemeService(client service.Connector, version string, issueTyp } } +// WorkflowSchemeService provides methods to manage workflow schemes in Jira Service Management. type WorkflowSchemeService struct { + // internalClient is the connector interface for workflow scheme operations. internalClient jira.WorkflowSchemeConnector - IssueType *WorkflowSchemeIssueTypeService + // IssueType is the service for managing workflow scheme issue types. + IssueType *WorkflowSchemeIssueTypeService } // Gets returns a paginated list of all workflow schemes, not including draft workflow schemes. diff --git a/jira/internal/workflow_scheme_issue_type_impl.go b/jira/internal/workflow_scheme_issue_type_impl.go index a08d6871..d85ca6a7 100644 --- a/jira/internal/workflow_scheme_issue_type_impl.go +++ b/jira/internal/workflow_scheme_issue_type_impl.go @@ -11,6 +11,7 @@ import ( "strings" ) +// NewWorkflowSchemeIssueTypeService creates a new instance of WorkflowSchemeIssueTypeService. func NewWorkflowSchemeIssueTypeService(client service.Connector, version string) *WorkflowSchemeIssueTypeService { return &WorkflowSchemeIssueTypeService{ @@ -18,7 +19,9 @@ func NewWorkflowSchemeIssueTypeService(client service.Connector, version string) } } +// WorkflowSchemeIssueTypeService provides methods to manage issue type-workflow mappings in workflow schemes. type WorkflowSchemeIssueTypeService struct { + // internalClient is the connector interface for workflow scheme issue type operations. internalClient jira.WorkflowSchemeIssueTypeConnector } diff --git a/jira/internal/workflow_status_impl.go b/jira/internal/workflow_status_impl.go index 21ad596d..33fc8ff7 100644 --- a/jira/internal/workflow_status_impl.go +++ b/jira/internal/workflow_status_impl.go @@ -12,6 +12,7 @@ import ( "strings" ) +// NewWorkflowStatusService creates a new instance of WorkflowStatusService. func NewWorkflowStatusService(client service.Connector, version string) (*WorkflowStatusService, error) { if version == "" { @@ -23,7 +24,9 @@ func NewWorkflowStatusService(client service.Connector, version string) (*Workfl }, nil } +// WorkflowStatusService provides methods to manage workflow statuses in Jira Service Management. type WorkflowStatusService struct { + // internalClient is the connector interface for workflow status operations. internalClient jira.WorkflowStatusConnector } diff --git a/jira/internal/worklog_impl_adf.go b/jira/internal/worklog_impl_adf.go index 05b21a98..cfc5afd1 100644 --- a/jira/internal/worklog_impl_adf.go +++ b/jira/internal/worklog_impl_adf.go @@ -13,6 +13,7 @@ import ( "github.com/ctreminiom/go-atlassian/service/jira" ) +// NewWorklogADFService creates a new instance of WorklogADFService. func NewWorklogADFService(client service.Connector, version string) (*WorklogADFService, error) { if version == "" { @@ -24,7 +25,9 @@ func NewWorklogADFService(client service.Connector, version string) (*WorklogADF }, nil } +// WorklogADFService provides methods to manage worklogs in Jira Service Management. type WorklogADFService struct { + // internalClient is the connector interface for worklog operations. internalClient jira.WorklogADFConnector } diff --git a/jira/internal/worklog_impl_rich_text.go b/jira/internal/worklog_impl_rich_text.go index 8695cb2b..95cef639 100644 --- a/jira/internal/worklog_impl_rich_text.go +++ b/jira/internal/worklog_impl_rich_text.go @@ -12,6 +12,7 @@ import ( "strings" ) +// NewWorklogRichTextService creates a new instance of WorklogRichTextService. func NewWorklogRichTextService(client service.Connector, version string) (*WorklogRichTextService, error) { if version == "" { @@ -23,7 +24,9 @@ func NewWorklogRichTextService(client service.Connector, version string) (*Workl }, nil } +// WorklogRichTextService provides methods to manage worklogs in Jira Service Management. type WorklogRichTextService struct { + // internalClient is the connector interface for worklog operations. internalClient jira.WorklogRichTextConnector } diff --git a/jira/sm/internal/approval_impl.go b/jira/sm/internal/approval_impl.go index c0788d5b..7324f542 100644 --- a/jira/sm/internal/approval_impl.go +++ b/jira/sm/internal/approval_impl.go @@ -11,14 +11,17 @@ import ( "strconv" ) +// NewApprovalService creates a new instance of ApprovalService. +// It takes a service.Connector and a version string as input and returns a pointer to ApprovalService. func NewApprovalService(client service.Connector, version string) *ApprovalService { - return &ApprovalService{ internalClient: &internalServiceRequestApprovalImpl{c: client, version: version}, } } +// ApprovalService provides methods to interact with approval operations in Jira Service Management. type ApprovalService struct { + // internalClient is the connector interface for approval operations. internalClient sm.ApprovalConnector } diff --git a/jira/sm/internal/attachment_impl.go b/jira/sm/internal/attachment_impl.go index 1357d7ef..2a7c71d3 100644 --- a/jira/sm/internal/attachment_impl.go +++ b/jira/sm/internal/attachment_impl.go @@ -12,14 +12,17 @@ import ( "github.com/ctreminiom/go-atlassian/service/sm" ) +// NewAttachmentService creates a new instance of AttachmentService. +// It takes a service.Connector and a version string as input and returns a pointer to AttachmentService. func NewAttachmentService(client service.Connector, version string) *AttachmentService { - return &AttachmentService{ internalClient: &internalServiceRequestAttachmentImpl{c: client, version: version}, } } +// AttachmentService provides methods to interact with attachment operations in Jira Service Management. type AttachmentService struct { + // internalClient is the connector interface for attachment operations. internalClient sm.AttachmentConnector } diff --git a/jira/sm/internal/authentication_impl.go b/jira/sm/internal/authentication_impl.go index 59ab2f4b..ff5af654 100644 --- a/jira/sm/internal/authentication_impl.go +++ b/jira/sm/internal/authentication_impl.go @@ -5,61 +5,81 @@ import ( "github.com/ctreminiom/go-atlassian/service/common" ) +// NewAuthenticationService creates a new instance of AuthenticationService. +// It takes a service.Connector as input and returns a common.Authentication interface. func NewAuthenticationService(client service.Connector) common.Authentication { return &AuthenticationService{c: client} } +// AuthenticationService provides methods to manage authentication in Jira Service Management. type AuthenticationService struct { + // c is the connector interface for authentication operations. c service.Connector + // basicAuthProvided indicates if basic authentication credentials have been provided. basicAuthProvided bool - mail, token string + // mail is the email address used for basic authentication. + // token is the token used for basic authentication. + mail, token string + // userAgentProvided indicates if a user agent has been provided. + // agent is the user agent string. userAgentProvided bool agent string + // experimentalFlagSet indicates if the experimental flag has been set. experimentalFlagSet bool } +// SetBearerToken sets the bearer token for authentication. func (a *AuthenticationService) SetBearerToken(token string) { a.token = token } +// GetBearerToken returns the bearer token used for authentication. func (a *AuthenticationService) GetBearerToken() string { return a.token } + +// SetExperimentalFlag sets the experimental flag. func (a *AuthenticationService) SetExperimentalFlag() { a.experimentalFlagSet = true } +// HasSetExperimentalFlag returns true if the experimental flag has been set. func (a *AuthenticationService) HasSetExperimentalFlag() bool { return a.experimentalFlagSet } +// SetBasicAuth sets the basic authentication credentials. func (a *AuthenticationService) SetBasicAuth(mail, token string) { a.mail = mail a.token = token - a.basicAuthProvided = true } +// GetBasicAuth returns the email and token used for basic authentication. func (a *AuthenticationService) GetBasicAuth() (string, string) { return a.mail, a.token } +// HasBasicAuth returns true if basic authentication credentials have been provided. func (a *AuthenticationService) HasBasicAuth() bool { return a.basicAuthProvided } +// SetUserAgent sets the user agent string. func (a *AuthenticationService) SetUserAgent(agent string) { a.agent = agent a.userAgentProvided = true } +// GetUserAgent returns the user agent string. func (a *AuthenticationService) GetUserAgent() string { return a.agent } +// HasUserAgent returns true if a user agent has been provided. func (a *AuthenticationService) HasUserAgent() bool { return a.userAgentProvided } diff --git a/jira/sm/internal/comment_impl.go b/jira/sm/internal/comment_impl.go index e52e600c..02c5e645 100644 --- a/jira/sm/internal/comment_impl.go +++ b/jira/sm/internal/comment_impl.go @@ -15,14 +15,17 @@ import ( "github.com/ctreminiom/go-atlassian/service/sm" ) +// NewCommentService creates a new instance of CommentService. +// It takes a service.Connector and a version string as input and returns a pointer to CommentService. func NewCommentService(client service.Connector, version string) *CommentService { - return &CommentService{ internalClient: &internalServiceRequestCommentImpl{c: client, version: version}, } } +// CommentService provides methods to interact with comment operations in Jira Service Management. type CommentService struct { + // internalClient is the connector interface for comment operations. internalClient sm.CommentConnector } diff --git a/jira/sm/internal/customer_impl.go b/jira/sm/internal/customer_impl.go index 6bf80f20..d4733b85 100644 --- a/jira/sm/internal/customer_impl.go +++ b/jira/sm/internal/customer_impl.go @@ -12,14 +12,17 @@ import ( "github.com/ctreminiom/go-atlassian/service/sm" ) +// NewCustomerService creates a new instance of CustomerService. +// It takes a service.Connector and a version string as input and returns a pointer to CustomerService. func NewCustomerService(client service.Connector, version string) *CustomerService { - return &CustomerService{ internalClient: &internalCustomerImpl{c: client, version: version}, } } +// CustomerService provides methods to interact with customer operations in Jira Service Management. type CustomerService struct { + // internalClient is the connector interface for customer operations. internalClient sm.CustomerConnector } diff --git a/jira/sm/internal/feedback_impl.go b/jira/sm/internal/feedback_impl.go index 3a4a3935..9adb73b9 100644 --- a/jira/sm/internal/feedback_impl.go +++ b/jira/sm/internal/feedback_impl.go @@ -9,14 +9,17 @@ import ( "net/http" ) +// NewFeedbackService creates a new instance of FeedbackService. +// It takes a service.Connector and a version string as input and returns a pointer to FeedbackService. func NewFeedbackService(client service.Connector, version string) *FeedbackService { - return &FeedbackService{ internalClient: &internalServiceRequestFeedbackImpl{c: client, version: version}, } } +// FeedbackService provides methods to interact with feedback operations in Jira Service Management. type FeedbackService struct { + // internalClient is the connector interface for feedback operations. internalClient sm.FeedbackConnector } diff --git a/jira/sm/internal/info_impl.go b/jira/sm/internal/info_impl.go index 714df214..8d862b8a 100644 --- a/jira/sm/internal/info_impl.go +++ b/jira/sm/internal/info_impl.go @@ -8,6 +8,8 @@ import ( "net/http" ) +// NewInfoService creates a new instance of InfoService. +// It takes a service.Connector and a version string as input and returns a pointer to InfoService. func NewInfoService(client service.Connector, version string) *InfoService { return &InfoService{ @@ -15,7 +17,9 @@ func NewInfoService(client service.Connector, version string) *InfoService { } } +// InfoService provides methods to interact with information operations in Jira Service Management. type InfoService struct { + // internalClient is the connector interface for information operations. internalClient sm.InfoConnector } diff --git a/jira/sm/internal/knowledgebase_impl.go b/jira/sm/internal/knowledgebase_impl.go index fb7498ef..fa2d1517 100644 --- a/jira/sm/internal/knowledgebase_impl.go +++ b/jira/sm/internal/knowledgebase_impl.go @@ -11,14 +11,17 @@ import ( "strconv" ) +// NewKnowledgebaseService creates a new instance of KnowledgebaseService. +// It takes a service.Connector and a version string as input and returns a pointer to KnowledgebaseService. func NewKnowledgebaseService(client service.Connector, version string) *KnowledgebaseService { - return &KnowledgebaseService{ internalClient: &internalKnowledgebaseImpl{c: client, version: version}, } } +// KnowledgebaseService provides methods to interact with knowledge base operations in Jira Service Management. type KnowledgebaseService struct { + // internalClient is the connector interface for knowledge base operations. internalClient sm.KnowledgeBaseConnector } diff --git a/jira/sm/internal/organization_impl.go b/jira/sm/internal/organization_impl.go index 0e13567e..788720f9 100644 --- a/jira/sm/internal/organization_impl.go +++ b/jira/sm/internal/organization_impl.go @@ -11,14 +11,17 @@ import ( "strconv" ) +// NewOrganizationService creates a new instance of OrganizationService. +// It takes a service.Connector and a version string as input and returns a pointer to OrganizationService. func NewOrganizationService(client service.Connector, version string) *OrganizationService { - return &OrganizationService{ internalClient: &internalOrganizationImpl{c: client, version: version}, } } +// OrganizationService provides methods to interact with organization operations in Jira Service Management. type OrganizationService struct { + // internalClient is the connector interface for organization operations. internalClient sm.OrganizationConnector } diff --git a/jira/sm/internal/participant_impl.go b/jira/sm/internal/participant_impl.go index f09abc55..be0423bc 100644 --- a/jira/sm/internal/participant_impl.go +++ b/jira/sm/internal/participant_impl.go @@ -11,14 +11,17 @@ import ( "strconv" ) +// NewParticipantService creates a new instance of ParticipantService. +// It takes a service.Connector and a version string as input and returns a pointer to ParticipantService. func NewParticipantService(client service.Connector, version string) *ParticipantService { - return &ParticipantService{ internalClient: &internalServiceRequestParticipantImpl{c: client, version: version}, } } +// ParticipantService provides methods to interact with participant operations in Jira Service Management. type ParticipantService struct { + // internalClient is the connector interface for participant operations. internalClient sm.ParticipantConnector } diff --git a/jira/sm/internal/queue_impl.go b/jira/sm/internal/queue_impl.go index bdb31289..c6881aad 100644 --- a/jira/sm/internal/queue_impl.go +++ b/jira/sm/internal/queue_impl.go @@ -11,6 +11,8 @@ import ( "strconv" ) +// NewQueueService creates a new instance of QueueService. +// It takes a service.Connector and a version string as input and returns a pointer to QueueService. func NewQueueService(client service.Connector, version string) *QueueService { return &QueueService{ @@ -18,7 +20,9 @@ func NewQueueService(client service.Connector, version string) *QueueService { } } +// QueueService provides methods to interact with queue operations in Jira Service Management. type QueueService struct { + // internalClient is the connector interface for queue operations. internalClient sm.QueueConnector } diff --git a/jira/sm/internal/request_impl.go b/jira/sm/internal/request_impl.go index 0ec28676..c4cc0d50 100644 --- a/jira/sm/internal/request_impl.go +++ b/jira/sm/internal/request_impl.go @@ -12,16 +12,27 @@ import ( "strings" ) +// ServiceRequestSubServices holds the sub-services related to service requests in Jira Service Management. type ServiceRequestSubServices struct { - Approval *ApprovalService - Attachment *AttachmentService - Comment *CommentService + // Approval handles approval operations. + Approval *ApprovalService + // Attachment handles attachment operations. + Attachment *AttachmentService + // Comment handles comment operations. + Comment *CommentService + // Participant handles participant operations. Participant *ParticipantService - SLA *ServiceLevelAgreementService - Feedback *FeedbackService - Type *TypeService + // SLA handles service level agreement operations. + SLA *ServiceLevelAgreementService + // Feedback handles feedback operations. + Feedback *FeedbackService + // Type handles request type operations. + Type *TypeService } +// NewRequestService creates a new instance of RequestService. +// It takes a service.Connector, a version string, and an optional ServiceRequestSubServices as input. +// Returns a pointer to RequestService and an error if the version is not provided. func NewRequestService(client service.Connector, version string, subServices *ServiceRequestSubServices) (*RequestService, error) { if version == "" { @@ -40,21 +51,29 @@ func NewRequestService(client service.Connector, version string, subServices *Se requestService.SLA = subServices.SLA requestService.Feedback = subServices.Feedback requestService.Type = subServices.Type - } return requestService, nil } +// RequestService provides methods to interact with service request operations in Jira Service Management. type RequestService struct { + // internalClient is the connector interface for service request operations. internalClient sm.RequestConnector - Approval *ApprovalService - Attachment *AttachmentService - Comment *CommentService - Participant *ParticipantService - SLA *ServiceLevelAgreementService - Feedback *FeedbackService - Type *TypeService + // Approval handles approval operations. + Approval *ApprovalService + // Attachment handles attachment operations. + Attachment *AttachmentService + // Comment handles comment operations. + Comment *CommentService + // Participant handles participant operations. + Participant *ParticipantService + // SLA handles service level agreement operations. + SLA *ServiceLevelAgreementService + // Feedback handles feedback operations. + Feedback *FeedbackService + // Type handles request type operations. + Type *TypeService } // Create creates a customer request in a service desk. diff --git a/jira/sm/internal/service_desk_impl.go b/jira/sm/internal/service_desk_impl.go index a5e0c93c..43427b55 100644 --- a/jira/sm/internal/service_desk_impl.go +++ b/jira/sm/internal/service_desk_impl.go @@ -15,6 +15,9 @@ import ( "github.com/ctreminiom/go-atlassian/service/sm" ) +// NewServiceDeskService creates a new instance of ServiceDeskService. +// It takes a service.Connector, a version string, and a QueueService as input. +// Returns a pointer to ServiceDeskService and an error if the version is not provided. func NewServiceDeskService(client service.Connector, version string, queue *QueueService) (*ServiceDeskService, error) { if version == "" { @@ -27,9 +30,12 @@ func NewServiceDeskService(client service.Connector, version string, queue *Queu }, nil } +// ServiceDeskService provides methods to interact with service desk operations in Jira Service Management. type ServiceDeskService struct { + // internalClient is the connector interface for service desk operations. internalClient sm.ServiceDeskConnector - Queue *QueueService + // Queue handles queue operations. + Queue *QueueService } // Gets returns all the service desks in the Jira Service Management instance that the user has permission to access. diff --git a/jira/sm/internal/sla_impl.go b/jira/sm/internal/sla_impl.go index 013fc6a4..23b2551d 100644 --- a/jira/sm/internal/sla_impl.go +++ b/jira/sm/internal/sla_impl.go @@ -11,14 +11,17 @@ import ( "strconv" ) +// NewServiceLevelAgreementService creates a new instance of ServiceLevelAgreementService. +// It takes a service.Connector and a version string as input and returns a pointer to ServiceLevelAgreementService. func NewServiceLevelAgreementService(client service.Connector, version string) *ServiceLevelAgreementService { - return &ServiceLevelAgreementService{ internalClient: &internalServiceLevelAgreementImpl{c: client, version: version}, } } +// ServiceLevelAgreementService provides methods to interact with SLA operations in Jira Service Management. type ServiceLevelAgreementService struct { + // internalClient is the connector interface for SLA operations. internalClient sm.ServiceLevelAgreementConnector } diff --git a/jira/sm/internal/type_impl.go b/jira/sm/internal/type_impl.go index a1ffe4fb..ec8c5130 100644 --- a/jira/sm/internal/type_impl.go +++ b/jira/sm/internal/type_impl.go @@ -12,6 +12,8 @@ import ( "github.com/ctreminiom/go-atlassian/service/sm" ) +// NewTypeService creates a new instance of TypeService. +// It takes a service.Connector and a version string as input and returns a pointer to TypeService. func NewTypeService(client service.Connector, version string) *TypeService { return &TypeService{ @@ -19,7 +21,9 @@ func NewTypeService(client service.Connector, version string) *TypeService { } } +// TypeService provides methods to interact with request type operations in Jira Service Management. type TypeService struct { + // internalClient is the connector interface for request type operations. internalClient sm.TypeConnector } diff --git a/jira/sm/internal/workspace_impl.go b/jira/sm/internal/workspace_impl.go index 14750500..58f6e955 100644 --- a/jira/sm/internal/workspace_impl.go +++ b/jira/sm/internal/workspace_impl.go @@ -8,6 +8,8 @@ import ( "net/http" ) +// NewWorkSpaceService creates a new instance of WorkSpaceService. +// It takes a service.Connector and a version string as input and returns a pointer to WorkSpaceService. func NewWorkSpaceService(client service.Connector, version string) *WorkSpaceService { return &WorkSpaceService{ @@ -15,7 +17,9 @@ func NewWorkSpaceService(client service.Connector, version string) *WorkSpaceSer } } +// WorkSpaceService provides methods to interact with workspace operations in Jira Service Management. type WorkSpaceService struct { + // internalClient is the connector interface for workspace operations. internalClient sm.WorkSpaceConnector } diff --git a/pkg/infra/models/assets_ticket.go b/pkg/infra/models/assets_ticket.go index f512ea4e..dc9fceaa 100644 --- a/pkg/infra/models/assets_ticket.go +++ b/pkg/infra/models/assets_ticket.go @@ -1,8 +1,6 @@ package models // TicketPageScheme represents a paginated list of tickets. -// Tickets is a slice of the tickets on the page. -// AllTicketsQuery is a query that fetches all tickets. type TicketPageScheme struct { Tickets []*TicketScheme `json:"tickets,omitempty"` // The tickets on the page. AllTicketsQuery string `json:"allTicketsQuery,omitempty"` // A query that fetches all tickets. @@ -24,9 +22,6 @@ type TicketScheme struct { } // TicketStatusScheme represents the status of a ticket. -// Name is the name of the status. -// Description is the description of the status. -// ColorName is the name of the color associated with the status. type TicketStatusScheme struct { Name string `json:"name,omitempty"` // The name of the status. Description string `json:"description,omitempty"` // The description of the status. @@ -34,9 +29,6 @@ type TicketStatusScheme struct { } // TicketTypeScheme represents the type of a ticket. -// Name is the name of the type. -// Description is the description of the type. -// IconURL is the URL of the icon associated with the type. type TicketTypeScheme struct { Name string `json:"name,omitempty"` // The name of the type. Description string `json:"description,omitempty"` // The description of the type. @@ -44,8 +36,6 @@ type TicketTypeScheme struct { } // TicketPriorityScheme represents the priority of a ticket. -// Name is the name of the priority. -// IconURL is the URL of the icon associated with the priority. type TicketPriorityScheme struct { Name string `json:"name,omitempty"` // The name of the priority. IconURL string `json:"iconUrl,omitempty"` // The URL of the icon associated with the priority. diff --git a/pkg/infra/models/bitbucket_branch.go b/pkg/infra/models/bitbucket_branch.go index b3aeb13e..98f025e4 100644 --- a/pkg/infra/models/bitbucket_branch.go +++ b/pkg/infra/models/bitbucket_branch.go @@ -1,8 +1,6 @@ package models // BranchScheme represents a branch in a repository. -// MergeStrategies is a slice of the merge strategies available for the branch. -// DefaultMergeStrategy is the default merge strategy used for the branch. type BranchScheme struct { MergeStrategies []string `json:"merge_strategies"` // The merge strategies available for the branch. DefaultMergeStrategy string `json:"default_merge_strategy"` // The default merge strategy used for the branch. diff --git a/pkg/infra/models/bitbucket_repository.go b/pkg/infra/models/bitbucket_repository.go index ba13a2a8..cc480d38 100644 --- a/pkg/infra/models/bitbucket_repository.go +++ b/pkg/infra/models/bitbucket_repository.go @@ -1,12 +1,6 @@ package models // RepositoryPermissionPageScheme represents a paginated list of repository permissions. -// Size is the number of permissions in the current page. -// Page is the current page number. -// Pagelen is the total number of pages. -// Next is the URL to the next page. -// Previous is the URL to the previous page. -// Values is a slice of the repository permissions in the current page. type RepositoryPermissionPageScheme struct { Size int `json:"size,omitempty"` // The number of permissions in the current page. Page int `json:"page,omitempty"` // The current page number. @@ -17,10 +11,6 @@ type RepositoryPermissionPageScheme struct { } // RepositoryPermissionScheme represents a repository permission. -// Type is the type of the permission. -// Permission is the level of the permission. -// User is the user who has the permission. -// Repository is the repository to which the permission applies. type RepositoryPermissionScheme struct { Type string `json:"type,omitempty"` // The type of the permission. Permission string `json:"permission,omitempty"` // The level of the permission. @@ -29,24 +19,6 @@ type RepositoryPermissionScheme struct { } // RepositoryScheme represents a repository. -// Type is the type of the repository. -// UUID is the unique identifier of the repository. -// FullName is the full name of the repository. -// IsPrivate indicates if the repository is private. -// SCM is the source control management system used by the repository. -// Name is the name of the repository. -// Description is the description of the repository. -// CreatedOn is the creation time of the repository. -// UpdatedOn is the update time of the repository. -// Size is the size of the repository. -// Language is the programming language used in the repository. -// HasIssues indicates if the repository has issues enabled. -// HasWiki indicates if the repository has a wiki enabled. -// ForkPolicy is the fork policy of the repository. -// Owner is the owner of the repository. -// Parent is the parent repository, if the repository is a fork. -// Project is the project to which the repository belongs. -// Links is a collection of links related to the repository. type RepositoryScheme struct { Type string `json:"type,omitempty"` // The type of the repository. UUID string `json:"uuid,omitempty"` // The unique identifier of the repository. @@ -69,16 +41,6 @@ type RepositoryScheme struct { } // RepositoryLinksScheme represents a collection of links related to a repository. -// Self is the link to the repository itself. -// HTML is the link to the repository's HTML page. -// Avatar is the link to the repository's avatar. -// PullRequests is the link to the repository's pull requests. -// Commits is the link to the repository's commits. -// Forks is the link to the repository's forks. -// Watchers is the link to the repository's watchers. -// Downloads is the link to the repository's downloads. -// Clone is a slice of links to clone the repository. -// Hooks is the link to the repository's hooks. type RepositoryLinksScheme struct { Self *BitbucketLinkScheme `json:"self,omitempty"` // The link to the repository itself. HTML *BitbucketLinkScheme `json:"html,omitempty"` // The link to the repository's HTML page. diff --git a/pkg/infra/models/bitbucket_webhooks.go b/pkg/infra/models/bitbucket_webhooks.go index c8531ea8..9c97030f 100644 --- a/pkg/infra/models/bitbucket_webhooks.go +++ b/pkg/infra/models/bitbucket_webhooks.go @@ -1,10 +1,6 @@ package models // WebhookSubscriptionPayloadScheme represents the payload for a webhook subscription. -// Description is the description of the webhook subscription. -// URL is the URL of the webhook subscription. -// Active indicates if the webhook subscription is active. -// Events is a slice of the events for the webhook subscription. type WebhookSubscriptionPayloadScheme struct { Description string `json:"description,omitempty"` // The description of the webhook subscription. URL string `json:"url,omitempty"` // The URL of the webhook subscription. @@ -13,12 +9,6 @@ type WebhookSubscriptionPayloadScheme struct { } // WebhookSubscriptionPageScheme represents a paginated list of webhook subscriptions. -// Size is the number of subscriptions in the current page. -// Page is the current page number. -// Pagelen is the total number of pages. -// Next is the URL to the next page. -// Previous is the URL to the previous page. -// Values is a slice of the webhook subscriptions in the current page. type WebhookSubscriptionPageScheme struct { Size int `json:"size,omitempty"` // The number of subscriptions in the current page. Page int `json:"page,omitempty"` // The current page number. @@ -29,14 +19,6 @@ type WebhookSubscriptionPageScheme struct { } // WebhookSubscriptionScheme represents a webhook subscription. -// UUID is the unique identifier of the webhook subscription. -// URL is the URL of the webhook subscription. -// Description is the description of the webhook subscription. -// SubjectType is the type of the subject of the webhook subscription. -// Subject is the subject of the webhook subscription. -// Active indicates if the webhook subscription is active. -// CreatedAt is the creation time of the webhook subscription. -// Events is a slice of the events for the webhook subscription. type WebhookSubscriptionScheme struct { UUID string `json:"uuid,omitempty"` // The unique identifier of the webhook subscription. URL string `json:"url,omitempty"` // The URL of the webhook subscription. @@ -49,7 +31,6 @@ type WebhookSubscriptionScheme struct { } // WebhookSubscriptionSubjectScheme represents the subject of a webhook subscription. -// Type is the type of the subject. type WebhookSubscriptionSubjectScheme struct { Type string `json:"type,omitempty"` // The type of the subject. } diff --git a/pkg/infra/models/bitbucket_workspace.go b/pkg/infra/models/bitbucket_workspace.go index 00308de9..0c88b664 100644 --- a/pkg/infra/models/bitbucket_workspace.go +++ b/pkg/infra/models/bitbucket_workspace.go @@ -1,14 +1,6 @@ package models // WorkspaceScheme represents a workspace. -// Type is the type of the workspace. -// Links is a collection of links related to the workspace. -// UUID is the unique identifier of the workspace. -// Name is the name of the workspace. -// Slug is the slug of the workspace. -// IsPrivate indicates if the workspace is private. -// CreatedOn is the creation time of the workspace. -// UpdatedOn is the update time of the workspace. type WorkspaceScheme struct { Type string `json:"type,omitempty"` // The type of the workspace. Links *WorkspaceLinksScheme `json:"links,omitempty"` // The links related to the workspace. @@ -21,14 +13,6 @@ type WorkspaceScheme struct { } // WorkspaceLinksScheme represents a collection of links related to a workspace. -// Avatar is the link to the workspace's avatar. -// HTML is the link to the workspace's HTML page. -// Members is the link to the workspace's members. -// Owners is the link to the workspace's owners. -// Projects is the link to the workspace's projects. -// Repositories is the link to the workspace's repositories. -// Snippets is the link to the workspace's snippets. -// Self is the link to the workspace itself. type WorkspaceLinksScheme struct { Avatar *BitbucketLinkScheme `json:"avatar,omitempty"` // The link to the workspace's avatar. HTML *BitbucketLinkScheme `json:"html,omitempty"` // The link to the workspace's HTML page. @@ -41,8 +25,6 @@ type WorkspaceLinksScheme struct { } // BitbucketLinkScheme represents a link in Bitbucket. -// Href is the URL of the link. -// Name is the name of the link. type BitbucketLinkScheme struct { Href string `json:"href,omitempty"` // The URL of the link. Name string `json:"name,omitempty"` // The name of the link. diff --git a/pkg/infra/models/bitbucket_workspace_membership.go b/pkg/infra/models/bitbucket_workspace_membership.go index 5fb446e2..34f84f6a 100644 --- a/pkg/infra/models/bitbucket_workspace_membership.go +++ b/pkg/infra/models/bitbucket_workspace_membership.go @@ -3,12 +3,6 @@ package models import "time" // WorkspaceMembershipPageScheme represents a paginated list of workspace memberships. -// Size is the number of memberships in the current page. -// Page is the current page number. -// Pagelen is the total number of pages. -// Next is the URL to the next page. -// Previous is the URL to the previous page. -// Values is a slice of the workspace memberships in the current page. type WorkspaceMembershipPageScheme struct { Size int `json:"size,omitempty"` // The number of memberships in the current page. Page int `json:"page,omitempty"` // The current page number. @@ -19,12 +13,6 @@ type WorkspaceMembershipPageScheme struct { } // WorkspaceMembershipScheme represents a workspace membership. -// Links is a collection of links related to the membership. -// User is the user who has the membership. -// Workspace is the workspace to which the membership applies. -// AddedOn is the time when the membership was added. -// Permission is the level of the membership. -// LastAccessed is the last time the membership was accessed. type WorkspaceMembershipScheme struct { Links *WorkspaceMembershipLinksScheme `json:"links,omitempty"` // The links related to the membership. User *BitbucketAccountScheme `json:"user,omitempty"` // The user who has the membership. @@ -35,20 +23,11 @@ type WorkspaceMembershipScheme struct { } // WorkspaceMembershipLinksScheme represents a collection of links related to a workspace membership. -// Self is the link to the membership itself. type WorkspaceMembershipLinksScheme struct { Self *BitbucketLinkScheme `json:"self,omitempty"` // The link to the membership itself. } // BitbucketAccountScheme represents a Bitbucket account. -// Links is a collection of links related to the account. -// CreatedOn is the creation time of the account. -// DisplayName is the display name of the account. -// Username is the username of the account. -// UUID is the unique identifier of the account. -// Type is the type of the account. -// AccountID is the account ID of the account. -// Nickname is the nickname of the account. type BitbucketAccountScheme struct { Links *BitbucketAccountLinksScheme `json:"links,omitempty"` // The links related to the account. CreatedOn string `json:"created_on,omitempty"` // The creation time of the account. @@ -61,9 +40,6 @@ type BitbucketAccountScheme struct { } // BitbucketAccountLinksScheme represents a collection of links related to a Bitbucket account. -// Avatar is the link to the account's avatar. -// Self is the link to the account itself. -// HTML is the link to the account's HTML page. type BitbucketAccountLinksScheme struct { Avatar *BitbucketLinkScheme `json:"avatar,omitempty"` // The link to the account's avatar. Self *BitbucketLinkScheme `json:"self,omitempty"` // The link to the account itself. diff --git a/pkg/infra/models/confluence_attachment.go b/pkg/infra/models/confluence_attachment.go index 031f4ec3..34f7d34a 100644 --- a/pkg/infra/models/confluence_attachment.go +++ b/pkg/infra/models/confluence_attachment.go @@ -1,20 +1,6 @@ package models // AttachmentScheme represents an attachment in Confluence. -// ID is the unique identifier of the attachment. -// BlogPostID is the ID of the blog post to which the attachment belongs. -// CustomContentID is the custom content ID of the attachment. -// Comment is the comment for the attachment. -// MediaTypeDescription is the description of the media type of the attachment. -// WebuiLink is the web UI link of the attachment. -// DownloadLink is the download link of the attachment. -// Title is the title of the attachment. -// Status is the status of the attachment. -// FileSize is the size of the file of the attachment. -// MediaType is the media type of the attachment. -// PageID is the ID of the page to which the attachment belongs. -// FileID is the ID of the file of the attachment. -// Version is the version of the attachment. type AttachmentScheme struct { ID string `json:"id,omitempty"` BlogPostID string `json:"blogPostId,omitempty"` @@ -33,12 +19,6 @@ type AttachmentScheme struct { } // AttachmentVersionScheme represents a version of an attachment in Confluence. -// CreatedAt is the creation time of the version. -// Message is the message for the version. -// Number is the number of the version. -// MinorEdit indicates if the version is a minor edit. -// AuthorID is the ID of the author of the version. -// Attachment is the attachment of the version. type AttachmentVersionScheme struct { CreatedAt string `json:"createdAt,omitempty"` Message string `json:"message,omitempty"` @@ -49,18 +29,12 @@ type AttachmentVersionScheme struct { } // AttachmentVersionBodyScheme represents the body of a version of an attachment in Confluence. -// Title is the title of the body. -// ID is the ID of the body. type AttachmentVersionBodyScheme struct { Title string `json:"title,omitempty"` ID string `json:"id,omitempty"` } // AttachmentParamsScheme represents the parameters for an attachment in Confluence. -// Sort is used to sort the result by a particular field. -// MediaType filters the mediaType of attachments. -// FileName filters on the file-name of attachments. -// SerializeIDs indicates if IDs should be serialized. type AttachmentParamsScheme struct { Sort string MediaType string @@ -69,37 +43,23 @@ type AttachmentParamsScheme struct { } // AttachmentPageScheme represents a paginated list of attachments in Confluence. -// Results is a slice of the attachments in the current page. -// Links is a collection of links related to the page. type AttachmentPageScheme struct { Results []*AttachmentScheme `json:"results,omitempty"` Links *PageLinkScheme `json:"_links,omitempty"` } // PageLinkScheme represents a link in a page in Confluence. -// Next is the URL to the next page. type PageLinkScheme struct { Next string `json:"next,omitempty"` } // AttachmentVersionPageScheme represents a paginated list of versions of an attachment in Confluence. -// Results is a slice of the versions in the current page. -// Links is a collection of links related to the page. type AttachmentVersionPageScheme struct { Results []*AttachmentVersionScheme `json:"results,omitempty"` Links *PageLinkScheme `json:"_links,omitempty"` } // DetailedVersionScheme represents a detailed version in Confluence. -// Number is the number of the version. -// AuthorID is the ID of the author of the version. -// Message is the message for the version. -// CreatedAt is the creation time of the version. -// MinorEdit indicates if the version is a minor edit. -// ContentTypeModified indicates if the content type was modified in the version. -// Collaborators is a slice of the collaborators of the version. -// PrevVersion is the number of the previous version. -// NextVersion is the number of the next version. type DetailedVersionScheme struct { Number int `json:"number,omitempty"` AuthorID string `json:"authorId,omitempty"` diff --git a/pkg/infra/models/confluence_content.go b/pkg/infra/models/confluence_content.go index 5ce60619..ddf79c6d 100644 --- a/pkg/infra/models/confluence_content.go +++ b/pkg/infra/models/confluence_content.go @@ -3,14 +3,6 @@ package models import "time" // GetContentOptionsScheme represents the options for getting content. -// ContextType is the type of the context. -// SpaceKey is the key of the space. -// Title is the title of the content. -// Trigger is the trigger for getting the content. -// OrderBy is the field by which to order the content. -// Status is the status of the content. -// Expand is the fields to expand in the content. -// PostingDay is the day the content was posted. type GetContentOptionsScheme struct { ContextType, SpaceKey string Title string @@ -21,11 +13,6 @@ type GetContentOptionsScheme struct { } // ContentPageScheme represents a page of content. -// Results is the content in the current page. -// Start is the start index of the content in the current page. -// Limit is the limit on the number of content in the current page. -// Size is the size of the content in the current page. -// Links is the links related to the current page. type ContentPageScheme struct { Results []*ContentScheme `json:"results"` Start int `json:"start"` @@ -35,15 +22,6 @@ type ContentPageScheme struct { } // LinkScheme represents a link. -// Base is the base URL of the link. -// Context is the context of the link. -// Self is the URL to the link itself. -// Tinyui is the tiny UI URL of the link. -// Editui is the edit UI URL of the link. -// Webui is the web UI URL of the link. -// Download is the download URL of the link. -// Next is the URL to the next link. -// Collection is the collection of the link. type LinkScheme struct { Base string `json:"base,omitempty"` Context string `json:"context,omitempty"` @@ -57,21 +35,6 @@ type LinkScheme struct { } // ContentScheme represents content. -// ID is the unique identifier of the content. -// Type is the type of the content. -// Status is the status of the content. -// Title is the title of the content. -// Expandable is the fields that can be expanded in the content. -// Links is the links related to the content. -// ChildTypes is the types of the children of the content. -// Space is the space of the content. -// Metadata is the metadata of the content. -// Operations is the operations on the content. -// Body is the body of the content. -// Version is the version of the content. -// Extensions is the extensions of the content. -// Ancestors is the ancestors of the content. -// History is the history of the content. type ContentScheme struct { ID string `json:"id,omitempty"` Type string `json:"type,omitempty"` @@ -91,11 +54,6 @@ type ContentScheme struct { } // ContentExtensionScheme represents an extension of content. -// MediaType is the media type of the extension. -// FileSize is the size of the file of the extension. -// Comment is the comment on the extension. -// MediaTypeDescription is the description of the media type of the extension. -// FileID is the ID of the file of the extension. type ContentExtensionScheme struct { MediaType string `json:"mediaType,omitempty"` FileSize int `json:"fileSize,omitempty"` @@ -105,12 +63,6 @@ type ContentExtensionScheme struct { } // BodyScheme represents the body of content. -// View is the view of the body. -// ExportView is the export view of the body. -// StyledView is the styled view of the body. -// Storage is the storage of the body. -// Editor2 is the editor2 of the body. -// AnonymousExportView is the anonymous export view of the body. type BodyScheme struct { View *BodyNodeScheme `json:"view,omitempty"` ExportView *BodyNodeScheme `json:"export_view,omitempty"` @@ -121,25 +73,18 @@ type BodyScheme struct { } // BodyNodeScheme represents a node in the body of content. -// Value is the value of the node. -// Representation is the representation of the node. type BodyNodeScheme struct { Value string `json:"value,omitempty"` Representation string `json:"representation,omitempty"` } // OperationScheme represents an operation. -// Operation is the operation. -// TargetType is the target type of the operation. type OperationScheme struct { Operation string `json:"operation,omitempty"` TargetType string `json:"targetType,omitempty"` } // MetadataScheme represents the metadata of content. -// Labels is the labels of the metadata. -// Expandable is the fields that can be expanded in the metadata. -// MediaType is the media type of the metadata. type MetadataScheme struct { Labels *LabelsScheme `json:"labels"` Expandable *ExpandableScheme `json:"_expandable,omitempty"` @@ -147,11 +92,6 @@ type MetadataScheme struct { } // LabelsScheme represents labels. -// Results is the results of the labels. -// Start is the start index of the labels. -// Limit is the limit on the number of labels. -// Size is the size of the labels. -// Links is the links related to the labels. type LabelsScheme struct { Results []*LabelValueScheme `json:"results,omitempty"` Start int `json:"start,omitempty"` @@ -161,10 +101,6 @@ type LabelsScheme struct { } // LabelValueScheme represents a value of a label. -// Prefix is the prefix of the label value. -// Name is the name of the label value. -// ID is the ID of the label value. -// Label is the label of the label value. type LabelValueScheme struct { Prefix string `json:"prefix,omitempty"` Name string `json:"name,omitempty"` @@ -173,9 +109,6 @@ type LabelValueScheme struct { } // ChildTypesScheme represents the types of children of content. -// Attachment is the attachment type of the child. -// Comment is the comment type of the child. -// Page is the page type of the child. type ChildTypesScheme struct { Attachment *ChildTypeScheme `json:"attachment,omitempty"` Comment *ChildTypeScheme `json:"comment,omitempty"` @@ -183,8 +116,6 @@ type ChildTypesScheme struct { } // ChildTypeScheme represents a type of a child of content. -// Value is the value of the child type. -// Links is the links related to the child type. type ChildTypeScheme struct { Value bool `json:"value,omitempty"` Links struct { @@ -235,7 +166,6 @@ type ContentHistoryScheme struct { } // ContentHistoryContributorsScheme represents the contributors of the content history. -// Publishers are the publishers of the content. type ContentHistoryContributorsScheme struct { Publishers *VersionCollaboratorsScheme `json:"publishers,omitempty"` } @@ -267,17 +197,12 @@ type ProfilePictureScheme struct { } // ContentUserDetailScheme represents the detailed information of a user in the content. -// Business is a pointer to a UserBusinessDetailScheme which represents the business details of the user. -// Personal is a pointer to a UserPersonalDetailScheme which represents the personal details of the user. type ContentUserDetailScheme struct { Business *UserBusinessDetailScheme `json:"business,omitempty"` // The business details of the user. Personal *UserPersonalDetailScheme `json:"personal,omitempty"` // The personal details of the user. } // UserBusinessDetailScheme represents the business details of a user. -// Position is the position of the user in the business. -// Department is the department of the user in the business. -// Location is the location of the user in the business. type UserBusinessDetailScheme struct { Position string `json:"position,omitempty"` // The position of the user in the business. Department string `json:"department,omitempty"` // The department of the user in the business. @@ -285,10 +210,6 @@ type UserBusinessDetailScheme struct { } // UserPersonalDetailScheme represents the personal details of a user. -// Phone is the phone number of the user. -// Im is the instant messaging handle of the user. -// Website is the website of the user. -// Email is the email of the user. type UserPersonalDetailScheme struct { Phone string `json:"phone,omitempty"` // The phone number of the user. Im string `json:"im,omitempty"` // The instant messaging handle of the user. @@ -297,20 +218,16 @@ type UserPersonalDetailScheme struct { } // ContentArchivePayloadScheme represents the payload for archiving content. -// Pages is a slice of pointers to ContentArchiveIDPayloadScheme which represents the pages to be archived. type ContentArchivePayloadScheme struct { Pages []*ContentArchiveIDPayloadScheme `json:"pages,omitempty"` // The pages to be archived. } // ContentArchiveIDPayloadScheme represents the ID payload for archiving content. -// ID is the ID of the content to be archived. type ContentArchiveIDPayloadScheme struct { ID int `json:"id,omitempty"` // The ID of the content to be archived. } // ContentArchiveResultScheme represents the result of archiving content. -// ID is the ID of the archived content. -// Links is a struct containing the status of the archived content. type ContentArchiveResultScheme struct { ID string `json:"id"` // The ID of the archived content. Links struct { @@ -319,7 +236,6 @@ type ContentArchiveResultScheme struct { } // ContentMoveScheme represents the scheme for moving content. -// ID is the ID of the content to be moved. type ContentMoveScheme struct { ID string `json:"pageId"` // The ID of the content to be moved. } diff --git a/pkg/infra/models/confluence_content_attachement.go b/pkg/infra/models/confluence_content_attachement.go index bcc996de..4d230c92 100644 --- a/pkg/infra/models/confluence_content_attachement.go +++ b/pkg/infra/models/confluence_content_attachement.go @@ -1,9 +1,6 @@ package models // GetContentAttachmentsOptionsScheme represents the options for getting content attachments. -// Expand is a slice of strings representing the fields to expand in the content attachments. -// FileName is a string representing the file name of the content attachments. -// MediaType is a string representing the media type of the content attachments. type GetContentAttachmentsOptionsScheme struct { Expand []string // The fields to expand in the content attachments. FileName string // The file name of the content attachments. diff --git a/pkg/infra/models/confluence_content_permission.go b/pkg/infra/models/confluence_content_permission.go index 984a2843..85f08fdd 100644 --- a/pkg/infra/models/confluence_content_permission.go +++ b/pkg/infra/models/confluence_content_permission.go @@ -1,32 +1,24 @@ package models // CheckPermissionScheme represents the scheme for checking permissions in Confluence. -// Subject is a pointer to a PermissionSubjectScheme which represents the subject of the permission. -// Operation is a string representing the operation of the permission. type CheckPermissionScheme struct { Subject *PermissionSubjectScheme `json:"subject,omitempty"` // The subject of the permission. Operation string `json:"operation,omitempty"` // The operation of the permission. } // PermissionSubjectScheme represents the subject of a permission in Confluence. -// Identifier is a string representing the identifier of the subject. -// Type is a string representing the type of the subject. type PermissionSubjectScheme struct { Identifier string `json:"identifier,omitempty"` // The identifier of the subject. Type string `json:"type,omitempty"` // The type of the subject. } // PermissionCheckResponseScheme represents the response scheme for checking permissions in Confluence. -// HasPermission is a boolean indicating if the permission is granted. -// Errors is a slice of pointers to PermissionCheckMessageScheme which represents the errors occurred during the permission check. type PermissionCheckResponseScheme struct { HasPermission bool `json:"hasPermission"` // Indicates if the permission is granted. Errors []*PermissionCheckMessageScheme `json:"errors,omitempty"` // The errors occurred during the permission check. } // PermissionCheckMessageScheme represents a message scheme for checking permissions in Confluence. -// Translation is a string representing the translation of the message. -// Args is a slice of anonymous structs representing the arguments of the message. type PermissionCheckMessageScheme struct { Translation string `json:"translation"` // The translation of the message. Args []struct { diff --git a/pkg/infra/models/jira_group_user_picker.go b/pkg/infra/models/jira_group_user_picker.go index b93e3f04..61496773 100644 --- a/pkg/infra/models/jira_group_user_picker.go +++ b/pkg/infra/models/jira_group_user_picker.go @@ -1,86 +1,97 @@ package models +// GroupUserPickerFindOptionScheme represents the options for finding users and groups in Jira. type GroupUserPickerFindOptionScheme struct { - // The search string. + // Query is the search string. Query string `url:"query"` - // The maximum number of items to return in each list. + // MaxResults is the maximum number of items to return in each list. MaxResults int `url:"maxResults,omitempty"` - // Whether the user avatar should be returned. + // ShowAvatar indicates whether the user avatar should be returned. ShowAvatar bool `url:"showAvatar,omitempty"` - // The custom field ID of the field this request is for. + // FieldID is the custom field ID of the field this request is for. FieldID string `url:"fieldId,omitempty"` - // The ID of a project that returned users and groups must have permission to view. + // ProjectIDs is the ID of a project that returned users and groups must have permission to view. // This parameter is only used when FieldID is present. ProjectIDs []string `url:"projectId,omitempty"` - // The ID of an issue type that returned users and groups must have permission to view. + // IssueTypeIDs is the ID of an issue type that returned users and groups must have permission to view. // Special values, such as -1 (all standard issue types) and -2 (all subtask issue types), are supported. // This parameter is only used when FieldID is present. IssueTypeIDs []string `url:"issueTypeId,omitempty"` - // The size of the avatar to return. + // AvatarSize is the size of the avatar to return. // Possible values are: // xsmall, xsmall@2x, xsmall@3x, small, small@2x, small@3x, medium, medium@2x, medium@3x, large, // large@2x, large@3x, xlarge, xlarge@2x, xlarge@3x, xxlarge, xxlarge@2x, xxlarge@3x, xxxlarge, // xxxlarge@2x, xxxlarge@3x AvatarSize string `url:"avatarSize,omitempty"` - // Whether the search for groups should be case-insensitive. + // CaseInsensitive indicates whether the search for groups should be case-insensitive. CaseInsensitive bool `url:"caseInsensitive,omitempty"` - // Whether Connect app users and groups should be excluded from the search results. + // ExcludeConnectAddons indicates whether Connect app users and groups should be excluded from the search results. ExcludeConnectAddons bool `url:"excludeConnectAddons,omitempty"` } +// GroupUserPickerFindScheme represents the result of finding users and groups in Jira. type GroupUserPickerFindScheme struct { - // The list of groups found in a search, including header text (Showing X of Y matching groups) + // Groups is the list of groups found in a search, including header text (Showing X of Y matching groups) // and total of matched groups. Groups *GroupUserPickerFoundGroupsScheme `json:"groups"` - Users *GroupUserPickerFoundUsersScheme `json:"users"` + // Users is the list of users found in a search. + Users *GroupUserPickerFoundUsersScheme `json:"users"` } +// GroupUserPickerFoundGroupsScheme represents the groups found in a search. type GroupUserPickerFoundGroupsScheme struct { + // Groups is the list of groups found in a search. Groups []*GroupUserPickerFoundGroupScheme `json:"groups"` - // Header text indicating the number of groups in the response and the total number of groups found in the search. + // Header is the header text indicating the number of groups in the response and the total number of groups found in the search. Header string `json:"header"` - // The total number of groups found in the search. + // Total is the total number of groups found in the search. Total int `json:"total"` } +// GroupUserPickerFoundGroupScheme represents a group found in a search. type GroupUserPickerFoundGroupScheme struct { - // The ID of the group, which uniquely identifies the group across all Atlassian products. + // GroupID is the ID of the group, which uniquely identifies the group across all Atlassian products. // For example, 952d12c3-5b5b-4d04-bb32-44d383afc4b2. GroupID string `json:"groupId"` - // The group name with the matched query string highlighted with the HTML bold tag. - HTML string `json:"html"` + // HTML is the group name with the matched query string highlighted with the HTML bold tag. + HTML string `json:"html"` + // Labels is the list of labels associated with the group. Labels []*GroupUserPickerFoundGroupLabelScheme `json:"labels"` - // The name of the group. + // Name is the name of the group. // The name of a group is mutable, to reliably identify a group use GroupID. Name string `json:"name"` } +// GroupUserPickerFoundGroupLabelScheme represents a label associated with a group. type GroupUserPickerFoundGroupLabelScheme struct { - // The group label name. + // Text is the group label name. Text string `json:"text"` - // The title of the group label. + // Title is the title of the group label. Title string `json:"title"` - // The type of the group label. + // Type is the type of the group label. // Valid values: ADMIN, SINGLE, MULTIPLE Type string `json:"type"` } +// GroupUserPickerFoundUsersScheme represents the users found in a search. type GroupUserPickerFoundUsersScheme struct { + // Users is the list of users found in a search. Users []*GroupUserPickerFoundUserScheme `json:"users"` - // Header text indicating the number of groups in the response and the total number of groups found in the search. + // Header is the header text indicating the number of groups in the response and the total number of groups found in the search. Header string `json:"header"` - // The total number of groups found in the search. + // Total is the total number of groups found in the search. Total int `json:"total"` } +// GroupUserPickerFoundUserScheme represents a user found in a search. type GroupUserPickerFoundUserScheme struct { - // The account ID of the user, which uniquely identifies the user across all Atlassian products. + // AccountID is the account ID of the user, which uniquely identifies the user across all Atlassian products. // For example, 5b10ac8d82e05b22cc7d4ef5. AccountID string `json:"accountId"` - // The avatar URL of the user. + // AvatarURL is the avatar URL of the user. AvatarURL string `json:"avatarUrl"` - // The display name of the user. Depending on the user’s privacy setting, this may be returned as null. + // DisplayName is the display name of the user. Depending on the user’s privacy setting, this may be returned as null. DisplayName string `json:"displayName"` - // The display name, email address, and key of the user with the matched query string highlighted with the HTML bold tag. + // HTML is the display name, email address, and key of the user with the matched query string highlighted with the HTML bold tag. HTML string `json:"html"` } diff --git a/pkg/infra/models/jira_workflow.go b/pkg/infra/models/jira_workflow.go index 7e39e51a..8dd43de3 100644 --- a/pkg/infra/models/jira_workflow.go +++ b/pkg/infra/models/jira_workflow.go @@ -161,106 +161,119 @@ type WorkflowConditionScheme struct { Type string `json:"type,omitempty"` // The type of the condition. } +// WorkflowSearchCriteria represents the criteria for searching workflows in Jira. type WorkflowSearchCriteria struct { - ProjectAndIssueTypes []*WorkflowSearchProjectIssueTypeMapping `json:"projectAndIssueTypes,omitempty"` - WorkflowIDs []string `json:"workflowIds,omitempty"` - WorkflowNames []string `json:"workflowNames,omitempty"` + ProjectAndIssueTypes []*WorkflowSearchProjectIssueTypeMapping `json:"projectAndIssueTypes,omitempty"` // ProjectAndIssueTypes is a list of project and issue type mappings to filter the search. + WorkflowIDs []string `json:"workflowIds,omitempty"` // WorkflowIDs is a list of workflow IDs to filter the search. + WorkflowNames []string `json:"workflowNames,omitempty"` // WorkflowNames is a list of workflow names to filter the search. } +// WorkflowSearchProjectIssueTypeMapping represents a mapping of project and issue type for workflow search. type WorkflowSearchProjectIssueTypeMapping struct { - IssueTypeID string `json:"issueTypeId,omitempty"` - ProjectID string `json:"projectId,omitempty"` + IssueTypeID string `json:"issueTypeId,omitempty"` // IssueTypeID is the ID of the issue type. + ProjectID string `json:"projectId,omitempty"` // ProjectID is the ID of the project. } +// WorkflowReadResponseScheme represents the response scheme for reading workflows in Jira. type WorkflowReadResponseScheme struct { - Statuses []*WorkflowStatusDetailScheme `json:"statuses,omitempty"` - Workflows []*JiraWorkflowScheme `json:"workflows,omitempty"` + Statuses []*WorkflowStatusDetailScheme `json:"statuses,omitempty"` // Statuses is a list of workflow status details. + Workflows []*JiraWorkflowScheme `json:"workflows,omitempty"` // Workflows is a list of Jira workflows. } +// JiraWorkflowScheme represents a workflow in Jira. type JiraWorkflowScheme struct { - Description string `json:"description,omitempty"` - ID string `json:"id,omitempty"` - IsEditable bool `json:"isEditable,omitempty"` - Name string `json:"name,omitempty"` - Scope *WorkflowStatusScopeScheme `json:"scope,omitempty"` - StartPointLayout *WorkflowLayoutScheme `json:"startPointLayout,omitempty"` - Statuses []*WorkflowReferenceStatusScheme `json:"statuses,omitempty"` - TaskID string `json:"taskId,omitempty"` - Transitions []*WorkflowTransitionScheme `json:"transitions,omitempty"` - Usages []*ProjectIssueTypesScheme `json:"usages,omitempty"` - Version *WorkflowDocumentVersionScheme `json:"version,omitempty"` -} - + Description string `json:"description,omitempty"` // Description is the description of the workflow. + ID string `json:"id,omitempty"` // ID is the ID of the workflow. + IsEditable bool `json:"isEditable,omitempty"` // IsEditable indicates if the workflow is editable. + Name string `json:"name,omitempty"` // Name is the name of the workflow. + Scope *WorkflowStatusScopeScheme `json:"scope,omitempty"` // Scope is the scope of the workflow. + StartPointLayout *WorkflowLayoutScheme `json:"startPointLayout,omitempty"` // StartPointLayout is the layout of the start point of the workflow. + Statuses []*WorkflowReferenceStatusScheme `json:"statuses,omitempty"` // Statuses is a list of reference statuses in the workflow. + TaskID string `json:"taskId,omitempty"` // TaskID is the ID of the task associated with the workflow. + Transitions []*WorkflowTransitionScheme `json:"transitions,omitempty"` // Transitions is a list of transitions in the workflow. + Usages []*ProjectIssueTypesScheme `json:"usages,omitempty"` // Usages is a list of project issue types that use the workflow. + Version *WorkflowDocumentVersionScheme `json:"version,omitempty"` // Version is the version of the workflow document. +} + +// WorkflowLayoutScheme represents the layout of a workflow element in Jira. type WorkflowLayoutScheme struct { - X float64 `json:"x,omitempty"` - Y float64 `json:"y,omitempty"` + X float64 `json:"x,omitempty"` // X is the X coordinate of the layout. + Y float64 `json:"y,omitempty"` // Y is the Y coordinate of the layout. } +// WorkflowReferenceStatusScheme represents a reference status in a workflow in Jira. type WorkflowReferenceStatusScheme struct { - Deprecated bool `json:"deprecated,omitempty"` - Layout *WorkflowLayoutScheme `json:"layout,omitempty"` - StatusReference string `json:"statusReference,omitempty"` + Deprecated bool `json:"deprecated,omitempty"` // Deprecated indicates if the status is deprecated. + Layout *WorkflowLayoutScheme `json:"layout,omitempty"` // Layout is the layout of the status. + StatusReference string `json:"statusReference,omitempty"` // StatusReference is the reference of the status. } +// WorkflowDocumentVersionScheme represents the version of a workflow document in Jira. type WorkflowDocumentVersionScheme struct { - ID string `json:"id,omitempty"` - VersionNumber int `json:"versionNumber,omitempty"` + ID string `json:"id,omitempty"` // ID is the ID of the document version. + VersionNumber int `json:"versionNumber,omitempty"` // VersionNumber is the version number of the document. } +// WorkflowCapabilitiesScheme represents the capabilities of a workflow in Jira. type WorkflowCapabilitiesScheme struct { - ConnectRules []*AvailableWorkflowConnectRuleScheme `json:"connectRules,omitempty"` - EditorScope string `json:"editorScope,omitempty"` - ForgeRules []*AvailableWorkflowForgeRuleScheme `json:"forgeRules,omitempty"` - ProjectTypes []string `json:"projectTypes,omitempty"` - SystemRules []*AvailableWorkflowSystemRuleScheme `json:"systemRules,omitempty"` - TriggerRules []*AvailableWorkflowTriggers `json:"triggerRules,omitempty"` + ConnectRules []*AvailableWorkflowConnectRuleScheme `json:"connectRules,omitempty"` // ConnectRules is a list of available workflow connect rules. + EditorScope string `json:"editorScope,omitempty"` // EditorScope is the scope of the editor. + ForgeRules []*AvailableWorkflowForgeRuleScheme `json:"forgeRules,omitempty"` // ForgeRules is a list of available workflow forge rules. + SystemRules []*AvailableWorkflowSystemRuleScheme `json:"systemRules,omitempty"` // SystemRules is a list of available workflow system rules. + TriggerRules []*AvailableWorkflowTriggers `json:"triggerRules,omitempty"` // TriggerRules is a list of available workflow trigger rules. } +// AvailableWorkflowConnectRuleScheme represents a connect rule in a workflow. type AvailableWorkflowConnectRuleScheme struct { - AddonKey string `json:"addonKey,omitempty"` - CreateURL string `json:"createUrl,omitempty"` - Description string `json:"description,omitempty"` - EditURL string `json:"editUrl,omitempty"` - ModuleKey string `json:"moduleKey,omitempty"` - Name string `json:"name,omitempty"` - RuleKey string `json:"ruleKey,omitempty"` - RuleType string `json:"ruleType,omitempty"` - ViewURL string `json:"viewUrl,omitempty"` -} - + AddonKey string `json:"addonKey,omitempty"` // AddonKey is the key of the addon. + CreateURL string `json:"createUrl,omitempty"` // CreateURL is the URL to create the rule. + Description string `json:"description,omitempty"` // Description is the description of the rule. + EditURL string `json:"editUrl,omitempty"` // EditURL is the URL to edit the rule. + ModuleKey string `json:"moduleKey,omitempty"` // ModuleKey is the key of the module. + Name string `json:"name,omitempty"` // Name is the name of the rule. + RuleKey string `json:"ruleKey,omitempty"` // RuleKey is the key of the rule. + RuleType string `json:"ruleType,omitempty"` // RuleType is the type of the rule. + ViewURL string `json:"viewUrl,omitempty"` // ViewURL is the URL to view the rule. +} + +// AvailableWorkflowForgeRuleScheme represents a forge rule in a workflow. type AvailableWorkflowForgeRuleScheme struct { - Description string `json:"description,omitempty"` - ID string `json:"id,omitempty"` - Name string `json:"name,omitempty"` - RuleKey string `json:"ruleKey,omitempty"` - RuleType string `json:"ruleType,omitempty"` + Description string `json:"description,omitempty"` // Description is the description of the rule. + ID string `json:"id,omitempty"` // ID is the ID of the rule. + Name string `json:"name,omitempty"` // Name is the name of the rule. + RuleKey string `json:"ruleKey,omitempty"` // RuleKey is the key of the rule. + RuleType string `json:"ruleType,omitempty"` // RuleType is the type of the rule. } +// AvailableWorkflowSystemRuleScheme represents a system rule in a workflow. type AvailableWorkflowSystemRuleScheme struct { - Description string `json:"description,omitempty"` - IncompatibleRuleKeys []string `json:"incompatibleRuleKeys,omitempty"` - IsAvailableForInitialTransition bool `json:"isAvailableForInitialTransition,omitempty"` - IsVisible bool `json:"isVisible,omitempty"` - Name string `json:"name,omitempty"` - RuleKey string `json:"ruleKey,omitempty"` - RuleType string `json:"ruleType,omitempty"` + Description string `json:"description,omitempty"` // Description is the description of the rule. + IncompatibleRuleKeys []string `json:"incompatibleRuleKeys,omitempty"` // IncompatibleRuleKeys is a list of keys of incompatible rules. + IsAvailableForInitialTransition bool `json:"isAvailableForInitialTransition,omitempty"` // IsAvailableForInitialTransition indicates if the rule is available for the initial transition. + IsVisible bool `json:"isVisible,omitempty"` // IsVisible indicates if the rule is visible. + Name string `json:"name,omitempty"` // Name is the name of the rule. + RuleKey string `json:"ruleKey,omitempty"` // RuleKey is the key of the rule. + RuleType string `json:"ruleType,omitempty"` // RuleType is the type of the rule. } +// AvailableWorkflowTriggers represents the triggers available in a workflow. type AvailableWorkflowTriggers struct { - AvailableTypes []*AvailableWorkflowTriggerTypeScheme `json:"availableTypes,omitempty"` - RuleKey string `json:"ruleKey,omitempty"` + AvailableTypes []*AvailableWorkflowTriggerTypeScheme `json:"availableTypes,omitempty"` // AvailableTypes is a list of available trigger types. + RuleKey string `json:"ruleKey,omitempty"` // RuleKey is the key of the rule. } +// AvailableWorkflowTriggerTypeScheme represents a trigger type in a workflow. type AvailableWorkflowTriggerTypeScheme struct { - Description string `json:"description,omitempty"` - Name string `json:"name,omitempty"` - Type string `json:"type,omitempty"` + Description string `json:"description,omitempty"` // Description is the description of the trigger type. + Name string `json:"name,omitempty"` // Name is the name of the trigger type. + Type string `json:"type,omitempty"` // Type is the type of the trigger. } +// WorkflowCreatesPayload represents the payload for creating workflows in Jira. type WorkflowCreatesPayload struct { - Scope *WorkflowScopeScheme `json:"scope,omitempty"` - Statuses []*WorkflowStatusUpdateScheme `json:"statuses,omitempty"` - Workflows []*WorkflowCreateScheme `json:"workflows,omitempty"` + Scope *WorkflowScopeScheme `json:"scope,omitempty"` // Scope is the scope of the workflow. + Statuses []*WorkflowStatusUpdateScheme `json:"statuses,omitempty"` // Statuses is a list of statuses in the workflow. + Workflows []*WorkflowCreateScheme `json:"workflows,omitempty"` // Workflows is a list of workflows to be created. } // AddWorkflow adds a new workflow and its statuses to the payload, ensuring no duplicate statuses. @@ -284,39 +297,46 @@ func (w *WorkflowCreatesPayload) AddWorkflow(workflow *WorkflowCreateScheme) err return nil } +// AddStatus adds a new status to the WorkflowCreatesPayload. func (w *WorkflowCreatesPayload) AddStatus(status *WorkflowStatusUpdateScheme) { w.Statuses = append(w.Statuses, status) } +// WorkflowScopeScheme represents the scope of a workflow in Jira. type WorkflowScopeScheme struct { - Project *WorkflowScopeProjectScheme `json:"project,omitempty"` - Type string `json:"type,omitempty"` + Project *WorkflowScopeProjectScheme `json:"project,omitempty"` // Project is the project associated with the workflow. + Type string `json:"type,omitempty"` // Valid values: PROJECT, GLOBAL. } +// WorkflowScopeProjectScheme represents a project in the workflow scope. type WorkflowScopeProjectScheme struct { - ID string `json:"id,omitempty"` + ID string `json:"id,omitempty"` // ID is the ID of the project. } +// WorkflowStatusUpdateScheme represents an update to a workflow status in Jira. type WorkflowStatusUpdateScheme struct { - Description string `json:"description,omitempty"` - ID string `json:"id,omitempty"` - Name string `json:"name,omitempty"` - StatusCategory string `json:"statusCategory,omitempty"` - StatusReference string `json:"statusReference,omitempty"` + Description string `json:"description,omitempty"` // Description is the description of the status. + ID string `json:"id,omitempty"` // ID is the ID of the status. + Name string `json:"name,omitempty"` // Name is the name of the status. + StatusCategory string `json:"statusCategory,omitempty"` // StatusCategory is the category of the status. + StatusReference string `json:"statusReference,omitempty"` // StatusReference is the reference of the status. } +// WorkflowCreateScheme represents the creation of a workflow in Jira. type WorkflowCreateScheme struct { - Description string `json:"description,omitempty"` - Name string `json:"name,omitempty"` - StartPointLayout *WorkflowLayoutScheme `json:"startPointLayout,omitempty"` - Statuses []*StatusLayoutUpdateScheme `json:"statuses,omitempty"` - Transitions []*TransitionUpdateDTOScheme `json:"transitions,omitempty"` + Description string `json:"description,omitempty"` // Description is the description of the workflow. + Name string `json:"name,omitempty"` // Name is the name of the workflow. + StartPointLayout *WorkflowLayoutScheme `json:"startPointLayout,omitempty"` // StartPointLayout is the layout of the start point of the workflow. + Statuses []*StatusLayoutUpdateScheme `json:"statuses,omitempty"` // Statuses is a list of statuses in the workflow. + Transitions []*TransitionUpdateDTOScheme `json:"transitions,omitempty"` // Transitions is a list of transitions in the workflow. } +// AddStatus adds a new status to the WorkflowCreateScheme. func (w *WorkflowCreateScheme) AddStatus(status *StatusLayoutUpdateScheme) { w.Statuses = append(w.Statuses, status) } +// AddTransition adds a new transition to the WorkflowCreateScheme. func (w *WorkflowCreateScheme) AddTransition(transition *TransitionUpdateDTOScheme) error { if !w.isStatusReferenceAdded(transition.To.StatusReference) { return fmt.Errorf("status reference %s not found", transition.To.StatusReference) @@ -326,6 +346,8 @@ func (w *WorkflowCreateScheme) AddTransition(transition *TransitionUpdateDTOSche return nil } +// isStatusReferenceAdded checks if a status reference is already added to the workflow. +// It returns true if the status reference is found, otherwise false. func (w *WorkflowCreateScheme) isStatusReferenceAdded(statusReference string) bool { for _, status := range w.Statuses { if status.StatusReference == statusReference { @@ -335,95 +357,111 @@ func (w *WorkflowCreateScheme) isStatusReferenceAdded(statusReference string) bo return false } +// StatusLayoutUpdateScheme represents an update to the layout of a status in a workflow. type StatusLayoutUpdateScheme struct { - Layout *WorkflowLayoutScheme `json:"layout,omitempty"` - StatusReference string `json:"statusReference"` + // Layout is the layout of the status. + Layout *WorkflowLayoutScheme `json:"layout,omitempty"` + // StatusReference is the reference of the status. + StatusReference string `json:"statusReference"` } +// TransitionUpdateDTOScheme represents an update to a transition in a workflow. type TransitionUpdateDTOScheme struct { - Actions []*WorkflowRuleConfigurationScheme `json:"actions,omitempty"` - Conditions *ConditionGroupUpdateScheme `json:"conditions,omitempty"` - CustomIssueEventID string `json:"customIssueEventId,omitempty"` - Description string `json:"description,omitempty"` - From []*StatusReferenceAndPortScheme `json:"from,omitempty"` - ID string `json:"id,omitempty"` - Links []*WorkflowTransitionLinkScheme `json:"links,omitempty"` - Name string `json:"name,omitempty"` - To *StatusReferenceAndPortScheme `json:"to,omitempty"` - ToStatusReference string `json:"toStatusReference,omitempty"` - TransitionScreen *WorkflowRuleConfigurationScheme `json:"transitionScreen,omitempty"` - Triggers []*WorkflowTriggerScheme `json:"triggers,omitempty"` - Type string `json:"type,omitempty"` - Validators []*WorkflowRuleConfigurationScheme `json:"validators,omitempty"` -} - + Actions []*WorkflowRuleConfigurationScheme `json:"actions,omitempty"` // Actions is a list of actions associated with the transition. + Conditions *ConditionGroupUpdateScheme `json:"conditions,omitempty"` // Conditions is a list of conditions associated with the transition. + CustomIssueEventID string `json:"customIssueEventId,omitempty"` // CustomIssueEventID is the custom issue event ID associated with the transition. + Description string `json:"description,omitempty"` // Description is the description of the transition. + From []*StatusReferenceAndPortScheme `json:"from,omitempty"` // From is a list of statuses from which this transition can be executed. + ID string `json:"id,omitempty"` // ID is the ID of the transition. + Links []*WorkflowTransitionLinkScheme `json:"links,omitempty"` // Links is a list of links associated with the transition. + Name string `json:"name,omitempty"` // Name is the name of the transition. + To *StatusReferenceAndPortScheme `json:"to,omitempty"` // To is the status to which this transition goes. + ToStatusReference string `json:"toStatusReference,omitempty"` // ToStatusReference is the reference of the status to which this transition goes. + TransitionScreen *WorkflowRuleConfigurationScheme `json:"transitionScreen,omitempty"` // TransitionScreen is the screen associated with the transition. + Triggers []*WorkflowTriggerScheme `json:"triggers,omitempty"` // Triggers is a list of triggers associated with the transition. + Type string `json:"type,omitempty"` // Type is the type of the transition. + Validators []*WorkflowRuleConfigurationScheme `json:"validators,omitempty"` // Validators is a list of validators associated with the transition. +} + +// ConditionGroupUpdateScheme represents an update to a condition group in a workflow. type ConditionGroupUpdateScheme struct { - ConditionGroups []*ConditionGroupUpdateScheme `json:"conditionGroups,omitempty"` - Conditions []*WorkflowRuleConfigurationScheme `json:"conditions,omitempty"` - Operation string `json:"operation,omitempty"` + ConditionGroups []*ConditionGroupUpdateScheme `json:"conditionGroups,omitempty"` // ConditionGroups is a list of nested condition groups. + Conditions []*WorkflowRuleConfigurationScheme `json:"conditions,omitempty"` // Conditions is a list of conditions. + Operation string `json:"operation,omitempty"` // Operation is the operation applied to the conditions. } +// StatusReferenceAndPortScheme represents a status reference and port in a workflow. type StatusReferenceAndPortScheme struct { - Port int `json:"port,omitempty"` - StatusReference string `json:"statusReference,omitempty"` + Port int `json:"port,omitempty"` // Port is the port associated with the status. + StatusReference string `json:"statusReference,omitempty"` // StatusReference is the reference of the status. } +// WorkflowCreateResponseScheme represents the response after creating a workflow in Jira. type WorkflowCreateResponseScheme struct { - Statuses []*JiraWorkflowStatusScheme `json:"statuses,omitempty"` - Workflows []*JiraWorkflowScheme `json:"workflows,omitempty"` + Statuses []*JiraWorkflowStatusScheme `json:"statuses,omitempty"` // Statuses is a list of statuses in the workflow. + Workflows []*JiraWorkflowScheme `json:"workflows,omitempty"` // Workflows is a list of Jira workflows. } +// JiraWorkflowStatusScheme represents a status in a Jira workflow. type JiraWorkflowStatusScheme struct { - Description string `json:"description,omitempty"` - ID string `json:"id,omitempty"` - Name string `json:"name,omitempty"` - Scope *WorkflowScopeScheme `json:"scope,omitempty"` - StatusCategory string `json:"statusCategory,omitempty"` - StatusReference string `json:"statusReference,omitempty"` - Usages []*ProjectIssueTypesScheme `json:"usages,omitempty"` + Description string `json:"description,omitempty"` // Description is the description of the status. + ID string `json:"id,omitempty"` // ID is the ID of the status. + Name string `json:"name,omitempty"` // Name is the name of the status. + Scope *WorkflowScopeScheme `json:"scope,omitempty"` // Scope is the scope of the status. + StatusCategory string `json:"statusCategory,omitempty"` // StatusCategory is the category of the status. + StatusReference string `json:"statusReference,omitempty"` // StatusReference is the reference of the status. + Usages []*ProjectIssueTypesScheme `json:"usages,omitempty"` // Usages is a list of project issue types that use the status. } +// ValidationOptionsForCreateScheme represents the validation options for creating a workflow. type ValidationOptionsForCreateScheme struct { - Payload *WorkflowCreatesPayload `json:"payload,omitempty"` - Options *ValidationOptionsLevelScheme `json:"validationOptions"` + Payload *WorkflowCreatesPayload `json:"payload,omitempty"` // Payload is the payload for creating workflows. + Options *ValidationOptionsLevelScheme `json:"validationOptions"` // Options are the validation options. } +// ValidationOptionsLevelScheme represents the levels of validation options. type ValidationOptionsLevelScheme struct { - Levels []string `json:"levels,omitempty"` + Levels []string `json:"levels,omitempty"` // Valid values: WARNING, ERROR. } +// WorkflowValidationErrorListScheme represents a list of workflow validation errors. type WorkflowValidationErrorListScheme struct { - Errors []*WorkflowValidationErrorScheme `json:"errors,omitempty"` + Errors []*WorkflowValidationErrorScheme `json:"errors,omitempty"` // Errors is a list of workflow validation errors. } +// WorkflowValidationErrorScheme represents a workflow validation error. type WorkflowValidationErrorScheme struct { - Code string `json:"code,omitempty"` - ElementReference *WorkflowElementReferenceScheme `json:"elementReference,omitempty"` - Level string `json:"level,omitempty"` - Message string `json:"message,omitempty"` - Type string `json:"type,omitempty"` + Code string `json:"code,omitempty"` // Valid values: INVALID_TRANSITION, INVALID_STATUS, INVALID_TRANSITION_TO_STATUS, INVALID_TRANSITION_FROM_STATUS, INVALID_TRANSITION_TO_STATUS + ElementReference *WorkflowElementReferenceScheme `json:"elementReference,omitempty"` // ElementReference is the reference to the element that caused the error. + Level string `json:"level,omitempty"` // Valid values: WARNING, ERROR. + Message string `json:"message,omitempty"` // Message is the error message. + Type string `json:"type,omitempty"` // Valid values: TRANSITION, STATUS } +// WorkflowElementReferenceScheme represents a reference to an element in a workflow. type WorkflowElementReferenceScheme struct { - PropertyKey string `json:"propertyKey,omitempty"` - RuleID string `json:"ruleId,omitempty"` - StatusMappingReference *ProjectAndIssueTypePairScheme `json:"statusMappingReference,omitempty"` - StatusReference string `json:"statusReference,omitempty"` - TransitionID string `json:"transitionId,omitempty"` + PropertyKey string `json:"propertyKey,omitempty"` // PropertyKey is the key of the property. + RuleID string `json:"ruleId,omitempty"` // RuleID is the ID of the rule. + StatusMappingReference *ProjectAndIssueTypePairScheme `json:"statusMappingReference,omitempty"` // StatusMappingReference is the reference to the status mapping. + StatusReference string `json:"statusReference,omitempty"` // StatusReference is the reference of the status. + TransitionID string `json:"transitionId,omitempty"` // TransitionID is the ID of the transition. } +// ProjectAndIssueTypePairScheme represents a pair of project and issue type. type ProjectAndIssueTypePairScheme struct { - IssueTypeID string `json:"issueTypeId,omitempty"` - ProjectID string `json:"projectId,omitempty"` + IssueTypeID string `json:"issueTypeId,omitempty"` // IssueTypeID is the ID of the issue type. + ProjectID string `json:"projectId,omitempty"` // ProjectID is the ID of the project. } +// WorkflowUpdatesPayloadScheme represents the payload for updating workflows in Jira. type WorkflowUpdatesPayloadScheme struct { - Statuses []*WorkflowStatusUpdateScheme `json:"statuses,omitempty"` - Workflows []*WorkflowUpdateScheme `json:"workflows,omitempty"` + Statuses []*WorkflowStatusUpdateScheme `json:"statuses,omitempty"` // Statuses is a list of statuses in the workflow. + Workflows []*WorkflowUpdateScheme `json:"workflows,omitempty"` // Workflows is a list of workflows to be updated. } +// InjectWorkflow adds a new workflow to the payload for updating workflows. +// It takes a JiraWorkflowScheme as input and appends it to the Workflows slice. func (w *WorkflowUpdatesPayloadScheme) InjectWorkflow(workflow *JiraWorkflowScheme) { - w.Workflows = append(w.Workflows, &WorkflowUpdateScheme{ Description: workflow.Description, ID: workflow.ID, @@ -432,37 +470,42 @@ func (w *WorkflowUpdatesPayloadScheme) InjectWorkflow(workflow *JiraWorkflowSche }) } +// WorkflowUpdateScheme represents the update scheme for a workflow in Jira. type WorkflowUpdateScheme struct { - DefaultStatusMappings []*StatusMigrationScheme `json:"defaultStatusMappings,omitempty"` - Description string `json:"description,omitempty"` - ID string `json:"id,omitempty"` - StartPointLayout *WorkflowLayoutScheme `json:"startPointLayout,omitempty"` - StatusMappings []*StatusMappingDTOScheme `json:"statusMappings,omitempty"` - Statuses []*StatusLayoutUpdateScheme `json:"statuses,omitempty"` - Transitions []*TransitionUpdateDTOScheme `json:"transitions,omitempty"` - Version *WorkflowDocumentVersionScheme `json:"version,omitempty"` + DefaultStatusMappings []*StatusMigrationScheme `json:"defaultStatusMappings,omitempty"` // DefaultStatusMappings is a list of default status mappings. + Description string `json:"description,omitempty"` // Description is the description of the workflow. + ID string `json:"id,omitempty"` // ID is the ID of the workflow. + StartPointLayout *WorkflowLayoutScheme `json:"startPointLayout,omitempty"` // StartPointLayout is the layout of the start point of the workflow. + StatusMappings []*StatusMappingDTOScheme `json:"statusMappings,omitempty"` // StatusMappings is a list of status mappings in the workflow. + Statuses []*StatusLayoutUpdateScheme `json:"statuses,omitempty"` // Statuses is a list of statuses in the workflow. + Transitions []*TransitionUpdateDTOScheme `json:"transitions,omitempty"` // Transitions is a list of transitions in the workflow. + Version *WorkflowDocumentVersionScheme `json:"version,omitempty"` // Version is the version of the workflow document. } +// StatusMigrationScheme represents a status migration in a workflow in Jira. type StatusMigrationScheme struct { - NewStatusReference string `json:"newStatusReference,omitempty"` - OldStatusReference string `json:"oldStatusReference,omitempty"` + NewStatusReference string `json:"newStatusReference,omitempty"` // NewStatusReference is the reference of the new status. + OldStatusReference string `json:"oldStatusReference,omitempty"` // OldStatusReference is the reference of the old status. } +// StatusMappingDTOScheme represents a status mapping DTO in a workflow in Jira. type StatusMappingDTOScheme struct { - IssueTypeID string `json:"issueTypeId,omitempty"` - ProjectID string `json:"projectId,omitempty"` - StatusMigrations []*StatusMigrationScheme `json:"statusMigrations,omitempty"` - Statuses []*StatusLayoutUpdateScheme `json:"statuses,omitempty"` - Transitions []*TransitionUpdateDTOScheme `json:"transitions,omitempty"` + IssueTypeID string `json:"issueTypeId,omitempty"` // IssueTypeID is the ID of the issue type. + ProjectID string `json:"projectId,omitempty"` // ProjectID is the ID of the project. + StatusMigrations []*StatusMigrationScheme `json:"statusMigrations,omitempty"` // StatusMigrations is a list of status migrations. + Statuses []*StatusLayoutUpdateScheme `json:"statuses,omitempty"` // Statuses is a list of statuses in the workflow. + Transitions []*TransitionUpdateDTOScheme `json:"transitions,omitempty"` // Transitions is a list of transitions in the workflow. } +// WorkflowUpdateResponseScheme represents the response after updating a workflow in Jira. type WorkflowUpdateResponseScheme struct { - Statuses []*JiraWorkflowStatusScheme `json:"statuses,omitempty"` - TaskID string `json:"taskId,omitempty"` - Workflows []*JiraWorkflowScheme `json:"workflows,omitempty"` + Statuses []*JiraWorkflowStatusScheme `json:"statuses,omitempty"` // Statuses is a list of statuses in the workflow. + TaskID string `json:"taskId,omitempty"` // TaskID is the ID of the task associated with the workflow update. + Workflows []*JiraWorkflowScheme `json:"workflows,omitempty"` // Workflows is a list of Jira workflows. } +// ValidationOptionsForUpdateScheme represents the validation options for updating a workflow. type ValidationOptionsForUpdateScheme struct { - Payload *WorkflowUpdatesPayloadScheme `json:"payload,omitempty"` - Options *ValidationOptionsLevelScheme `json:"validationOptions,omitempty"` + Payload *WorkflowUpdatesPayloadScheme `json:"payload,omitempty"` // Payload is the payload for updating workflows. + Options *ValidationOptionsLevelScheme `json:"validationOptions,omitempty"` // Options are the validation options. } diff --git a/pkg/infra/models/sm_request_comment.go b/pkg/infra/models/sm_request_comment.go index f1988392..0a8cd994 100644 --- a/pkg/infra/models/sm_request_comment.go +++ b/pkg/infra/models/sm_request_comment.go @@ -1,5 +1,6 @@ package models +// RequestCommentOptionsScheme represents the options for filtering and paginating request comments. type RequestCommentOptionsScheme struct { Public *bool `url:"public,omitempty"` Internal *bool `url:"internal,omitempty"`