diff --git a/admin/api_client_impl.go b/admin/api_client_impl.go index 7e9ec459..5da16aa9 100644 --- a/admin/api_client_impl.go +++ b/admin/api_client_impl.go @@ -170,13 +170,13 @@ func (c *Client) processResponse(response *http.Response, structure interface{}) return res, model.ErrUnauthorized case http.StatusInternalServerError: - return res, model.ErrInternalError + return res, model.ErrInternal case http.StatusBadRequest: - return res, model.ErrBadRequestError + return res, model.ErrBadRequest default: - return res, model.ErrInvalidStatusCodeError + return res, model.ErrInvalidStatusCode } } diff --git a/admin/api_client_impl_test.go b/admin/api_client_impl_test.go index c3809fa6..98bd2eaf 100644 --- a/admin/api_client_impl_test.go +++ b/admin/api_client_impl_test.go @@ -127,7 +127,7 @@ func TestClient_Call(t *testing.T) { Bytes: *bytes.NewBufferString("Hello, world!"), }, wantErr: true, - Err: model.ErrBadRequestError, + Err: model.ErrBadRequest, }, { @@ -152,7 +152,7 @@ func TestClient_Call(t *testing.T) { Bytes: *bytes.NewBufferString("Hello, world!"), }, wantErr: true, - Err: model.ErrInternalError, + Err: model.ErrInternal, }, { diff --git a/admin/internal/organization_directory_impl.go b/admin/internal/organization_directory_impl.go index 62ac4eb7..6443445b 100644 --- a/admin/internal/organization_directory_impl.go +++ b/admin/internal/organization_directory_impl.go @@ -84,11 +84,11 @@ type internalOrganizationDirectoryServiceImpl struct { func (i *internalOrganizationDirectoryServiceImpl) Activity(ctx context.Context, organizationID, accountID string) (*model.UserProductAccessScheme, *model.ResponseScheme, error) { if organizationID == "" { - return nil, nil, model.ErrNoAdminOrganizationError + return nil, nil, model.ErrNoAdminOrganization } if accountID == "" { - return nil, nil, model.ErrNoAdminAccountIDError + return nil, nil, model.ErrNoAdminAccountID } endpoint := fmt.Sprintf("admin/v1/orgs/%v/directory/users/%v/last-active-dates", organizationID, accountID) @@ -110,11 +110,11 @@ func (i *internalOrganizationDirectoryServiceImpl) Activity(ctx context.Context, func (i *internalOrganizationDirectoryServiceImpl) Remove(ctx context.Context, organizationID, accountID string) (*model.ResponseScheme, error) { if organizationID == "" { - return nil, model.ErrNoAdminOrganizationError + return nil, model.ErrNoAdminOrganization } if accountID == "" { - return nil, model.ErrNoAdminAccountIDError + return nil, model.ErrNoAdminAccountID } endpoint := fmt.Sprintf("admin/v1/orgs/%v/directory/users/%v", organizationID, accountID) @@ -130,11 +130,11 @@ func (i *internalOrganizationDirectoryServiceImpl) Remove(ctx context.Context, o func (i *internalOrganizationDirectoryServiceImpl) Suspend(ctx context.Context, organizationID, accountID string) (*model.GenericActionSuccessScheme, *model.ResponseScheme, error) { if organizationID == "" { - return nil, nil, model.ErrNoAdminOrganizationError + return nil, nil, model.ErrNoAdminOrganization } if accountID == "" { - return nil, nil, model.ErrNoAdminAccountIDError + return nil, nil, model.ErrNoAdminAccountID } endpoint := fmt.Sprintf("admin/v1/orgs/%v/directory/users/%v/suspend-access", organizationID, accountID) @@ -156,11 +156,11 @@ func (i *internalOrganizationDirectoryServiceImpl) Suspend(ctx context.Context, func (i *internalOrganizationDirectoryServiceImpl) Restore(ctx context.Context, organizationID, accountID string) (*model.GenericActionSuccessScheme, *model.ResponseScheme, error) { if organizationID == "" { - return nil, nil, model.ErrNoAdminOrganizationError + return nil, nil, model.ErrNoAdminOrganization } if accountID == "" { - return nil, nil, model.ErrNoAdminAccountIDError + return nil, nil, model.ErrNoAdminAccountID } endpoint := fmt.Sprintf("admin/v1/orgs/%v/directory/users/%v/restore-access", organizationID, accountID) diff --git a/admin/internal/organization_directory_impl_test.go b/admin/internal/organization_directory_impl_test.go index 588f3b20..47805edd 100644 --- a/admin/internal/organization_directory_impl_test.go +++ b/admin/internal/organization_directory_impl_test.go @@ -66,7 +66,7 @@ func Test_internalOrganizationDirectoryServiceImpl_Activity(t *testing.T) { organizationID: "", }, wantErr: true, - Err: model.ErrNoAdminOrganizationError, + Err: model.ErrNoAdminOrganization, }, { @@ -76,7 +76,7 @@ func Test_internalOrganizationDirectoryServiceImpl_Activity(t *testing.T) { organizationID: "organization-id-sample", }, wantErr: true, - Err: model.ErrNoAdminAccountIDError, + Err: model.ErrNoAdminAccountID, }, { @@ -192,7 +192,7 @@ func Test_internalOrganizationDirectoryServiceImpl_Remove(t *testing.T) { organizationID: "", }, wantErr: true, - Err: model.ErrNoAdminOrganizationError, + Err: model.ErrNoAdminOrganization, }, { @@ -202,7 +202,7 @@ func Test_internalOrganizationDirectoryServiceImpl_Remove(t *testing.T) { organizationID: "organization-id-sample", }, wantErr: true, - Err: model.ErrNoAdminAccountIDError, + Err: model.ErrNoAdminAccountID, }, { @@ -317,7 +317,7 @@ func Test_internalOrganizationDirectoryServiceImpl_Suspend(t *testing.T) { organizationID: "", }, wantErr: true, - Err: model.ErrNoAdminOrganizationError, + Err: model.ErrNoAdminOrganization, }, { @@ -327,7 +327,7 @@ func Test_internalOrganizationDirectoryServiceImpl_Suspend(t *testing.T) { organizationID: "organization-id-sample", }, wantErr: true, - Err: model.ErrNoAdminAccountIDError, + Err: model.ErrNoAdminAccountID, }, { @@ -443,7 +443,7 @@ func Test_internalOrganizationDirectoryServiceImpl_Restore(t *testing.T) { organizationID: "", }, wantErr: true, - Err: model.ErrNoAdminOrganizationError, + Err: model.ErrNoAdminOrganization, }, { @@ -453,7 +453,7 @@ func Test_internalOrganizationDirectoryServiceImpl_Restore(t *testing.T) { organizationID: "organization-id-sample", }, wantErr: true, - Err: model.ErrNoAdminAccountIDError, + Err: model.ErrNoAdminAccountID, }, { diff --git a/admin/internal/organization_impl.go b/admin/internal/organization_impl.go index d2cff03e..d466b66e 100644 --- a/admin/internal/organization_impl.go +++ b/admin/internal/organization_impl.go @@ -130,7 +130,7 @@ func (i *internalOrganizationImpl) Gets(ctx context.Context, cursor string) (*mo func (i *internalOrganizationImpl) Get(ctx context.Context, organizationID string) (*model.AdminOrganizationScheme, *model.ResponseScheme, error) { if organizationID == "" { - return nil, nil, model.ErrNoAdminOrganizationError + return nil, nil, model.ErrNoAdminOrganization } endpoint := fmt.Sprintf("admin/v1/orgs/%v", organizationID) @@ -152,7 +152,7 @@ func (i *internalOrganizationImpl) Get(ctx context.Context, organizationID strin func (i *internalOrganizationImpl) Users(ctx context.Context, organizationID, cursor string) (*model.OrganizationUserPageScheme, *model.ResponseScheme, error) { if organizationID == "" { - return nil, nil, model.ErrNoAdminOrganizationError + return nil, nil, model.ErrNoAdminOrganization } var endpoint strings.Builder @@ -182,7 +182,7 @@ func (i *internalOrganizationImpl) Users(ctx context.Context, organizationID, cu func (i *internalOrganizationImpl) Domains(ctx context.Context, organizationID, cursor string) (*model.OrganizationDomainPageScheme, *model.ResponseScheme, error) { if organizationID == "" { - return nil, nil, model.ErrNoAdminOrganizationError + return nil, nil, model.ErrNoAdminOrganization } var endpoint strings.Builder @@ -212,11 +212,11 @@ func (i *internalOrganizationImpl) Domains(ctx context.Context, organizationID, func (i *internalOrganizationImpl) Domain(ctx context.Context, organizationID, domainID string) (*model.OrganizationDomainScheme, *model.ResponseScheme, error) { if organizationID == "" { - return nil, nil, model.ErrNoAdminOrganizationError + return nil, nil, model.ErrNoAdminOrganization } if domainID == "" { - return nil, nil, model.ErrNoAdminDomainIDError + return nil, nil, model.ErrNoAdminDomainID } endpoint := fmt.Sprintf("admin/v1/orgs/%v/domains/%v", organizationID, domainID) @@ -238,7 +238,7 @@ func (i *internalOrganizationImpl) Domain(ctx context.Context, organizationID, d func (i *internalOrganizationImpl) Events(ctx context.Context, organizationID string, options *model.OrganizationEventOptScheme, cursor string) (*model.OrganizationEventPageScheme, *model.ResponseScheme, error) { if organizationID == "" { - return nil, nil, model.ErrNoAdminOrganizationError + return nil, nil, model.ErrNoAdminOrganization } params := url.Values{} @@ -291,11 +291,11 @@ func (i *internalOrganizationImpl) Events(ctx context.Context, organizationID st func (i *internalOrganizationImpl) Event(ctx context.Context, organizationID, eventID string) (*model.OrganizationEventScheme, *model.ResponseScheme, error) { if organizationID == "" { - return nil, nil, model.ErrNoAdminOrganizationError + return nil, nil, model.ErrNoAdminOrganization } if eventID == "" { - return nil, nil, model.ErrNoEventIDError + return nil, nil, model.ErrNoEventID } endpoint := fmt.Sprintf("admin/v1/orgs/%v/events/%v", organizationID, eventID) @@ -317,7 +317,7 @@ func (i *internalOrganizationImpl) Event(ctx context.Context, organizationID, ev func (i *internalOrganizationImpl) Actions(ctx context.Context, organizationID string) (*model.OrganizationEventActionScheme, *model.ResponseScheme, error) { if organizationID == "" { - return nil, nil, model.ErrNoAdminOrganizationError + return nil, nil, model.ErrNoAdminOrganization } endpoint := fmt.Sprintf("admin/v1/orgs/%v/event-actions", organizationID) diff --git a/admin/internal/organization_impl_test.go b/admin/internal/organization_impl_test.go index 1b7b5866..51b690a5 100644 --- a/admin/internal/organization_impl_test.go +++ b/admin/internal/organization_impl_test.go @@ -169,7 +169,7 @@ func Test_internalOrganizationImpl_Get(t *testing.T) { organizationID: "", }, wantErr: true, - Err: model.ErrNoAdminOrganizationError, + Err: model.ErrNoAdminOrganization, }, { @@ -283,7 +283,7 @@ func Test_internalOrganizationImpl_Users(t *testing.T) { organizationID: "", }, wantErr: true, - Err: model.ErrNoAdminOrganizationError, + Err: model.ErrNoAdminOrganization, }, { @@ -398,7 +398,7 @@ func Test_internalOrganizationImpl_Domains(t *testing.T) { organizationID: "", }, wantErr: true, - Err: model.ErrNoAdminOrganizationError, + Err: model.ErrNoAdminOrganization, }, { @@ -513,7 +513,7 @@ func Test_internalOrganizationImpl_Domain(t *testing.T) { organizationID: "", }, wantErr: true, - Err: model.ErrNoAdminOrganizationError, + Err: model.ErrNoAdminOrganization, }, { @@ -523,7 +523,7 @@ func Test_internalOrganizationImpl_Domain(t *testing.T) { organizationID: "organization-sample-uuid", }, wantErr: true, - Err: model.ErrNoAdminDomainIDError, + Err: model.ErrNoAdminDomainID, }, { @@ -656,7 +656,7 @@ func Test_internalOrganizationImpl_Events(t *testing.T) { organizationID: "", }, wantErr: true, - Err: model.ErrNoAdminOrganizationError, + Err: model.ErrNoAdminOrganization, }, { @@ -778,7 +778,7 @@ func Test_internalOrganizationImpl_Event(t *testing.T) { organizationID: "", }, wantErr: true, - Err: model.ErrNoAdminOrganizationError, + Err: model.ErrNoAdminOrganization, }, { @@ -788,7 +788,7 @@ func Test_internalOrganizationImpl_Event(t *testing.T) { organizationID: "organization-sample-uuid", }, wantErr: true, - Err: model.ErrNoEventIDError, + Err: model.ErrNoEventID, }, { diff --git a/admin/internal/organization_policy_impl.go b/admin/internal/organization_policy_impl.go index 6fc2d6b8..3f82b1b3 100644 --- a/admin/internal/organization_policy_impl.go +++ b/admin/internal/organization_policy_impl.go @@ -75,7 +75,7 @@ type internalOrganizationPolicyImpl struct { func (i *internalOrganizationPolicyImpl) Gets(ctx context.Context, organizationID, policyType, cursor string) (*model.OrganizationPolicyPageScheme, *model.ResponseScheme, error) { if organizationID == "" { - return nil, nil, model.ErrNoAdminOrganizationError + return nil, nil, model.ErrNoAdminOrganization } params := url.Values{} @@ -111,11 +111,11 @@ func (i *internalOrganizationPolicyImpl) Gets(ctx context.Context, organizationI func (i *internalOrganizationPolicyImpl) Get(ctx context.Context, organizationID, policyID string) (*model.OrganizationPolicyScheme, *model.ResponseScheme, error) { if organizationID == "" { - return nil, nil, model.ErrNoAdminOrganizationError + return nil, nil, model.ErrNoAdminOrganization } if policyID == "" { - return nil, nil, model.ErrNoAdminPolicyError + return nil, nil, model.ErrNoAdminPolicy } endpoint := fmt.Sprintf("admin/v1/orgs/%v/policies/%v", organizationID, policyID) @@ -137,7 +137,7 @@ func (i *internalOrganizationPolicyImpl) Get(ctx context.Context, organizationID func (i *internalOrganizationPolicyImpl) Create(ctx context.Context, organizationID string, payload *model.OrganizationPolicyData) (*model.OrganizationPolicyScheme, *model.ResponseScheme, error) { if organizationID == "" { - return nil, nil, model.ErrNoAdminOrganizationError + return nil, nil, model.ErrNoAdminOrganization } endpoint := fmt.Sprintf("admin/v1/orgs/%v/policies", organizationID) @@ -159,11 +159,11 @@ func (i *internalOrganizationPolicyImpl) Create(ctx context.Context, organizatio func (i *internalOrganizationPolicyImpl) Update(ctx context.Context, organizationID, policyID string, payload *model.OrganizationPolicyData) (*model.OrganizationPolicyScheme, *model.ResponseScheme, error) { if organizationID == "" { - return nil, nil, model.ErrNoAdminOrganizationError + return nil, nil, model.ErrNoAdminOrganization } if policyID == "" { - return nil, nil, model.ErrNoAdminPolicyError + return nil, nil, model.ErrNoAdminPolicy } endpoint := fmt.Sprintf("admin/v1/orgs/%v/policies/%v", organizationID, policyID) @@ -185,11 +185,11 @@ func (i *internalOrganizationPolicyImpl) Update(ctx context.Context, organizatio func (i *internalOrganizationPolicyImpl) Delete(ctx context.Context, organizationID, policyID string) (*model.ResponseScheme, error) { if organizationID == "" { - return nil, model.ErrNoAdminOrganizationError + return nil, model.ErrNoAdminOrganization } if policyID == "" { - return nil, model.ErrNoAdminPolicyError + return nil, model.ErrNoAdminPolicy } endpoint := fmt.Sprintf("admin/v1/orgs/%v/policies/%v", organizationID, policyID) diff --git a/admin/internal/organization_policy_impl_test.go b/admin/internal/organization_policy_impl_test.go index b0efae2a..74308e77 100644 --- a/admin/internal/organization_policy_impl_test.go +++ b/admin/internal/organization_policy_impl_test.go @@ -67,7 +67,7 @@ func Test_internalOrganizationPolicyImpl_Gets(t *testing.T) { organizationID: "", }, wantErr: true, - Err: model.ErrNoAdminOrganizationError, + Err: model.ErrNoAdminOrganization, }, { @@ -184,7 +184,7 @@ func Test_internalOrganizationPolicyImpl_Get(t *testing.T) { organizationID: "", }, wantErr: true, - Err: model.ErrNoAdminOrganizationError, + Err: model.ErrNoAdminOrganization, }, { @@ -194,7 +194,7 @@ func Test_internalOrganizationPolicyImpl_Get(t *testing.T) { organizationID: "organization-id-sample", }, wantErr: true, - Err: model.ErrNoAdminPolicyError, + Err: model.ErrNoAdminPolicy, }, { @@ -320,7 +320,7 @@ func Test_internalOrganizationPolicyImpl_Create(t *testing.T) { organizationID: "", }, wantErr: true, - Err: model.ErrNoAdminOrganizationError, + Err: model.ErrNoAdminOrganization, }, { @@ -446,7 +446,7 @@ func Test_internalOrganizationPolicyImpl_Update(t *testing.T) { organizationID: "", }, wantErr: true, - Err: model.ErrNoAdminOrganizationError, + Err: model.ErrNoAdminOrganization, }, { @@ -456,7 +456,7 @@ func Test_internalOrganizationPolicyImpl_Update(t *testing.T) { organizationID: "organization-id-sample", }, wantErr: true, - Err: model.ErrNoAdminPolicyError, + Err: model.ErrNoAdminPolicy, }, { @@ -572,7 +572,7 @@ func Test_internalOrganizationPolicyImpl_Delete(t *testing.T) { organizationID: "", }, wantErr: true, - Err: model.ErrNoAdminOrganizationError, + Err: model.ErrNoAdminOrganization, }, { @@ -582,7 +582,7 @@ func Test_internalOrganizationPolicyImpl_Delete(t *testing.T) { organizationID: "organization-id-sample", }, wantErr: true, - Err: model.ErrNoAdminPolicyError, + Err: model.ErrNoAdminPolicy, }, { diff --git a/admin/internal/scim_group_impl.go b/admin/internal/scim_group_impl.go index 64cd3911..4b7f1b82 100644 --- a/admin/internal/scim_group_impl.go +++ b/admin/internal/scim_group_impl.go @@ -96,7 +96,7 @@ type internalSCIMGroupImpl struct { func (i *internalSCIMGroupImpl) Gets(ctx context.Context, directoryID, filter string, startAt, maxResults int) (*model.ScimGroupPageScheme, *model.ResponseScheme, error) { if directoryID == "" { - return nil, nil, model.ErrNoAdminDirectoryIDError + return nil, nil, model.ErrNoAdminDirectoryID } params := url.Values{} @@ -126,11 +126,11 @@ func (i *internalSCIMGroupImpl) Gets(ctx context.Context, directoryID, filter st func (i *internalSCIMGroupImpl) Get(ctx context.Context, directoryID, groupID string) (*model.ScimGroupScheme, *model.ResponseScheme, error) { if directoryID == "" { - return nil, nil, model.ErrNoAdminDirectoryIDError + return nil, nil, model.ErrNoAdminDirectoryID } if groupID == "" { - return nil, nil, model.ErrNoAdminGroupIDError + return nil, nil, model.ErrNoAdminGroupID } endpoint := fmt.Sprintf("scim/directory/%v/Groups/%v", directoryID, groupID) @@ -152,15 +152,15 @@ func (i *internalSCIMGroupImpl) Get(ctx context.Context, directoryID, groupID st func (i *internalSCIMGroupImpl) Update(ctx context.Context, directoryID, groupID string, newGroupName string) (*model.ScimGroupScheme, *model.ResponseScheme, error) { if directoryID == "" { - return nil, nil, model.ErrNoAdminDirectoryIDError + return nil, nil, model.ErrNoAdminDirectoryID } if groupID == "" { - return nil, nil, model.ErrNoAdminGroupIDError + return nil, nil, model.ErrNoAdminGroupID } if newGroupName == "" { - return nil, nil, model.ErrNoAdminGroupNameError + return nil, nil, model.ErrNoAdminGroupName } endpoint := fmt.Sprintf("scim/directory/%v/Groups/%v", directoryID, groupID) @@ -184,11 +184,11 @@ func (i *internalSCIMGroupImpl) Update(ctx context.Context, directoryID, groupID func (i *internalSCIMGroupImpl) Delete(ctx context.Context, directoryID, groupID string) (*model.ResponseScheme, error) { if directoryID == "" { - return nil, model.ErrNoAdminDirectoryIDError + return nil, model.ErrNoAdminDirectoryID } if groupID == "" { - return nil, model.ErrNoAdminGroupIDError + return nil, model.ErrNoAdminGroupID } endpoint := fmt.Sprintf("scim/directory/%v/Groups/%v", directoryID, groupID) @@ -204,11 +204,11 @@ func (i *internalSCIMGroupImpl) Delete(ctx context.Context, directoryID, groupID func (i *internalSCIMGroupImpl) Create(ctx context.Context, directoryID, groupName string) (*model.ScimGroupScheme, *model.ResponseScheme, error) { if directoryID == "" { - return nil, nil, model.ErrNoAdminDirectoryIDError + return nil, nil, model.ErrNoAdminDirectoryID } if groupName == "" { - return nil, nil, model.ErrNoAdminGroupNameError + return nil, nil, model.ErrNoAdminGroupName } payload := map[string]interface{}{"displayName": groupName} @@ -232,11 +232,11 @@ func (i *internalSCIMGroupImpl) Create(ctx context.Context, directoryID, groupNa func (i *internalSCIMGroupImpl) Path(ctx context.Context, directoryID, groupID string, payload *model.SCIMGroupPathScheme) (*model.ScimGroupScheme, *model.ResponseScheme, error) { if directoryID == "" { - return nil, nil, model.ErrNoAdminDirectoryIDError + return nil, nil, model.ErrNoAdminDirectoryID } if groupID == "" { - return nil, nil, model.ErrNoAdminGroupIDError + return nil, nil, model.ErrNoAdminGroupID } endpoint := fmt.Sprintf("scim/directory/%v/Groups/%v", directoryID, groupID) diff --git a/admin/internal/scim_group_impl_test.go b/admin/internal/scim_group_impl_test.go index 78be3d57..dcc018cf 100644 --- a/admin/internal/scim_group_impl_test.go +++ b/admin/internal/scim_group_impl_test.go @@ -69,7 +69,7 @@ func Test_internalSCIMGroupImpl_Gets(t *testing.T) { directoryID: "", }, wantErr: true, - Err: model.ErrNoAdminDirectoryIDError, + Err: model.ErrNoAdminDirectoryID, }, { @@ -187,7 +187,7 @@ func Test_internalSCIMGroupImpl_Get(t *testing.T) { directoryID: "", }, wantErr: true, - Err: model.ErrNoAdminDirectoryIDError, + Err: model.ErrNoAdminDirectoryID, }, { @@ -197,7 +197,7 @@ func Test_internalSCIMGroupImpl_Get(t *testing.T) { directoryID: "directory-id-sample", }, wantErr: true, - Err: model.ErrNoAdminGroupIDError, + Err: model.ErrNoAdminGroupID, }, { @@ -313,7 +313,7 @@ func Test_internalSCIMGroupImpl_Delete(t *testing.T) { directoryID: "", }, wantErr: true, - Err: model.ErrNoAdminDirectoryIDError, + Err: model.ErrNoAdminDirectoryID, }, { @@ -323,7 +323,7 @@ func Test_internalSCIMGroupImpl_Delete(t *testing.T) { directoryID: "directory-id-sample", }, wantErr: true, - Err: model.ErrNoAdminGroupIDError, + Err: model.ErrNoAdminGroupID, }, { @@ -440,7 +440,7 @@ func Test_internalSCIMGroupImpl_Create(t *testing.T) { directoryID: "", }, wantErr: true, - Err: model.ErrNoAdminDirectoryIDError, + Err: model.ErrNoAdminDirectoryID, }, { @@ -450,7 +450,7 @@ func Test_internalSCIMGroupImpl_Create(t *testing.T) { directoryID: "directory-id-sample", }, wantErr: true, - Err: model.ErrNoAdminGroupNameError, + Err: model.ErrNoAdminGroupName, }, { @@ -569,7 +569,7 @@ func Test_internalSCIMGroupImpl_Update(t *testing.T) { directoryID: "", }, wantErr: true, - Err: model.ErrNoAdminDirectoryIDError, + Err: model.ErrNoAdminDirectoryID, }, { @@ -579,7 +579,7 @@ func Test_internalSCIMGroupImpl_Update(t *testing.T) { directoryID: "directory-id-sample", }, wantErr: true, - Err: model.ErrNoAdminGroupIDError, + Err: model.ErrNoAdminGroupID, }, { @@ -590,7 +590,7 @@ func Test_internalSCIMGroupImpl_Update(t *testing.T) { groupID: "group-id-sample", }, wantErr: true, - Err: model.ErrNoAdminGroupNameError, + Err: model.ErrNoAdminGroupName, }, { @@ -725,7 +725,7 @@ func Test_internalSCIMGroupImpl_Path(t *testing.T) { directoryID: "", }, wantErr: true, - Err: model.ErrNoAdminDirectoryIDError, + Err: model.ErrNoAdminDirectoryID, }, { @@ -735,7 +735,7 @@ func Test_internalSCIMGroupImpl_Path(t *testing.T) { directoryID: "directory-id-sample", }, wantErr: true, - Err: model.ErrNoAdminGroupIDError, + Err: model.ErrNoAdminGroupID, }, { diff --git a/admin/internal/scim_schema_impl.go b/admin/internal/scim_schema_impl.go index 2e52420a..7a21a7c6 100644 --- a/admin/internal/scim_schema_impl.go +++ b/admin/internal/scim_schema_impl.go @@ -85,7 +85,7 @@ type internalSCIMSchemaImpl struct { func (i *internalSCIMSchemaImpl) Gets(ctx context.Context, directoryID string) (*model.SCIMSchemasScheme, *model.ResponseScheme, error) { if directoryID == "" { - return nil, nil, model.ErrNoAdminDirectoryIDError + return nil, nil, model.ErrNoAdminDirectoryID } endpoint := fmt.Sprintf("scim/directory/%v/Schemas", directoryID) @@ -107,7 +107,7 @@ func (i *internalSCIMSchemaImpl) Gets(ctx context.Context, directoryID string) ( func (i *internalSCIMSchemaImpl) Group(ctx context.Context, directoryID string) (*model.SCIMSchemaScheme, *model.ResponseScheme, error) { if directoryID == "" { - return nil, nil, model.ErrNoAdminDirectoryIDError + return nil, nil, model.ErrNoAdminDirectoryID } endpoint := fmt.Sprintf("scim/directory/%v/Schemas/urn:ietf:params:scim:schemas:core:2.0:Group", directoryID) @@ -129,7 +129,7 @@ func (i *internalSCIMSchemaImpl) Group(ctx context.Context, directoryID string) func (i *internalSCIMSchemaImpl) User(ctx context.Context, directoryID string) (*model.SCIMSchemaScheme, *model.ResponseScheme, error) { if directoryID == "" { - return nil, nil, model.ErrNoAdminDirectoryIDError + return nil, nil, model.ErrNoAdminDirectoryID } endpoint := fmt.Sprintf("scim/directory/%v/Schemas/urn:ietf:params:scim:schemas:core:2.0:User", directoryID) @@ -151,7 +151,7 @@ func (i *internalSCIMSchemaImpl) User(ctx context.Context, directoryID string) ( func (i *internalSCIMSchemaImpl) Enterprise(ctx context.Context, directoryID string) (*model.SCIMSchemaScheme, *model.ResponseScheme, error) { if directoryID == "" { - return nil, nil, model.ErrNoAdminDirectoryIDError + return nil, nil, model.ErrNoAdminDirectoryID } endpoint := fmt.Sprintf("scim/directory/%v/Schemas/urn:ietf:params:scim:schemas:extension:enterprise:2.0:User", directoryID) @@ -173,7 +173,7 @@ func (i *internalSCIMSchemaImpl) Enterprise(ctx context.Context, directoryID str func (i *internalSCIMSchemaImpl) Feature(ctx context.Context, directoryID string) (*model.ServiceProviderConfigScheme, *model.ResponseScheme, error) { if directoryID == "" { - return nil, nil, model.ErrNoAdminDirectoryIDError + return nil, nil, model.ErrNoAdminDirectoryID } endpoint := fmt.Sprintf("scim/directory/%v/ServiceProviderConfig", directoryID) diff --git a/admin/internal/scim_schema_impl_test.go b/admin/internal/scim_schema_impl_test.go index 8c156fa4..b6a1c0a2 100644 --- a/admin/internal/scim_schema_impl_test.go +++ b/admin/internal/scim_schema_impl_test.go @@ -65,7 +65,7 @@ func Test_internalSCIMSchemaImpl_Gets(t *testing.T) { directoryID: "", }, wantErr: true, - Err: model.ErrNoAdminDirectoryIDError, + Err: model.ErrNoAdminDirectoryID, }, { @@ -178,7 +178,7 @@ func Test_internalSCIMSchemaImpl_Group(t *testing.T) { directoryID: "", }, wantErr: true, - Err: model.ErrNoAdminDirectoryIDError, + Err: model.ErrNoAdminDirectoryID, }, { @@ -291,7 +291,7 @@ func Test_internalSCIMSchemaImpl_User(t *testing.T) { directoryID: "", }, wantErr: true, - Err: model.ErrNoAdminDirectoryIDError, + Err: model.ErrNoAdminDirectoryID, }, { @@ -404,7 +404,7 @@ func Test_internalSCIMSchemaImpl_Enterprise(t *testing.T) { directoryID: "", }, wantErr: true, - Err: model.ErrNoAdminDirectoryIDError, + Err: model.ErrNoAdminDirectoryID, }, { @@ -517,7 +517,7 @@ func Test_internalSCIMSchemaImpl_Feature(t *testing.T) { directoryID: "", }, wantErr: true, - Err: model.ErrNoAdminDirectoryIDError, + Err: model.ErrNoAdminDirectoryID, }, { diff --git a/admin/internal/scim_user_impl.go b/admin/internal/scim_user_impl.go index 8b927869..2070d42c 100644 --- a/admin/internal/scim_user_impl.go +++ b/admin/internal/scim_user_impl.go @@ -107,7 +107,7 @@ type internalSCIMUserImpl struct { func (i *internalSCIMUserImpl) Create(ctx context.Context, directoryID string, payload *model.SCIMUserScheme, attributes, excludedAttributes []string) (*model.SCIMUserScheme, *model.ResponseScheme, error) { if directoryID == "" { - return nil, nil, model.ErrNoAdminDirectoryIDError + return nil, nil, model.ErrNoAdminDirectoryID } params := url.Values{} @@ -144,7 +144,7 @@ func (i *internalSCIMUserImpl) Create(ctx context.Context, directoryID string, p func (i *internalSCIMUserImpl) Gets(ctx context.Context, directoryID string, opts *model.SCIMUserGetsOptionsScheme, startIndex, count int) (*model.SCIMUserPageScheme, *model.ResponseScheme, error) { if directoryID == "" { - return nil, nil, model.ErrNoAdminDirectoryIDError + return nil, nil, model.ErrNoAdminDirectoryID } params := url.Values{} @@ -185,11 +185,11 @@ func (i *internalSCIMUserImpl) Gets(ctx context.Context, directoryID string, opt func (i *internalSCIMUserImpl) Get(ctx context.Context, directoryID, userID string, attributes, excludedAttributes []string) (*model.SCIMUserScheme, *model.ResponseScheme, error) { if directoryID == "" { - return nil, nil, model.ErrNoAdminDirectoryIDError + return nil, nil, model.ErrNoAdminDirectoryID } if userID == "" { - return nil, nil, model.ErrNoAdminUserIDError + return nil, nil, model.ErrNoAdminUserID } params := url.Values{} @@ -225,11 +225,11 @@ func (i *internalSCIMUserImpl) Get(ctx context.Context, directoryID, userID stri func (i *internalSCIMUserImpl) Deactivate(ctx context.Context, directoryID, userID string) (*model.ResponseScheme, error) { if directoryID == "" { - return nil, model.ErrNoAdminDirectoryIDError + return nil, model.ErrNoAdminDirectoryID } if userID == "" { - return nil, model.ErrNoAdminUserIDError + return nil, model.ErrNoAdminUserID } endpoint := fmt.Sprintf("scim/directory/%v/Users/%v", directoryID, userID) @@ -245,11 +245,11 @@ func (i *internalSCIMUserImpl) Deactivate(ctx context.Context, directoryID, user func (i *internalSCIMUserImpl) Path(ctx context.Context, directoryID, userID string, payload *model.SCIMUserToPathScheme, attributes, excludedAttributes []string) (*model.SCIMUserScheme, *model.ResponseScheme, error) { if directoryID == "" { - return nil, nil, model.ErrNoAdminDirectoryIDError + return nil, nil, model.ErrNoAdminDirectoryID } if userID == "" { - return nil, nil, model.ErrNoAdminUserIDError + return nil, nil, model.ErrNoAdminUserID } params := url.Values{} @@ -286,11 +286,11 @@ func (i *internalSCIMUserImpl) Path(ctx context.Context, directoryID, userID str func (i *internalSCIMUserImpl) Update(ctx context.Context, directoryID, userID string, payload *model.SCIMUserScheme, attributes, excludedAttributes []string) (*model.SCIMUserScheme, *model.ResponseScheme, error) { if directoryID == "" { - return nil, nil, model.ErrNoAdminDirectoryIDError + return nil, nil, model.ErrNoAdminDirectoryID } if userID == "" { - return nil, nil, model.ErrNoAdminUserIDError + return nil, nil, model.ErrNoAdminUserID } params := url.Values{} diff --git a/admin/internal/scim_user_impl_test.go b/admin/internal/scim_user_impl_test.go index d551d62b..05d2b1a5 100644 --- a/admin/internal/scim_user_impl_test.go +++ b/admin/internal/scim_user_impl_test.go @@ -74,7 +74,7 @@ func Test_internalSCIMUserImpl_Gets(t *testing.T) { directoryID: "", }, wantErr: true, - Err: model.ErrNoAdminDirectoryIDError, + Err: model.ErrNoAdminDirectoryID, }, { @@ -199,7 +199,7 @@ func Test_internalSCIMUserImpl_Get(t *testing.T) { directoryID: "", }, wantErr: true, - Err: model.ErrNoAdminDirectoryIDError, + Err: model.ErrNoAdminDirectoryID, }, { @@ -209,7 +209,7 @@ func Test_internalSCIMUserImpl_Get(t *testing.T) { directoryID: "direction-id-sample", }, wantErr: true, - Err: model.ErrNoAdminUserIDError, + Err: model.ErrNoAdminUserID, }, { @@ -327,7 +327,7 @@ func Test_internalSCIMUserImpl_Deactivate(t *testing.T) { directoryID: "", }, wantErr: true, - Err: model.ErrNoAdminDirectoryIDError, + Err: model.ErrNoAdminDirectoryID, }, { @@ -337,7 +337,7 @@ func Test_internalSCIMUserImpl_Deactivate(t *testing.T) { directoryID: "direction-id-sample", }, wantErr: true, - Err: model.ErrNoAdminUserIDError, + Err: model.ErrNoAdminUserID, }, { @@ -460,7 +460,7 @@ func Test_internalSCIMUserImpl_Path(t *testing.T) { directoryID: "", }, wantErr: true, - Err: model.ErrNoAdminDirectoryIDError, + Err: model.ErrNoAdminDirectoryID, }, { @@ -470,7 +470,7 @@ func Test_internalSCIMUserImpl_Path(t *testing.T) { directoryID: "direction-id-sample", }, wantErr: true, - Err: model.ErrNoAdminUserIDError, + Err: model.ErrNoAdminUserID, }, { @@ -610,7 +610,7 @@ func Test_internalSCIMUserImpl_Update(t *testing.T) { directoryID: "", }, wantErr: true, - Err: model.ErrNoAdminDirectoryIDError, + Err: model.ErrNoAdminDirectoryID, }, { @@ -620,7 +620,7 @@ func Test_internalSCIMUserImpl_Update(t *testing.T) { directoryID: "direction-id-sample", }, wantErr: true, - Err: model.ErrNoAdminUserIDError, + Err: model.ErrNoAdminUserID, }, { @@ -759,7 +759,7 @@ func Test_internalSCIMUserImpl_Create(t *testing.T) { directoryID: "", }, wantErr: true, - Err: model.ErrNoAdminDirectoryIDError, + Err: model.ErrNoAdminDirectoryID, }, { diff --git a/admin/internal/user_impl.go b/admin/internal/user_impl.go index 9017553d..4c1732ac 100644 --- a/admin/internal/user_impl.go +++ b/admin/internal/user_impl.go @@ -88,7 +88,7 @@ type internalUserImpl struct { func (i *internalUserImpl) Permissions(ctx context.Context, accountID string, privileges []string) (*model.AdminUserPermissionScheme, *model.ResponseScheme, error) { if accountID == "" { - return nil, nil, model.ErrNoAdminAccountIDError + return nil, nil, model.ErrNoAdminAccountID } var endpoint strings.Builder @@ -119,7 +119,7 @@ func (i *internalUserImpl) Permissions(ctx context.Context, accountID string, pr func (i *internalUserImpl) Get(ctx context.Context, accountID string) (*model.AdminUserScheme, *model.ResponseScheme, error) { if accountID == "" { - return nil, nil, model.ErrNoAdminAccountIDError + return nil, nil, model.ErrNoAdminAccountID } endpoint := fmt.Sprintf("users/%v/manage/profile", accountID) @@ -141,7 +141,7 @@ func (i *internalUserImpl) Get(ctx context.Context, accountID string) (*model.Ad func (i *internalUserImpl) Update(ctx context.Context, accountID string, payload map[string]interface{}) (*model.AdminUserScheme, *model.ResponseScheme, error) { if accountID == "" { - return nil, nil, model.ErrNoAdminAccountIDError + return nil, nil, model.ErrNoAdminAccountID } endpoint := fmt.Sprintf("users/%v/manage/profile", accountID) @@ -163,7 +163,7 @@ func (i *internalUserImpl) Update(ctx context.Context, accountID string, payload func (i *internalUserImpl) Disable(ctx context.Context, accountID, message string) (*model.ResponseScheme, error) { if accountID == "" { - return nil, model.ErrNoAdminAccountIDError + return nil, model.ErrNoAdminAccountID } endpoint := fmt.Sprintf("users/%v/manage/lifecycle/disable", accountID) @@ -184,7 +184,7 @@ func (i *internalUserImpl) Disable(ctx context.Context, accountID, message strin func (i *internalUserImpl) Enable(ctx context.Context, accountID string) (*model.ResponseScheme, error) { if accountID == "" { - return nil, model.ErrNoAdminAccountIDError + return nil, model.ErrNoAdminAccountID } endpoint := fmt.Sprintf("users/%v/manage/lifecycle/enable", accountID) diff --git a/admin/internal/user_impl_test.go b/admin/internal/user_impl_test.go index 4d4484f7..e72e33a2 100644 --- a/admin/internal/user_impl_test.go +++ b/admin/internal/user_impl_test.go @@ -67,7 +67,7 @@ func Test_internalUserImpl_Permissions(t *testing.T) { accountID: "", }, wantErr: true, - Err: model.ErrNoAdminAccountIDError, + Err: model.ErrNoAdminAccountID, }, { @@ -181,7 +181,7 @@ func Test_internalUserImpl_Get(t *testing.T) { accountID: "", }, wantErr: true, - Err: model.ErrNoAdminAccountIDError, + Err: model.ErrNoAdminAccountID, }, { @@ -294,7 +294,7 @@ func Test_internalUserImpl_Enable(t *testing.T) { accountID: "", }, wantErr: true, - Err: model.ErrNoAdminAccountIDError, + Err: model.ErrNoAdminAccountID, }, { @@ -409,7 +409,7 @@ func Test_internalUserImpl_Disable(t *testing.T) { accountID: "", }, wantErr: true, - Err: model.ErrNoAdminAccountIDError, + Err: model.ErrNoAdminAccountID, }, { @@ -526,7 +526,7 @@ func Test_internalUserImpl_Update(t *testing.T) { accountID: "", }, wantErr: true, - Err: model.ErrNoAdminAccountIDError, + Err: model.ErrNoAdminAccountID, }, { diff --git a/admin/internal/user_token_impl.go b/admin/internal/user_token_impl.go index 4dcfd730..408b6e6f 100644 --- a/admin/internal/user_token_impl.go +++ b/admin/internal/user_token_impl.go @@ -46,7 +46,7 @@ type internalUserTokenImpl struct { func (i *internalUserTokenImpl) Gets(ctx context.Context, accountID string) ([]*model.UserTokensScheme, *model.ResponseScheme, error) { if accountID == "" { - return nil, nil, model.ErrNoAdminAccountIDError + return nil, nil, model.ErrNoAdminAccountID } endpoint := fmt.Sprintf("users/%v/manage/api-tokens", accountID) @@ -68,11 +68,11 @@ func (i *internalUserTokenImpl) Gets(ctx context.Context, accountID string) ([]* func (i *internalUserTokenImpl) Delete(ctx context.Context, accountID, tokenID string) (*model.ResponseScheme, error) { if accountID == "" { - return nil, model.ErrNoAdminAccountIDError + return nil, model.ErrNoAdminAccountID } if tokenID == "" { - return nil, model.ErrNoAdminUserTokenError + return nil, model.ErrNoAdminUserToken } endpoint := fmt.Sprintf("users/%v/manage/api-tokens/%v", accountID, tokenID) diff --git a/admin/internal/user_token_impl_test.go b/admin/internal/user_token_impl_test.go index b28d8c31..b4deed26 100644 --- a/admin/internal/user_token_impl_test.go +++ b/admin/internal/user_token_impl_test.go @@ -65,7 +65,7 @@ func Test_internalUserTokenImpl_Gets(t *testing.T) { accountID: "", }, wantErr: true, - Err: model.ErrNoAdminAccountIDError, + Err: model.ErrNoAdminAccountID, }, { @@ -178,7 +178,7 @@ func Test_internalUserTokenImpl_Delete(t *testing.T) { accountID: "", }, wantErr: true, - Err: model.ErrNoAdminAccountIDError, + Err: model.ErrNoAdminAccountID, }, { @@ -188,7 +188,7 @@ func Test_internalUserTokenImpl_Delete(t *testing.T) { accountID: "account-id-sample", }, wantErr: true, - Err: model.ErrNoAdminUserTokenError, + Err: model.ErrNoAdminUserToken, }, { diff --git a/assets/api_client_impl.go b/assets/api_client_impl.go index f4c7b509..ed30d3e8 100644 --- a/assets/api_client_impl.go +++ b/assets/api_client_impl.go @@ -172,13 +172,13 @@ func (c *Client) processResponse(response *http.Response, structure interface{}) return res, model.ErrUnauthorized case http.StatusInternalServerError: - return res, model.ErrInternalError + return res, model.ErrInternal case http.StatusBadRequest: - return res, model.ErrBadRequestError + return res, model.ErrBadRequest default: - return res, model.ErrInvalidStatusCodeError + return res, model.ErrInvalidStatusCode } } diff --git a/assets/api_client_impl_test.go b/assets/api_client_impl_test.go index a2799673..2e5770fd 100644 --- a/assets/api_client_impl_test.go +++ b/assets/api_client_impl_test.go @@ -127,7 +127,7 @@ func TestClient_Call(t *testing.T) { Bytes: *bytes.NewBufferString("Hello, world!"), }, wantErr: true, - Err: model.ErrBadRequestError, + Err: model.ErrBadRequest, }, { @@ -152,7 +152,7 @@ func TestClient_Call(t *testing.T) { Bytes: *bytes.NewBufferString("Hello, world!"), }, wantErr: true, - Err: model.ErrInternalError, + Err: model.ErrInternal, }, { diff --git a/assets/internal/aql_impl.go b/assets/internal/aql_impl.go index c6f8fc2c..6b7ae621 100644 --- a/assets/internal/aql_impl.go +++ b/assets/internal/aql_impl.go @@ -44,7 +44,7 @@ type internalAQLImpl struct { func (i *internalAQLImpl) Filter(ctx context.Context, workspaceID string, parameters *model.AQLSearchParamsScheme) (*model.ObjectListScheme, *model.ResponseScheme, error) { if workspaceID == "" { - return nil, nil, model.ErrNoWorkspaceIDError + return nil, nil, model.ErrNoWorkspaceID } var endpoint strings.Builder diff --git a/assets/internal/aql_impl_test.go b/assets/internal/aql_impl_test.go index bfec3277..0d47357d 100644 --- a/assets/internal/aql_impl_test.go +++ b/assets/internal/aql_impl_test.go @@ -101,7 +101,7 @@ func Test_internalAQLImpl_Filter(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoWorkspaceIDError, + Err: model.ErrNoWorkspaceID, }, } diff --git a/assets/internal/icon_impl.go b/assets/internal/icon_impl.go index 8d7c1fd1..f1ad5c5c 100644 --- a/assets/internal/icon_impl.go +++ b/assets/internal/icon_impl.go @@ -48,11 +48,11 @@ type internalIconImpl struct { func (i *internalIconImpl) Get(ctx context.Context, workspaceID, iconID string) (*model.IconScheme, *model.ResponseScheme, error) { if workspaceID == "" { - return nil, nil, model.ErrNoWorkspaceIDError + return nil, nil, model.ErrNoWorkspaceID } if iconID == "" { - return nil, nil, model.ErrNoIconIDError + return nil, nil, model.ErrNoIconID } endpoint := fmt.Sprintf("jsm/assets/workspace/%v/v1/icon/%v", workspaceID, iconID) @@ -74,7 +74,7 @@ func (i *internalIconImpl) Get(ctx context.Context, workspaceID, iconID string) func (i *internalIconImpl) Global(ctx context.Context, workspaceID string) ([]*model.IconScheme, *model.ResponseScheme, error) { if workspaceID == "" { - return nil, nil, model.ErrNoWorkspaceIDError + return nil, nil, model.ErrNoWorkspaceID } endpoint := fmt.Sprintf("jsm/assets/workspace/%v/v1/icon/global", workspaceID) diff --git a/assets/internal/icon_impl_test.go b/assets/internal/icon_impl_test.go index dec817cf..2f659218 100644 --- a/assets/internal/icon_impl_test.go +++ b/assets/internal/icon_impl_test.go @@ -91,7 +91,7 @@ func Test_internalIconImpl_Get(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoWorkspaceIDError, + Err: model.ErrNoWorkspaceID, }, { @@ -101,7 +101,7 @@ func Test_internalIconImpl_Get(t *testing.T) { workspaceID: "workspace-uuid-sample", }, wantErr: true, - Err: model.ErrNoIconIDError, + Err: model.ErrNoIconID, }, } @@ -211,7 +211,7 @@ func Test_internalIconImpl_Global(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoWorkspaceIDError, + Err: model.ErrNoWorkspaceID, }, } diff --git a/assets/internal/object_impl.go b/assets/internal/object_impl.go index 03c108c5..7f10412e 100644 --- a/assets/internal/object_impl.go +++ b/assets/internal/object_impl.go @@ -125,7 +125,7 @@ type internalObjectImpl struct { func (i *internalObjectImpl) Search(ctx context.Context, workspaceID string, payload *model.ObjectSearchParamsScheme) (*model.ObjectListScheme, *model.ResponseScheme, error) { if workspaceID == "" { - return nil, nil, model.ErrNoWorkspaceIDError + return nil, nil, model.ErrNoWorkspaceID } endpoint := fmt.Sprintf("jsm/assets/workspace/%v/v1/object/navlist/aql", workspaceID) @@ -148,11 +148,11 @@ func (i *internalObjectImpl) Search(ctx context.Context, workspaceID string, pay func (i *internalObjectImpl) Filter(ctx context.Context, workspaceID, aql string, attributes bool, startAt, maxResults int) (*model.ObjectListResultScheme, *model.ResponseScheme, error) { if workspaceID == "" { - return nil, nil, model.ErrNoWorkspaceIDError + return nil, nil, model.ErrNoWorkspaceID } if aql == "" { - return nil, nil, model.ErrNoAqlQueryError + return nil, nil, model.ErrNoAqlQuery } params := url.Values{} @@ -182,11 +182,11 @@ func (i *internalObjectImpl) Filter(ctx context.Context, workspaceID, aql string func (i *internalObjectImpl) Get(ctx context.Context, workspaceID, objectID string) (*model.ObjectScheme, *model.ResponseScheme, error) { if workspaceID == "" { - return nil, nil, model.ErrNoWorkspaceIDError + return nil, nil, model.ErrNoWorkspaceID } if objectID == "" { - return nil, nil, model.ErrNoObjectIDError + return nil, nil, model.ErrNoObjectID } endpoint := fmt.Sprintf("jsm/assets/workspace/%v/v1/object/%v", workspaceID, objectID) @@ -208,11 +208,11 @@ func (i *internalObjectImpl) Get(ctx context.Context, workspaceID, objectID stri func (i *internalObjectImpl) Update(ctx context.Context, workspaceID, objectID string, payload *model.ObjectPayloadScheme) (*model.ObjectScheme, *model.ResponseScheme, error) { if workspaceID == "" { - return nil, nil, model.ErrNoWorkspaceIDError + return nil, nil, model.ErrNoWorkspaceID } if objectID == "" { - return nil, nil, model.ErrNoObjectIDError + return nil, nil, model.ErrNoObjectID } endpoint := fmt.Sprintf("jsm/assets/workspace/%v/v1/object/%v", workspaceID, objectID) @@ -234,11 +234,11 @@ func (i *internalObjectImpl) Update(ctx context.Context, workspaceID, objectID s func (i *internalObjectImpl) Delete(ctx context.Context, workspaceID, objectID string) (*model.ResponseScheme, error) { if workspaceID == "" { - return nil, model.ErrNoWorkspaceIDError + return nil, model.ErrNoWorkspaceID } if objectID == "" { - return nil, model.ErrNoObjectIDError + return nil, model.ErrNoObjectID } endpoint := fmt.Sprintf("jsm/assets/workspace/%v/v1/object/%v", workspaceID, objectID) @@ -254,11 +254,11 @@ func (i *internalObjectImpl) Delete(ctx context.Context, workspaceID, objectID s func (i *internalObjectImpl) Attributes(ctx context.Context, workspaceID, objectID string) ([]*model.ObjectAttributeScheme, *model.ResponseScheme, error) { if workspaceID == "" { - return nil, nil, model.ErrNoWorkspaceIDError + return nil, nil, model.ErrNoWorkspaceID } if objectID == "" { - return nil, nil, model.ErrNoObjectIDError + return nil, nil, model.ErrNoObjectID } endpoint := fmt.Sprintf("jsm/assets/workspace/%v/v1/object/%v/attributes", workspaceID, objectID) @@ -280,11 +280,11 @@ func (i *internalObjectImpl) Attributes(ctx context.Context, workspaceID, object func (i *internalObjectImpl) History(ctx context.Context, workspaceID, objectID string, ascOrder bool) ([]*model.ObjectHistoryScheme, *model.ResponseScheme, error) { if workspaceID == "" { - return nil, nil, model.ErrNoWorkspaceIDError + return nil, nil, model.ErrNoWorkspaceID } if objectID == "" { - return nil, nil, model.ErrNoObjectIDError + return nil, nil, model.ErrNoObjectID } var endpoint strings.Builder @@ -315,11 +315,11 @@ func (i *internalObjectImpl) History(ctx context.Context, workspaceID, objectID func (i *internalObjectImpl) References(ctx context.Context, workspaceID, objectID string) ([]*model.ObjectReferenceTypeInfoScheme, *model.ResponseScheme, error) { if workspaceID == "" { - return nil, nil, model.ErrNoWorkspaceIDError + return nil, nil, model.ErrNoWorkspaceID } if objectID == "" { - return nil, nil, model.ErrNoObjectIDError + return nil, nil, model.ErrNoObjectID } endpoint := fmt.Sprintf("jsm/assets/workspace/%v/v1/object/%v/referenceinfo", workspaceID, objectID) @@ -341,7 +341,7 @@ func (i *internalObjectImpl) References(ctx context.Context, workspaceID, object func (i *internalObjectImpl) Create(ctx context.Context, workspaceID string, payload *model.ObjectPayloadScheme) (*model.ObjectScheme, *model.ResponseScheme, error) { if workspaceID == "" { - return nil, nil, model.ErrNoWorkspaceIDError + return nil, nil, model.ErrNoWorkspaceID } endpoint := fmt.Sprintf("jsm/assets/workspace/%v/v1/object/create", workspaceID) @@ -363,11 +363,11 @@ func (i *internalObjectImpl) Create(ctx context.Context, workspaceID string, pay func (i *internalObjectImpl) Relation(ctx context.Context, workspaceID, objectID string) (*model.TicketPageScheme, *model.ResponseScheme, error) { if workspaceID == "" { - return nil, nil, model.ErrNoWorkspaceIDError + return nil, nil, model.ErrNoWorkspaceID } if objectID == "" { - return nil, nil, model.ErrNoObjectIDError + return nil, nil, model.ErrNoObjectID } endpoint := fmt.Sprintf("jsm/assets/workspace/%v/v1/objectconnectedtickets/%v/tickets", workspaceID, objectID) diff --git a/assets/internal/object_impl_test.go b/assets/internal/object_impl_test.go index c6abe616..ac2b5752 100644 --- a/assets/internal/object_impl_test.go +++ b/assets/internal/object_impl_test.go @@ -93,7 +93,7 @@ func Test_internalObjectImpl_Get(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoWorkspaceIDError, + Err: model.ErrNoWorkspaceID, }, { @@ -103,7 +103,7 @@ func Test_internalObjectImpl_Get(t *testing.T) { workspaceID: "workspace-uuid-sample", }, wantErr: true, - Err: model.ErrNoObjectIDError, + Err: model.ErrNoObjectID, }, } @@ -215,7 +215,7 @@ func Test_internalObjectImpl_Delete(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoWorkspaceIDError, + Err: model.ErrNoWorkspaceID, }, { @@ -225,7 +225,7 @@ func Test_internalObjectImpl_Delete(t *testing.T) { workspaceID: "workspace-uuid-sample", }, wantErr: true, - Err: model.ErrNoObjectIDError, + Err: model.ErrNoObjectID, }, } @@ -336,7 +336,7 @@ func Test_internalObjectImpl_Attributes(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoWorkspaceIDError, + Err: model.ErrNoWorkspaceID, }, { @@ -346,7 +346,7 @@ func Test_internalObjectImpl_Attributes(t *testing.T) { workspaceID: "workspace-uuid-sample", }, wantErr: true, - Err: model.ErrNoObjectIDError, + Err: model.ErrNoObjectID, }, } @@ -461,7 +461,7 @@ func Test_internalObjectImpl_History(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoWorkspaceIDError, + Err: model.ErrNoWorkspaceID, }, { @@ -471,7 +471,7 @@ func Test_internalObjectImpl_History(t *testing.T) { workspaceID: "workspace-uuid-sample", }, wantErr: true, - Err: model.ErrNoObjectIDError, + Err: model.ErrNoObjectID, }, } @@ -584,7 +584,7 @@ func Test_internalObjectImpl_References(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoWorkspaceIDError, + Err: model.ErrNoWorkspaceID, }, { @@ -594,7 +594,7 @@ func Test_internalObjectImpl_References(t *testing.T) { workspaceID: "workspace-uuid-sample", }, wantErr: true, - Err: model.ErrNoObjectIDError, + Err: model.ErrNoObjectID, }, } @@ -706,7 +706,7 @@ func Test_internalObjectImpl_Relation(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoWorkspaceIDError, + Err: model.ErrNoWorkspaceID, }, { @@ -716,7 +716,7 @@ func Test_internalObjectImpl_Relation(t *testing.T) { workspaceID: "workspace-uuid-sample", }, wantErr: true, - Err: model.ErrNoObjectIDError, + Err: model.ErrNoObjectID, }, } @@ -847,7 +847,7 @@ func Test_internalObjectImpl_Update(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoWorkspaceIDError, + Err: model.ErrNoWorkspaceID, }, { @@ -857,7 +857,7 @@ func Test_internalObjectImpl_Update(t *testing.T) { workspaceID: "workspace-uuid-sample", }, wantErr: true, - Err: model.ErrNoObjectIDError, + Err: model.ErrNoObjectID, }, } @@ -994,7 +994,7 @@ func Test_internalObjectImpl_Create(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoWorkspaceIDError, + Err: model.ErrNoWorkspaceID, }, } @@ -1114,7 +1114,7 @@ func Test_internalObjectImpl_Filter(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoWorkspaceIDError, + Err: model.ErrNoWorkspaceID, }, { @@ -1124,7 +1124,7 @@ func Test_internalObjectImpl_Filter(t *testing.T) { workspaceID: "workspace-uuid-sample", }, wantErr: true, - Err: model.ErrNoAqlQueryError, + Err: model.ErrNoAqlQuery, }, } @@ -1250,7 +1250,7 @@ func Test_internalObjectImpl_Search(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoWorkspaceIDError, + Err: model.ErrNoWorkspaceID, }, } diff --git a/assets/internal/object_schema_impl.go b/assets/internal/object_schema_impl.go index db196187..624b7f00 100644 --- a/assets/internal/object_schema_impl.go +++ b/assets/internal/object_schema_impl.go @@ -95,7 +95,7 @@ type internalObjectSchemaImpl struct { func (i *internalObjectSchemaImpl) List(ctx context.Context, workspaceID string) (*model.ObjectSchemaPageScheme, *model.ResponseScheme, error) { if workspaceID == "" { - return nil, nil, model.ErrNoWorkspaceIDError + return nil, nil, model.ErrNoWorkspaceID } endpoint := fmt.Sprintf("jsm/assets/workspace/%v/v1/objectschema/list", workspaceID) @@ -117,7 +117,7 @@ func (i *internalObjectSchemaImpl) List(ctx context.Context, workspaceID string) func (i *internalObjectSchemaImpl) Create(ctx context.Context, workspaceID string, payload *model.ObjectSchemaPayloadScheme) (*model.ObjectSchemaScheme, *model.ResponseScheme, error) { if workspaceID == "" { - return nil, nil, model.ErrNoWorkspaceIDError + return nil, nil, model.ErrNoWorkspaceID } endpoint := fmt.Sprintf("jsm/assets/workspace/%v/v1/objectschema/create", workspaceID) @@ -139,11 +139,11 @@ func (i *internalObjectSchemaImpl) Create(ctx context.Context, workspaceID strin func (i *internalObjectSchemaImpl) Get(ctx context.Context, workspaceID, objectSchemaID string) (*model.ObjectSchemaScheme, *model.ResponseScheme, error) { if workspaceID == "" { - return nil, nil, model.ErrNoWorkspaceIDError + return nil, nil, model.ErrNoWorkspaceID } if objectSchemaID == "" { - return nil, nil, model.ErrNoObjectSchemaIDError + return nil, nil, model.ErrNoObjectSchemaID } endpoint := fmt.Sprintf("jsm/assets/workspace/%v/v1/objectschema/%v", workspaceID, objectSchemaID) @@ -165,11 +165,11 @@ func (i *internalObjectSchemaImpl) Get(ctx context.Context, workspaceID, objectS func (i *internalObjectSchemaImpl) Update(ctx context.Context, workspaceID, objectSchemaID string, payload *model.ObjectSchemaPayloadScheme) (*model.ObjectSchemaScheme, *model.ResponseScheme, error) { if workspaceID == "" { - return nil, nil, model.ErrNoWorkspaceIDError + return nil, nil, model.ErrNoWorkspaceID } if objectSchemaID == "" { - return nil, nil, model.ErrNoObjectSchemaIDError + return nil, nil, model.ErrNoObjectSchemaID } endpoint := fmt.Sprintf("jsm/assets/workspace/%v/v1/objectschema/%v", workspaceID, objectSchemaID) @@ -191,11 +191,11 @@ func (i *internalObjectSchemaImpl) Update(ctx context.Context, workspaceID, obje func (i *internalObjectSchemaImpl) Delete(ctx context.Context, workspaceID, objectSchemaID string) (*model.ObjectSchemaScheme, *model.ResponseScheme, error) { if workspaceID == "" { - return nil, nil, model.ErrNoWorkspaceIDError + return nil, nil, model.ErrNoWorkspaceID } if objectSchemaID == "" { - return nil, nil, model.ErrNoObjectSchemaIDError + return nil, nil, model.ErrNoObjectSchemaID } endpoint := fmt.Sprintf("jsm/assets/workspace/%v/v1/objectschema/%v", workspaceID, objectSchemaID) @@ -217,11 +217,11 @@ func (i *internalObjectSchemaImpl) Delete(ctx context.Context, workspaceID, obje func (i *internalObjectSchemaImpl) Attributes(ctx context.Context, workspaceID, objectSchemaID string, options *model.ObjectSchemaAttributesParamsScheme) ([]*model.ObjectTypeAttributeScheme, *model.ResponseScheme, error) { if workspaceID == "" { - return nil, nil, model.ErrNoWorkspaceIDError + return nil, nil, model.ErrNoWorkspaceID } if objectSchemaID == "" { - return nil, nil, model.ErrNoObjectSchemaIDError + return nil, nil, model.ErrNoObjectSchemaID } query := url.Values{} @@ -268,11 +268,11 @@ func (i *internalObjectSchemaImpl) Attributes(ctx context.Context, workspaceID, func (i *internalObjectSchemaImpl) ObjectTypes(ctx context.Context, workspaceID, objectSchemaID string, excludeAbstract bool) ([]*model.ObjectTypeScheme, *model.ResponseScheme, error) { if workspaceID == "" { - return nil, nil, model.ErrNoWorkspaceIDError + return nil, nil, model.ErrNoWorkspaceID } if objectSchemaID == "" { - return nil, nil, model.ErrNoObjectSchemaIDError + return nil, nil, model.ErrNoObjectSchemaID } var endpoint strings.Builder diff --git a/assets/internal/object_schema_impl_test.go b/assets/internal/object_schema_impl_test.go index c953ee11..a61ed86c 100644 --- a/assets/internal/object_schema_impl_test.go +++ b/assets/internal/object_schema_impl_test.go @@ -89,7 +89,7 @@ func Test_internalObjectSchemaImpl_List(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoWorkspaceIDError, + Err: model.ErrNoWorkspaceID, }, } @@ -201,7 +201,7 @@ func Test_internalObjectSchemaImpl_Get(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoWorkspaceIDError, + Err: model.ErrNoWorkspaceID, }, { @@ -211,7 +211,7 @@ func Test_internalObjectSchemaImpl_Get(t *testing.T) { workspaceID: "workspace-uuid-sample", }, wantErr: true, - Err: model.ErrNoObjectSchemaIDError, + Err: model.ErrNoObjectSchemaID, }, } @@ -323,7 +323,7 @@ func Test_internalObjectSchemaImpl_Delete(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoWorkspaceIDError, + Err: model.ErrNoWorkspaceID, }, { @@ -333,7 +333,7 @@ func Test_internalObjectSchemaImpl_Delete(t *testing.T) { workspaceID: "workspace-uuid-sample", }, wantErr: true, - Err: model.ErrNoObjectSchemaIDError, + Err: model.ErrNoObjectSchemaID, }, } @@ -482,7 +482,7 @@ func Test_internalObjectSchemaImpl_Attributes(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoWorkspaceIDError, + Err: model.ErrNoWorkspaceID, }, { @@ -492,7 +492,7 @@ func Test_internalObjectSchemaImpl_Attributes(t *testing.T) { workspaceID: "workspace-uuid-sample", }, wantErr: true, - Err: model.ErrNoObjectSchemaIDError, + Err: model.ErrNoObjectSchemaID, }, } @@ -611,7 +611,7 @@ func Test_internalObjectSchemaImpl_ObjectTypes(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoWorkspaceIDError, + Err: model.ErrNoWorkspaceID, }, { @@ -621,7 +621,7 @@ func Test_internalObjectSchemaImpl_ObjectTypes(t *testing.T) { workspaceID: "workspace-uuid-sample", }, wantErr: true, - Err: model.ErrNoObjectSchemaIDError, + Err: model.ErrNoObjectSchemaID, }, } @@ -746,7 +746,7 @@ func Test_internalObjectSchemaImpl_Update(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoWorkspaceIDError, + Err: model.ErrNoWorkspaceID, }, { @@ -756,7 +756,7 @@ func Test_internalObjectSchemaImpl_Update(t *testing.T) { workspaceID: "workspace-uuid-sample", }, wantErr: true, - Err: model.ErrNoObjectSchemaIDError, + Err: model.ErrNoObjectSchemaID, }, } @@ -880,7 +880,7 @@ func Test_internalObjectSchemaImpl_Create(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoWorkspaceIDError, + Err: model.ErrNoWorkspaceID, }, } diff --git a/assets/internal/object_type_attribute_impl.go b/assets/internal/object_type_attribute_impl.go index 80ed4a04..2efb4222 100644 --- a/assets/internal/object_type_attribute_impl.go +++ b/assets/internal/object_type_attribute_impl.go @@ -57,11 +57,11 @@ type internalObjectTypeAttributeImpl struct { func (i *internalObjectTypeAttributeImpl) Create(ctx context.Context, workspaceID, objectTypeID string, payload *model.ObjectTypeAttributePayloadScheme) (*model.ObjectTypeAttributeScheme, *model.ResponseScheme, error) { if workspaceID == "" { - return nil, nil, model.ErrNoWorkspaceIDError + return nil, nil, model.ErrNoWorkspaceID } if objectTypeID == "" { - return nil, nil, model.ErrNoObjectTypeIDError + return nil, nil, model.ErrNoObjectTypeID } endpoint := fmt.Sprintf("jsm/assets/workspace/%v/v1/objecttypeattribute/%v", workspaceID, objectTypeID) @@ -83,15 +83,15 @@ func (i *internalObjectTypeAttributeImpl) Create(ctx context.Context, workspaceI func (i *internalObjectTypeAttributeImpl) Update(ctx context.Context, workspaceID, objectTypeID, attributeID string, payload *model.ObjectTypeAttributePayloadScheme) (*model.ObjectTypeAttributeScheme, *model.ResponseScheme, error) { if workspaceID == "" { - return nil, nil, model.ErrNoWorkspaceIDError + return nil, nil, model.ErrNoWorkspaceID } if objectTypeID == "" { - return nil, nil, model.ErrNoObjectTypeIDError + return nil, nil, model.ErrNoObjectTypeID } if attributeID == "" { - return nil, nil, model.ErrNoObjectTypeAttributeIDError + return nil, nil, model.ErrNoObjectTypeAttributeID } endpoint := fmt.Sprintf("jsm/assets/workspace/%v/v1/objecttypeattribute/%v/%v", workspaceID, objectTypeID, attributeID) @@ -113,11 +113,11 @@ func (i *internalObjectTypeAttributeImpl) Update(ctx context.Context, workspaceI func (i *internalObjectTypeAttributeImpl) Delete(ctx context.Context, workspaceID, attributeID string) (*model.ResponseScheme, error) { if workspaceID == "" { - return nil, model.ErrNoWorkspaceIDError + return nil, model.ErrNoWorkspaceID } if attributeID == "" { - return nil, model.ErrNoObjectTypeAttributeIDError + return nil, model.ErrNoObjectTypeAttributeID } endpoint := fmt.Sprintf("jsm/assets/workspace/%v/v1/objecttypeattribute/%v", workspaceID, attributeID) diff --git a/assets/internal/object_type_attribute_impl_test.go b/assets/internal/object_type_attribute_impl_test.go index be2d743c..e736e1d5 100644 --- a/assets/internal/object_type_attribute_impl_test.go +++ b/assets/internal/object_type_attribute_impl_test.go @@ -124,7 +124,7 @@ func Test_internalObjectTypeAttributeImpl_Create(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoWorkspaceIDError, + Err: model.ErrNoWorkspaceID, }, { @@ -134,7 +134,7 @@ func Test_internalObjectTypeAttributeImpl_Create(t *testing.T) { workspaceID: "workspace-uuid-sample", }, wantErr: true, - Err: model.ErrNoObjectTypeIDError, + Err: model.ErrNoObjectTypeID, }, } @@ -286,7 +286,7 @@ func Test_internalObjectTypeAttributeImpl_Update(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoWorkspaceIDError, + Err: model.ErrNoWorkspaceID, }, { @@ -296,7 +296,7 @@ func Test_internalObjectTypeAttributeImpl_Update(t *testing.T) { workspaceID: "workspace-uuid-sample", }, wantErr: true, - Err: model.ErrNoObjectTypeIDError, + Err: model.ErrNoObjectTypeID, }, { @@ -307,7 +307,7 @@ func Test_internalObjectTypeAttributeImpl_Update(t *testing.T) { objectTypeID: "object-type-id-sample", }, wantErr: true, - Err: model.ErrNoObjectTypeAttributeIDError, + Err: model.ErrNoObjectTypeAttributeID, }, } @@ -425,7 +425,7 @@ func Test_internalObjectTypeAttributeImpl_Delete(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoWorkspaceIDError, + Err: model.ErrNoWorkspaceID, }, { @@ -435,7 +435,7 @@ func Test_internalObjectTypeAttributeImpl_Delete(t *testing.T) { workspaceID: "workspace-uuid-sample", }, wantErr: true, - Err: model.ErrNoObjectTypeAttributeIDError, + Err: model.ErrNoObjectTypeAttributeID, }, } diff --git a/assets/internal/object_type_impl.go b/assets/internal/object_type_impl.go index 6b41df0e..75dc4458 100644 --- a/assets/internal/object_type_impl.go +++ b/assets/internal/object_type_impl.go @@ -86,11 +86,11 @@ type internalObjectTypeImpl struct { func (i *internalObjectTypeImpl) Get(ctx context.Context, workspaceID, objectTypeID string) (*model.ObjectTypeScheme, *model.ResponseScheme, error) { if workspaceID == "" { - return nil, nil, model.ErrNoWorkspaceIDError + return nil, nil, model.ErrNoWorkspaceID } if objectTypeID == "" { - return nil, nil, model.ErrNoObjectTypeIDError + return nil, nil, model.ErrNoObjectTypeID } endpoint := fmt.Sprintf("jsm/assets/workspace/%v/v1/objecttype/%v", workspaceID, objectTypeID) @@ -112,11 +112,11 @@ func (i *internalObjectTypeImpl) Get(ctx context.Context, workspaceID, objectTyp func (i *internalObjectTypeImpl) Update(ctx context.Context, workspaceID, objectTypeID string, payload *model.ObjectTypePayloadScheme) (*model.ObjectTypeScheme, *model.ResponseScheme, error) { if workspaceID == "" { - return nil, nil, model.ErrNoWorkspaceIDError + return nil, nil, model.ErrNoWorkspaceID } if objectTypeID == "" { - return nil, nil, model.ErrNoObjectTypeIDError + return nil, nil, model.ErrNoObjectTypeID } endpoint := fmt.Sprintf("jsm/assets/workspace/%v/v1/objecttype/%v", workspaceID, objectTypeID) @@ -138,7 +138,7 @@ func (i *internalObjectTypeImpl) Update(ctx context.Context, workspaceID, object func (i *internalObjectTypeImpl) Create(ctx context.Context, workspaceID string, payload *model.ObjectTypePayloadScheme) (*model.ObjectTypeScheme, *model.ResponseScheme, error) { if workspaceID == "" { - return nil, nil, model.ErrNoWorkspaceIDError + return nil, nil, model.ErrNoWorkspaceID } endpoint := fmt.Sprintf("jsm/assets/workspace/%v/v1/objecttype/create", workspaceID) @@ -160,11 +160,11 @@ func (i *internalObjectTypeImpl) Create(ctx context.Context, workspaceID string, func (i *internalObjectTypeImpl) Delete(ctx context.Context, workspaceID, objectTypeID string) (*model.ObjectTypeScheme, *model.ResponseScheme, error) { if workspaceID == "" { - return nil, nil, model.ErrNoWorkspaceIDError + return nil, nil, model.ErrNoWorkspaceID } if objectTypeID == "" { - return nil, nil, model.ErrNoObjectTypeIDError + return nil, nil, model.ErrNoObjectTypeID } endpoint := fmt.Sprintf("jsm/assets/workspace/%v/v1/objecttype/%v", workspaceID, objectTypeID) @@ -186,11 +186,11 @@ func (i *internalObjectTypeImpl) Delete(ctx context.Context, workspaceID, object func (i *internalObjectTypeImpl) Attributes(ctx context.Context, workspaceID, objectTypeID string, options *model.ObjectTypeAttributesParamsScheme) ([]*model.ObjectTypeAttributeScheme, *model.ResponseScheme, error) { if workspaceID == "" { - return nil, nil, model.ErrNoWorkspaceIDError + return nil, nil, model.ErrNoWorkspaceID } if objectTypeID == "" { - return nil, nil, model.ErrNoObjectTypeIDError + return nil, nil, model.ErrNoObjectTypeID } var endpoint strings.Builder @@ -249,11 +249,11 @@ func (i *internalObjectTypeImpl) Attributes(ctx context.Context, workspaceID, ob func (i *internalObjectTypeImpl) Position(ctx context.Context, workspaceID, objectTypeID string, payload *model.ObjectTypePositionPayloadScheme) (*model.ObjectTypeScheme, *model.ResponseScheme, error) { if workspaceID == "" { - return nil, nil, model.ErrNoWorkspaceIDError + return nil, nil, model.ErrNoWorkspaceID } if objectTypeID == "" { - return nil, nil, model.ErrNoObjectTypeIDError + return nil, nil, model.ErrNoObjectTypeID } endpoint := fmt.Sprintf("jsm/assets/workspace/%v/v1/objecttype/%v/position", workspaceID, objectTypeID) diff --git a/assets/internal/object_type_impl_test.go b/assets/internal/object_type_impl_test.go index ca35d5c2..bb6989c2 100644 --- a/assets/internal/object_type_impl_test.go +++ b/assets/internal/object_type_impl_test.go @@ -93,7 +93,7 @@ func Test_internalObjectTypeImpl_Get(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoWorkspaceIDError, + Err: model.ErrNoWorkspaceID, }, { @@ -103,7 +103,7 @@ func Test_internalObjectTypeImpl_Get(t *testing.T) { workspaceID: "workspace-id-sample", }, wantErr: true, - Err: model.ErrNoObjectTypeIDError, + Err: model.ErrNoObjectTypeID, }, } @@ -215,7 +215,7 @@ func Test_internalObjectTypeImpl_Delete(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoWorkspaceIDError, + Err: model.ErrNoWorkspaceID, }, { @@ -224,7 +224,7 @@ func Test_internalObjectTypeImpl_Delete(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoWorkspaceIDError, + Err: model.ErrNoWorkspaceID, }, } @@ -349,7 +349,7 @@ func Test_internalObjectTypeImpl_Attributes(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoWorkspaceIDError, + Err: model.ErrNoWorkspaceID, }, { @@ -359,7 +359,7 @@ func Test_internalObjectTypeImpl_Attributes(t *testing.T) { workspaceID: "workspace-id-sample", }, wantErr: true, - Err: model.ErrNoObjectTypeIDError, + Err: model.ErrNoObjectTypeID, }, } @@ -485,7 +485,7 @@ func Test_internalObjectTypeImpl_Update(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoWorkspaceIDError, + Err: model.ErrNoWorkspaceID, }, { @@ -495,7 +495,7 @@ func Test_internalObjectTypeImpl_Update(t *testing.T) { workspaceID: "workspace-uuid-sample", }, wantErr: true, - Err: model.ErrNoObjectTypeIDError, + Err: model.ErrNoObjectTypeID, }, } @@ -623,7 +623,7 @@ func Test_internalObjectTypeImpl_Create(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoWorkspaceIDError, + Err: model.ErrNoWorkspaceID, }, } @@ -747,7 +747,7 @@ func Test_internalObjectTypeImpl_Position(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoWorkspaceIDError, + Err: model.ErrNoWorkspaceID, }, { @@ -757,7 +757,7 @@ func Test_internalObjectTypeImpl_Position(t *testing.T) { workspaceID: "workspace-uuid-sample", }, wantErr: true, - Err: model.ErrNoObjectTypeIDError, + Err: model.ErrNoObjectTypeID, }, } diff --git a/bitbucket/api_client_impl.go b/bitbucket/api_client_impl.go index d359e727..09895cf7 100644 --- a/bitbucket/api_client_impl.go +++ b/bitbucket/api_client_impl.go @@ -158,13 +158,13 @@ func (c *Client) processResponse(response *http.Response, structure interface{}) return res, models.ErrUnauthorized case http.StatusInternalServerError: - return res, models.ErrInternalError + return res, models.ErrInternal case http.StatusBadRequest: - return res, models.ErrBadRequestError + return res, models.ErrBadRequest default: - return res, models.ErrInvalidStatusCodeError + return res, models.ErrInvalidStatusCode } } diff --git a/bitbucket/api_client_impl_test.go b/bitbucket/api_client_impl_test.go index 71f48b7c..aafac9e1 100644 --- a/bitbucket/api_client_impl_test.go +++ b/bitbucket/api_client_impl_test.go @@ -130,7 +130,7 @@ func TestClient_Call(t *testing.T) { Bytes: *bytes.NewBufferString("Hello, world!"), }, wantErr: true, - Err: model.ErrBadRequestError, + Err: model.ErrBadRequest, }, { @@ -155,7 +155,7 @@ func TestClient_Call(t *testing.T) { Bytes: *bytes.NewBufferString("Hello, world!"), }, wantErr: true, - Err: model.ErrInternalError, + Err: model.ErrInternal, }, { diff --git a/bitbucket/internal/workspace_impl.go b/bitbucket/internal/workspace_impl.go index 9ac9facc..13ea6c84 100644 --- a/bitbucket/internal/workspace_impl.go +++ b/bitbucket/internal/workspace_impl.go @@ -73,7 +73,7 @@ type internalWorkspaceServiceImpl struct { func (i *internalWorkspaceServiceImpl) Get(ctx context.Context, workspace string) (*model.WorkspaceScheme, *model.ResponseScheme, error) { if workspace == "" { - return nil, nil, model.ErrNoWorkspaceError + return nil, nil, model.ErrNoWorkspace } endpoint := fmt.Sprintf("2.0/workspaces/%v", workspace) @@ -96,7 +96,7 @@ func (i *internalWorkspaceServiceImpl) Get(ctx context.Context, workspace string func (i *internalWorkspaceServiceImpl) Members(ctx context.Context, workspace string) (*model.WorkspaceMembershipPageScheme, *model.ResponseScheme, error) { if workspace == "" { - return nil, nil, model.ErrNoWorkspaceError + return nil, nil, model.ErrNoWorkspace } endpoint := fmt.Sprintf("2.0/workspaces/%v/members", workspace) @@ -119,11 +119,11 @@ func (i *internalWorkspaceServiceImpl) Members(ctx context.Context, workspace st func (i *internalWorkspaceServiceImpl) Membership(ctx context.Context, workspace, memberID string) (*model.WorkspaceMembershipScheme, *model.ResponseScheme, error) { if workspace == "" { - return nil, nil, model.ErrNoWorkspaceError + return nil, nil, model.ErrNoWorkspace } if memberID == "" { - return nil, nil, model.ErrNoMemberIDError + return nil, nil, model.ErrNoMemberID } endpoint := fmt.Sprintf("2.0/workspaces/%v/members/%v", workspace, memberID) @@ -146,7 +146,7 @@ func (i *internalWorkspaceServiceImpl) Membership(ctx context.Context, workspace func (i *internalWorkspaceServiceImpl) Projects(ctx context.Context, workspace string) (*model.BitbucketProjectPageScheme, *model.ResponseScheme, error) { if workspace == "" { - return nil, nil, model.ErrNoWorkspaceError + return nil, nil, model.ErrNoWorkspace } endpoint := fmt.Sprintf("2.0/workspaces/%v/projects", workspace) diff --git a/bitbucket/internal/workspace_impl_test.go b/bitbucket/internal/workspace_impl_test.go index 4e5c25f0..db7837ad 100644 --- a/bitbucket/internal/workspace_impl_test.go +++ b/bitbucket/internal/workspace_impl_test.go @@ -89,7 +89,7 @@ func Test_internalWorkspaceServiceImpl_Get(t *testing.T) { workspace: "", }, wantErr: true, - Err: model.ErrNoWorkspaceError, + Err: model.ErrNoWorkspace, }, } @@ -198,7 +198,7 @@ func Test_internalWorkspaceServiceImpl_Members(t *testing.T) { workspace: "", }, wantErr: true, - Err: model.ErrNoWorkspaceError, + Err: model.ErrNoWorkspace, }, } @@ -307,7 +307,7 @@ func Test_internalWorkspaceServiceImpl_Projects(t *testing.T) { workspace: "", }, wantErr: true, - Err: model.ErrNoWorkspaceError, + Err: model.ErrNoWorkspace, }, } @@ -419,7 +419,7 @@ func Test_internalWorkspaceServiceImpl_Membership(t *testing.T) { workspace: "", }, wantErr: true, - Err: model.ErrNoWorkspaceError, + Err: model.ErrNoWorkspace, }, { @@ -429,7 +429,7 @@ func Test_internalWorkspaceServiceImpl_Membership(t *testing.T) { workspace: "work-space-name-sample", }, wantErr: true, - Err: model.ErrNoMemberIDError, + Err: model.ErrNoMemberID, }, } diff --git a/bitbucket/internal/workspace_permissions_impl.go b/bitbucket/internal/workspace_permissions_impl.go index d4da8d85..1148171c 100644 --- a/bitbucket/internal/workspace_permissions_impl.go +++ b/bitbucket/internal/workspace_permissions_impl.go @@ -65,7 +65,7 @@ type internalWorkspacePermissionServiceImpl struct { func (i *internalWorkspacePermissionServiceImpl) Members(ctx context.Context, workspace, query string) (*model.WorkspaceMembershipPageScheme, *model.ResponseScheme, error) { if workspace == "" { - return nil, nil, model.ErrNoWorkspaceError + return nil, nil, model.ErrNoWorkspace } var endpoint strings.Builder @@ -96,7 +96,7 @@ func (i *internalWorkspacePermissionServiceImpl) Members(ctx context.Context, wo func (i *internalWorkspacePermissionServiceImpl) Repositories(ctx context.Context, workspace, query, sort string) (*model.RepositoryPermissionPageScheme, *model.ResponseScheme, error) { if workspace == "" { - return nil, nil, model.ErrNoWorkspaceError + return nil, nil, model.ErrNoWorkspace } var endpoint strings.Builder @@ -131,11 +131,11 @@ func (i *internalWorkspacePermissionServiceImpl) Repositories(ctx context.Contex func (i *internalWorkspacePermissionServiceImpl) Repository(ctx context.Context, workspace, repository, query, sort string) (*model.RepositoryPermissionPageScheme, *model.ResponseScheme, error) { if workspace == "" { - return nil, nil, model.ErrNoWorkspaceError + return nil, nil, model.ErrNoWorkspace } if repository == "" { - return nil, nil, model.ErrNoRepositoryError + return nil, nil, model.ErrNoRepository } var endpoint strings.Builder diff --git a/bitbucket/internal/workspace_permissions_impl_test.go b/bitbucket/internal/workspace_permissions_impl_test.go index 3eed0dd3..73e46f47 100644 --- a/bitbucket/internal/workspace_permissions_impl_test.go +++ b/bitbucket/internal/workspace_permissions_impl_test.go @@ -90,7 +90,7 @@ func Test_internalWorkspacePermissionServiceImpl_Members(t *testing.T) { workspace: "", }, wantErr: true, - Err: model.ErrNoWorkspaceError, + Err: model.ErrNoWorkspace, }, } @@ -205,7 +205,7 @@ func Test_internalWorkspacePermissionServiceImpl_Repositories(t *testing.T) { workspace: "", }, wantErr: true, - Err: model.ErrNoWorkspaceError, + Err: model.ErrNoWorkspace, }, } @@ -324,7 +324,7 @@ func Test_internalWorkspacePermissionServiceImpl_Repository(t *testing.T) { workspace: "", }, wantErr: true, - Err: model.ErrNoWorkspaceError, + Err: model.ErrNoWorkspace, }, { @@ -334,7 +334,7 @@ func Test_internalWorkspacePermissionServiceImpl_Repository(t *testing.T) { workspace: "work-space-name-sample", }, wantErr: true, - Err: model.ErrNoRepositoryError, + Err: model.ErrNoRepository, }, } diff --git a/bitbucket/internal/workspace_webhooks_impl.go b/bitbucket/internal/workspace_webhooks_impl.go index bb9b0439..a7cef8ef 100644 --- a/bitbucket/internal/workspace_webhooks_impl.go +++ b/bitbucket/internal/workspace_webhooks_impl.go @@ -76,7 +76,7 @@ type internalWorkspaceHookServiceImpl struct { func (i *internalWorkspaceHookServiceImpl) Gets(ctx context.Context, workspace string) (*model.WebhookSubscriptionPageScheme, *model.ResponseScheme, error) { if workspace == "" { - return nil, nil, model.ErrNoWorkspaceError + return nil, nil, model.ErrNoWorkspace } endpoint := fmt.Sprintf("2.0/workspaces/%v/hooks", workspace) @@ -98,7 +98,7 @@ func (i *internalWorkspaceHookServiceImpl) Gets(ctx context.Context, workspace s func (i *internalWorkspaceHookServiceImpl) Create(ctx context.Context, workspace string, payload *model.WebhookSubscriptionPayloadScheme) (*model.WebhookSubscriptionScheme, *model.ResponseScheme, error) { if workspace == "" { - return nil, nil, model.ErrNoWorkspaceError + return nil, nil, model.ErrNoWorkspace } endpoint := fmt.Sprintf("2.0/workspaces/%v/hooks", workspace) @@ -120,11 +120,11 @@ func (i *internalWorkspaceHookServiceImpl) Create(ctx context.Context, workspace func (i *internalWorkspaceHookServiceImpl) Get(ctx context.Context, workspace, webhookID string) (*model.WebhookSubscriptionScheme, *model.ResponseScheme, error) { if workspace == "" { - return nil, nil, model.ErrNoWorkspaceError + return nil, nil, model.ErrNoWorkspace } if webhookID == "" { - return nil, nil, model.ErrNoWebhookIDError + return nil, nil, model.ErrNoWebhookID } endpoint := fmt.Sprintf("2.0/workspaces/%v/hooks/%v", workspace, webhookID) @@ -146,11 +146,11 @@ func (i *internalWorkspaceHookServiceImpl) Get(ctx context.Context, workspace, w func (i *internalWorkspaceHookServiceImpl) Update(ctx context.Context, workspace, webhookID string, payload *model.WebhookSubscriptionPayloadScheme) (*model.WebhookSubscriptionScheme, *model.ResponseScheme, error) { if workspace == "" { - return nil, nil, model.ErrNoWorkspaceError + return nil, nil, model.ErrNoWorkspace } if webhookID == "" { - return nil, nil, model.ErrNoWebhookIDError + return nil, nil, model.ErrNoWebhookID } endpoint := fmt.Sprintf("2.0/workspaces/%v/hooks/%v", workspace, webhookID) @@ -172,11 +172,11 @@ func (i *internalWorkspaceHookServiceImpl) Update(ctx context.Context, workspace func (i *internalWorkspaceHookServiceImpl) Delete(ctx context.Context, workspace, webhookID string) (*model.ResponseScheme, error) { if workspace == "" { - return nil, model.ErrNoWorkspaceError + return nil, model.ErrNoWorkspace } if webhookID == "" { - return nil, model.ErrNoWebhookIDError + return nil, model.ErrNoWebhookID } endpoint := fmt.Sprintf("2.0/workspaces/%v/hooks/%v", workspace, webhookID) diff --git a/bitbucket/internal/workspace_webhooks_impl_test.go b/bitbucket/internal/workspace_webhooks_impl_test.go index b2b443b7..884774ed 100644 --- a/bitbucket/internal/workspace_webhooks_impl_test.go +++ b/bitbucket/internal/workspace_webhooks_impl_test.go @@ -89,7 +89,7 @@ func Test_internalWorkspaceWebhookServiceImpl_Gets(t *testing.T) { workspace: "", }, wantErr: true, - Err: model.ErrNoWorkspaceError, + Err: model.ErrNoWorkspace, }, } @@ -201,7 +201,7 @@ func Test_internalWorkspaceWebhookServiceImpl_Get(t *testing.T) { workspace: "", }, wantErr: true, - Err: model.ErrNoWorkspaceError, + Err: model.ErrNoWorkspace, }, { @@ -211,7 +211,7 @@ func Test_internalWorkspaceWebhookServiceImpl_Get(t *testing.T) { workspace: "work-space-name-sample", }, wantErr: true, - Err: model.ErrNoWebhookIDError, + Err: model.ErrNoWebhookID, }, } @@ -330,7 +330,7 @@ func Test_internalWorkspaceWebhookServiceImpl_Create(t *testing.T) { workspace: "", }, wantErr: true, - Err: model.ErrNoWorkspaceError, + Err: model.ErrNoWorkspace, }, } @@ -452,7 +452,7 @@ func Test_internalWorkspaceWebhookServiceImpl_Update(t *testing.T) { workspace: "", }, wantErr: true, - Err: model.ErrNoWorkspaceError, + Err: model.ErrNoWorkspace, }, { @@ -462,7 +462,7 @@ func Test_internalWorkspaceWebhookServiceImpl_Update(t *testing.T) { workspace: "work-space-name-sample", }, wantErr: true, - Err: model.ErrNoWebhookIDError, + Err: model.ErrNoWebhookID, }, } @@ -575,7 +575,7 @@ func Test_internalWorkspaceWebhookServiceImpl_Delete(t *testing.T) { workspace: "", }, wantErr: true, - Err: model.ErrNoWorkspaceError, + Err: model.ErrNoWorkspace, }, { @@ -585,7 +585,7 @@ func Test_internalWorkspaceWebhookServiceImpl_Delete(t *testing.T) { workspace: "work-space-name-sample", }, wantErr: true, - Err: model.ErrNoWebhookIDError, + Err: model.ErrNoWebhookID, }, } diff --git a/confluence/api_client_impl.go b/confluence/api_client_impl.go index 7dc729be..b05afbd1 100644 --- a/confluence/api_client_impl.go +++ b/confluence/api_client_impl.go @@ -21,7 +21,7 @@ func New(httpClient common.HttpClient, site string) (*Client, error) { } if site == "" { - return nil, models.ErrNoSiteError + return nil, models.ErrNoSite } if !strings.HasSuffix(site, "/") { @@ -170,13 +170,13 @@ func (c *Client) processResponse(response *http.Response, structure interface{}) return res, models.ErrUnauthorized case http.StatusInternalServerError: - return res, models.ErrInternalError + return res, models.ErrInternal case http.StatusBadRequest: - return res, models.ErrBadRequestError + return res, models.ErrBadRequest default: - return res, models.ErrInvalidStatusCodeError + return res, models.ErrInvalidStatusCode } } diff --git a/confluence/api_client_impl_test.go b/confluence/api_client_impl_test.go index ee1350cd..a137e0ae 100644 --- a/confluence/api_client_impl_test.go +++ b/confluence/api_client_impl_test.go @@ -128,7 +128,7 @@ func TestClient_Call(t *testing.T) { Bytes: *bytes.NewBufferString("Hello, world!"), }, wantErr: true, - Err: model.ErrBadRequestError, + Err: model.ErrBadRequest, }, { @@ -153,7 +153,7 @@ func TestClient_Call(t *testing.T) { Bytes: *bytes.NewBufferString("Hello, world!"), }, wantErr: true, - Err: model.ErrInternalError, + Err: model.ErrInternal, }, { @@ -514,7 +514,7 @@ func TestNew(t *testing.T) { }, want: noURLClientMocked, wantErr: true, - Err: model.ErrNoSiteError, + Err: model.ErrNoSite, }, { name: "when the site url is not valid", diff --git a/confluence/internal/analytics_impl.go b/confluence/internal/analytics_impl.go index ceba9b97..85a7f6ef 100644 --- a/confluence/internal/analytics_impl.go +++ b/confluence/internal/analytics_impl.go @@ -51,7 +51,7 @@ type internalAnalyticsServiceImpl struct { func (i *internalAnalyticsServiceImpl) Get(ctx context.Context, contentID, fromDate string) (*model.ContentViewScheme, *model.ResponseScheme, error) { if contentID == "" { - return nil, nil, model.ErrNoContentIDError + return nil, nil, model.ErrNoContentID } var endpoint strings.Builder @@ -81,7 +81,7 @@ func (i *internalAnalyticsServiceImpl) Get(ctx context.Context, contentID, fromD func (i *internalAnalyticsServiceImpl) Distinct(ctx context.Context, contentID, fromDate string) (*model.ContentViewScheme, *model.ResponseScheme, error) { if contentID == "" { - return nil, nil, model.ErrNoContentIDError + return nil, nil, model.ErrNoContentID } var endpoint strings.Builder diff --git a/confluence/internal/analytics_impl_test.go b/confluence/internal/analytics_impl_test.go index ce3919ce..9807b49e 100644 --- a/confluence/internal/analytics_impl_test.go +++ b/confluence/internal/analytics_impl_test.go @@ -90,7 +90,7 @@ func Test_internalAnalyticsServiceImpl_Get(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoContentIDError, + Err: model.ErrNoContentID, }, } @@ -200,7 +200,7 @@ func Test_internalAnalyticsServiceImpl_Distinct(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoContentIDError, + Err: model.ErrNoContentID, }, } diff --git a/confluence/internal/attachment_content_impl.go b/confluence/internal/attachment_content_impl.go index eb23d9e7..295342dc 100644 --- a/confluence/internal/attachment_content_impl.go +++ b/confluence/internal/attachment_content_impl.go @@ -74,7 +74,7 @@ type internalContentAttachmentImpl struct { func (i *internalContentAttachmentImpl) Gets(ctx context.Context, contentID string, startAt, maxResults int, options *model.GetContentAttachmentsOptionsScheme) (*model.ContentPageScheme, *model.ResponseScheme, error) { if contentID == "" { - return nil, nil, model.ErrNoContentIDError + return nil, nil, model.ErrNoContentID } query := url.Values{} @@ -116,15 +116,15 @@ func (i *internalContentAttachmentImpl) Gets(ctx context.Context, contentID stri func (i *internalContentAttachmentImpl) CreateOrUpdate(ctx context.Context, attachmentID, status, fileName string, file io.Reader) (*model.ContentPageScheme, *model.ResponseScheme, error) { if attachmentID == "" { - return nil, nil, model.ErrNoContentAttachmentIDError + return nil, nil, model.ErrNoContentAttachmentID } if fileName == "" { - return nil, nil, model.ErrNoContentAttachmentNameError + return nil, nil, model.ErrNoContentAttachmentName } if file == nil { - return nil, nil, model.ErrNoContentReaderError + return nil, nil, model.ErrNoContentReader } var endpoint strings.Builder @@ -173,15 +173,15 @@ func (i *internalContentAttachmentImpl) CreateOrUpdate(ctx context.Context, atta func (i *internalContentAttachmentImpl) Create(ctx context.Context, attachmentID, status, fileName string, file io.Reader) (*model.ContentPageScheme, *model.ResponseScheme, error) { if attachmentID == "" { - return nil, nil, model.ErrNoContentAttachmentIDError + return nil, nil, model.ErrNoContentAttachmentID } if fileName == "" { - return nil, nil, model.ErrNoContentAttachmentNameError + return nil, nil, model.ErrNoContentAttachmentName } if file == nil { - return nil, nil, model.ErrNoContentReaderError + return nil, nil, model.ErrNoContentReader } var endpoint strings.Builder diff --git a/confluence/internal/attachment_content_impl_test.go b/confluence/internal/attachment_content_impl_test.go index 04653218..5ad71542 100644 --- a/confluence/internal/attachment_content_impl_test.go +++ b/confluence/internal/attachment_content_impl_test.go @@ -107,7 +107,7 @@ func Test_internalContentAttachmentImpl_Gets(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoContentIDError, + Err: model.ErrNoContentID, }, } @@ -237,7 +237,7 @@ func Test_internalContentAttachmentImpl_CreateOrUpdate(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoContentAttachmentIDError, + Err: model.ErrNoContentAttachmentID, }, { @@ -247,7 +247,7 @@ func Test_internalContentAttachmentImpl_CreateOrUpdate(t *testing.T) { attachmentID: "3837272", }, wantErr: true, - Err: model.ErrNoContentAttachmentNameError, + Err: model.ErrNoContentAttachmentName, }, { @@ -258,7 +258,7 @@ func Test_internalContentAttachmentImpl_CreateOrUpdate(t *testing.T) { fileName: "LICENSE", }, wantErr: true, - Err: model.ErrNoContentReaderError, + Err: model.ErrNoContentReader, }, } @@ -388,7 +388,7 @@ func Test_internalContentAttachmentImpl_Create(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoContentAttachmentIDError, + Err: model.ErrNoContentAttachmentID, }, { @@ -398,7 +398,7 @@ func Test_internalContentAttachmentImpl_Create(t *testing.T) { attachmentID: "3837272", }, wantErr: true, - Err: model.ErrNoContentAttachmentNameError, + Err: model.ErrNoContentAttachmentName, }, { @@ -409,7 +409,7 @@ func Test_internalContentAttachmentImpl_Create(t *testing.T) { fileName: "LICENSE", }, wantErr: true, - Err: model.ErrNoContentReaderError, + Err: model.ErrNoContentReader, }, } diff --git a/confluence/internal/attachment_impl.go b/confluence/internal/attachment_impl.go index 53e3915e..92c3021d 100644 --- a/confluence/internal/attachment_impl.go +++ b/confluence/internal/attachment_impl.go @@ -73,7 +73,7 @@ type internalAttachmentImpl struct { func (i *internalAttachmentImpl) Delete(ctx context.Context, attachmentID string) (*model.ResponseScheme, error) { if attachmentID == "" { - return nil, model.ErrNoContentAttachmentIDError + return nil, model.ErrNoContentAttachmentID } endpoint := fmt.Sprintf("wiki/api/v2/attachments/%v", attachmentID) @@ -89,7 +89,7 @@ func (i *internalAttachmentImpl) Delete(ctx context.Context, attachmentID string func (i *internalAttachmentImpl) Get(ctx context.Context, attachmentID string, versionID int, serializeIDs bool) (*model.AttachmentScheme, *model.ResponseScheme, error) { if attachmentID == "" { - return nil, nil, model.ErrNoContentAttachmentIDError + return nil, nil, model.ErrNoContentAttachmentID } var endpoint strings.Builder @@ -125,7 +125,7 @@ func (i *internalAttachmentImpl) Get(ctx context.Context, attachmentID string, v func (i *internalAttachmentImpl) Gets(ctx context.Context, entityID int, entityType string, options *model.AttachmentParamsScheme, cursor string, limit int) (*model.AttachmentPageScheme, *model.ResponseScheme, error) { if entityID == 0 { - return nil, nil, model.ErrNoEntityIDError + return nil, nil, model.ErrNoEntityID } query := url.Values{} diff --git a/confluence/internal/attachment_impl_test.go b/confluence/internal/attachment_impl_test.go index 7a344454..05dff89a 100644 --- a/confluence/internal/attachment_impl_test.go +++ b/confluence/internal/attachment_impl_test.go @@ -93,7 +93,7 @@ func Test_internalAttachmentImpl_Get(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoContentAttachmentIDError, + Err: model.ErrNoContentAttachmentID, }, } @@ -226,7 +226,7 @@ func Test_internalAttachmentImpl_Gets(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoEntityIDError, + Err: model.ErrNoEntityID, }, { @@ -348,7 +348,7 @@ func Test_internalAttachmentImpl_Delete(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoContentAttachmentIDError, + Err: model.ErrNoContentAttachmentID, }, } diff --git a/confluence/internal/attachment_version_impl.go b/confluence/internal/attachment_version_impl.go index 8e02cd1a..724b4647 100644 --- a/confluence/internal/attachment_version_impl.go +++ b/confluence/internal/attachment_version_impl.go @@ -50,7 +50,7 @@ type internalAttachmentVersionImpl struct { func (i *internalAttachmentVersionImpl) Gets(ctx context.Context, attachmentID, cursor, sort string, limit int) (*model.AttachmentVersionPageScheme, *model.ResponseScheme, error) { if attachmentID == "" { - return nil, nil, model.ErrNoContentAttachmentIDError + return nil, nil, model.ErrNoContentAttachmentID } query := url.Values{} @@ -83,7 +83,7 @@ func (i *internalAttachmentVersionImpl) Gets(ctx context.Context, attachmentID, func (i *internalAttachmentVersionImpl) Get(ctx context.Context, attachmentID string, versionID int) (*model.DetailedVersionScheme, *model.ResponseScheme, error) { if attachmentID == "" { - return nil, nil, model.ErrNoContentAttachmentIDError + return nil, nil, model.ErrNoContentAttachmentID } endpoint := fmt.Sprintf("wiki/api/v2/attachments/%v/versions/%v", attachmentID, versionID) diff --git a/confluence/internal/attachment_version_impl_test.go b/confluence/internal/attachment_version_impl_test.go index fabddfd1..a0471529 100644 --- a/confluence/internal/attachment_version_impl_test.go +++ b/confluence/internal/attachment_version_impl_test.go @@ -94,7 +94,7 @@ func Test_internalAttachmentVersionImpl_Gets(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoContentAttachmentIDError, + Err: model.ErrNoContentAttachmentID, }, } @@ -208,7 +208,7 @@ func Test_internalAttachmentVersionImpl_Get(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoContentAttachmentIDError, + Err: model.ErrNoContentAttachmentID, }, } diff --git a/confluence/internal/children_descendants_content_impl.go b/confluence/internal/children_descendants_content_impl.go index 8744ba03..f50ebfd1 100644 --- a/confluence/internal/children_descendants_content_impl.go +++ b/confluence/internal/children_descendants_content_impl.go @@ -151,7 +151,7 @@ type internalChildrenDescandantsImpl struct { func (i *internalChildrenDescandantsImpl) Children(ctx context.Context, contentID string, expand []string, parentVersion int) (*model.ContentChildrenScheme, *model.ResponseScheme, error) { if contentID == "" { - return nil, nil, model.ErrNoContentIDError + return nil, nil, model.ErrNoContentID } var endpoint strings.Builder @@ -188,20 +188,20 @@ func (i *internalChildrenDescandantsImpl) Children(ctx context.Context, contentI func (i *internalChildrenDescandantsImpl) Move(ctx context.Context, pageID string, position string, targetID string) (*model.ContentMoveScheme, *model.ResponseScheme, error) { if pageID == "" { - return nil, nil, model.ErrNoPageIDError + return nil, nil, model.ErrNoPageID } if position == "" { - return nil, nil, model.ErrNoPositionError + return nil, nil, model.ErrNoPosition } if targetID == "" { - return nil, nil, model.ErrNoTargetIDError + return nil, nil, model.ErrNoTargetID } _, validPosition := model.ValidPositions[position] if !validPosition { - return nil, nil, model.ErrInvalidPositionError + return nil, nil, model.ErrInvalidPosition } var endpoint strings.Builder @@ -224,11 +224,11 @@ func (i *internalChildrenDescandantsImpl) Move(ctx context.Context, pageID strin func (i *internalChildrenDescandantsImpl) ChildrenByType(ctx context.Context, contentID, contentType string, parentVersion int, expand []string, startAt, maxResults int) (*model.ContentPageScheme, *model.ResponseScheme, error) { if contentID == "" { - return nil, nil, model.ErrNoContentIDError + return nil, nil, model.ErrNoContentID } if contentType == "" { - return nil, nil, model.ErrNoContentTypeError + return nil, nil, model.ErrNoContentType } query := url.Values{} @@ -262,7 +262,7 @@ func (i *internalChildrenDescandantsImpl) ChildrenByType(ctx context.Context, co func (i *internalChildrenDescandantsImpl) Descendants(ctx context.Context, contentID string, expand []string) (*model.ContentChildrenScheme, *model.ResponseScheme, error) { if contentID == "" { - return nil, nil, model.ErrNoContentIDError + return nil, nil, model.ErrNoContentID } var endpoint strings.Builder @@ -295,11 +295,11 @@ func (i *internalChildrenDescandantsImpl) Descendants(ctx context.Context, conte func (i *internalChildrenDescandantsImpl) DescendantsByType(ctx context.Context, contentID, contentType, depth string, expand []string, startAt, maxResults int) (*model.ContentPageScheme, *model.ResponseScheme, error) { if contentID == "" { - return nil, nil, model.ErrNoContentIDError + return nil, nil, model.ErrNoContentID } if contentType == "" { - return nil, nil, model.ErrNoContentTypeError + return nil, nil, model.ErrNoContentType } query := url.Values{} @@ -333,7 +333,7 @@ func (i *internalChildrenDescandantsImpl) DescendantsByType(ctx context.Context, func (i *internalChildrenDescandantsImpl) CopyHierarchy(ctx context.Context, contentID string, options *model.CopyOptionsScheme) (*model.TaskScheme, *model.ResponseScheme, error) { if contentID == "" { - return nil, nil, model.ErrNoContentIDError + return nil, nil, model.ErrNoContentID } endpoint := fmt.Sprintf("wiki/rest/api/content/%v/pagehierarchy/copy", contentID) @@ -355,7 +355,7 @@ func (i *internalChildrenDescandantsImpl) CopyHierarchy(ctx context.Context, con func (i *internalChildrenDescandantsImpl) CopyPage(ctx context.Context, contentID string, expand []string, options *model.CopyOptionsScheme) (*model.ContentScheme, *model.ResponseScheme, error) { if contentID == "" { - return nil, nil, model.ErrNoContentIDError + return nil, nil, model.ErrNoContentID } var endpoint strings.Builder diff --git a/confluence/internal/children_descendants_content_impl_test.go b/confluence/internal/children_descendants_content_impl_test.go index 0ffee077..01c7adb4 100644 --- a/confluence/internal/children_descendants_content_impl_test.go +++ b/confluence/internal/children_descendants_content_impl_test.go @@ -93,7 +93,7 @@ func Test_internalChildrenDescandantsImpl_Children(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoContentIDError, + Err: model.ErrNoContentID, }, } @@ -264,7 +264,7 @@ func Test_internalChildrenDescandantsImpl_Move(t *testing.T) { targetID: "100100101", }, wantErr: true, - Err: model.ErrNoPageIDError, + Err: model.ErrNoPageID, }, { @@ -275,7 +275,7 @@ func Test_internalChildrenDescandantsImpl_Move(t *testing.T) { position: "append", }, wantErr: true, - Err: model.ErrNoTargetIDError, + Err: model.ErrNoTargetID, }, { @@ -286,7 +286,7 @@ func Test_internalChildrenDescandantsImpl_Move(t *testing.T) { targetID: "200200202", }, wantErr: true, - Err: model.ErrNoPositionError, + Err: model.ErrNoPosition, }, { @@ -298,7 +298,7 @@ func Test_internalChildrenDescandantsImpl_Move(t *testing.T) { targetID: "200200202", }, wantErr: true, - Err: model.ErrInvalidPositionError, + Err: model.ErrInvalidPosition, }, } @@ -421,7 +421,7 @@ func Test_internalChildrenDescandantsImpl_ChildrenByType(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoContentIDError, + Err: model.ErrNoContentID, }, { @@ -431,7 +431,7 @@ func Test_internalChildrenDescandantsImpl_ChildrenByType(t *testing.T) { contentID: "11929292", }, wantErr: true, - Err: model.ErrNoContentTypeError, + Err: model.ErrNoContentType, }, } @@ -546,7 +546,7 @@ func Test_internalChildrenDescandantsImpl_Descendants(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoContentIDError, + Err: model.ErrNoContentID, }, } @@ -667,7 +667,7 @@ func Test_internalChildrenDescandantsImpl_DescendantsByType(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoContentIDError, + Err: model.ErrNoContentID, }, { @@ -677,7 +677,7 @@ func Test_internalChildrenDescandantsImpl_DescendantsByType(t *testing.T) { contentID: "11929292", }, wantErr: true, - Err: model.ErrNoContentTypeError, + Err: model.ErrNoContentType, }, } @@ -806,7 +806,7 @@ func Test_internalChildrenDescandantsImpl_CopyHierarchy(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoContentIDError, + Err: model.ErrNoContentID, }, } @@ -937,7 +937,7 @@ func Test_internalChildrenDescandantsImpl_CopyPage(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoContentIDError, + Err: model.ErrNoContentID, }, } diff --git a/confluence/internal/comment_content_impl.go b/confluence/internal/comment_content_impl.go index a1dd7434..05feaaf5 100644 --- a/confluence/internal/comment_content_impl.go +++ b/confluence/internal/comment_content_impl.go @@ -42,7 +42,7 @@ type internalCommentImpl struct { func (i *internalCommentImpl) Gets(ctx context.Context, contentID string, expand, location []string, startAt, maxResults int) (*model.ContentPageScheme, *model.ResponseScheme, error) { if contentID == "" { - return nil, nil, model.ErrNoContentIDError + return nil, nil, model.ErrNoContentID } query := url.Values{} diff --git a/confluence/internal/comment_content_impl_test.go b/confluence/internal/comment_content_impl_test.go index f53a3a74..f94d79e5 100644 --- a/confluence/internal/comment_content_impl_test.go +++ b/confluence/internal/comment_content_impl_test.go @@ -97,7 +97,7 @@ func Test_internalCommentImpl_Gets(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoContentIDError, + Err: model.ErrNoContentID, }, } diff --git a/confluence/internal/content_impl.go b/confluence/internal/content_impl.go index 99ba9b8b..97f0f65a 100644 --- a/confluence/internal/content_impl.go +++ b/confluence/internal/content_impl.go @@ -249,7 +249,7 @@ func (i *internalContentImpl) Create(ctx context.Context, payload *model.Content func (i *internalContentImpl) Search(ctx context.Context, cql, cqlContext string, expand []string, cursor string, maxResults int) (*model.ContentPageScheme, *model.ResponseScheme, error) { if cql == "" { - return nil, nil, model.ErrNoCQLError + return nil, nil, model.ErrNoCQL } query := url.Values{} @@ -287,7 +287,7 @@ func (i *internalContentImpl) Search(ctx context.Context, cql, cqlContext string func (i *internalContentImpl) Get(ctx context.Context, contentID string, expand []string, version int) (*model.ContentScheme, *model.ResponseScheme, error) { if contentID == "" { - return nil, nil, model.ErrNoContentIDError + return nil, nil, model.ErrNoContentID } query := url.Values{} @@ -316,7 +316,7 @@ func (i *internalContentImpl) Get(ctx context.Context, contentID string, expand func (i *internalContentImpl) Update(ctx context.Context, contentID string, payload *model.ContentScheme) (*model.ContentScheme, *model.ResponseScheme, error) { if contentID == "" { - return nil, nil, model.ErrNoContentIDError + return nil, nil, model.ErrNoContentID } endpoint := fmt.Sprintf("wiki/rest/api/content/%v", contentID) @@ -338,7 +338,7 @@ func (i *internalContentImpl) Update(ctx context.Context, contentID string, payl func (i *internalContentImpl) Delete(ctx context.Context, contentID, status string) (*model.ResponseScheme, error) { if contentID == "" { - return nil, model.ErrNoContentIDError + return nil, model.ErrNoContentID } var endpoint strings.Builder @@ -362,7 +362,7 @@ func (i *internalContentImpl) Delete(ctx context.Context, contentID, status stri func (i *internalContentImpl) History(ctx context.Context, contentID string, expand []string) (*model.ContentHistoryScheme, *model.ResponseScheme, error) { if contentID == "" { - return nil, nil, model.ErrNoContentIDError + return nil, nil, model.ErrNoContentID } var endpoint strings.Builder diff --git a/confluence/internal/content_impl_test.go b/confluence/internal/content_impl_test.go index bd099200..8f1816a7 100644 --- a/confluence/internal/content_impl_test.go +++ b/confluence/internal/content_impl_test.go @@ -222,7 +222,7 @@ func Test_internalContentImpl_Search(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoCQLError, + Err: model.ErrNoCQL, }, } @@ -337,7 +337,7 @@ func Test_internalContentImpl_Get(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoContentIDError, + Err: model.ErrNoContentID, }, } @@ -449,7 +449,7 @@ func Test_internalContentImpl_History(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoContentIDError, + Err: model.ErrNoContentID, }, } @@ -560,7 +560,7 @@ func Test_internalContentImpl_Delete(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoContentIDError, + Err: model.ErrNoContentID, }, } @@ -793,7 +793,7 @@ func Test_internalContentImpl_Update(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoContentIDError, + Err: model.ErrNoContentID, }, } diff --git a/confluence/internal/custom_content_impl.go b/confluence/internal/custom_content_impl.go index 15c94323..c6dace57 100644 --- a/confluence/internal/custom_content_impl.go +++ b/confluence/internal/custom_content_impl.go @@ -82,7 +82,7 @@ type internalCustomContentServiceImpl struct { func (i *internalCustomContentServiceImpl) Gets(ctx context.Context, type_ string, options *model.CustomContentOptionsScheme, cursor string, limit int) (*model.CustomContentPageScheme, *model.ResponseScheme, error) { if type_ == "" { - return nil, nil, model.ErrNoCustomContentTypeError + return nil, nil, model.ErrNoCustomContentType } query := url.Values{} @@ -160,7 +160,7 @@ func (i *internalCustomContentServiceImpl) Create(ctx context.Context, payload * func (i *internalCustomContentServiceImpl) Get(ctx context.Context, customContentID int, format string, versionID int) (*model.CustomContentScheme, *model.ResponseScheme, error) { if customContentID == 0 { - return nil, nil, model.ErrNoCustomContentIDError + return nil, nil, model.ErrNoCustomContentID } query := url.Values{} @@ -197,7 +197,7 @@ func (i *internalCustomContentServiceImpl) Get(ctx context.Context, customConten func (i *internalCustomContentServiceImpl) Update(ctx context.Context, customContentID int, payload *model.CustomContentPayloadScheme) (*model.CustomContentScheme, *model.ResponseScheme, error) { if customContentID == 0 { - return nil, nil, model.ErrNoCustomContentIDError + return nil, nil, model.ErrNoCustomContentID } endpoint := fmt.Sprintf("wiki/api/v2/custom-content/%v", customContentID) @@ -220,7 +220,7 @@ func (i *internalCustomContentServiceImpl) Update(ctx context.Context, customCon func (i *internalCustomContentServiceImpl) Delete(ctx context.Context, customContentID int) (*model.ResponseScheme, error) { if customContentID == 0 { - return nil, model.ErrNoCustomContentIDError + return nil, model.ErrNoCustomContentID } endpoint := fmt.Sprintf("wiki/api/v2/custom-content/%v", customContentID) diff --git a/confluence/internal/custom_content_impl_test.go b/confluence/internal/custom_content_impl_test.go index 36272efa..0cd14623 100644 --- a/confluence/internal/custom_content_impl_test.go +++ b/confluence/internal/custom_content_impl_test.go @@ -105,7 +105,7 @@ func Test_internalCustomContentServiceImpl_Gets(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoCustomContentTypeError, + Err: model.ErrNoCustomContentType, }, } @@ -354,7 +354,7 @@ func Test_internalCustomContentServiceImpl_Update(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoCustomContentIDError, + Err: model.ErrNoCustomContentID, }, } @@ -467,7 +467,7 @@ func Test_internalCustomContentServiceImpl_Delete(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoCustomContentIDError, + Err: model.ErrNoCustomContentID, }, } @@ -583,7 +583,7 @@ func Test_internalCustomContentServiceImpl_Get(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoCustomContentIDError, + Err: model.ErrNoCustomContentID, }, } diff --git a/confluence/internal/label_content_impl.go b/confluence/internal/label_content_impl.go index 213de82d..a2d00ace 100644 --- a/confluence/internal/label_content_impl.go +++ b/confluence/internal/label_content_impl.go @@ -60,7 +60,7 @@ type internalContentLabelImpl struct { func (i *internalContentLabelImpl) Gets(ctx context.Context, contentID, prefix string, startAt, maxResults int) (*model.ContentLabelPageScheme, *model.ResponseScheme, error) { if contentID == "" { - return nil, nil, model.ErrNoContentIDError + return nil, nil, model.ErrNoContentID } query := url.Values{} @@ -90,7 +90,7 @@ func (i *internalContentLabelImpl) Gets(ctx context.Context, contentID, prefix s func (i *internalContentLabelImpl) Add(ctx context.Context, contentID string, payload []*model.ContentLabelPayloadScheme, want400Response bool) (*model.ContentLabelPageScheme, *model.ResponseScheme, error) { if contentID == "" { - return nil, nil, model.ErrNoContentIDError + return nil, nil, model.ErrNoContentID } var endpoint strings.Builder @@ -120,11 +120,11 @@ func (i *internalContentLabelImpl) Add(ctx context.Context, contentID string, pa func (i *internalContentLabelImpl) Remove(ctx context.Context, contentID, labelName string) (*model.ResponseScheme, error) { if contentID == "" { - return nil, model.ErrNoContentIDError + return nil, model.ErrNoContentID } if labelName == "" { - return nil, model.ErrNoContentLabelError + return nil, model.ErrNoContentLabel } endpoint := fmt.Sprintf("wiki/rest/api/content/%v/label/%v", contentID, labelName) diff --git a/confluence/internal/label_content_impl_test.go b/confluence/internal/label_content_impl_test.go index c1c9c9d6..bb1e0a80 100644 --- a/confluence/internal/label_content_impl_test.go +++ b/confluence/internal/label_content_impl_test.go @@ -93,7 +93,7 @@ func Test_internalContentLabelImpl_Gets(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoContentIDError, + Err: model.ErrNoContentID, }, } @@ -204,7 +204,7 @@ func Test_internalContentLabelImpl_Remove(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoContentIDError, + Err: model.ErrNoContentID, }, { @@ -214,7 +214,7 @@ func Test_internalContentLabelImpl_Remove(t *testing.T) { contentID: "1111", }, wantErr: true, - Err: model.ErrNoContentLabelError, + Err: model.ErrNoContentLabel, }, } @@ -334,7 +334,7 @@ func Test_internalContentLabelImpl_Add(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoContentIDError, + Err: model.ErrNoContentID, }, } diff --git a/confluence/internal/label_impl.go b/confluence/internal/label_impl.go index 5e9387d6..2e642d90 100644 --- a/confluence/internal/label_impl.go +++ b/confluence/internal/label_impl.go @@ -40,7 +40,7 @@ type internalLabelImpl struct { func (i *internalLabelImpl) Get(ctx context.Context, labelName, labelType string, start, limit int) (*model.LabelDetailsScheme, *model.ResponseScheme, error) { if labelName == "" { - return nil, nil, model.ErrNoLabelNameError + return nil, nil, model.ErrNoLabelName } query := url.Values{} diff --git a/confluence/internal/label_impl_test.go b/confluence/internal/label_impl_test.go index f0b08617..d899702c 100644 --- a/confluence/internal/label_impl_test.go +++ b/confluence/internal/label_impl_test.go @@ -94,7 +94,7 @@ func Test_internalLabelImpl_Get(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoLabelNameError, + Err: model.ErrNoLabelName, }, } diff --git a/confluence/internal/page_impl.go b/confluence/internal/page_impl.go index edf473a9..1db08ff1 100644 --- a/confluence/internal/page_impl.go +++ b/confluence/internal/page_impl.go @@ -190,7 +190,7 @@ func (i *internalPageImpl) Gets(ctx context.Context, options *model.PageOptionsS func (i *internalPageImpl) Get(ctx context.Context, pageID int, format string, draft bool, version int) (*model.PageScheme, *model.ResponseScheme, error) { if pageID == 0 { - return nil, nil, model.ErrNoPageIDError + return nil, nil, model.ErrNoPageID } query := url.Values{} @@ -230,7 +230,7 @@ func (i *internalPageImpl) Bulk(ctx context.Context, cursor string, limit int) ( func (i *internalPageImpl) GetsByLabel(ctx context.Context, labelID int, sort, cursor string, limit int) (*model.PageChunkScheme, *model.ResponseScheme, error) { if labelID == 0 { - return nil, nil, model.ErrNoLabelIDError + return nil, nil, model.ErrNoLabelID } query := url.Values{} @@ -263,7 +263,7 @@ func (i *internalPageImpl) GetsByLabel(ctx context.Context, labelID int, sort, c func (i *internalPageImpl) GetsBySpace(ctx context.Context, spaceID int, cursor string, limit int) (*model.PageChunkScheme, *model.ResponseScheme, error) { if spaceID == 0 { - return nil, nil, model.ErrNoSpaceIDError + return nil, nil, model.ErrNoSpaceID } query := url.Values{} @@ -292,7 +292,7 @@ func (i *internalPageImpl) GetsBySpace(ctx context.Context, spaceID int, cursor func (i *internalPageImpl) GetsByParent(ctx context.Context, parentID int, cursor string, limit int) (*model.ChildPageChunkScheme, *model.ResponseScheme, error) { if parentID == 0 { - return nil, nil, model.ErrNoPageIDError + return nil, nil, model.ErrNoPageID } query := url.Values{} @@ -339,7 +339,7 @@ func (i *internalPageImpl) Create(ctx context.Context, payload *model.PageCreate func (i *internalPageImpl) Update(ctx context.Context, pageID int, payload *model.PageUpdatePayloadScheme) (*model.PageScheme, *model.ResponseScheme, error) { if pageID == 0 { - return nil, nil, model.ErrNoPageIDError + return nil, nil, model.ErrNoPageID } endpoint := fmt.Sprintf("wiki/api/v2/pages/%v", pageID) @@ -361,7 +361,7 @@ func (i *internalPageImpl) Update(ctx context.Context, pageID int, payload *mode func (i *internalPageImpl) Delete(ctx context.Context, pageID int) (*model.ResponseScheme, error) { if pageID == 0 { - return nil, model.ErrNoPageIDError + return nil, model.ErrNoPageID } endpoint := fmt.Sprintf("wiki/api/v2/pages/%v", pageID) diff --git a/confluence/internal/page_impl_test.go b/confluence/internal/page_impl_test.go index bfc78de8..649f3d02 100644 --- a/confluence/internal/page_impl_test.go +++ b/confluence/internal/page_impl_test.go @@ -97,7 +97,7 @@ func Test_internalPageImpl_Get(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoPageIDError, + Err: model.ErrNoPageID, }, } @@ -409,7 +409,7 @@ func Test_internalPageImpl_GetsByLabel(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoLabelIDError, + Err: model.ErrNoLabelID, }, { @@ -525,7 +525,7 @@ func Test_internalPageImpl_GetsBySpace(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoSpaceIDError, + Err: model.ErrNoSpaceID, }, { @@ -639,7 +639,7 @@ func Test_internalPageImpl_GetsByParent(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoPageIDError, + Err: model.ErrNoPageID, }, { @@ -805,7 +805,7 @@ func Test_internalPageImpl_Delete(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoPageIDError, + Err: model.ErrNoPageID, }, } @@ -1088,7 +1088,7 @@ func Test_internalPageImpl_Update(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoPageIDError, + Err: model.ErrNoPageID, }, } diff --git a/confluence/internal/permission_content_impl.go b/confluence/internal/permission_content_impl.go index f3f95680..3fc57c97 100644 --- a/confluence/internal/permission_content_impl.go +++ b/confluence/internal/permission_content_impl.go @@ -52,7 +52,7 @@ type internalPermissionImpl struct { func (i *internalPermissionImpl) Check(ctx context.Context, contentID string, payload *model.CheckPermissionScheme) (*model.PermissionCheckResponseScheme, *model.ResponseScheme, error) { if contentID == "" { - return nil, nil, model.ErrNoContentIDError + return nil, nil, model.ErrNoContentID } endpoint := fmt.Sprintf("wiki/rest/api/content/%v/permission/check", contentID) diff --git a/confluence/internal/permission_content_impl_test.go b/confluence/internal/permission_content_impl_test.go index d2096ed8..ef238d6d 100644 --- a/confluence/internal/permission_content_impl_test.go +++ b/confluence/internal/permission_content_impl_test.go @@ -98,7 +98,7 @@ func Test_internalPermissionImpl_Check(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoContentIDError, + Err: model.ErrNoContentID, }, } diff --git a/confluence/internal/permission_space_impl.go b/confluence/internal/permission_space_impl.go index d6ce54a4..11fa3658 100644 --- a/confluence/internal/permission_space_impl.go +++ b/confluence/internal/permission_space_impl.go @@ -68,7 +68,7 @@ type internalSpacePermissionImpl struct { func (i *internalSpacePermissionImpl) Add(ctx context.Context, spaceKey string, payload *model.SpacePermissionPayloadScheme) (*model.SpacePermissionV2Scheme, *model.ResponseScheme, error) { if spaceKey == "" { - return nil, nil, model.ErrNoSpaceKeyError + return nil, nil, model.ErrNoSpaceKey } endpoint := fmt.Sprintf("wiki/rest/api/space/%v/permission", spaceKey) @@ -90,7 +90,7 @@ func (i *internalSpacePermissionImpl) Add(ctx context.Context, spaceKey string, func (i *internalSpacePermissionImpl) Bulk(ctx context.Context, spaceKey string, payload *model.SpacePermissionArrayPayloadScheme) (*model.ResponseScheme, error) { if spaceKey == "" { - return nil, model.ErrNoSpaceKeyError + return nil, model.ErrNoSpaceKey } endpoint := fmt.Sprintf("wiki/rest/api/space/%v/permission/custom-content", spaceKey) @@ -106,7 +106,7 @@ func (i *internalSpacePermissionImpl) Bulk(ctx context.Context, spaceKey string, func (i *internalSpacePermissionImpl) Remove(ctx context.Context, spaceKey string, permissionID int) (*model.ResponseScheme, error) { if spaceKey == "" { - return nil, model.ErrNoSpaceKeyError + return nil, model.ErrNoSpaceKey } endpoint := fmt.Sprintf("wiki/rest/api/space/%v/permission/%v", spaceKey, permissionID) diff --git a/confluence/internal/permission_space_impl_test.go b/confluence/internal/permission_space_impl_test.go index a3c9ecf4..15d9ee45 100644 --- a/confluence/internal/permission_space_impl_test.go +++ b/confluence/internal/permission_space_impl_test.go @@ -99,7 +99,7 @@ func Test_internalSpacePermissionImpl_Add(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoSpaceKeyError, + Err: model.ErrNoSpaceKey, }, } @@ -229,7 +229,7 @@ func Test_internalSpacePermissionImpl_Bulk(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoSpaceKeyError, + Err: model.ErrNoSpaceKey, }, } @@ -339,7 +339,7 @@ func Test_internalSpacePermissionImpl_Remove(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoSpaceKeyError, + Err: model.ErrNoSpaceKey, }, } diff --git a/confluence/internal/properties_content_impl.go b/confluence/internal/properties_content_impl.go index 1569999e..34e59dfa 100644 --- a/confluence/internal/properties_content_impl.go +++ b/confluence/internal/properties_content_impl.go @@ -69,7 +69,7 @@ type internalPropertyImpl struct { func (i *internalPropertyImpl) Gets(ctx context.Context, contentID string, expand []string, startAt, maxResults int) (*model.ContentPropertyPageScheme, *model.ResponseScheme, error) { if contentID == "" { - return nil, nil, model.ErrNoContentIDError + return nil, nil, model.ErrNoContentID } query := url.Values{} @@ -99,7 +99,7 @@ func (i *internalPropertyImpl) Gets(ctx context.Context, contentID string, expan func (i *internalPropertyImpl) Create(ctx context.Context, contentID string, payload *model.ContentPropertyPayloadScheme) (*model.ContentPropertyScheme, *model.ResponseScheme, error) { if contentID == "" { - return nil, nil, model.ErrNoContentIDError + return nil, nil, model.ErrNoContentID } endpoint := fmt.Sprintf("wiki/rest/api/content/%v/property", contentID) @@ -121,11 +121,11 @@ func (i *internalPropertyImpl) Create(ctx context.Context, contentID string, pay func (i *internalPropertyImpl) Get(ctx context.Context, contentID, key string) (*model.ContentPropertyScheme, *model.ResponseScheme, error) { if contentID == "" { - return nil, nil, model.ErrNoContentIDError + return nil, nil, model.ErrNoContentID } if key == "" { - return nil, nil, model.ErrNoContentPropertyError + return nil, nil, model.ErrNoContentProperty } endpoint := fmt.Sprintf("wiki/rest/api/content/%v/property/%v", contentID, key) @@ -147,11 +147,11 @@ func (i *internalPropertyImpl) Get(ctx context.Context, contentID, key string) ( func (i *internalPropertyImpl) Delete(ctx context.Context, contentID, key string) (*model.ResponseScheme, error) { if contentID == "" { - return nil, model.ErrNoContentIDError + return nil, model.ErrNoContentID } if key == "" { - return nil, model.ErrNoContentPropertyError + return nil, model.ErrNoContentProperty } endpoint := fmt.Sprintf("wiki/rest/api/content/%v/property/%v", contentID, key) diff --git a/confluence/internal/properties_content_impl_test.go b/confluence/internal/properties_content_impl_test.go index 5c377dd7..fb4d4b27 100644 --- a/confluence/internal/properties_content_impl_test.go +++ b/confluence/internal/properties_content_impl_test.go @@ -95,7 +95,7 @@ func Test_internalPropertyImpl_Gets(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoContentIDError, + Err: model.ErrNoContentID, }, } @@ -208,7 +208,7 @@ func Test_internalPropertyImpl_Get(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoContentIDError, + Err: model.ErrNoContentID, }, { @@ -218,7 +218,7 @@ func Test_internalPropertyImpl_Get(t *testing.T) { contentID: "1111", }, wantErr: true, - Err: model.ErrNoContentPropertyError, + Err: model.ErrNoContentProperty, }, } @@ -330,7 +330,7 @@ func Test_internalPropertyImpl_Delete(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoContentIDError, + Err: model.ErrNoContentID, }, { @@ -340,7 +340,7 @@ func Test_internalPropertyImpl_Delete(t *testing.T) { contentID: "1111", }, wantErr: true, - Err: model.ErrNoContentPropertyError, + Err: model.ErrNoContentProperty, }, } @@ -457,7 +457,7 @@ func Test_internalPropertyImpl_Create(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoContentIDError, + Err: model.ErrNoContentID, }, } diff --git a/confluence/internal/restriction_content_impl.go b/confluence/internal/restriction_content_impl.go index 12493b2e..d40b932a 100644 --- a/confluence/internal/restriction_content_impl.go +++ b/confluence/internal/restriction_content_impl.go @@ -72,7 +72,7 @@ type internalRestrictionImpl struct { func (i *internalRestrictionImpl) Gets(ctx context.Context, contentID string, expand []string, startAt, maxResults int) (*model.ContentRestrictionPageScheme, *model.ResponseScheme, error) { if contentID == "" { - return nil, nil, model.ErrNoContentIDError + return nil, nil, model.ErrNoContentID } query := url.Values{} @@ -102,7 +102,7 @@ func (i *internalRestrictionImpl) Gets(ctx context.Context, contentID string, ex func (i *internalRestrictionImpl) Add(ctx context.Context, contentID string, payload *model.ContentRestrictionUpdatePayloadScheme, expand []string) (*model.ContentRestrictionPageScheme, *model.ResponseScheme, error) { if contentID == "" { - return nil, nil, model.ErrNoContentIDError + return nil, nil, model.ErrNoContentID } var endpoint strings.Builder @@ -132,7 +132,7 @@ func (i *internalRestrictionImpl) Add(ctx context.Context, contentID string, pay func (i *internalRestrictionImpl) Delete(ctx context.Context, contentID string, expand []string) (*model.ContentRestrictionPageScheme, *model.ResponseScheme, error) { if contentID == "" { - return nil, nil, model.ErrNoContentIDError + return nil, nil, model.ErrNoContentID } var endpoint strings.Builder @@ -162,7 +162,7 @@ func (i *internalRestrictionImpl) Delete(ctx context.Context, contentID string, func (i *internalRestrictionImpl) Update(ctx context.Context, contentID string, payload *model.ContentRestrictionUpdatePayloadScheme, expand []string) (*model.ContentRestrictionPageScheme, *model.ResponseScheme, error) { if contentID == "" { - return nil, nil, model.ErrNoContentIDError + return nil, nil, model.ErrNoContentID } var endpoint strings.Builder diff --git a/confluence/internal/restriction_content_impl_test.go b/confluence/internal/restriction_content_impl_test.go index e86abdad..e821c706 100644 --- a/confluence/internal/restriction_content_impl_test.go +++ b/confluence/internal/restriction_content_impl_test.go @@ -3,12 +3,14 @@ package internal import ( "context" "errors" + "net/http" + "testing" + + "github.com/stretchr/testify/assert" + model "github.com/ctreminiom/go-atlassian/pkg/infra/models" "github.com/ctreminiom/go-atlassian/service" "github.com/ctreminiom/go-atlassian/service/mocks" - "github.com/stretchr/testify/assert" - "net/http" - "testing" ) func Test_internalRestrictionImpl_Gets(t *testing.T) { @@ -96,7 +98,7 @@ func Test_internalRestrictionImpl_Gets(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoContentIDError, + Err: model.ErrNoContentID, }, } @@ -215,7 +217,7 @@ func Test_internalRestrictionImpl_Add(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoContentIDError, + Err: model.ErrNoContentID, }, } @@ -329,7 +331,7 @@ func Test_internalRestrictionImpl_Delete(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoContentIDError, + Err: model.ErrNoContentID, }, } @@ -447,7 +449,7 @@ func Test_internalRestrictionImpl_Update(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoContentIDError, + Err: model.ErrNoContentID, }, } diff --git a/confluence/internal/restriction_operation_content_impl.go b/confluence/internal/restriction_operation_content_impl.go index 62fdcd63..593b4ee1 100644 --- a/confluence/internal/restriction_operation_content_impl.go +++ b/confluence/internal/restriction_operation_content_impl.go @@ -62,7 +62,7 @@ type internalRestrictionOperationImpl struct { func (i *internalRestrictionOperationImpl) Gets(ctx context.Context, contentID string, expand []string) (*model.ContentRestrictionByOperationScheme, *model.ResponseScheme, error) { if contentID == "" { - return nil, nil, model.ErrNoContentIDError + return nil, nil, model.ErrNoContentID } var endpoint strings.Builder @@ -92,11 +92,11 @@ func (i *internalRestrictionOperationImpl) Gets(ctx context.Context, contentID s func (i *internalRestrictionOperationImpl) Get(ctx context.Context, contentID, operationKey string, expand []string, startAt, maxResults int) (*model.ContentRestrictionScheme, *model.ResponseScheme, error) { if contentID == "" { - return nil, nil, model.ErrNoContentIDError + return nil, nil, model.ErrNoContentID } if operationKey == "" { - return nil, nil, model.ErrNoContentRestrictionKeyError + return nil, nil, model.ErrNoContentRestrictionKey } query := url.Values{} diff --git a/confluence/internal/restriction_operation_content_impl_test.go b/confluence/internal/restriction_operation_content_impl_test.go index b3ed070b..d01dbb40 100644 --- a/confluence/internal/restriction_operation_content_impl_test.go +++ b/confluence/internal/restriction_operation_content_impl_test.go @@ -90,7 +90,7 @@ func Test_internalRestrictionOperationImpl_Gets(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoContentIDError, + Err: model.ErrNoContentID, }, } @@ -211,7 +211,7 @@ func Test_internalRestrictionOperationImpl_Get(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoContentIDError, + Err: model.ErrNoContentID, }, { @@ -221,7 +221,7 @@ func Test_internalRestrictionOperationImpl_Get(t *testing.T) { contentID: "1111", }, wantErr: true, - Err: model.ErrNoContentRestrictionKeyError, + Err: model.ErrNoContentRestrictionKey, }, } diff --git a/confluence/internal/restriction_operation_group_content_impl.go b/confluence/internal/restriction_operation_group_content_impl.go index c371ab52..d1b32e13 100644 --- a/confluence/internal/restriction_operation_group_content_impl.go +++ b/confluence/internal/restriction_operation_group_content_impl.go @@ -67,15 +67,15 @@ type internalRestrictionOperationGroupImpl struct { func (i *internalRestrictionOperationGroupImpl) Get(ctx context.Context, contentID, operationKey, groupNameOrID string) (*model.ResponseScheme, error) { if contentID == "" { - return nil, model.ErrNoContentIDError + return nil, model.ErrNoContentID } if operationKey == "" { - return nil, model.ErrNoContentRestrictionKeyError + return nil, model.ErrNoContentRestrictionKey } if groupNameOrID == "" { - return nil, model.ErrNoConfluenceGroupError + return nil, model.ErrNoConfluenceGroup } var endpoint strings.Builder @@ -102,15 +102,15 @@ func (i *internalRestrictionOperationGroupImpl) Get(ctx context.Context, content func (i *internalRestrictionOperationGroupImpl) Add(ctx context.Context, contentID, operationKey, groupNameOrID string) (*model.ResponseScheme, error) { if contentID == "" { - return nil, model.ErrNoContentIDError + return nil, model.ErrNoContentID } if operationKey == "" { - return nil, model.ErrNoContentRestrictionKeyError + return nil, model.ErrNoContentRestrictionKey } if groupNameOrID == "" { - return nil, model.ErrNoConfluenceGroupError + return nil, model.ErrNoConfluenceGroup } var endpoint strings.Builder @@ -137,15 +137,15 @@ func (i *internalRestrictionOperationGroupImpl) Add(ctx context.Context, content func (i *internalRestrictionOperationGroupImpl) Remove(ctx context.Context, contentID, operationKey, groupNameOrID string) (*model.ResponseScheme, error) { if contentID == "" { - return nil, model.ErrNoContentIDError + return nil, model.ErrNoContentID } if operationKey == "" { - return nil, model.ErrNoContentRestrictionKeyError + return nil, model.ErrNoContentRestrictionKey } if groupNameOrID == "" { - return nil, model.ErrNoConfluenceGroupError + return nil, model.ErrNoConfluenceGroup } var endpoint strings.Builder diff --git a/confluence/internal/restriction_operation_group_content_impl_test.go b/confluence/internal/restriction_operation_group_content_impl_test.go index 291e423c..5b77344b 100644 --- a/confluence/internal/restriction_operation_group_content_impl_test.go +++ b/confluence/internal/restriction_operation_group_content_impl_test.go @@ -91,7 +91,7 @@ func Test_internalRestrictionOperationGroupImpl_Get(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoContentIDError, + Err: model.ErrNoContentID, }, { @@ -101,7 +101,7 @@ func Test_internalRestrictionOperationGroupImpl_Get(t *testing.T) { contentID: "1111", }, wantErr: true, - Err: model.ErrNoContentRestrictionKeyError, + Err: model.ErrNoContentRestrictionKey, }, { @@ -112,7 +112,7 @@ func Test_internalRestrictionOperationGroupImpl_Get(t *testing.T) { operationKey: "read", }, wantErr: true, - Err: model.ErrNoConfluenceGroupError, + Err: model.ErrNoConfluenceGroup, }, } @@ -226,7 +226,7 @@ func Test_internalRestrictionOperationGroupImpl_Add(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoContentIDError, + Err: model.ErrNoContentID, }, { @@ -236,7 +236,7 @@ func Test_internalRestrictionOperationGroupImpl_Add(t *testing.T) { contentID: "1111", }, wantErr: true, - Err: model.ErrNoContentRestrictionKeyError, + Err: model.ErrNoContentRestrictionKey, }, { @@ -247,7 +247,7 @@ func Test_internalRestrictionOperationGroupImpl_Add(t *testing.T) { operationKey: "read", }, wantErr: true, - Err: model.ErrNoConfluenceGroupError, + Err: model.ErrNoConfluenceGroup, }, } @@ -390,7 +390,7 @@ func Test_internalRestrictionOperationGroupImpl_Remove(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoContentIDError, + Err: model.ErrNoContentID, }, { @@ -400,7 +400,7 @@ func Test_internalRestrictionOperationGroupImpl_Remove(t *testing.T) { contentID: "1111", }, wantErr: true, - Err: model.ErrNoContentRestrictionKeyError, + Err: model.ErrNoContentRestrictionKey, }, { @@ -411,7 +411,7 @@ func Test_internalRestrictionOperationGroupImpl_Remove(t *testing.T) { operationKey: "read", }, wantErr: true, - Err: model.ErrNoConfluenceGroupError, + Err: model.ErrNoConfluenceGroup, }, } diff --git a/confluence/internal/restriction_operation_user_content_impl.go b/confluence/internal/restriction_operation_user_content_impl.go index b193d9c9..310f8c44 100644 --- a/confluence/internal/restriction_operation_user_content_impl.go +++ b/confluence/internal/restriction_operation_user_content_impl.go @@ -62,15 +62,15 @@ type internalRestrictionOperationUserImpl struct { func (i *internalRestrictionOperationUserImpl) Get(ctx context.Context, contentID, operationKey, accountID string) (*model.ResponseScheme, error) { if contentID == "" { - return nil, model.ErrNoContentIDError + return nil, model.ErrNoContentID } if operationKey == "" { - return nil, model.ErrNoContentRestrictionKeyError + return nil, model.ErrNoContentRestrictionKey } if accountID == "" { - return nil, model.ErrNoAccountIDError + return nil, model.ErrNoAccountID } query := url.Values{} @@ -89,15 +89,15 @@ func (i *internalRestrictionOperationUserImpl) Get(ctx context.Context, contentI func (i *internalRestrictionOperationUserImpl) Add(ctx context.Context, contentID, operationKey, accountID string) (*model.ResponseScheme, error) { if contentID == "" { - return nil, model.ErrNoContentIDError + return nil, model.ErrNoContentID } if operationKey == "" { - return nil, model.ErrNoContentRestrictionKeyError + return nil, model.ErrNoContentRestrictionKey } if accountID == "" { - return nil, model.ErrNoAccountIDError + return nil, model.ErrNoAccountID } query := url.Values{} @@ -116,15 +116,15 @@ func (i *internalRestrictionOperationUserImpl) Add(ctx context.Context, contentI func (i *internalRestrictionOperationUserImpl) Remove(ctx context.Context, contentID, operationKey, accountID string) (*model.ResponseScheme, error) { if contentID == "" { - return nil, model.ErrNoContentIDError + return nil, model.ErrNoContentID } if operationKey == "" { - return nil, model.ErrNoContentRestrictionKeyError + return nil, model.ErrNoContentRestrictionKey } if accountID == "" { - return nil, model.ErrNoAccountIDError + return nil, model.ErrNoAccountID } query := url.Values{} diff --git a/confluence/internal/restriction_operation_user_content_impl_test.go b/confluence/internal/restriction_operation_user_content_impl_test.go index 4b6e148e..efb6eabe 100644 --- a/confluence/internal/restriction_operation_user_content_impl_test.go +++ b/confluence/internal/restriction_operation_user_content_impl_test.go @@ -91,7 +91,7 @@ func Test_internalRestrictionOperationUserImpl_Get(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoContentIDError, + Err: model.ErrNoContentID, }, { @@ -101,7 +101,7 @@ func Test_internalRestrictionOperationUserImpl_Get(t *testing.T) { contentID: "1111", }, wantErr: true, - Err: model.ErrNoContentRestrictionKeyError, + Err: model.ErrNoContentRestrictionKey, }, { @@ -112,7 +112,7 @@ func Test_internalRestrictionOperationUserImpl_Get(t *testing.T) { operationKey: "read", }, wantErr: true, - Err: model.ErrNoAccountIDError, + Err: model.ErrNoAccountID, }, } @@ -226,7 +226,7 @@ func Test_internalRestrictionOperationUserImpl_Add(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoContentIDError, + Err: model.ErrNoContentID, }, { @@ -236,7 +236,7 @@ func Test_internalRestrictionOperationUserImpl_Add(t *testing.T) { contentID: "1111", }, wantErr: true, - Err: model.ErrNoContentRestrictionKeyError, + Err: model.ErrNoContentRestrictionKey, }, { @@ -247,7 +247,7 @@ func Test_internalRestrictionOperationUserImpl_Add(t *testing.T) { operationKey: "read", }, wantErr: true, - Err: model.ErrNoAccountIDError, + Err: model.ErrNoAccountID, }, } @@ -361,7 +361,7 @@ func Test_internalRestrictionOperationUserImpl_Remove(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoContentIDError, + Err: model.ErrNoContentID, }, { @@ -371,7 +371,7 @@ func Test_internalRestrictionOperationUserImpl_Remove(t *testing.T) { contentID: "1111", }, wantErr: true, - Err: model.ErrNoContentRestrictionKeyError, + Err: model.ErrNoContentRestrictionKey, }, { @@ -382,7 +382,7 @@ func Test_internalRestrictionOperationUserImpl_Remove(t *testing.T) { operationKey: "read", }, wantErr: true, - Err: model.ErrNoAccountIDError, + Err: model.ErrNoAccountID, }, } diff --git a/confluence/internal/search_impl.go b/confluence/internal/search_impl.go index 4c4d4d40..b65121c4 100644 --- a/confluence/internal/search_impl.go +++ b/confluence/internal/search_impl.go @@ -55,7 +55,7 @@ type internalSearchImpl struct { func (i *internalSearchImpl) Content(ctx context.Context, cql string, options *model.SearchContentOptions) (*model.SearchPageScheme, *model.ResponseScheme, error) { if cql == "" { - return nil, nil, model.ErrNoCQLError + return nil, nil, model.ErrNoCQL } query := url.Values{} @@ -129,7 +129,7 @@ func (i *internalSearchImpl) Content(ctx context.Context, cql string, options *m func (i *internalSearchImpl) Users(ctx context.Context, cql string, start, limit int, expand []string) (*model.SearchPageScheme, *model.ResponseScheme, error) { if cql == "" { - return nil, nil, model.ErrNoCQLError + return nil, nil, model.ErrNoCQL } query := url.Values{} diff --git a/confluence/internal/search_impl_test.go b/confluence/internal/search_impl_test.go index cc7ed651..715904ff 100644 --- a/confluence/internal/search_impl_test.go +++ b/confluence/internal/search_impl_test.go @@ -114,7 +114,7 @@ func Test_internalSearchImpl_Content(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoCQLError, + Err: model.ErrNoCQL, }, } @@ -233,7 +233,7 @@ func Test_internalSearchImpl_Users(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoCQLError, + Err: model.ErrNoCQL, }, } diff --git a/confluence/internal/space_impl.go b/confluence/internal/space_impl.go index acd784d9..5256c52e 100644 --- a/confluence/internal/space_impl.go +++ b/confluence/internal/space_impl.go @@ -180,11 +180,11 @@ func (i *internalSpaceImpl) Create(ctx context.Context, payload *model.CreateSpa if payload != nil { if payload.Name == "" { - return nil, nil, model.ErrNoSpaceNameError + return nil, nil, model.ErrNoSpaceName } if payload.Key == "" { - return nil, nil, model.ErrNoSpaceKeyError + return nil, nil, model.ErrNoSpaceKey } } @@ -213,7 +213,7 @@ func (i *internalSpaceImpl) Create(ctx context.Context, payload *model.CreateSpa func (i *internalSpaceImpl) Get(ctx context.Context, spaceKey string, expand []string) (*model.SpaceScheme, *model.ResponseScheme, error) { if spaceKey == "" { - return nil, nil, model.ErrNoSpaceKeyError + return nil, nil, model.ErrNoSpaceKey } var endpoint strings.Builder @@ -243,7 +243,7 @@ func (i *internalSpaceImpl) Get(ctx context.Context, spaceKey string, expand []s func (i *internalSpaceImpl) Update(ctx context.Context, spaceKey string, payload *model.UpdateSpaceScheme) (*model.SpaceScheme, *model.ResponseScheme, error) { if spaceKey == "" { - return nil, nil, model.ErrNoSpaceKeyError + return nil, nil, model.ErrNoSpaceKey } endpoint := fmt.Sprintf("wiki/rest/api/space/%v", spaceKey) @@ -265,7 +265,7 @@ func (i *internalSpaceImpl) Update(ctx context.Context, spaceKey string, payload func (i *internalSpaceImpl) Delete(ctx context.Context, spaceKey string) (*model.ContentTaskScheme, *model.ResponseScheme, error) { if spaceKey == "" { - return nil, nil, model.ErrNoSpaceKeyError + return nil, nil, model.ErrNoSpaceKey } endpoint := fmt.Sprintf("wiki/rest/api/space/%v", spaceKey) @@ -287,7 +287,7 @@ func (i *internalSpaceImpl) Delete(ctx context.Context, spaceKey string) (*model func (i *internalSpaceImpl) Content(ctx context.Context, spaceKey, depth string, expand []string, startAt, maxResults int) (*model.ContentChildrenScheme, *model.ResponseScheme, error) { if spaceKey == "" { - return nil, nil, model.ErrNoSpaceKeyError + return nil, nil, model.ErrNoSpaceKey } query := url.Values{} @@ -321,7 +321,7 @@ func (i *internalSpaceImpl) Content(ctx context.Context, spaceKey, depth string, func (i *internalSpaceImpl) ContentByType(ctx context.Context, spaceKey, contentType, depth string, expand []string, startAt, maxResults int) (*model.ContentPageScheme, *model.ResponseScheme, error) { if spaceKey == "" { - return nil, nil, model.ErrNoSpaceKeyError + return nil, nil, model.ErrNoSpaceKey } query := url.Values{} diff --git a/confluence/internal/space_impl_test.go b/confluence/internal/space_impl_test.go index 13998d76..e263c193 100644 --- a/confluence/internal/space_impl_test.go +++ b/confluence/internal/space_impl_test.go @@ -215,7 +215,7 @@ func Test_internalSpaceImpl_Get(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoSpaceKeyError, + Err: model.ErrNoSpaceKey, }, } @@ -335,7 +335,7 @@ func Test_internalSpaceImpl_Content(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoSpaceKeyError, + Err: model.ErrNoSpaceKey, }, } @@ -458,7 +458,7 @@ func Test_internalSpaceImpl_ContentByType(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoSpaceKeyError, + Err: model.ErrNoSpaceKey, }, } @@ -570,7 +570,7 @@ func Test_internalSpaceImpl_Delete(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoSpaceKeyError, + Err: model.ErrNoSpaceKey, }, } @@ -692,7 +692,7 @@ func Test_internalSpaceImpl_Create(t *testing.T) { payload: &model.CreateSpaceScheme{}, }, wantErr: true, - Err: model.ErrNoSpaceNameError, + Err: model.ErrNoSpaceName, }, { @@ -705,7 +705,7 @@ func Test_internalSpaceImpl_Create(t *testing.T) { }, wantErr: true, - Err: model.ErrNoSpaceKeyError, + Err: model.ErrNoSpaceKey, }, } @@ -823,7 +823,7 @@ func Test_internalSpaceImpl_Update(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoSpaceKeyError, + Err: model.ErrNoSpaceKey, }, } diff --git a/confluence/internal/space_v2_impl.go b/confluence/internal/space_v2_impl.go index b81c405e..40fb8185 100644 --- a/confluence/internal/space_v2_impl.go +++ b/confluence/internal/space_v2_impl.go @@ -63,7 +63,7 @@ type internalSpaceV2Impl struct { func (i *internalSpaceV2Impl) Permissions(ctx context.Context, spaceID int, cursor string, limit int) (*model.SpacePermissionPageScheme, *model.ResponseScheme, error) { if spaceID == 0 { - return nil, nil, model.ErrNoSpaceIDError + return nil, nil, model.ErrNoSpaceID } query := url.Values{} @@ -153,7 +153,7 @@ func (i *internalSpaceV2Impl) Bulk(ctx context.Context, options *model.GetSpaces func (i *internalSpaceV2Impl) Get(ctx context.Context, spaceID int, descriptionFormat string) (*model.SpaceSchemeV2, *model.ResponseScheme, error) { if spaceID == 0 { - return nil, nil, model.ErrNoSpaceIDError + return nil, nil, model.ErrNoSpaceID } var endpoint strings.Builder diff --git a/confluence/internal/space_v2_impl_test.go b/confluence/internal/space_v2_impl_test.go index 260ce8a8..f1f05dbb 100644 --- a/confluence/internal/space_v2_impl_test.go +++ b/confluence/internal/space_v2_impl_test.go @@ -184,7 +184,7 @@ func Test_internalSpaceV2Impl_Get(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoSpaceIDError, + Err: model.ErrNoSpaceID, }, { diff --git a/confluence/internal/version_content.go b/confluence/internal/version_content.go index 917ad1fd..b535f819 100644 --- a/confluence/internal/version_content.go +++ b/confluence/internal/version_content.go @@ -73,7 +73,7 @@ type internalVersionImpl struct { func (i *internalVersionImpl) Gets(ctx context.Context, contentID string, expand []string, start, limit int) (*model.ContentVersionPageScheme, *model.ResponseScheme, error) { if contentID == "" { - return nil, nil, model.ErrNoContentIDError + return nil, nil, model.ErrNoContentID } query := url.Values{} @@ -103,7 +103,7 @@ func (i *internalVersionImpl) Gets(ctx context.Context, contentID string, expand func (i *internalVersionImpl) Get(ctx context.Context, contentID string, versionNumber int, expand []string) (*model.ContentVersionScheme, *model.ResponseScheme, error) { if contentID == "" { - return nil, nil, model.ErrNoContentIDError + return nil, nil, model.ErrNoContentID } var endpoint strings.Builder @@ -133,7 +133,7 @@ func (i *internalVersionImpl) Get(ctx context.Context, contentID string, version func (i *internalVersionImpl) Restore(ctx context.Context, contentID string, payload *model.ContentRestorePayloadScheme, expand []string) (*model.ContentVersionScheme, *model.ResponseScheme, error) { if contentID == "" { - return nil, nil, model.ErrNoContentIDError + return nil, nil, model.ErrNoContentID } var endpoint strings.Builder @@ -163,7 +163,7 @@ func (i *internalVersionImpl) Restore(ctx context.Context, contentID string, pay func (i *internalVersionImpl) Delete(ctx context.Context, contentID string, versionNumber int) (*model.ResponseScheme, error) { if contentID == "" { - return nil, model.ErrNoContentIDError + return nil, model.ErrNoContentID } endpoint := fmt.Sprintf("wiki/rest/api/content/%v/version/%v", contentID, versionNumber) diff --git a/confluence/internal/version_content_test.go b/confluence/internal/version_content_test.go index 97cbdea6..ee618466 100644 --- a/confluence/internal/version_content_test.go +++ b/confluence/internal/version_content_test.go @@ -95,7 +95,7 @@ func Test_internalVersionImpl_Gets(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoContentIDError, + Err: model.ErrNoContentID, }, } @@ -212,7 +212,7 @@ func Test_internalVersionImpl_Get(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoContentIDError, + Err: model.ErrNoContentID, }, } @@ -338,7 +338,7 @@ func Test_internalVersionImpl_Restore(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoContentIDError, + Err: model.ErrNoContentID, }, } @@ -452,7 +452,7 @@ func Test_internalVersionImpl_Delete(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoContentIDError, + Err: model.ErrNoContentID, }, } diff --git a/confluence/v2/api_client_impl.go b/confluence/v2/api_client_impl.go index df4e1b92..5876512a 100644 --- a/confluence/v2/api_client_impl.go +++ b/confluence/v2/api_client_impl.go @@ -21,7 +21,7 @@ func New(httpClient common.HttpClient, site string) (*Client, error) { } if site == "" { - return nil, models.ErrNoSiteError + return nil, models.ErrNoSite } if !strings.HasSuffix(site, "/") { @@ -152,13 +152,13 @@ func (c *Client) processResponse(response *http.Response, structure interface{}) return res, models.ErrUnauthorized case http.StatusInternalServerError: - return res, models.ErrInternalError + return res, models.ErrInternal case http.StatusBadRequest: - return res, models.ErrBadRequestError + return res, models.ErrBadRequest default: - return res, models.ErrInvalidStatusCodeError + return res, models.ErrInvalidStatusCode } } diff --git a/confluence/v2/api_client_impl_test.go b/confluence/v2/api_client_impl_test.go index ee1350cd..a137e0ae 100644 --- a/confluence/v2/api_client_impl_test.go +++ b/confluence/v2/api_client_impl_test.go @@ -128,7 +128,7 @@ func TestClient_Call(t *testing.T) { Bytes: *bytes.NewBufferString("Hello, world!"), }, wantErr: true, - Err: model.ErrBadRequestError, + Err: model.ErrBadRequest, }, { @@ -153,7 +153,7 @@ func TestClient_Call(t *testing.T) { Bytes: *bytes.NewBufferString("Hello, world!"), }, wantErr: true, - Err: model.ErrInternalError, + Err: model.ErrInternal, }, { @@ -514,7 +514,7 @@ func TestNew(t *testing.T) { }, want: noURLClientMocked, wantErr: true, - Err: model.ErrNoSiteError, + Err: model.ErrNoSite, }, { name: "when the site url is not valid", diff --git a/jira/agile/api_client_impl.go b/jira/agile/api_client_impl.go index ef9c8a3f..875d166a 100644 --- a/jira/agile/api_client_impl.go +++ b/jira/agile/api_client_impl.go @@ -21,7 +21,7 @@ func New(httpClient common.HttpClient, site string) (*Client, error) { } if site == "" { - return nil, model.ErrNoSiteError + return nil, model.ErrNoSite } if !strings.HasSuffix(site, "/") { @@ -143,13 +143,13 @@ func (c *Client) processResponse(response *http.Response, structure interface{}) return res, model.ErrUnauthorized case http.StatusInternalServerError: - return res, model.ErrInternalError + return res, model.ErrInternal case http.StatusBadRequest: - return res, model.ErrBadRequestError + return res, model.ErrBadRequest default: - return res, model.ErrInvalidStatusCodeError + return res, model.ErrInvalidStatusCode } } diff --git a/jira/agile/api_client_impl_test.go b/jira/agile/api_client_impl_test.go index 65124f82..7e74c1c1 100644 --- a/jira/agile/api_client_impl_test.go +++ b/jira/agile/api_client_impl_test.go @@ -132,7 +132,7 @@ func TestClient_Call(t *testing.T) { Bytes: *bytes.NewBufferString("Hello, world!"), }, wantErr: true, - Err: model.ErrBadRequestError, + Err: model.ErrBadRequest, }, { @@ -157,7 +157,7 @@ func TestClient_Call(t *testing.T) { Bytes: *bytes.NewBufferString("Hello, world!"), }, wantErr: true, - Err: model.ErrInternalError, + Err: model.ErrInternal, }, { @@ -509,7 +509,7 @@ func TestNew(t *testing.T) { }, want: noURLClientMocked, wantErr: true, - Err: model.ErrNoSiteError, + Err: model.ErrNoSite, }, { name: "when the site url is not valid", diff --git a/jira/agile/internal/board_backlog_impl.go b/jira/agile/internal/board_backlog_impl.go index f38061b5..39ccca0d 100644 --- a/jira/agile/internal/board_backlog_impl.go +++ b/jira/agile/internal/board_backlog_impl.go @@ -74,7 +74,7 @@ func (i *internalBoardBacklogImpl) Move(ctx context.Context, issues []string) (* func (i *internalBoardBacklogImpl) MoveTo(ctx context.Context, boardID int, payload *model.BoardBacklogPayloadScheme) (*model.ResponseScheme, error) { if boardID == 0 { - return nil, model.ErrNoBoardIDError + return nil, model.ErrNoBoardID } url := fmt.Sprintf("rest/agile/%v/backlog/%v/issue", i.version, boardID) diff --git a/jira/agile/internal/board_backlog_impl_test.go b/jira/agile/internal/board_backlog_impl_test.go index 769a2865..f7c171cb 100644 --- a/jira/agile/internal/board_backlog_impl_test.go +++ b/jira/agile/internal/board_backlog_impl_test.go @@ -257,7 +257,7 @@ func Test_internalBoardBacklogImpl_MoveTo(t *testing.T) { args: args{ ctx: context.Background(), }, - Err: model.ErrNoBoardIDError, + Err: model.ErrNoBoardID, wantErr: true, }, } diff --git a/jira/agile/internal/board_impl.go b/jira/agile/internal/board_impl.go index 3e2bab1d..53aeacbc 100644 --- a/jira/agile/internal/board_impl.go +++ b/jira/agile/internal/board_impl.go @@ -248,7 +248,7 @@ type internalBoardImpl struct { func (i *internalBoardImpl) Get(ctx context.Context, boardID int) (*model.BoardScheme, *model.ResponseScheme, error) { if boardID == 0 { - return nil, nil, model.ErrNoBoardIDError + return nil, nil, model.ErrNoBoardID } url := fmt.Sprintf("rest/agile/%v/board/%v", i.version, boardID) @@ -288,7 +288,7 @@ func (i *internalBoardImpl) Create(ctx context.Context, payload *model.BoardPayl func (i *internalBoardImpl) Filter(ctx context.Context, filterID, startAt, maxResults int) (*model.BoardPageScheme, *model.ResponseScheme, error) { if filterID == 0 { - return nil, nil, model.ErrNoFilterIDError + return nil, nil, model.ErrNoFilterID } params := url.Values{} @@ -314,7 +314,7 @@ func (i *internalBoardImpl) Filter(ctx context.Context, filterID, startAt, maxRe func (i *internalBoardImpl) Backlog(ctx context.Context, boardID int, opts *model.IssueOptionScheme, startAt, maxResults int) (*model.BoardIssuePageScheme, *model.ResponseScheme, error) { if boardID == 0 { - return nil, nil, model.ErrNoBoardIDError + return nil, nil, model.ErrNoBoardID } params := url.Values{} @@ -357,7 +357,7 @@ func (i *internalBoardImpl) Backlog(ctx context.Context, boardID int, opts *mode func (i *internalBoardImpl) Configuration(ctx context.Context, boardID int) (*model.BoardConfigurationScheme, *model.ResponseScheme, error) { if boardID == 0 { - return nil, nil, model.ErrNoBoardIDError + return nil, nil, model.ErrNoBoardID } url := fmt.Sprintf("rest/agile/%v/board/%v/configuration", i.version, boardID) @@ -379,7 +379,7 @@ func (i *internalBoardImpl) Configuration(ctx context.Context, boardID int) (*mo func (i *internalBoardImpl) Epics(ctx context.Context, boardID, startAt, maxResults int, done bool) (*model.BoardEpicPageScheme, *model.ResponseScheme, error) { if boardID == 0 { - return nil, nil, model.ErrNoBoardIDError + return nil, nil, model.ErrNoBoardID } params := url.Values{} @@ -406,7 +406,7 @@ func (i *internalBoardImpl) Epics(ctx context.Context, boardID, startAt, maxResu func (i *internalBoardImpl) IssuesWithoutEpic(ctx context.Context, boardID int, opts *model.IssueOptionScheme, startAt, maxResults int) (*model.BoardIssuePageScheme, *model.ResponseScheme, error) { if boardID == 0 { - return nil, nil, model.ErrNoBoardIDError + return nil, nil, model.ErrNoBoardID } params := url.Values{} @@ -451,11 +451,11 @@ func (i *internalBoardImpl) IssuesWithoutEpic(ctx context.Context, boardID int, func (i *internalBoardImpl) IssuesByEpic(ctx context.Context, boardID, epicID int, opts *model.IssueOptionScheme, startAt, maxResults int) (*model.BoardIssuePageScheme, *model.ResponseScheme, error) { if boardID == 0 { - return nil, nil, model.ErrNoBoardIDError + return nil, nil, model.ErrNoBoardID } if epicID == 0 { - return nil, nil, model.ErrNoEpicIDError + return nil, nil, model.ErrNoEpicID } params := url.Values{} @@ -500,7 +500,7 @@ func (i *internalBoardImpl) IssuesByEpic(ctx context.Context, boardID, epicID in func (i *internalBoardImpl) Issues(ctx context.Context, boardID int, opts *model.IssueOptionScheme, startAt, maxResults int) (*model.BoardIssuePageScheme, *model.ResponseScheme, error) { if boardID == 0 { - return nil, nil, model.ErrNoBoardIDError + return nil, nil, model.ErrNoBoardID } params := url.Values{} @@ -546,7 +546,7 @@ func (i *internalBoardImpl) Issues(ctx context.Context, boardID int, opts *model func (i *internalBoardImpl) Move(ctx context.Context, boardID int, payload *model.BoardMovementPayloadScheme) (*model.ResponseScheme, error) { if boardID == 0 { - return nil, model.ErrNoBoardIDError + return nil, model.ErrNoBoardID } url := fmt.Sprintf("rest/agile/%v/board/%v/issue", i.version, boardID) @@ -562,7 +562,7 @@ func (i *internalBoardImpl) Move(ctx context.Context, boardID int, payload *mode func (i *internalBoardImpl) Projects(ctx context.Context, boardID, startAt, maxResults int) (*model.BoardProjectPageScheme, *model.ResponseScheme, error) { if boardID == 0 { - return nil, nil, model.ErrNoBoardIDError + return nil, nil, model.ErrNoBoardID } params := url.Values{} @@ -588,7 +588,7 @@ func (i *internalBoardImpl) Projects(ctx context.Context, boardID, startAt, maxR func (i *internalBoardImpl) Sprints(ctx context.Context, boardID, startAt, maxResults int, states []string) (*model.BoardSprintPageScheme, *model.ResponseScheme, error) { if boardID == 0 { - return nil, nil, model.ErrNoBoardIDError + return nil, nil, model.ErrNoBoardID } params := url.Values{} @@ -615,11 +615,11 @@ func (i *internalBoardImpl) Sprints(ctx context.Context, boardID, startAt, maxRe func (i *internalBoardImpl) IssuesBySprint(ctx context.Context, boardID, sprintID int, opts *model.IssueOptionScheme, startAt, maxResults int) (*model.BoardIssuePageScheme, *model.ResponseScheme, error) { if boardID == 0 { - return nil, nil, model.ErrNoBoardIDError + return nil, nil, model.ErrNoBoardID } if sprintID == 0 { - return nil, nil, model.ErrNoSprintIDError + return nil, nil, model.ErrNoSprintID } params := url.Values{} @@ -664,7 +664,7 @@ func (i *internalBoardImpl) IssuesBySprint(ctx context.Context, boardID, sprintI func (i *internalBoardImpl) Versions(ctx context.Context, boardID, startAt, maxResults int, released bool) (*model.BoardVersionPageScheme, *model.ResponseScheme, error) { if boardID == 0 { - return nil, nil, model.ErrNoBoardIDError + return nil, nil, model.ErrNoBoardID } params := url.Values{} @@ -691,7 +691,7 @@ func (i *internalBoardImpl) Versions(ctx context.Context, boardID, startAt, maxR func (i *internalBoardImpl) Delete(ctx context.Context, boardID int) (*model.ResponseScheme, error) { if boardID == 0 { - return nil, model.ErrNoBoardIDError + return nil, model.ErrNoBoardID } url := fmt.Sprintf("rest/agile/%v/board/%v", i.version, boardID) diff --git a/jira/agile/internal/board_impl_test.go b/jira/agile/internal/board_impl_test.go index 22121261..697743d4 100644 --- a/jira/agile/internal/board_impl_test.go +++ b/jira/agile/internal/board_impl_test.go @@ -121,7 +121,7 @@ func Test_BoardService_Get(t *testing.T) { on: func(fields *fields) { fields.c = mocks.NewConnector(t) }, - Err: model.ErrNoBoardIDError, + Err: model.ErrNoBoardID, wantErr: true, }, } @@ -434,7 +434,7 @@ func Test_BoardService_Backlog(t *testing.T) { on: func(fields *fields) { fields.c = mocks.NewConnector(t) }, - Err: model.ErrNoBoardIDError, + Err: model.ErrNoBoardID, wantErr: true, }, } @@ -575,7 +575,7 @@ func Test_BoardService_Configuration(t *testing.T) { on: func(fields *fields) { fields.c = mocks.NewConnector(t) }, - Err: model.ErrNoBoardIDError, + Err: model.ErrNoBoardID, wantErr: true, }, } @@ -728,7 +728,7 @@ func Test_BoardService_Epics(t *testing.T) { on: func(fields *fields) { fields.c = mocks.NewConnector(t) }, - Err: model.ErrNoBoardIDError, + Err: model.ErrNoBoardID, wantErr: true, }, } @@ -870,7 +870,7 @@ func Test_BoardService_Delete(t *testing.T) { on: func(fields *fields) { fields.c = mocks.NewConnector(t) }, - Err: model.ErrNoBoardIDError, + Err: model.ErrNoBoardID, wantErr: true, }, } @@ -1018,7 +1018,7 @@ func Test_BoardService_Filter(t *testing.T) { on: func(fields *fields) { fields.c = mocks.NewConnector(t) }, - Err: model.ErrNoFilterIDError, + Err: model.ErrNoFilterID, wantErr: true, }, } @@ -1383,7 +1383,7 @@ func Test_BoardService_Issues(t *testing.T) { on: func(fields *fields) { fields.c = mocks.NewConnector(t) }, - Err: model.ErrNoBoardIDError, + Err: model.ErrNoBoardID, wantErr: true, }, } @@ -1576,7 +1576,7 @@ func Test_BoardService_IssuesByEpic(t *testing.T) { on: func(fields *fields) { fields.c = mocks.NewConnector(t) }, - Err: model.ErrNoBoardIDError, + Err: model.ErrNoBoardID, wantErr: true, }, @@ -1591,7 +1591,7 @@ func Test_BoardService_IssuesByEpic(t *testing.T) { on: func(fields *fields) { fields.c = mocks.NewConnector(t) }, - Err: model.ErrNoEpicIDError, + Err: model.ErrNoEpicID, wantErr: true, }, } @@ -1784,7 +1784,7 @@ func Test_BoardService_IssuesBySprint(t *testing.T) { on: func(fields *fields) { fields.c = mocks.NewConnector(t) }, - Err: model.ErrNoBoardIDError, + Err: model.ErrNoBoardID, wantErr: true, }, @@ -1799,7 +1799,7 @@ func Test_BoardService_IssuesBySprint(t *testing.T) { on: func(fields *fields) { fields.c = mocks.NewConnector(t) }, - Err: model.ErrNoSprintIDError, + Err: model.ErrNoSprintID, wantErr: true, }, } @@ -1987,7 +1987,7 @@ func Test_BoardService_IssuesWithoutEpic(t *testing.T) { on: func(fields *fields) { fields.c = mocks.NewConnector(t) }, - Err: model.ErrNoBoardIDError, + Err: model.ErrNoBoardID, wantErr: true, }, } @@ -2141,7 +2141,7 @@ func Test_BoardService_Move(t *testing.T) { on: func(fields *fields) { fields.c = mocks.NewConnector(t) }, - Err: model.ErrNoBoardIDError, + Err: model.ErrNoBoardID, wantErr: true, }, } @@ -2289,7 +2289,7 @@ func Test_BoardService_Projects(t *testing.T) { on: func(fields *fields) { fields.c = mocks.NewConnector(t) }, - Err: model.ErrNoBoardIDError, + Err: model.ErrNoBoardID, wantErr: true, }, } @@ -2443,7 +2443,7 @@ func Test_BoardService_Sprints(t *testing.T) { on: func(fields *fields) { fields.c = mocks.NewConnector(t) }, - Err: model.ErrNoBoardIDError, + Err: model.ErrNoBoardID, wantErr: true, }, } @@ -2627,7 +2627,7 @@ func Test_BoardService_Versions(t *testing.T) { on: func(fields *fields) { fields.c = mocks.NewConnector(t) }, - Err: model.ErrNoBoardIDError, + Err: model.ErrNoBoardID, wantErr: true, }, } diff --git a/jira/agile/internal/epic_impl.go b/jira/agile/internal/epic_impl.go index ab22c3ca..ac1e4ea0 100644 --- a/jira/agile/internal/epic_impl.go +++ b/jira/agile/internal/epic_impl.go @@ -79,7 +79,7 @@ type internalEpicImpl struct { func (i *internalEpicImpl) Get(ctx context.Context, epicIDOrKey string) (*model.EpicScheme, *model.ResponseScheme, error) { if epicIDOrKey == "" { - return nil, nil, model.ErrNoEpicIDError + return nil, nil, model.ErrNoEpicID } url := fmt.Sprintf("rest/agile/%v/epic/%v", i.version, epicIDOrKey) @@ -101,7 +101,7 @@ func (i *internalEpicImpl) Get(ctx context.Context, epicIDOrKey string) (*model. func (i *internalEpicImpl) Issues(ctx context.Context, epicIDOrKey string, opts *model.IssueOptionScheme, startAt, maxResults int) (*model.BoardIssuePageScheme, *model.ResponseScheme, error) { if epicIDOrKey == "" { - return nil, nil, model.ErrNoEpicIDError + return nil, nil, model.ErrNoEpicID } params := url.Values{} @@ -144,7 +144,7 @@ func (i *internalEpicImpl) Issues(ctx context.Context, epicIDOrKey string, opts func (i *internalEpicImpl) Move(ctx context.Context, epicIDOrKey string, issues []string) (*model.ResponseScheme, error) { if epicIDOrKey == "" { - return nil, model.ErrNoEpicIDError + return nil, model.ErrNoEpicID } payload := map[string]interface{}{"issues": issues} diff --git a/jira/agile/internal/epic_impl_test.go b/jira/agile/internal/epic_impl_test.go index c0b7e653..1d2178da 100644 --- a/jira/agile/internal/epic_impl_test.go +++ b/jira/agile/internal/epic_impl_test.go @@ -121,7 +121,7 @@ func Test_EpicService_Get(t *testing.T) { on: func(fields *fields) { fields.c = mocks.NewConnector(t) }, - Err: model.ErrNoEpicIDError, + Err: model.ErrNoEpicID, wantErr: true, }, } @@ -291,7 +291,7 @@ func Test_EpicService_Issues(t *testing.T) { on: func(fields *fields) { fields.c = mocks.NewConnector(t) }, - Err: model.ErrNoEpicIDError, + Err: model.ErrNoEpicID, wantErr: true, }, } @@ -441,7 +441,7 @@ func Test_EpicService_Move(t *testing.T) { on: func(fields *fields) { fields.c = mocks.NewConnector(t) }, - Err: model.ErrNoEpicIDError, + Err: model.ErrNoEpicID, wantErr: true, }, } diff --git a/jira/agile/internal/sprint_impl.go b/jira/agile/internal/sprint_impl.go index b38b87bd..1e764fb7 100644 --- a/jira/agile/internal/sprint_impl.go +++ b/jira/agile/internal/sprint_impl.go @@ -139,7 +139,7 @@ type internalSprintImpl struct { func (i *internalSprintImpl) Move(ctx context.Context, sprintID int, payload *model.SprintMovePayloadScheme) (*model.ResponseScheme, error) { if sprintID == 0 { - return nil, model.ErrNoSprintIDError + return nil, model.ErrNoSprintID } url := fmt.Sprintf("/rest/agile/%v/sprint/%v/issue", i.version, sprintID) @@ -155,7 +155,7 @@ func (i *internalSprintImpl) Move(ctx context.Context, sprintID int, payload *mo func (i *internalSprintImpl) Get(ctx context.Context, sprintID int) (*model.SprintScheme, *model.ResponseScheme, error) { if sprintID == 0 { - return nil, nil, model.ErrNoSprintIDError + return nil, nil, model.ErrNoSprintID } url := fmt.Sprintf("rest/agile/%v/sprint/%v", i.version, sprintID) @@ -195,7 +195,7 @@ func (i *internalSprintImpl) Create(ctx context.Context, payload *model.SprintPa func (i *internalSprintImpl) Update(ctx context.Context, sprintID int, payload *model.SprintPayloadScheme) (*model.SprintScheme, *model.ResponseScheme, error) { if sprintID == 0 { - return nil, nil, model.ErrNoSprintIDError + return nil, nil, model.ErrNoSprintID } url := fmt.Sprintf("rest/agile/%v/sprint/%v", i.version, sprintID) @@ -217,7 +217,7 @@ func (i *internalSprintImpl) Update(ctx context.Context, sprintID int, payload * func (i *internalSprintImpl) Path(ctx context.Context, sprintID int, payload *model.SprintPayloadScheme) (*model.SprintScheme, *model.ResponseScheme, error) { if sprintID == 0 { - return nil, nil, model.ErrNoSprintIDError + return nil, nil, model.ErrNoSprintID } url := fmt.Sprintf("rest/agile/%v/sprint/%v", i.version, sprintID) @@ -239,7 +239,7 @@ func (i *internalSprintImpl) Path(ctx context.Context, sprintID int, payload *mo func (i *internalSprintImpl) Delete(ctx context.Context, sprintID int) (*model.ResponseScheme, error) { if sprintID == 0 { - return nil, model.ErrNoSprintIDError + return nil, model.ErrNoSprintID } url := fmt.Sprintf("rest/agile/%v/sprint/%v", i.version, sprintID) @@ -255,7 +255,7 @@ func (i *internalSprintImpl) Delete(ctx context.Context, sprintID int) (*model.R func (i *internalSprintImpl) Issues(ctx context.Context, sprintID int, opts *model.IssueOptionScheme, startAt, maxResults int) (*model.SprintIssuePageScheme, *model.ResponseScheme, error) { if sprintID == 0 { - return nil, nil, model.ErrNoSprintIDError + return nil, nil, model.ErrNoSprintID } params := url.Values{} @@ -300,7 +300,7 @@ func (i *internalSprintImpl) Issues(ctx context.Context, sprintID int, opts *mod func (i *internalSprintImpl) Start(ctx context.Context, sprintID int) (*model.ResponseScheme, error) { if sprintID == 0 { - return nil, model.ErrNoSprintIDError + return nil, model.ErrNoSprintID } url := fmt.Sprintf("rest/agile/%v/sprint/%v", i.version, sprintID) @@ -316,7 +316,7 @@ func (i *internalSprintImpl) Start(ctx context.Context, sprintID int) (*model.Re func (i *internalSprintImpl) Close(ctx context.Context, sprintID int) (*model.ResponseScheme, error) { if sprintID == 0 { - return nil, model.ErrNoSprintIDError + return nil, model.ErrNoSprintID } url := fmt.Sprintf("rest/agile/%v/sprint/%v", i.version, sprintID) diff --git a/jira/agile/internal/sprint_impl_test.go b/jira/agile/internal/sprint_impl_test.go index 94db8e53..c7cbd1fd 100644 --- a/jira/agile/internal/sprint_impl_test.go +++ b/jira/agile/internal/sprint_impl_test.go @@ -121,7 +121,7 @@ func Test_SprintService_Get(t *testing.T) { on: func(fields *fields) { fields.c = mocks.NewConnector(t) }, - Err: model.ErrNoSprintIDError, + Err: model.ErrNoSprintID, wantErr: true, }, } @@ -629,7 +629,7 @@ func Test_SprintService_Delete(t *testing.T) { on: func(fields *fields) { fields.c = mocks.NewConnector(t) }, - Err: model.ErrNoSprintIDError, + Err: model.ErrNoSprintID, wantErr: true, }, @@ -850,7 +850,7 @@ func Test_SprintService_Issues(t *testing.T) { on: func(fields *fields) { fields.c = mocks.NewConnector(t) }, - Err: model.ErrNoSprintIDError, + Err: model.ErrNoSprintID, wantErr: true, }, } @@ -940,7 +940,7 @@ func Test_SprintService_Start(t *testing.T) { on: func(fields *fields) { fields.c = mocks.NewConnector(t) }, - Err: model.ErrNoSprintIDError, + Err: model.ErrNoSprintID, wantErr: true, }, @@ -1081,7 +1081,7 @@ func Test_SprintService_Close(t *testing.T) { on: func(fields *fields) { fields.c = mocks.NewConnector(t) }, - Err: model.ErrNoSprintIDError, + Err: model.ErrNoSprintID, wantErr: true, }, @@ -1231,7 +1231,7 @@ func Test_SprintService_Move(t *testing.T) { on: func(fields *fields) { fields.c = mocks.NewConnector(t) }, - Err: model.ErrNoSprintIDError, + Err: model.ErrNoSprintID, wantErr: true, }, diff --git a/jira/internal/application_role_impl.go b/jira/internal/application_role_impl.go index 7cb02660..c0be0f4d 100644 --- a/jira/internal/application_role_impl.go +++ b/jira/internal/application_role_impl.go @@ -75,7 +75,7 @@ func (i *internalApplicationRoleImpl) Gets(ctx context.Context) ([]*model.Applic func (i *internalApplicationRoleImpl) Get(ctx context.Context, key string) (*model.ApplicationRoleScheme, *model.ResponseScheme, error) { if key == "" { - return nil, nil, model.ErrNoApplicationRoleError + return nil, nil, model.ErrNoApplicationRole } endpoint := fmt.Sprintf("rest/api/%v/applicationrole/%v", i.version, key) diff --git a/jira/internal/application_role_impl_test.go b/jira/internal/application_role_impl_test.go index 8d32971f..32c24f6c 100644 --- a/jira/internal/application_role_impl_test.go +++ b/jira/internal/application_role_impl_test.go @@ -97,7 +97,7 @@ func TestApplicationRoleService_Get(t *testing.T) { fields.c = mocks.NewConnector(t) }, wantErr: true, - Err: model.ErrNoApplicationRoleError, + Err: model.ErrNoApplicationRole, }, { diff --git a/jira/internal/attachment_impl.go b/jira/internal/attachment_impl.go index 7637d38d..cabdee56 100644 --- a/jira/internal/attachment_impl.go +++ b/jira/internal/attachment_impl.go @@ -103,7 +103,7 @@ type internalIssueAttachmentServiceImpl struct { func (i *internalIssueAttachmentServiceImpl) Download(ctx context.Context, attachmentID string, redirect bool) (*model.ResponseScheme, error) { if attachmentID == "" { - return nil, model.ErrNoAttachmentIDError + return nil, model.ErrNoAttachmentID } var endpoint strings.Builder @@ -146,7 +146,7 @@ func (i *internalIssueAttachmentServiceImpl) Settings(ctx context.Context) (*mod func (i *internalIssueAttachmentServiceImpl) Metadata(ctx context.Context, attachmentID string) (*model.IssueAttachmentMetadataScheme, *model.ResponseScheme, error) { if attachmentID == "" { - return nil, nil, model.ErrNoAttachmentIDError + return nil, nil, model.ErrNoAttachmentID } endpoint := fmt.Sprintf("rest/api/%v/attachment/%v", i.version, attachmentID) @@ -168,7 +168,7 @@ func (i *internalIssueAttachmentServiceImpl) Metadata(ctx context.Context, attac func (i *internalIssueAttachmentServiceImpl) Delete(ctx context.Context, attachmentID string) (*model.ResponseScheme, error) { if attachmentID == "" { - return nil, model.ErrNoAttachmentIDError + return nil, model.ErrNoAttachmentID } endpoint := fmt.Sprintf("rest/api/%v/attachment/%v", i.version, attachmentID) @@ -184,7 +184,7 @@ func (i *internalIssueAttachmentServiceImpl) Delete(ctx context.Context, attachm func (i *internalIssueAttachmentServiceImpl) Human(ctx context.Context, attachmentID string) (*model.IssueAttachmentHumanMetadataScheme, *model.ResponseScheme, error) { if attachmentID == "" { - return nil, nil, model.ErrNoAttachmentIDError + return nil, nil, model.ErrNoAttachmentID } endpoint := fmt.Sprintf("rest/api/%v/attachment/%v/expand/human", i.version, attachmentID) @@ -206,15 +206,15 @@ func (i *internalIssueAttachmentServiceImpl) Human(ctx context.Context, attachme func (i *internalIssueAttachmentServiceImpl) Add(ctx context.Context, issueKeyOrID, fileName string, file io.Reader) ([]*model.IssueAttachmentScheme, *model.ResponseScheme, error) { if issueKeyOrID == "" { - return nil, nil, model.ErrNoIssueKeyOrIDError + return nil, nil, model.ErrNoIssueKeyOrID } if fileName == "" { - return nil, nil, model.ErrNoAttachmentNameError + return nil, nil, model.ErrNoAttachmentName } if file == nil { - return nil, nil, model.ErrNoReaderError + return nil, nil, model.ErrNoReader } endpoint := fmt.Sprintf("rest/api/%v/issue/%v/attachments", i.version, issueKeyOrID) diff --git a/jira/internal/attachment_impl_test.go b/jira/internal/attachment_impl_test.go index 7ca93eaa..24ec331a 100644 --- a/jira/internal/attachment_impl_test.go +++ b/jira/internal/attachment_impl_test.go @@ -237,7 +237,7 @@ func Test_internalIssueAttachmentServiceImpl_Metadata(t *testing.T) { fields.c = mocks.NewConnector(t) }, wantErr: true, - Err: model.ErrNoAttachmentIDError, + Err: model.ErrNoAttachmentID, }, { @@ -386,7 +386,7 @@ func Test_internalIssueAttachmentServiceImpl_Human(t *testing.T) { fields.c = mocks.NewConnector(t) }, wantErr: true, - Err: model.ErrNoAttachmentIDError, + Err: model.ErrNoAttachmentID, }, { @@ -535,7 +535,7 @@ func Test_internalIssueAttachmentServiceImpl_Delete(t *testing.T) { fields.c = mocks.NewConnector(t) }, wantErr: true, - Err: model.ErrNoAttachmentIDError, + Err: model.ErrNoAttachmentID, }, { @@ -696,7 +696,7 @@ func Test_internalIssueAttachmentServiceImpl_Add(t *testing.T) { file: fileMocked, }, wantErr: true, - Err: model.ErrNoIssueKeyOrIDError, + Err: model.ErrNoIssueKeyOrID, }, { @@ -709,7 +709,7 @@ func Test_internalIssueAttachmentServiceImpl_Add(t *testing.T) { file: fileMocked, }, wantErr: true, - Err: model.ErrNoAttachmentNameError, + Err: model.ErrNoAttachmentName, }, { @@ -722,7 +722,7 @@ func Test_internalIssueAttachmentServiceImpl_Add(t *testing.T) { file: nil, }, wantErr: true, - Err: model.ErrNoReaderError, + Err: model.ErrNoReader, }, { @@ -876,7 +876,7 @@ func Test_internalIssueAttachmentServiceImpl_Download(t *testing.T) { fields.c = mocks.NewConnector(t) }, wantErr: true, - Err: model.ErrNoAttachmentIDError, + Err: model.ErrNoAttachmentID, }, { diff --git a/jira/internal/comment_impl_adf.go b/jira/internal/comment_impl_adf.go index 477d05d0..be041f99 100644 --- a/jira/internal/comment_impl_adf.go +++ b/jira/internal/comment_impl_adf.go @@ -63,11 +63,11 @@ type internalAdfCommentImpl struct { func (i *internalAdfCommentImpl) Delete(ctx context.Context, issueKeyOrID, commentID string) (*model.ResponseScheme, error) { if issueKeyOrID == "" { - return nil, model.ErrNoIssueKeyOrIDError + return nil, model.ErrNoIssueKeyOrID } if commentID == "" { - return nil, model.ErrNoCommentIDError + return nil, model.ErrNoCommentID } endpoint := fmt.Sprintf("rest/api/%v/issue/%v/comment/%v", i.version, issueKeyOrID, commentID) @@ -83,7 +83,7 @@ func (i *internalAdfCommentImpl) Delete(ctx context.Context, issueKeyOrID, comme func (i *internalAdfCommentImpl) Gets(ctx context.Context, issueKeyOrID, orderBy string, expand []string, startAt, maxResults int) (*model.IssueCommentPageScheme, *model.ResponseScheme, error) { if issueKeyOrID == "" { - return nil, nil, model.ErrNoIssueKeyOrIDError + return nil, nil, model.ErrNoIssueKeyOrID } params := url.Values{} @@ -117,11 +117,11 @@ func (i *internalAdfCommentImpl) Gets(ctx context.Context, issueKeyOrID, orderBy func (i *internalAdfCommentImpl) Get(ctx context.Context, issueKeyOrID, commentID string) (*model.IssueCommentScheme, *model.ResponseScheme, error) { if issueKeyOrID == "" { - return nil, nil, model.ErrNoIssueKeyOrIDError + return nil, nil, model.ErrNoIssueKeyOrID } if commentID == "" { - return nil, nil, model.ErrNoCommentIDError + return nil, nil, model.ErrNoCommentID } endpoint := fmt.Sprintf("rest/api/%v/issue/%v/comment/%v", i.version, issueKeyOrID, commentID) @@ -143,7 +143,7 @@ func (i *internalAdfCommentImpl) Get(ctx context.Context, issueKeyOrID, commentI func (i *internalAdfCommentImpl) Add(ctx context.Context, issueKeyOrID string, payload *model.CommentPayloadScheme, expand []string) (*model.IssueCommentScheme, *model.ResponseScheme, error) { if issueKeyOrID == "" { - return nil, nil, model.ErrNoIssueKeyOrIDError + return nil, nil, model.ErrNoIssueKeyOrID } params := url.Values{} diff --git a/jira/internal/comment_impl_adf_test.go b/jira/internal/comment_impl_adf_test.go index c20063ca..b48a2d81 100644 --- a/jira/internal/comment_impl_adf_test.go +++ b/jira/internal/comment_impl_adf_test.go @@ -84,7 +84,7 @@ func Test_internalAdfCommentImpl_Gets(t *testing.T) { maxResults: 50, }, wantErr: true, - Err: model.ErrNoIssueKeyOrIDError, + Err: model.ErrNoIssueKeyOrID, }, { @@ -210,7 +210,7 @@ func Test_internalAdfCommentImpl_Get(t *testing.T) { issueKeyOrID: "", }, wantErr: true, - Err: model.ErrNoIssueKeyOrIDError, + Err: model.ErrNoIssueKeyOrID, }, { @@ -221,7 +221,7 @@ func Test_internalAdfCommentImpl_Get(t *testing.T) { issueKeyOrID: "DUMMY-1", }, wantErr: true, - Err: model.ErrNoCommentIDError, + Err: model.ErrNoCommentID, }, { @@ -343,7 +343,7 @@ func Test_internalAdfCommentImpl_Delete(t *testing.T) { issueKeyOrID: "", }, wantErr: true, - Err: model.ErrNoIssueKeyOrIDError, + Err: model.ErrNoIssueKeyOrID, }, { @@ -354,7 +354,7 @@ func Test_internalAdfCommentImpl_Delete(t *testing.T) { issueKeyOrID: "DUMMY-1", }, wantErr: true, - Err: model.ErrNoCommentIDError, + Err: model.ErrNoCommentID, }, { @@ -519,7 +519,7 @@ func Test_internalAdfCommentImpl_Add(t *testing.T) { expand: []string{"body"}, }, wantErr: true, - Err: model.ErrNoIssueKeyOrIDError, + Err: model.ErrNoIssueKeyOrID, }, { diff --git a/jira/internal/comment_impl_rich_text.go b/jira/internal/comment_impl_rich_text.go index 9d6a98ec..37cb91c4 100644 --- a/jira/internal/comment_impl_rich_text.go +++ b/jira/internal/comment_impl_rich_text.go @@ -63,11 +63,11 @@ type internalRichTextCommentImpl struct { func (i *internalRichTextCommentImpl) Delete(ctx context.Context, issueKeyOrID, commentID string) (*model.ResponseScheme, error) { if issueKeyOrID == "" { - return nil, model.ErrNoIssueKeyOrIDError + return nil, model.ErrNoIssueKeyOrID } if commentID == "" { - return nil, model.ErrNoCommentIDError + return nil, model.ErrNoCommentID } endpoint := fmt.Sprintf("rest/api/%v/issue/%v/comment/%v", i.version, issueKeyOrID, commentID) @@ -83,7 +83,7 @@ func (i *internalRichTextCommentImpl) Delete(ctx context.Context, issueKeyOrID, func (i *internalRichTextCommentImpl) Gets(ctx context.Context, issueKeyOrID, orderBy string, expand []string, startAt, maxResults int) (*model.IssueCommentPageSchemeV2, *model.ResponseScheme, error) { if issueKeyOrID == "" { - return nil, nil, model.ErrNoIssueKeyOrIDError + return nil, nil, model.ErrNoIssueKeyOrID } params := url.Values{} @@ -117,11 +117,11 @@ func (i *internalRichTextCommentImpl) Gets(ctx context.Context, issueKeyOrID, or func (i *internalRichTextCommentImpl) Get(ctx context.Context, issueKeyOrID, commentID string) (*model.IssueCommentSchemeV2, *model.ResponseScheme, error) { if issueKeyOrID == "" { - return nil, nil, model.ErrNoIssueKeyOrIDError + return nil, nil, model.ErrNoIssueKeyOrID } if commentID == "" { - return nil, nil, model.ErrNoCommentIDError + return nil, nil, model.ErrNoCommentID } endpoint := fmt.Sprintf("rest/api/%v/issue/%v/comment/%v", i.version, issueKeyOrID, commentID) @@ -143,7 +143,7 @@ func (i *internalRichTextCommentImpl) Get(ctx context.Context, issueKeyOrID, com func (i *internalRichTextCommentImpl) Add(ctx context.Context, issueKeyOrID string, payload *model.CommentPayloadSchemeV2, expand []string) (*model.IssueCommentSchemeV2, *model.ResponseScheme, error) { if issueKeyOrID == "" { - return nil, nil, model.ErrNoIssueKeyOrIDError + return nil, nil, model.ErrNoIssueKeyOrID } params := url.Values{} diff --git a/jira/internal/comment_impl_rich_text_test.go b/jira/internal/comment_impl_rich_text_test.go index 5d0175d5..78fb6102 100644 --- a/jira/internal/comment_impl_rich_text_test.go +++ b/jira/internal/comment_impl_rich_text_test.go @@ -84,7 +84,7 @@ func Test_internalRichTextCommentImpl_Gets(t *testing.T) { maxResults: 50, }, wantErr: true, - Err: model.ErrNoIssueKeyOrIDError, + Err: model.ErrNoIssueKeyOrID, }, { @@ -210,7 +210,7 @@ func Test_internalRichTextCommentImpl_Get(t *testing.T) { issueKeyOrID: "", }, wantErr: true, - Err: model.ErrNoIssueKeyOrIDError, + Err: model.ErrNoIssueKeyOrID, }, { @@ -221,7 +221,7 @@ func Test_internalRichTextCommentImpl_Get(t *testing.T) { issueKeyOrID: "DUMMY-1", }, wantErr: true, - Err: model.ErrNoCommentIDError, + Err: model.ErrNoCommentID, }, { @@ -343,7 +343,7 @@ func Test_internalRichTextCommentImpl_Delete(t *testing.T) { issueKeyOrID: "", }, wantErr: true, - Err: model.ErrNoIssueKeyOrIDError, + Err: model.ErrNoIssueKeyOrID, }, { @@ -354,7 +354,7 @@ func Test_internalRichTextCommentImpl_Delete(t *testing.T) { issueKeyOrID: "DUMMY-1", }, wantErr: true, - Err: model.ErrNoCommentIDError, + Err: model.ErrNoCommentID, }, { @@ -488,7 +488,7 @@ func Test_internalRichTextCommentImpl_Add(t *testing.T) { expand: []string{"body"}, }, wantErr: true, - Err: model.ErrNoIssueKeyOrIDError, + Err: model.ErrNoIssueKeyOrID, }, { diff --git a/jira/internal/dashboard_impl.go b/jira/internal/dashboard_impl.go index 053ae32d..54954f26 100644 --- a/jira/internal/dashboard_impl.go +++ b/jira/internal/dashboard_impl.go @@ -199,7 +199,7 @@ func (i *internalDashboardImpl) Search(ctx context.Context, options *model.Dashb func (i *internalDashboardImpl) Get(ctx context.Context, dashboardID string) (*model.DashboardScheme, *model.ResponseScheme, error) { if dashboardID == "" { - return nil, nil, model.ErrNoDashboardIDError + return nil, nil, model.ErrNoDashboardID } endpoint := fmt.Sprintf("rest/api/%v/dashboard/%v", i.version, dashboardID) @@ -221,7 +221,7 @@ func (i *internalDashboardImpl) Get(ctx context.Context, dashboardID string) (*m func (i *internalDashboardImpl) Delete(ctx context.Context, dashboardID string) (*model.ResponseScheme, error) { if dashboardID == "" { - return nil, model.ErrNoDashboardIDError + return nil, model.ErrNoDashboardID } endpoint := fmt.Sprintf("rest/api/%v/dashboard/%v", i.version, dashboardID) @@ -237,7 +237,7 @@ func (i *internalDashboardImpl) Delete(ctx context.Context, dashboardID string) func (i *internalDashboardImpl) Copy(ctx context.Context, dashboardID string, payload *model.DashboardPayloadScheme) (*model.DashboardScheme, *model.ResponseScheme, error) { if dashboardID == "" { - return nil, nil, model.ErrNoDashboardIDError + return nil, nil, model.ErrNoDashboardID } endpoint := fmt.Sprintf("rest/api/%v/dashboard/%v/copy", i.version, dashboardID) @@ -259,7 +259,7 @@ func (i *internalDashboardImpl) Copy(ctx context.Context, dashboardID string, pa func (i *internalDashboardImpl) Update(ctx context.Context, dashboardID string, payload *model.DashboardPayloadScheme) (*model.DashboardScheme, *model.ResponseScheme, error) { if dashboardID == "" { - return nil, nil, model.ErrNoDashboardIDError + return nil, nil, model.ErrNoDashboardID } endpoint := fmt.Sprintf("rest/api/%v/dashboard/%v", i.version, dashboardID) diff --git a/jira/internal/dashboard_impl_test.go b/jira/internal/dashboard_impl_test.go index 8c868dca..ff25b86d 100644 --- a/jira/internal/dashboard_impl_test.go +++ b/jira/internal/dashboard_impl_test.go @@ -121,7 +121,7 @@ func TestDashboardService_Copy(t *testing.T) { fields.c = mocks.NewConnector(t) }, wantErr: true, - Err: model.ErrNoDashboardIDError, + Err: model.ErrNoDashboardID, }, { @@ -290,7 +290,7 @@ func TestDashboardService_Update(t *testing.T) { fields.c = mocks.NewConnector(t) }, wantErr: true, - Err: model.ErrNoDashboardIDError, + Err: model.ErrNoDashboardID, }, { @@ -929,7 +929,7 @@ func TestDashboardService_Get(t *testing.T) { fields.c = mocks.NewConnector(t) }, wantErr: true, - Err: model.ErrNoDashboardIDError, + Err: model.ErrNoDashboardID, }, { @@ -1078,7 +1078,7 @@ func TestDashboardService_Delete(t *testing.T) { fields.c = mocks.NewConnector(t) }, wantErr: true, - Err: model.ErrNoDashboardIDError, + Err: model.ErrNoDashboardID, }, { diff --git a/jira/internal/field_configuration_impl.go b/jira/internal/field_configuration_impl.go index 9c2f8336..5183c5ab 100644 --- a/jira/internal/field_configuration_impl.go +++ b/jira/internal/field_configuration_impl.go @@ -116,7 +116,7 @@ func (i *internalIssueFieldConfigServiceImpl) Gets(ctx context.Context, ids []in func (i *internalIssueFieldConfigServiceImpl) Create(ctx context.Context, name, description string) (*model.FieldConfigurationScheme, *model.ResponseScheme, error) { if name == "" { - return nil, nil, model.ErrNoFieldConfigurationNameError + return nil, nil, model.ErrNoFieldConfigurationName } endpoint := fmt.Sprintf("rest/api/%v/fieldconfiguration", i.version) @@ -144,11 +144,11 @@ func (i *internalIssueFieldConfigServiceImpl) Create(ctx context.Context, name, func (i *internalIssueFieldConfigServiceImpl) Update(ctx context.Context, id int, name, description string) (*model.ResponseScheme, error) { if id == 0 { - return nil, model.ErrNoFieldConfigurationIDError + return nil, model.ErrNoFieldConfigurationID } if name == "" { - return nil, model.ErrNoFieldConfigurationNameError + return nil, model.ErrNoFieldConfigurationName } payload := map[string]interface{}{"name": name} @@ -170,7 +170,7 @@ func (i *internalIssueFieldConfigServiceImpl) Update(ctx context.Context, id int func (i *internalIssueFieldConfigServiceImpl) Delete(ctx context.Context, id int) (*model.ResponseScheme, error) { if id == 0 { - return nil, model.ErrNoFieldConfigurationIDError + return nil, model.ErrNoFieldConfigurationID } endpoint := fmt.Sprintf("rest/api/%v/fieldconfiguration/%v", i.version, id) diff --git a/jira/internal/field_configuration_impl_test.go b/jira/internal/field_configuration_impl_test.go index 95009024..df759054 100644 --- a/jira/internal/field_configuration_impl_test.go +++ b/jira/internal/field_configuration_impl_test.go @@ -295,7 +295,7 @@ func Test_internalIssueFieldConfigServiceImpl_Create(t *testing.T) { description: "description sample", }, wantErr: true, - Err: model.ErrNoFieldConfigurationNameError, + Err: model.ErrNoFieldConfigurationName, }, { @@ -494,7 +494,7 @@ func Test_internalIssueFieldConfigServiceImpl_Update(t *testing.T) { description: "description sample", }, wantErr: true, - Err: model.ErrNoFieldConfigurationNameError, + Err: model.ErrNoFieldConfigurationName, }, { @@ -507,7 +507,7 @@ func Test_internalIssueFieldConfigServiceImpl_Update(t *testing.T) { description: "description sample", }, wantErr: true, - Err: model.ErrNoFieldConfigurationIDError, + Err: model.ErrNoFieldConfigurationID, }, { @@ -660,7 +660,7 @@ func Test_internalIssueFieldConfigServiceImpl_Delete(t *testing.T) { id: 0, }, wantErr: true, - Err: model.ErrNoFieldConfigurationIDError, + Err: model.ErrNoFieldConfigurationID, }, { diff --git a/jira/internal/field_configuration_item_impl.go b/jira/internal/field_configuration_item_impl.go index bc81bf4e..29f76c13 100644 --- a/jira/internal/field_configuration_item_impl.go +++ b/jira/internal/field_configuration_item_impl.go @@ -60,7 +60,7 @@ type internalIssueFieldConfigItemServiceImpl struct { func (i *internalIssueFieldConfigItemServiceImpl) Gets(ctx context.Context, id, startAt, maxResults int) (*model.FieldConfigurationItemPageScheme, *model.ResponseScheme, error) { if id == 0 { - return nil, nil, model.ErrNoFieldConfigurationIDError + return nil, nil, model.ErrNoFieldConfigurationID } params := url.Values{} @@ -86,7 +86,7 @@ func (i *internalIssueFieldConfigItemServiceImpl) Gets(ctx context.Context, id, func (i *internalIssueFieldConfigItemServiceImpl) Update(ctx context.Context, id int, payload *model.UpdateFieldConfigurationItemPayloadScheme) (*model.ResponseScheme, error) { if id == 0 { - return nil, model.ErrNoFieldConfigurationIDError + return nil, model.ErrNoFieldConfigurationID } endpoint := fmt.Sprintf("rest/api/%v/fieldconfiguration/%v/fields", i.version, id) diff --git a/jira/internal/field_configuration_item_impl_test.go b/jira/internal/field_configuration_item_impl_test.go index 99b6fc8b..54151996 100644 --- a/jira/internal/field_configuration_item_impl_test.go +++ b/jira/internal/field_configuration_item_impl_test.go @@ -73,7 +73,7 @@ func Test_internalIssueFieldConfigItemServiceImpl_Gets(t *testing.T) { maxResults: 50, }, wantErr: true, - Err: model.ErrNoFieldConfigurationIDError, + Err: model.ErrNoFieldConfigurationID, }, { @@ -251,7 +251,7 @@ func Test_internalIssueFieldConfigItemServiceImpl_Update(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoFieldConfigurationIDError, + Err: model.ErrNoFieldConfigurationID, }, { diff --git a/jira/internal/field_configuration_scheme.go b/jira/internal/field_configuration_scheme.go index c6f9f838..9c8c209b 100644 --- a/jira/internal/field_configuration_scheme.go +++ b/jira/internal/field_configuration_scheme.go @@ -169,7 +169,7 @@ func (i *internalIssueFieldConfigSchemeServiceImpl) Gets(ctx context.Context, id func (i *internalIssueFieldConfigSchemeServiceImpl) Create(ctx context.Context, name, description string) (*model.FieldConfigurationSchemeScheme, *model.ResponseScheme, error) { if name == "" { - return nil, nil, model.ErrNoFieldConfigurationSchemeNameError + return nil, nil, model.ErrNoFieldConfigurationSchemeName } payload := map[string]interface{}{"name": name} @@ -261,11 +261,11 @@ func (i *internalIssueFieldConfigSchemeServiceImpl) Assign(ctx context.Context, func (i *internalIssueFieldConfigSchemeServiceImpl) Update(ctx context.Context, schemeID int, name, description string) (*model.ResponseScheme, error) { if schemeID == 0 { - return nil, model.ErrNoFieldConfigurationSchemeIDError + return nil, model.ErrNoFieldConfigurationSchemeID } if name == "" { - return nil, model.ErrNoFieldConfigurationSchemeNameError + return nil, model.ErrNoFieldConfigurationSchemeName } payload := map[string]interface{}{"name": name} @@ -287,7 +287,7 @@ func (i *internalIssueFieldConfigSchemeServiceImpl) Update(ctx context.Context, func (i *internalIssueFieldConfigSchemeServiceImpl) Delete(ctx context.Context, schemeID int) (*model.ResponseScheme, error) { if schemeID == 0 { - return nil, model.ErrNoFieldConfigurationSchemeIDError + return nil, model.ErrNoFieldConfigurationSchemeID } endpoint := fmt.Sprintf("rest/api/%v/fieldconfigurationscheme/%v", i.version, schemeID) @@ -303,7 +303,7 @@ func (i *internalIssueFieldConfigSchemeServiceImpl) Delete(ctx context.Context, func (i *internalIssueFieldConfigSchemeServiceImpl) Link(ctx context.Context, schemeID int, payload *model.FieldConfigurationToIssueTypeMappingPayloadScheme) (*model.ResponseScheme, error) { if schemeID == 0 { - return nil, model.ErrNoFieldConfigurationSchemeIDError + return nil, model.ErrNoFieldConfigurationSchemeID } endpoint := fmt.Sprintf("rest/api/%v/fieldconfigurationscheme/%v/mapping", i.version, schemeID) @@ -319,11 +319,11 @@ func (i *internalIssueFieldConfigSchemeServiceImpl) Link(ctx context.Context, sc func (i *internalIssueFieldConfigSchemeServiceImpl) Unlink(ctx context.Context, schemeID int, issueTypeIDs []string) (*model.ResponseScheme, error) { if schemeID == 0 { - return nil, model.ErrNoFieldConfigurationSchemeIDError + return nil, model.ErrNoFieldConfigurationSchemeID } if len(issueTypeIDs) == 0 { - return nil, model.ErrNoIssueTypesError + return nil, model.ErrNoIssueTypes } endpoint := fmt.Sprintf("rest/api/%v/fieldconfigurationscheme/%v/mapping/delete", i.version, schemeID) diff --git a/jira/internal/field_configuration_scheme_test.go b/jira/internal/field_configuration_scheme_test.go index 2917672e..d4c024fa 100644 --- a/jira/internal/field_configuration_scheme_test.go +++ b/jira/internal/field_configuration_scheme_test.go @@ -838,7 +838,7 @@ func Test_internalIssueFieldConfigSchemeServiceImpl_Update(t *testing.T) { description: "description sample", }, wantErr: true, - Err: model.ErrNoFieldConfigurationSchemeIDError, + Err: model.ErrNoFieldConfigurationSchemeID, }, { @@ -851,7 +851,7 @@ func Test_internalIssueFieldConfigSchemeServiceImpl_Update(t *testing.T) { description: "description sample", }, wantErr: true, - Err: model.ErrNoFieldConfigurationSchemeNameError, + Err: model.ErrNoFieldConfigurationSchemeName, }, { @@ -974,7 +974,7 @@ func Test_internalIssueFieldConfigSchemeServiceImpl_Delete(t *testing.T) { schemeID: 0, }, wantErr: true, - Err: model.ErrNoFieldConfigurationSchemeIDError, + Err: model.ErrNoFieldConfigurationSchemeID, }, { @@ -1111,7 +1111,7 @@ func Test_internalIssueFieldConfigSchemeServiceImpl_Link(t *testing.T) { payload: payloadMocked, }, wantErr: true, - Err: model.ErrNoFieldConfigurationSchemeIDError, + Err: model.ErrNoFieldConfigurationSchemeID, }, { @@ -1294,7 +1294,7 @@ func Test_internalIssueFieldConfigSchemeServiceImpl_Unlink(t *testing.T) { schemeID: 0, }, wantErr: true, - Err: model.ErrNoFieldConfigurationSchemeIDError, + Err: model.ErrNoFieldConfigurationSchemeID, }, { @@ -1305,7 +1305,7 @@ func Test_internalIssueFieldConfigSchemeServiceImpl_Unlink(t *testing.T) { schemeID: 1000, }, wantErr: true, - Err: model.ErrNoIssueTypesError, + Err: model.ErrNoIssueTypes, }, { diff --git a/jira/internal/field_context_impl.go b/jira/internal/field_context_impl.go index 26bb1b60..6a93c2ae 100644 --- a/jira/internal/field_context_impl.go +++ b/jira/internal/field_context_impl.go @@ -175,7 +175,7 @@ type internalIssueFieldContextServiceImpl struct { func (i *internalIssueFieldContextServiceImpl) Gets(ctx context.Context, fieldID string, options *model.FieldContextOptionsScheme, startAt, maxResults int) (*model.CustomFieldContextPageScheme, *model.ResponseScheme, error) { if fieldID == "" { - return nil, nil, model.ErrNoFieldIDError + return nil, nil, model.ErrNoFieldID } params := url.Values{} @@ -210,7 +210,7 @@ func (i *internalIssueFieldContextServiceImpl) Gets(ctx context.Context, fieldID func (i *internalIssueFieldContextServiceImpl) Create(ctx context.Context, fieldID string, payload *model.FieldContextPayloadScheme) (*model.FieldContextScheme, *model.ResponseScheme, error) { if fieldID == "" { - return nil, nil, model.ErrNoFieldIDError + return nil, nil, model.ErrNoFieldID } endpoint := fmt.Sprintf("rest/api/%v/field/%v/context", i.version, fieldID) @@ -232,7 +232,7 @@ func (i *internalIssueFieldContextServiceImpl) Create(ctx context.Context, field func (i *internalIssueFieldContextServiceImpl) GetDefaultValues(ctx context.Context, fieldID string, contextIDs []int, startAt, maxResults int) (*model.CustomFieldDefaultValuePageScheme, *model.ResponseScheme, error) { if fieldID == "" { - return nil, nil, model.ErrNoFieldIDError + return nil, nil, model.ErrNoFieldID } params := url.Values{} @@ -262,7 +262,7 @@ func (i *internalIssueFieldContextServiceImpl) GetDefaultValues(ctx context.Cont func (i *internalIssueFieldContextServiceImpl) SetDefaultValue(ctx context.Context, fieldID string, payload *model.FieldContextDefaultPayloadScheme) (*model.ResponseScheme, error) { if fieldID == "" { - return nil, model.ErrNoFieldIDError + return nil, model.ErrNoFieldID } endpoint := fmt.Sprintf("rest/api/%v/field/%v/context/defaultValue", i.version, fieldID) @@ -278,7 +278,7 @@ func (i *internalIssueFieldContextServiceImpl) SetDefaultValue(ctx context.Conte func (i *internalIssueFieldContextServiceImpl) IssueTypesContext(ctx context.Context, fieldID string, contextIDs []int, startAt, maxResults int) (*model.IssueTypeToContextMappingPageScheme, *model.ResponseScheme, error) { if fieldID == "" { - return nil, nil, model.ErrNoFieldIDError + return nil, nil, model.ErrNoFieldID } params := url.Values{} @@ -308,7 +308,7 @@ func (i *internalIssueFieldContextServiceImpl) IssueTypesContext(ctx context.Con func (i *internalIssueFieldContextServiceImpl) ProjectsContext(ctx context.Context, fieldID string, contextIDs []int, startAt, maxResults int) (*model.CustomFieldContextProjectMappingPageScheme, *model.ResponseScheme, error) { if fieldID == "" { - return nil, nil, model.ErrNoFieldIDError + return nil, nil, model.ErrNoFieldID } params := url.Values{} @@ -338,11 +338,11 @@ func (i *internalIssueFieldContextServiceImpl) ProjectsContext(ctx context.Conte func (i *internalIssueFieldContextServiceImpl) Update(ctx context.Context, fieldID string, contextID int, name, description string) (*model.ResponseScheme, error) { if fieldID == "" { - return nil, model.ErrNoFieldIDError + return nil, model.ErrNoFieldID } if contextID == 0 { - return nil, model.ErrNoFieldContextIDError + return nil, model.ErrNoFieldContextID } payload := map[string]interface{}{"name": name} @@ -364,11 +364,11 @@ func (i *internalIssueFieldContextServiceImpl) Update(ctx context.Context, field func (i *internalIssueFieldContextServiceImpl) Delete(ctx context.Context, fieldID string, contextID int) (*model.ResponseScheme, error) { if fieldID == "" { - return nil, model.ErrNoFieldIDError + return nil, model.ErrNoFieldID } if contextID == 0 { - return nil, model.ErrNoFieldContextIDError + return nil, model.ErrNoFieldContextID } endpoint := fmt.Sprintf("rest/api/%v/field/%v/context/%v", i.version, fieldID, contextID) @@ -384,11 +384,11 @@ func (i *internalIssueFieldContextServiceImpl) Delete(ctx context.Context, field func (i *internalIssueFieldContextServiceImpl) AddIssueTypes(ctx context.Context, fieldID string, contextID int, issueTypesIDs []string) (*model.ResponseScheme, error) { if fieldID == "" { - return nil, model.ErrNoFieldIDError + return nil, model.ErrNoFieldID } if len(issueTypesIDs) == 0 { - return nil, model.ErrNoIssueTypesError + return nil, model.ErrNoIssueTypes } endpoint := fmt.Sprintf("rest/api/%v/field/%v/context/%v/issuetype", i.version, fieldID, contextID) @@ -404,11 +404,11 @@ func (i *internalIssueFieldContextServiceImpl) AddIssueTypes(ctx context.Context func (i *internalIssueFieldContextServiceImpl) RemoveIssueTypes(ctx context.Context, fieldID string, contextID int, issueTypesIDs []string) (*model.ResponseScheme, error) { if fieldID == "" { - return nil, model.ErrNoFieldIDError + return nil, model.ErrNoFieldID } if len(issueTypesIDs) == 0 { - return nil, model.ErrNoIssueTypesError + return nil, model.ErrNoIssueTypes } endpoint := fmt.Sprintf("rest/api/%v/field/%v/context/%v/issuetype/remove", i.version, fieldID, contextID) @@ -424,15 +424,15 @@ func (i *internalIssueFieldContextServiceImpl) RemoveIssueTypes(ctx context.Cont func (i *internalIssueFieldContextServiceImpl) Link(ctx context.Context, fieldID string, contextID int, projectIDs []string) (*model.ResponseScheme, error) { if fieldID == "" { - return nil, model.ErrNoFieldIDError + return nil, model.ErrNoFieldID } if contextID == 0 { - return nil, model.ErrNoFieldContextIDError + return nil, model.ErrNoFieldContextID } if len(projectIDs) == 0 { - return nil, model.ErrNoProjectIDsError + return nil, model.ErrNoProjectIDs } endpoint := fmt.Sprintf("rest/api/%v/field/%v/context/%v/project", i.version, fieldID, contextID) @@ -448,15 +448,15 @@ func (i *internalIssueFieldContextServiceImpl) Link(ctx context.Context, fieldID func (i *internalIssueFieldContextServiceImpl) UnLink(ctx context.Context, fieldID string, contextID int, projectIDs []string) (*model.ResponseScheme, error) { if fieldID == "" { - return nil, model.ErrNoFieldIDError + return nil, model.ErrNoFieldID } if contextID == 0 { - return nil, model.ErrNoFieldContextIDError + return nil, model.ErrNoFieldContextID } if len(projectIDs) == 0 { - return nil, model.ErrNoProjectIDsError + return nil, model.ErrNoProjectIDs } endpoint := fmt.Sprintf("rest/api/%v/field/%v/context/%v/project/remove", i.version, fieldID, contextID) diff --git a/jira/internal/field_context_impl_test.go b/jira/internal/field_context_impl_test.go index 83e1bdda..f667ba15 100644 --- a/jira/internal/field_context_impl_test.go +++ b/jira/internal/field_context_impl_test.go @@ -124,7 +124,7 @@ func Test_internalIssueFieldContextServiceImpl_Gets(t *testing.T) { maxResults: 50, }, wantErr: true, - Err: model.ErrNoFieldIDError, + Err: model.ErrNoFieldID, }, { @@ -291,7 +291,7 @@ func Test_internalIssueFieldContextServiceImpl_Create(t *testing.T) { payload: payloadMocked, }, wantErr: true, - Err: model.ErrNoFieldIDError, + Err: model.ErrNoFieldID, }, { @@ -448,7 +448,7 @@ func Test_internalIssueFieldContextServiceImpl_GetDefaultValues(t *testing.T) { fieldID: "", }, wantErr: true, - Err: model.ErrNoFieldIDError, + Err: model.ErrNoFieldID, }, { @@ -618,7 +618,7 @@ func Test_internalIssueFieldContextServiceImpl_SetDefaultValue(t *testing.T) { fieldID: "", }, wantErr: true, - Err: model.ErrNoFieldIDError, + Err: model.ErrNoFieldID, }, { @@ -774,7 +774,7 @@ func Test_internalIssueFieldContextServiceImpl_IssueTypesContext(t *testing.T) { fieldId: "", }, wantErr: true, - Err: model.ErrNoFieldIDError, + Err: model.ErrNoFieldID, }, { @@ -934,7 +934,7 @@ func Test_internalIssueFieldContextServiceImpl_ProjectsContext(t *testing.T) { fieldId: "", }, wantErr: true, - Err: model.ErrNoFieldIDError, + Err: model.ErrNoFieldID, }, { @@ -1131,7 +1131,7 @@ func Test_internalIssueFieldContextServiceImpl_Update(t *testing.T) { fieldId: "", }, wantErr: true, - Err: model.ErrNoFieldIDError, + Err: model.ErrNoFieldID, }, { @@ -1285,7 +1285,7 @@ func Test_internalIssueFieldContextServiceImpl_Delete(t *testing.T) { fieldId: "", }, wantErr: true, - Err: model.ErrNoFieldIDError, + Err: model.ErrNoFieldID, }, { @@ -1441,7 +1441,7 @@ func Test_internalIssueFieldContextServiceImpl_AddIssueTypes(t *testing.T) { fieldId: "", }, wantErr: true, - Err: model.ErrNoFieldIDError, + Err: model.ErrNoFieldID, }, { @@ -1599,7 +1599,7 @@ func Test_internalIssueFieldContextServiceImpl_RemoveIssueTypes(t *testing.T) { fieldId: "", }, wantErr: true, - Err: model.ErrNoFieldIDError, + Err: model.ErrNoFieldID, }, { @@ -1611,7 +1611,7 @@ func Test_internalIssueFieldContextServiceImpl_RemoveIssueTypes(t *testing.T) { issueTypesIds: nil, }, wantErr: true, - Err: model.ErrNoIssueTypesError, + Err: model.ErrNoIssueTypes, }, { @@ -1769,7 +1769,7 @@ func Test_internalIssueFieldContextServiceImpl_Link(t *testing.T) { fieldId: "", }, wantErr: true, - Err: model.ErrNoFieldIDError, + Err: model.ErrNoFieldID, }, { @@ -1780,7 +1780,7 @@ func Test_internalIssueFieldContextServiceImpl_Link(t *testing.T) { fieldId: "custom_field_10002", }, wantErr: true, - Err: model.ErrNoFieldContextIDError, + Err: model.ErrNoFieldContextID, }, { @@ -1792,7 +1792,7 @@ func Test_internalIssueFieldContextServiceImpl_Link(t *testing.T) { contextId: 10001, }, wantErr: true, - Err: model.ErrNoProjectIDsError, + Err: model.ErrNoProjectIDs, }, { @@ -1950,7 +1950,7 @@ func Test_internalIssueFieldContextServiceImpl_Unlink(t *testing.T) { fieldId: "", }, wantErr: true, - Err: model.ErrNoFieldIDError, + Err: model.ErrNoFieldID, }, { @@ -1961,7 +1961,7 @@ func Test_internalIssueFieldContextServiceImpl_Unlink(t *testing.T) { fieldId: "custom_field_10002", }, wantErr: true, - Err: model.ErrNoFieldContextIDError, + Err: model.ErrNoFieldContextID, }, { @@ -1973,7 +1973,7 @@ func Test_internalIssueFieldContextServiceImpl_Unlink(t *testing.T) { contextId: 10001, }, wantErr: true, - Err: model.ErrNoProjectIDsError, + Err: model.ErrNoProjectIDs, }, { diff --git a/jira/internal/field_context_option_impl.go b/jira/internal/field_context_option_impl.go index 1a4d0ead..bac04642 100644 --- a/jira/internal/field_context_option_impl.go +++ b/jira/internal/field_context_option_impl.go @@ -97,7 +97,7 @@ type internalIssueFieldContextOptionServiceImpl struct { func (i *internalIssueFieldContextOptionServiceImpl) Gets(ctx context.Context, fieldID string, contextId int, options *model.FieldOptionContextParams, startAt, maxResults int) (*model.CustomFieldContextOptionPageScheme, *model.ResponseScheme, error) { if fieldID == "" { - return nil, nil, model.ErrNoFieldIDError + return nil, nil, model.ErrNoFieldID } params := url.Values{} @@ -131,11 +131,11 @@ func (i *internalIssueFieldContextOptionServiceImpl) Gets(ctx context.Context, f func (i *internalIssueFieldContextOptionServiceImpl) Create(ctx context.Context, fieldID string, contextId int, payload *model.FieldContextOptionListScheme) (*model.FieldContextOptionListScheme, *model.ResponseScheme, error) { if fieldID == "" { - return nil, nil, model.ErrNoFieldIDError + return nil, nil, model.ErrNoFieldID } if contextId == 0 { - return nil, nil, model.ErrNoFieldContextIDError + return nil, nil, model.ErrNoFieldContextID } endpoint := fmt.Sprintf("rest/api/%v/field/%v/context/%v/option", i.version, fieldID, contextId) @@ -157,11 +157,11 @@ func (i *internalIssueFieldContextOptionServiceImpl) Create(ctx context.Context, func (i *internalIssueFieldContextOptionServiceImpl) Update(ctx context.Context, fieldId string, contextId int, payload *model.FieldContextOptionListScheme) (*model.FieldContextOptionListScheme, *model.ResponseScheme, error) { if fieldId == "" { - return nil, nil, model.ErrNoFieldIDError + return nil, nil, model.ErrNoFieldID } if contextId == 0 { - return nil, nil, model.ErrNoFieldContextIDError + return nil, nil, model.ErrNoFieldContextID } endpoint := fmt.Sprintf("rest/api/%v/field/%v/context/%v/option", i.version, fieldId, contextId) @@ -183,15 +183,15 @@ func (i *internalIssueFieldContextOptionServiceImpl) Update(ctx context.Context, func (i *internalIssueFieldContextOptionServiceImpl) Delete(ctx context.Context, fieldId string, contextId, optionId int) (*model.ResponseScheme, error) { if fieldId == "" { - return nil, model.ErrNoFieldIDError + return nil, model.ErrNoFieldID } if contextId == 0 { - return nil, model.ErrNoFieldContextIDError + return nil, model.ErrNoFieldContextID } if optionId == 0 { - return nil, model.ErrNoContextOptionIDError + return nil, model.ErrNoContextOptionID } endpoint := fmt.Sprintf("rest/api/%v/field/%v/context/%v/option/%v", i.version, fieldId, contextId, optionId) @@ -207,11 +207,11 @@ func (i *internalIssueFieldContextOptionServiceImpl) Delete(ctx context.Context, func (i *internalIssueFieldContextOptionServiceImpl) Order(ctx context.Context, fieldId string, contextId int, payload *model.OrderFieldOptionPayloadScheme) (*model.ResponseScheme, error) { if fieldId == "" { - return nil, model.ErrNoFieldIDError + return nil, model.ErrNoFieldID } if contextId == 0 { - return nil, model.ErrNoFieldContextIDError + return nil, model.ErrNoFieldContextID } endpoint := fmt.Sprintf("rest/api/%v/field/%v/context/%v/option/move", i.version, fieldId, contextId) diff --git a/jira/internal/field_context_option_impl_test.go b/jira/internal/field_context_option_impl_test.go index 275f4d88..7624622b 100644 --- a/jira/internal/field_context_option_impl_test.go +++ b/jira/internal/field_context_option_impl_test.go @@ -125,7 +125,7 @@ func Test_internalIssueFieldContextOptionServiceImpl_Gets(t *testing.T) { maxResults: 50, }, wantErr: true, - Err: model.ErrNoFieldIDError, + Err: model.ErrNoFieldID, }, { @@ -303,7 +303,7 @@ func Test_internalIssueFieldContextOptionServiceImpl_Create(t *testing.T) { contextId: 10001, }, wantErr: true, - Err: model.ErrNoFieldIDError, + Err: model.ErrNoFieldID, }, { @@ -315,7 +315,7 @@ func Test_internalIssueFieldContextOptionServiceImpl_Create(t *testing.T) { contextId: 0, }, wantErr: true, - Err: model.ErrNoFieldContextIDError, + Err: model.ErrNoFieldContextID, }, { @@ -488,7 +488,7 @@ func Test_internalIssueFieldContextOptionServiceImpl_Update(t *testing.T) { contextId: 10001, }, wantErr: true, - Err: model.ErrNoFieldIDError, + Err: model.ErrNoFieldID, }, { @@ -500,7 +500,7 @@ func Test_internalIssueFieldContextOptionServiceImpl_Update(t *testing.T) { contextId: 0, }, wantErr: true, - Err: model.ErrNoFieldContextIDError, + Err: model.ErrNoFieldContextID, }, { @@ -658,7 +658,7 @@ func Test_internalIssueFieldContextOptionServiceImpl_Delete(t *testing.T) { contextId: 10001, }, wantErr: true, - Err: model.ErrNoFieldIDError, + Err: model.ErrNoFieldID, }, { @@ -670,7 +670,7 @@ func Test_internalIssueFieldContextOptionServiceImpl_Delete(t *testing.T) { contextId: 0, }, wantErr: true, - Err: model.ErrNoFieldContextIDError, + Err: model.ErrNoFieldContextID, }, { @@ -684,7 +684,7 @@ func Test_internalIssueFieldContextOptionServiceImpl_Delete(t *testing.T) { }, wantErr: true, - Err: model.ErrNoContextOptionIDError, + Err: model.ErrNoContextOptionID, }, { @@ -846,7 +846,7 @@ func Test_internalIssueFieldContextOptionServiceImpl_Order(t *testing.T) { contextId: 10001, }, wantErr: true, - Err: model.ErrNoFieldIDError, + Err: model.ErrNoFieldID, }, { @@ -858,7 +858,7 @@ func Test_internalIssueFieldContextOptionServiceImpl_Order(t *testing.T) { contextId: 0, }, wantErr: true, - Err: model.ErrNoFieldContextIDError, + Err: model.ErrNoFieldContextID, }, { diff --git a/jira/internal/field_impl.go b/jira/internal/field_impl.go index eb37369d..926133ef 100644 --- a/jira/internal/field_impl.go +++ b/jira/internal/field_impl.go @@ -179,7 +179,7 @@ func (i *internalIssueFieldServiceImpl) Search(ctx context.Context, options *mod func (i *internalIssueFieldServiceImpl) Delete(ctx context.Context, fieldID string) (*model.TaskScheme, *model.ResponseScheme, error) { if fieldID == "" { - return nil, nil, model.ErrNoFieldIDError + return nil, nil, model.ErrNoFieldID } endpoint := fmt.Sprintf("rest/api/%v/field/%v", i.version, fieldID) diff --git a/jira/internal/field_impl_test.go b/jira/internal/field_impl_test.go index b5e8f5af..76ea4ae8 100644 --- a/jira/internal/field_impl_test.go +++ b/jira/internal/field_impl_test.go @@ -577,7 +577,7 @@ func Test_internalIssueFieldServiceImpl_Delete(t *testing.T) { fieldID: "", }, wantErr: true, - Err: model.ErrNoFieldIDError, + Err: model.ErrNoFieldID, }, { diff --git a/jira/internal/field_trash_impl.go b/jira/internal/field_trash_impl.go index 4825da92..d6748871 100644 --- a/jira/internal/field_trash_impl.go +++ b/jira/internal/field_trash_impl.go @@ -112,7 +112,7 @@ func (i *internalFieldTrashServiceImpl) Search(ctx context.Context, options *mod func (i *internalFieldTrashServiceImpl) Move(ctx context.Context, id string) (*model.ResponseScheme, error) { if id == "" { - return nil, model.ErrNoFieldIDError + return nil, model.ErrNoFieldID } endpoint := fmt.Sprintf("rest/api/%v/field/%v/trash", i.version, id) @@ -128,7 +128,7 @@ func (i *internalFieldTrashServiceImpl) Move(ctx context.Context, id string) (*m func (i *internalFieldTrashServiceImpl) Restore(ctx context.Context, id string) (*model.ResponseScheme, error) { if id == "" { - return nil, model.ErrNoFieldIDError + return nil, model.ErrNoFieldID } endpoint := fmt.Sprintf("rest/api/%v/field/%v/restore", i.version, id) diff --git a/jira/internal/field_trash_impl_test.go b/jira/internal/field_trash_impl_test.go index cf05fc1e..e859075a 100644 --- a/jira/internal/field_trash_impl_test.go +++ b/jira/internal/field_trash_impl_test.go @@ -286,7 +286,7 @@ func Test_internalFieldTrashServiceImpl_Move(t *testing.T) { id: "", }, wantErr: true, - Err: model.ErrNoFieldIDError, + Err: model.ErrNoFieldID, }, { @@ -436,7 +436,7 @@ func Test_internalFieldTrashServiceImpl_Restore(t *testing.T) { id: "", }, wantErr: true, - Err: model.ErrNoFieldIDError, + Err: model.ErrNoFieldID, }, { diff --git a/jira/internal/filter_impl.go b/jira/internal/filter_impl.go index c5f0fdb6..254f7cd1 100644 --- a/jira/internal/filter_impl.go +++ b/jira/internal/filter_impl.go @@ -234,7 +234,7 @@ func (i *internalFilterServiceImpl) Search(ctx context.Context, options *model.F func (i *internalFilterServiceImpl) Get(ctx context.Context, filterID int, expand []string) (*model.FilterScheme, *model.ResponseScheme, error) { if filterID == 0 { - return nil, nil, model.ErrNoFilterIDError + return nil, nil, model.ErrNoFilterID } var endpoint strings.Builder @@ -266,7 +266,7 @@ func (i *internalFilterServiceImpl) Get(ctx context.Context, filterID int, expan func (i *internalFilterServiceImpl) Update(ctx context.Context, filterID int, payload *model.FilterPayloadScheme) (*model.FilterScheme, *model.ResponseScheme, error) { if filterID == 0 { - return nil, nil, model.ErrNoFilterIDError + return nil, nil, model.ErrNoFilterID } endpoint := fmt.Sprintf("rest/api/%v/filter/%v", i.version, filterID) @@ -288,7 +288,7 @@ func (i *internalFilterServiceImpl) Update(ctx context.Context, filterID int, pa func (i *internalFilterServiceImpl) Delete(ctx context.Context, filterID int) (*model.ResponseScheme, error) { if filterID == 0 { - return nil, model.ErrNoFilterIDError + return nil, model.ErrNoFilterID } endpoint := fmt.Sprintf("rest/api/%v/filter/%v", i.version, filterID) @@ -309,11 +309,11 @@ func (i *internalFilterServiceImpl) Delete(ctx context.Context, filterID int) (* func (i *internalFilterServiceImpl) Change(ctx context.Context, filterID int, accountID string) (*model.ResponseScheme, error) { if filterID == 0 { - return nil, model.ErrNoFilterIDError + return nil, model.ErrNoFilterID } if accountID == "" { - return nil, model.ErrNoAccountIDError + return nil, model.ErrNoAccountID } endpoint := fmt.Sprintf("rest/api/%v/filter/%v/owner", i.version, filterID) diff --git a/jira/internal/filter_impl_test.go b/jira/internal/filter_impl_test.go index dc88b911..5e28ae08 100644 --- a/jira/internal/filter_impl_test.go +++ b/jira/internal/filter_impl_test.go @@ -631,7 +631,7 @@ func TestFilterService_Get(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoFilterIDError, + Err: model.ErrNoFilterID, }, { name: "when the api version is v2", @@ -785,7 +785,7 @@ func TestFilterService_Update(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoFilterIDError, + Err: model.ErrNoFilterID, }, { name: "when the api version is v2", @@ -933,7 +933,7 @@ func TestFilterService_Delete(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoFilterIDError, + Err: model.ErrNoFilterID, }, { name: "when the api version is v2", @@ -1139,7 +1139,7 @@ func TestFilterService_Change(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoFilterIDError, + Err: model.ErrNoFilterID, }, { @@ -1151,7 +1151,7 @@ func TestFilterService_Change(t *testing.T) { accountID: "", }, wantErr: true, - Err: model.ErrNoAccountIDError, + Err: model.ErrNoAccountID, }, { diff --git a/jira/internal/filter_share_impl.go b/jira/internal/filter_share_impl.go index 2166195d..e4047e9f 100644 --- a/jira/internal/filter_share_impl.go +++ b/jira/internal/filter_share_impl.go @@ -134,7 +134,7 @@ func (i *internalFilterShareImpl) SetScope(ctx context.Context, scope string) (* func (i *internalFilterShareImpl) Gets(ctx context.Context, filterID int) ([]*model.SharePermissionScheme, *model.ResponseScheme, error) { if filterID == 0 { - return nil, nil, model.ErrNoFilterIDError + return nil, nil, model.ErrNoFilterID } endpoint := fmt.Sprintf("rest/api/%v/filter/%v/permission", i.version, filterID) @@ -156,7 +156,7 @@ func (i *internalFilterShareImpl) Gets(ctx context.Context, filterID int) ([]*mo func (i *internalFilterShareImpl) Add(ctx context.Context, filterID int, payload *model.PermissionFilterPayloadScheme) ([]*model.SharePermissionScheme, *model.ResponseScheme, error) { if filterID == 0 { - return nil, nil, model.ErrNoFilterIDError + return nil, nil, model.ErrNoFilterID } endpoint := fmt.Sprintf("rest/api/%v/filter/%v/permission", i.version, filterID) @@ -178,11 +178,11 @@ func (i *internalFilterShareImpl) Add(ctx context.Context, filterID int, payload func (i *internalFilterShareImpl) Get(ctx context.Context, filterID, permissionID int) (*model.SharePermissionScheme, *model.ResponseScheme, error) { if filterID == 0 { - return nil, nil, model.ErrNoFilterIDError + return nil, nil, model.ErrNoFilterID } if permissionID == 0 { - return nil, nil, model.ErrNoPermissionGrantIDError + return nil, nil, model.ErrNoPermissionGrantID } endpoint := fmt.Sprintf("rest/api/%v/filter/%v/permission/%v", i.version, filterID, permissionID) @@ -204,11 +204,11 @@ func (i *internalFilterShareImpl) Get(ctx context.Context, filterID, permissionI func (i *internalFilterShareImpl) Delete(ctx context.Context, filterID, permissionID int) (*model.ResponseScheme, error) { if filterID == 0 { - return nil, model.ErrNoFilterIDError + return nil, model.ErrNoFilterID } if permissionID == 0 { - return nil, model.ErrNoPermissionGrantIDError + return nil, model.ErrNoPermissionGrantID } endpoint := fmt.Sprintf("rest/api/%v/filter/%v/permission/%v", i.version, filterID, permissionID) diff --git a/jira/internal/filter_share_impl_test.go b/jira/internal/filter_share_impl_test.go index 7ec97178..eb1c60e7 100644 --- a/jira/internal/filter_share_impl_test.go +++ b/jira/internal/filter_share_impl_test.go @@ -358,7 +358,7 @@ func TestFilterShareService_Gets(t *testing.T) { fields.c = mocks.NewConnector(t) }, wantErr: true, - Err: model.ErrNoFilterIDError, + Err: model.ErrNoFilterID, }, { @@ -512,7 +512,7 @@ func TestFilterShareService_Add(t *testing.T) { fields.c = mocks.NewConnector(t) }, wantErr: true, - Err: model.ErrNoFilterIDError, + Err: model.ErrNoFilterID, }, { @@ -662,7 +662,7 @@ func TestFilterShareService_Get(t *testing.T) { fields.c = mocks.NewConnector(t) }, wantErr: true, - Err: model.ErrNoFilterIDError, + Err: model.ErrNoFilterID, }, { @@ -677,7 +677,7 @@ func TestFilterShareService_Get(t *testing.T) { fields.c = mocks.NewConnector(t) }, wantErr: true, - Err: model.ErrNoPermissionGrantIDError, + Err: model.ErrNoPermissionGrantID, }, { @@ -827,7 +827,7 @@ func TestFilterShareService_Delete(t *testing.T) { fields.c = mocks.NewConnector(t) }, wantErr: true, - Err: model.ErrNoFilterIDError, + Err: model.ErrNoFilterID, }, { @@ -842,7 +842,7 @@ func TestFilterShareService_Delete(t *testing.T) { fields.c = mocks.NewConnector(t) }, wantErr: true, - Err: model.ErrNoPermissionGrantIDError, + Err: model.ErrNoPermissionGrantID, }, { diff --git a/jira/internal/group_impl.go b/jira/internal/group_impl.go index 8e9856c7..3268e0b9 100644 --- a/jira/internal/group_impl.go +++ b/jira/internal/group_impl.go @@ -94,7 +94,7 @@ type internalGroupServiceImpl struct { func (i *internalGroupServiceImpl) Create(ctx context.Context, groupName string) (*model.GroupScheme, *model.ResponseScheme, error) { if groupName == "" { - return nil, nil, model.ErrNoGroupNameError + return nil, nil, model.ErrNoGroupName } endpoint := fmt.Sprintf("rest/api/%v/group", i.version) @@ -116,7 +116,7 @@ func (i *internalGroupServiceImpl) Create(ctx context.Context, groupName string) func (i *internalGroupServiceImpl) Delete(ctx context.Context, groupName string) (*model.ResponseScheme, error) { if groupName == "" { - return nil, model.ErrNoGroupNameError + return nil, model.ErrNoGroupName } params := url.Values{} @@ -168,7 +168,7 @@ func (i *internalGroupServiceImpl) Bulk(ctx context.Context, options *model.Grou func (i *internalGroupServiceImpl) Members(ctx context.Context, groupName string, inactive bool, startAt, maxResults int) (*model.GroupMemberPageScheme, *model.ResponseScheme, error) { if groupName == "" { - return nil, nil, model.ErrNoGroupNameError + return nil, nil, model.ErrNoGroupName } params := url.Values{} @@ -196,11 +196,11 @@ func (i *internalGroupServiceImpl) Members(ctx context.Context, groupName string func (i *internalGroupServiceImpl) Add(ctx context.Context, groupName, accountID string) (*model.GroupScheme, *model.ResponseScheme, error) { if groupName == "" { - return nil, nil, model.ErrNoGroupNameError + return nil, nil, model.ErrNoGroupName } if accountID == "" { - return nil, nil, model.ErrNoAccountIDError + return nil, nil, model.ErrNoAccountID } params := url.Values{} @@ -224,11 +224,11 @@ func (i *internalGroupServiceImpl) Add(ctx context.Context, groupName, accountID func (i *internalGroupServiceImpl) Remove(ctx context.Context, groupName, accountID string) (*model.ResponseScheme, error) { if groupName == "" { - return nil, model.ErrNoGroupNameError + return nil, model.ErrNoGroupName } if accountID == "" { - return nil, model.ErrNoAccountIDError + return nil, model.ErrNoAccountID } params := url.Values{} diff --git a/jira/internal/group_impl_test.go b/jira/internal/group_impl_test.go index f0012ddf..1483860a 100644 --- a/jira/internal/group_impl_test.go +++ b/jira/internal/group_impl_test.go @@ -100,7 +100,7 @@ func Test_internalGroupServiceImpl_Create(t *testing.T) { fields.c = mocks.NewConnector(t) }, wantErr: true, - Err: model.ErrNoGroupNameError, + Err: model.ErrNoGroupName, }, { @@ -246,7 +246,7 @@ func Test_internalGroupServiceImpl_Delete(t *testing.T) { fields.c = mocks.NewConnector(t) }, wantErr: true, - Err: model.ErrNoGroupNameError, + Err: model.ErrNoGroupName, }, { @@ -394,7 +394,7 @@ func Test_internalGroupServiceImpl_Remove(t *testing.T) { fields.c = mocks.NewConnector(t) }, wantErr: true, - Err: model.ErrNoGroupNameError, + Err: model.ErrNoGroupName, }, { @@ -409,7 +409,7 @@ func Test_internalGroupServiceImpl_Remove(t *testing.T) { fields.c = mocks.NewConnector(t) }, wantErr: true, - Err: model.ErrNoAccountIDError, + Err: model.ErrNoAccountID, }, { @@ -558,7 +558,7 @@ func Test_internalGroupServiceImpl_Add(t *testing.T) { fields.c = mocks.NewConnector(t) }, wantErr: true, - Err: model.ErrNoGroupNameError, + Err: model.ErrNoGroupName, }, { @@ -573,7 +573,7 @@ func Test_internalGroupServiceImpl_Add(t *testing.T) { fields.c = mocks.NewConnector(t) }, wantErr: true, - Err: model.ErrNoAccountIDError, + Err: model.ErrNoAccountID, }, { @@ -880,7 +880,7 @@ func Test_internalGroupServiceImpl_Members(t *testing.T) { fields.c = mocks.NewConnector(t) }, wantErr: true, - Err: model.ErrNoGroupNameError, + Err: model.ErrNoGroupName, }, { diff --git a/jira/internal/group_user_picker_impl.go b/jira/internal/group_user_picker_impl.go index 613f6abf..60e812c5 100644 --- a/jira/internal/group_user_picker_impl.go +++ b/jira/internal/group_user_picker_impl.go @@ -47,7 +47,7 @@ type internalGroupUserPickerServiceImpl struct { func (i internalGroupUserPickerServiceImpl) Find(ctx context.Context, options *model.GroupUserPickerFindOptionScheme) (*model.GroupUserPickerFindScheme, *model.ResponseScheme, error) { if options == nil || options.Query == "" { - return nil, nil, model.ErrNoQueryError + return nil, nil, model.ErrNoQuery } endpoint := fmt.Sprintf("rest/api/%v/groupuserpicker", i.version) diff --git a/jira/internal/group_user_picker_impl_test.go b/jira/internal/group_user_picker_impl_test.go index f70b57b9..baab2bd9 100644 --- a/jira/internal/group_user_picker_impl_test.go +++ b/jira/internal/group_user_picker_impl_test.go @@ -100,7 +100,7 @@ func Test_internalGroupUserPickerServiceImpl_Find(t *testing.T) { fields.c = mocks.NewConnector(t) }, wantErr: true, - Err: model.ErrNoQueryError, + Err: model.ErrNoQuery, }, { diff --git a/jira/internal/issue_impl.go b/jira/internal/issue_impl.go index b2533171..41140269 100644 --- a/jira/internal/issue_impl.go +++ b/jira/internal/issue_impl.go @@ -118,7 +118,7 @@ func NewIssueService(client service.Connector, version string, services *IssueSe func deleteIssue(ctx context.Context, client service.Connector, version, issueKeyOrID string, deleteSubTasks bool) (*model.ResponseScheme, error) { if issueKeyOrID == "" { - return nil, model.ErrNoIssueKeyOrIDError + return nil, model.ErrNoIssueKeyOrID } params := url.Values{} @@ -137,11 +137,11 @@ func deleteIssue(ctx context.Context, client service.Connector, version, issueKe func assignIssue(ctx context.Context, client service.Connector, version, issueKeyOrID, accountID string) (*model.ResponseScheme, error) { if issueKeyOrID == "" { - return nil, model.ErrNoIssueKeyOrIDError + return nil, model.ErrNoIssueKeyOrID } if accountID == "" { - return nil, model.ErrNoAccountIDError + return nil, model.ErrNoAccountID } endpoint := fmt.Sprintf("/rest/api/%v/issue/%v/assignee", version, issueKeyOrID) @@ -158,7 +158,7 @@ func sendNotification(ctx context.Context, client service.Connector, version, is *model.ResponseScheme, error) { if issueKeyOrID == "" { - return nil, model.ErrNoIssueKeyOrIDError + return nil, model.ErrNoIssueKeyOrID } endpoint := fmt.Sprintf("rest/api/%v/issue/%v/notify", version, issueKeyOrID) @@ -174,7 +174,7 @@ func sendNotification(ctx context.Context, client service.Connector, version, is func getTransitions(ctx context.Context, client service.Connector, version, issueKeyOrID string) (*model.IssueTransitionsScheme, *model.ResponseScheme, error) { if issueKeyOrID == "" { - return nil, nil, model.ErrNoIssueKeyOrIDError + return nil, nil, model.ErrNoIssueKeyOrID } endpoint := fmt.Sprintf("rest/api/%v/issue/%v/transitions", version, issueKeyOrID) diff --git a/jira/internal/issue_impl_adf.go b/jira/internal/issue_impl_adf.go index 0662c92e..a28bcbb8 100644 --- a/jira/internal/issue_impl_adf.go +++ b/jira/internal/issue_impl_adf.go @@ -217,7 +217,7 @@ func (i *internalIssueADFServiceImpl) Create(ctx context.Context, payload *model func (i *internalIssueADFServiceImpl) Creates(ctx context.Context, payload []*model.IssueBulkSchemeV3) (*model.IssueBulkResponseScheme, *model.ResponseScheme, error) { if len(payload) == 0 { - return nil, nil, model.ErrNoCreateIssuesError + return nil, nil, model.ErrNoCreateIssues } var issuePayloads []map[string]interface{} @@ -254,7 +254,7 @@ func (i *internalIssueADFServiceImpl) Creates(ctx context.Context, payload []*mo func (i *internalIssueADFServiceImpl) Get(ctx context.Context, issueKeyOrID string, fields, expand []string) (*model.IssueScheme, *model.ResponseScheme, error) { if issueKeyOrID == "" { - return nil, nil, model.ErrNoIssueKeyOrIDError + return nil, nil, model.ErrNoIssueKeyOrID } params := url.Values{} @@ -291,7 +291,7 @@ func (i *internalIssueADFServiceImpl) Get(ctx context.Context, issueKeyOrID stri func (i *internalIssueADFServiceImpl) Update(ctx context.Context, issueKeyOrID string, notify bool, payload *model.IssueScheme, customFields *model.CustomFields, operations *model.UpdateOperations) (*model.ResponseScheme, error) { if issueKeyOrID == "" { - return nil, model.ErrNoIssueKeyOrIDError + return nil, model.ErrNoIssueKeyOrID } params := url.Values{} @@ -362,11 +362,11 @@ func (i *internalIssueADFServiceImpl) Update(ctx context.Context, issueKeyOrID s func (i *internalIssueADFServiceImpl) Move(ctx context.Context, issueKeyOrID, transitionID string, options *model.IssueMoveOptionsV3) (*model.ResponseScheme, error) { if issueKeyOrID == "" { - return nil, model.ErrNoIssueKeyOrIDError + return nil, model.ErrNoIssueKeyOrID } if transitionID == "" { - return nil, model.ErrNoTransitionIDError + return nil, model.ErrNoTransitionID } payloadUpdated := make(map[string]interface{}) @@ -376,7 +376,7 @@ func (i *internalIssueADFServiceImpl) Move(ctx context.Context, issueKeyOrID, tr if options != nil { if options.Fields == nil { - return nil, model.ErrNoIssueSchemeError + return nil, model.ErrNoIssueScheme } withCustomFields := options.CustomFields != nil diff --git a/jira/internal/issue_impl_adf_test.go b/jira/internal/issue_impl_adf_test.go index 36b2f209..34b78eb1 100644 --- a/jira/internal/issue_impl_adf_test.go +++ b/jira/internal/issue_impl_adf_test.go @@ -75,7 +75,7 @@ func Test_internalIssueADFServiceImpl_Delete(t *testing.T) { fields.c = mocks.NewConnector(t) }, wantErr: true, - Err: model.ErrNoIssueKeyOrIDError, + Err: model.ErrNoIssueKeyOrID, }, { @@ -196,7 +196,7 @@ func Test_internalIssueADFServiceImpl_Assign(t *testing.T) { fields.c = mocks.NewConnector(t) }, wantErr: true, - Err: model.ErrNoIssueKeyOrIDError, + Err: model.ErrNoIssueKeyOrID, }, { @@ -211,7 +211,7 @@ func Test_internalIssueADFServiceImpl_Assign(t *testing.T) { fields.c = mocks.NewConnector(t) }, wantErr: true, - Err: model.ErrNoAccountIDError, + Err: model.ErrNoAccountID, }, { @@ -341,7 +341,7 @@ func Test_internalIssueADFServiceImpl_Notify(t *testing.T) { fields.c = mocks.NewConnector(t) }, wantErr: true, - Err: model.ErrNoIssueKeyOrIDError, + Err: model.ErrNoIssueKeyOrID, }, { @@ -460,7 +460,7 @@ func Test_internalIssueADFServiceImpl_Transitions(t *testing.T) { fields.c = mocks.NewConnector(t) }, wantErr: true, - Err: model.ErrNoIssueKeyOrIDError, + Err: model.ErrNoIssueKeyOrID, }, { @@ -805,7 +805,7 @@ func Test_internalIssueADFServiceImpl_Creates(t *testing.T) { fields.c = mocks.NewConnector(t) }, wantErr: true, - Err: model.ErrNoCreateIssuesError, + Err: model.ErrNoCreateIssues, }, { @@ -942,7 +942,7 @@ func Test_internalIssueADFServiceImpl_Get(t *testing.T) { fields.c = mocks.NewConnector(t) }, wantErr: true, - Err: model.ErrNoIssueKeyOrIDError, + Err: model.ErrNoIssueKeyOrID, }, { @@ -1139,7 +1139,7 @@ func Test_internalIssueADFServiceImpl_Move(t *testing.T) { }, }, wantErr: true, - Err: model.ErrNoIssueSchemeError, + Err: model.ErrNoIssueScheme, }, { @@ -1275,7 +1275,7 @@ func Test_internalIssueADFServiceImpl_Move(t *testing.T) { fields.c = mocks.NewConnector(t) }, wantErr: true, - Err: model.ErrNoIssueKeyOrIDError, + Err: model.ErrNoIssueKeyOrID, }, { @@ -1301,7 +1301,7 @@ func Test_internalIssueADFServiceImpl_Move(t *testing.T) { fields.c = mocks.NewConnector(t) }, wantErr: true, - Err: model.ErrNoTransitionIDError, + Err: model.ErrNoTransitionID, }, { @@ -1496,7 +1496,7 @@ func Test_internalIssueADFServiceImpl_Update(t *testing.T) { fields.c = mocks.NewConnector(t) }, wantErr: true, - Err: model.ErrNoIssueKeyOrIDError, + Err: model.ErrNoIssueKeyOrID, }, { diff --git a/jira/internal/issue_impl_rich_text.go b/jira/internal/issue_impl_rich_text.go index fc1b4ddd..5e57e874 100644 --- a/jira/internal/issue_impl_rich_text.go +++ b/jira/internal/issue_impl_rich_text.go @@ -217,7 +217,7 @@ func (i *internalRichTextServiceImpl) Create(ctx context.Context, payload *model func (i *internalRichTextServiceImpl) Creates(ctx context.Context, payload []*model.IssueBulkSchemeV2) (*model.IssueBulkResponseScheme, *model.ResponseScheme, error) { if len(payload) == 0 { - return nil, nil, model.ErrNoCreateIssuesError + return nil, nil, model.ErrNoCreateIssues } var issuePayloads []map[string]interface{} @@ -254,7 +254,7 @@ func (i *internalRichTextServiceImpl) Creates(ctx context.Context, payload []*mo func (i *internalRichTextServiceImpl) Get(ctx context.Context, issueKeyOrID string, fields, expand []string) (*model.IssueSchemeV2, *model.ResponseScheme, error) { if issueKeyOrID == "" { - return nil, nil, model.ErrNoIssueKeyOrIDError + return nil, nil, model.ErrNoIssueKeyOrID } params := url.Values{} @@ -291,7 +291,7 @@ func (i *internalRichTextServiceImpl) Get(ctx context.Context, issueKeyOrID stri func (i *internalRichTextServiceImpl) Update(ctx context.Context, issueKeyOrID string, notify bool, payload *model.IssueSchemeV2, customFields *model.CustomFields, operations *model.UpdateOperations) (*model.ResponseScheme, error) { if issueKeyOrID == "" { - return nil, model.ErrNoIssueKeyOrIDError + return nil, model.ErrNoIssueKeyOrID } params := url.Values{} @@ -362,11 +362,11 @@ func (i *internalRichTextServiceImpl) Update(ctx context.Context, issueKeyOrID s func (i *internalRichTextServiceImpl) Move(ctx context.Context, issueKeyOrID, transitionID string, options *model.IssueMoveOptionsV2) (*model.ResponseScheme, error) { if issueKeyOrID == "" { - return nil, model.ErrNoIssueKeyOrIDError + return nil, model.ErrNoIssueKeyOrID } if transitionID == "" { - return nil, model.ErrNoTransitionIDError + return nil, model.ErrNoTransitionID } payloadUpdated := make(map[string]interface{}) @@ -376,7 +376,7 @@ func (i *internalRichTextServiceImpl) Move(ctx context.Context, issueKeyOrID, tr if options != nil { if options.Fields == nil { - return nil, model.ErrNoIssueSchemeError + return nil, model.ErrNoIssueScheme } withCustomFields := options.CustomFields != nil diff --git a/jira/internal/issue_impl_rich_text_test.go b/jira/internal/issue_impl_rich_text_test.go index 64a0b7c5..480151a3 100644 --- a/jira/internal/issue_impl_rich_text_test.go +++ b/jira/internal/issue_impl_rich_text_test.go @@ -75,7 +75,7 @@ func Test_internalRichTextServiceImpl_Delete(t *testing.T) { fields.c = mocks.NewConnector(t) }, wantErr: true, - Err: model.ErrNoIssueKeyOrIDError, + Err: model.ErrNoIssueKeyOrID, }, { @@ -196,7 +196,7 @@ func Test_internalRichTextServiceImpl_Assign(t *testing.T) { fields.c = mocks.NewConnector(t) }, wantErr: true, - Err: model.ErrNoIssueKeyOrIDError, + Err: model.ErrNoIssueKeyOrID, }, { @@ -211,7 +211,7 @@ func Test_internalRichTextServiceImpl_Assign(t *testing.T) { fields.c = mocks.NewConnector(t) }, wantErr: true, - Err: model.ErrNoAccountIDError, + Err: model.ErrNoAccountID, }, { @@ -341,7 +341,7 @@ func Test_internalRichTextServiceImpl_Notify(t *testing.T) { fields.c = mocks.NewConnector(t) }, wantErr: true, - Err: model.ErrNoIssueKeyOrIDError, + Err: model.ErrNoIssueKeyOrID, }, { @@ -460,7 +460,7 @@ func Test_internalRichTextServiceImpl_Transitions(t *testing.T) { fields.c = mocks.NewConnector(t) }, wantErr: true, - Err: model.ErrNoIssueKeyOrIDError, + Err: model.ErrNoIssueKeyOrID, }, { @@ -805,7 +805,7 @@ func Test_internalRichTextServiceImpl_Creates(t *testing.T) { fields.c = mocks.NewConnector(t) }, wantErr: true, - Err: model.ErrNoCreateIssuesError, + Err: model.ErrNoCreateIssues, }, { @@ -942,7 +942,7 @@ func Test_internalRichTextServiceImpl_Get(t *testing.T) { fields.c = mocks.NewConnector(t) }, wantErr: true, - Err: model.ErrNoIssueKeyOrIDError, + Err: model.ErrNoIssueKeyOrID, }, { @@ -1138,7 +1138,7 @@ func Test_internalRichTextServiceImpl_Move(t *testing.T) { }, }, wantErr: true, - Err: model.ErrNoIssueSchemeError, + Err: model.ErrNoIssueScheme, }, { @@ -1274,7 +1274,7 @@ func Test_internalRichTextServiceImpl_Move(t *testing.T) { fields.c = mocks.NewConnector(t) }, wantErr: true, - Err: model.ErrNoIssueKeyOrIDError, + Err: model.ErrNoIssueKeyOrID, }, { @@ -1300,7 +1300,7 @@ func Test_internalRichTextServiceImpl_Move(t *testing.T) { fields.c = mocks.NewConnector(t) }, wantErr: true, - Err: model.ErrNoTransitionIDError, + Err: model.ErrNoTransitionID, }, { @@ -1495,7 +1495,7 @@ func Test_internalRichTextServiceImpl_Update(t *testing.T) { fields.c = mocks.NewConnector(t) }, wantErr: true, - Err: model.ErrNoIssueKeyOrIDError, + Err: model.ErrNoIssueKeyOrID, }, { diff --git a/jira/internal/issue_property_impl.go b/jira/internal/issue_property_impl.go index 7a3ebfc9..92092cce 100644 --- a/jira/internal/issue_property_impl.go +++ b/jira/internal/issue_property_impl.go @@ -108,7 +108,7 @@ type internalIssuePropertyImpl struct { func (i *internalIssuePropertyImpl) Gets(ctx context.Context, issueKeyOrID string) (*model.PropertyPageScheme, *model.ResponseScheme, error) { if issueKeyOrID == "" { - return nil, nil, model.ErrNoIssueKeyOrIDError + return nil, nil, model.ErrNoIssueKeyOrID } endpoint := fmt.Sprintf("rest/api/%v/issue/%v/properties", i.version, issueKeyOrID) @@ -131,11 +131,11 @@ func (i *internalIssuePropertyImpl) Gets(ctx context.Context, issueKeyOrID strin func (i *internalIssuePropertyImpl) Get(ctx context.Context, issueKey, propertyKey string) (*model.EntityPropertyScheme, *model.ResponseScheme, error) { if issueKey == "" { - return nil, nil, model.ErrNoIssueKeyOrIDError + return nil, nil, model.ErrNoIssueKeyOrID } if propertyKey == "" { - return nil, nil, model.ErrNoPropertyKeyError + return nil, nil, model.ErrNoPropertyKey } endpoint := fmt.Sprintf("rest/api/%v/issue/%v/properties/%v", i.version, issueKey, propertyKey) @@ -157,11 +157,11 @@ func (i *internalIssuePropertyImpl) Get(ctx context.Context, issueKey, propertyK func (i *internalIssuePropertyImpl) Set(ctx context.Context, issueKey, propertyKey string, payload interface{}) (*model.ResponseScheme, error) { if issueKey == "" { - return nil, model.ErrNoIssueKeyOrIDError + return nil, model.ErrNoIssueKeyOrID } if propertyKey == "" { - return nil, model.ErrNoPropertyKeyError + return nil, model.ErrNoPropertyKey } endpoint := fmt.Sprintf("rest/api/%v/issue/%v/properties/%v", i.version, issueKey, propertyKey) @@ -177,11 +177,11 @@ func (i *internalIssuePropertyImpl) Set(ctx context.Context, issueKey, propertyK func (i *internalIssuePropertyImpl) Delete(ctx context.Context, issueKey, propertyKey string) (*model.ResponseScheme, error) { if issueKey == "" { - return nil, model.ErrNoIssueKeyOrIDError + return nil, model.ErrNoIssueKeyOrID } if propertyKey == "" { - return nil, model.ErrNoPropertyKeyError + return nil, model.ErrNoPropertyKey } endpoint := fmt.Sprintf("rest/api/%v/issue/%v/properties/%v", i.version, issueKey, propertyKey) diff --git a/jira/internal/issue_property_impl_test.go b/jira/internal/issue_property_impl_test.go index 1615b1f5..2d0bf093 100644 --- a/jira/internal/issue_property_impl_test.go +++ b/jira/internal/issue_property_impl_test.go @@ -96,7 +96,7 @@ func Test_internalIssuePropertyImpl_Gets(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoIssueKeyOrIDError, + Err: model.ErrNoIssueKeyOrID, }, { @@ -243,7 +243,7 @@ func Test_internalIssuePropertyImpl_Get(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoIssueKeyOrIDError, + Err: model.ErrNoIssueKeyOrID, }, { @@ -254,7 +254,7 @@ func Test_internalIssuePropertyImpl_Get(t *testing.T) { issueKeyOrID: "DUMMY-1", }, wantErr: true, - Err: model.ErrNoPropertyKeyError, + Err: model.ErrNoPropertyKey, }, { @@ -410,7 +410,7 @@ func Test_internalIssuePropertyImpl_Set(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoIssueKeyOrIDError, + Err: model.ErrNoIssueKeyOrID, }, { @@ -421,7 +421,7 @@ func Test_internalIssuePropertyImpl_Set(t *testing.T) { issueKeyOrID: "DUMMY-1", }, wantErr: true, - Err: model.ErrNoPropertyKeyError, + Err: model.ErrNoPropertyKey, }, { @@ -570,7 +570,7 @@ func Test_internalIssuePropertyImpl_Delete(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoIssueKeyOrIDError, + Err: model.ErrNoIssueKeyOrID, }, { @@ -581,7 +581,7 @@ func Test_internalIssuePropertyImpl_Delete(t *testing.T) { issueKeyOrID: "DUMMY-1", }, wantErr: true, - Err: model.ErrNoPropertyKeyError, + Err: model.ErrNoPropertyKey, }, { diff --git a/jira/internal/link_impl_adf.go b/jira/internal/link_impl_adf.go index e7b246ea..10e3c737 100644 --- a/jira/internal/link_impl_adf.go +++ b/jira/internal/link_impl_adf.go @@ -60,7 +60,7 @@ func (l *LinkADFService) Create(ctx context.Context, payload *model.LinkPayloadS func (i *internalLinkADFServiceImpl) Get(ctx context.Context, linkID string) (*model.IssueLinkScheme, *model.ResponseScheme, error) { if linkID == "" { - return nil, nil, model.ErrNoTypeIDError + return nil, nil, model.ErrNoTypeID } endpoint := fmt.Sprintf("rest/api/%v/issueLink/%v", i.version, linkID) @@ -82,7 +82,7 @@ func (i *internalLinkADFServiceImpl) Get(ctx context.Context, linkID string) (*m func (i *internalLinkADFServiceImpl) Gets(ctx context.Context, issueKeyOrID string) (*model.IssueLinkPageScheme, *model.ResponseScheme, error) { if len(issueKeyOrID) == 0 { - return nil, nil, model.ErrNoIssueKeyOrIDError + return nil, nil, model.ErrNoIssueKeyOrID } endpoint := fmt.Sprintf("rest/api/%v/issue/%v?fields=issuelinks", i.version, issueKeyOrID) @@ -104,7 +104,7 @@ func (i *internalLinkADFServiceImpl) Gets(ctx context.Context, issueKeyOrID stri func (i *internalLinkADFServiceImpl) Delete(ctx context.Context, linkID string) (*model.ResponseScheme, error) { if linkID == "" { - return nil, model.ErrNoTypeIDError + return nil, model.ErrNoTypeID } endpoint := fmt.Sprintf("rest/api/%v/issueLink/%v", i.version, linkID) diff --git a/jira/internal/link_impl_adf_test.go b/jira/internal/link_impl_adf_test.go index 6ccb2802..960135b2 100644 --- a/jira/internal/link_impl_adf_test.go +++ b/jira/internal/link_impl_adf_test.go @@ -126,7 +126,7 @@ func Test_internalLinkADFServiceImpl_Get(t *testing.T) { linkID: "", }, wantErr: true, - Err: model.ErrNoTypeIDError, + Err: model.ErrNoTypeID, }, } @@ -249,7 +249,7 @@ func Test_internalLinkADFServiceImpl_Gets(t *testing.T) { issueKeyOrID: "", }, wantErr: true, - Err: model.ErrNoIssueKeyOrIDError, + Err: model.ErrNoIssueKeyOrID, }, { @@ -422,7 +422,7 @@ func Test_internalLinkADFServiceImpl_Delete(t *testing.T) { linkID: "", }, wantErr: true, - Err: model.ErrNoTypeIDError, + Err: model.ErrNoTypeID, }, } diff --git a/jira/internal/link_impl_rich_text.go b/jira/internal/link_impl_rich_text.go index 460e8f69..fa78bb6a 100644 --- a/jira/internal/link_impl_rich_text.go +++ b/jira/internal/link_impl_rich_text.go @@ -64,7 +64,7 @@ func (l *LinkRichTextService) Create(ctx context.Context, payload *model.LinkPay func (i *internalLinkRichTextServiceImpl) Get(ctx context.Context, linkID string) (*model.IssueLinkScheme, *model.ResponseScheme, error) { if linkID == "" { - return nil, nil, model.ErrNoTypeIDError + return nil, nil, model.ErrNoTypeID } endpoint := fmt.Sprintf("rest/api/%v/issueLink/%v", i.version, linkID) @@ -86,7 +86,7 @@ func (i *internalLinkRichTextServiceImpl) Get(ctx context.Context, linkID string func (i *internalLinkRichTextServiceImpl) Gets(ctx context.Context, issueKeyOrID string) (*model.IssueLinkPageScheme, *model.ResponseScheme, error) { if len(issueKeyOrID) == 0 { - return nil, nil, model.ErrNoIssueKeyOrIDError + return nil, nil, model.ErrNoIssueKeyOrID } endpoint := fmt.Sprintf("rest/api/%v/issue/%v?fields=issuelinks", i.version, issueKeyOrID) @@ -108,7 +108,7 @@ func (i *internalLinkRichTextServiceImpl) Gets(ctx context.Context, issueKeyOrID func (i *internalLinkRichTextServiceImpl) Delete(ctx context.Context, linkID string) (*model.ResponseScheme, error) { if linkID == "" { - return nil, model.ErrNoTypeIDError + return nil, model.ErrNoTypeID } endpoint := fmt.Sprintf("rest/api/%v/issueLink/%v", i.version, linkID) diff --git a/jira/internal/link_impl_rich_text_test.go b/jira/internal/link_impl_rich_text_test.go index a4326f1f..6ac900d7 100644 --- a/jira/internal/link_impl_rich_text_test.go +++ b/jira/internal/link_impl_rich_text_test.go @@ -126,7 +126,7 @@ func Test_internalLinkRichTextServiceImpl_Get(t *testing.T) { linkId: "", }, wantErr: true, - Err: model.ErrNoTypeIDError, + Err: model.ErrNoTypeID, }, } @@ -249,7 +249,7 @@ func Test_internalLinkRichTextServiceImpl_Gets(t *testing.T) { issueKeyOrID: "", }, wantErr: true, - Err: model.ErrNoIssueKeyOrIDError, + Err: model.ErrNoIssueKeyOrID, }, { @@ -422,7 +422,7 @@ func Test_internalLinkRichTextServiceImpl_Delete(t *testing.T) { linkId: "", }, wantErr: true, - Err: model.ErrNoTypeIDError, + Err: model.ErrNoTypeID, }, } diff --git a/jira/internal/link_type_impl.go b/jira/internal/link_type_impl.go index a5fc5159..eea8dc0c 100644 --- a/jira/internal/link_type_impl.go +++ b/jira/internal/link_type_impl.go @@ -103,7 +103,7 @@ func (i *internalLinkTypeImpl) Gets(ctx context.Context) (*model.IssueLinkTypeSe func (i *internalLinkTypeImpl) Get(ctx context.Context, issueLinkTypeID string) (*model.LinkTypeScheme, *model.ResponseScheme, error) { if issueLinkTypeID == "" { - return nil, nil, model.ErrNoLinkTypeIDError + return nil, nil, model.ErrNoLinkTypeID } endpoint := fmt.Sprintf("rest/api/%v/issueLinkType/%v", i.version, issueLinkTypeID) @@ -143,7 +143,7 @@ func (i *internalLinkTypeImpl) Create(ctx context.Context, payload *model.LinkTy func (i *internalLinkTypeImpl) Update(ctx context.Context, issueLinkTypeID string, payload *model.LinkTypeScheme) (*model.LinkTypeScheme, *model.ResponseScheme, error) { if issueLinkTypeID == "" { - return nil, nil, model.ErrNoLinkTypeIDError + return nil, nil, model.ErrNoLinkTypeID } endpoint := fmt.Sprintf("rest/api/%v/issueLinkType/%v", i.version, issueLinkTypeID) @@ -165,7 +165,7 @@ func (i *internalLinkTypeImpl) Update(ctx context.Context, issueLinkTypeID strin func (i *internalLinkTypeImpl) Delete(ctx context.Context, issueLinkTypeID string) (*model.ResponseScheme, error) { if issueLinkTypeID == "" { - return nil, model.ErrNoLinkTypeIDError + return nil, model.ErrNoLinkTypeID } endpoint := fmt.Sprintf("rest/api/%v/issueLinkType/%v", i.version, issueLinkTypeID) diff --git a/jira/internal/link_type_impl_test.go b/jira/internal/link_type_impl_test.go index c9219f9f..42fb2940 100644 --- a/jira/internal/link_type_impl_test.go +++ b/jira/internal/link_type_impl_test.go @@ -234,7 +234,7 @@ func Test_internalLinkTypeImpl_Get(t *testing.T) { issueLinkTypeID: "", }, wantErr: true, - Err: model.ErrNoLinkTypeIDError, + Err: model.ErrNoLinkTypeID, }, { @@ -329,7 +329,7 @@ func Test_internalLinkTypeImpl_Update(t *testing.T) { issueLinkTypeID: "", }, wantErr: true, - Err: model.ErrNoLinkTypeIDError, + Err: model.ErrNoLinkTypeID, }, { name: "when the api version is v3", @@ -682,7 +682,7 @@ func Test_internalLinkTypeImpl_Delete(t *testing.T) { issueLinkTypeID: "", }, wantErr: true, - Err: model.ErrNoLinkTypeIDError, + Err: model.ErrNoLinkTypeID, }, { diff --git a/jira/internal/metadata_impl.go b/jira/internal/metadata_impl.go index 790e386d..b43622a9 100644 --- a/jira/internal/metadata_impl.go +++ b/jira/internal/metadata_impl.go @@ -61,7 +61,7 @@ type internalMetadataImpl struct { func (i *internalMetadataImpl) Get(ctx context.Context, issueKeyOrID string, overrideScreenSecurity, overrideEditableFlag bool) (gjson.Result, *model.ResponseScheme, error) { if issueKeyOrID == "" { - return gjson.Result{}, nil, model.ErrNoIssueKeyOrIDError + return gjson.Result{}, nil, model.ErrNoIssueKeyOrID } params := url.Values{} diff --git a/jira/internal/metadata_impl_test.go b/jira/internal/metadata_impl_test.go index 8edd529d..b4bd3fc7 100644 --- a/jira/internal/metadata_impl_test.go +++ b/jira/internal/metadata_impl_test.go @@ -112,7 +112,7 @@ func Test_internalMetadataImpl_Get(t *testing.T) { }, want: gjson.Result{}, wantErr: true, - Err: model.ErrNoIssueKeyOrIDError, + Err: model.ErrNoIssueKeyOrID, }, { diff --git a/jira/internal/notification_scheme_impl.go b/jira/internal/notification_scheme_impl.go index ce4b130e..56463afc 100644 --- a/jira/internal/notification_scheme_impl.go +++ b/jira/internal/notification_scheme_impl.go @@ -211,7 +211,7 @@ func (i *internalNotificationSchemeImpl) Projects(ctx context.Context, schemeIDs func (i *internalNotificationSchemeImpl) Get(ctx context.Context, schemeID string, expand []string) (*model.NotificationSchemeScheme, *model.ResponseScheme, error) { if schemeID == "" { - return nil, nil, model.ErrNoNotificationSchemeIDError + return nil, nil, model.ErrNoNotificationSchemeID } var endpoint strings.Builder @@ -242,7 +242,7 @@ func (i *internalNotificationSchemeImpl) Get(ctx context.Context, schemeID strin func (i *internalNotificationSchemeImpl) Update(ctx context.Context, schemeID string, payload *model.NotificationSchemePayloadScheme) (*model.ResponseScheme, error) { if schemeID == "" { - return nil, model.ErrNoNotificationSchemeIDError + return nil, model.ErrNoNotificationSchemeID } endpoint := fmt.Sprintf("rest/api/%v/notificationscheme/%v", i.version, schemeID) @@ -258,7 +258,7 @@ func (i *internalNotificationSchemeImpl) Update(ctx context.Context, schemeID st func (i *internalNotificationSchemeImpl) Append(ctx context.Context, schemeID string, payload *model.NotificationSchemeEventsPayloadScheme) (*model.ResponseScheme, error) { if schemeID == "" { - return nil, model.ErrNoNotificationSchemeIDError + return nil, model.ErrNoNotificationSchemeID } endpoint := fmt.Sprintf("rest/api/%v/notificationscheme/%v/notification", i.version, schemeID) @@ -274,7 +274,7 @@ func (i *internalNotificationSchemeImpl) Append(ctx context.Context, schemeID st func (i *internalNotificationSchemeImpl) Delete(ctx context.Context, schemeID string) (*model.ResponseScheme, error) { if schemeID == "" { - return nil, model.ErrNoNotificationSchemeIDError + return nil, model.ErrNoNotificationSchemeID } endpoint := fmt.Sprintf("rest/api/%v/notificationscheme/%v", i.version, schemeID) @@ -290,11 +290,11 @@ func (i *internalNotificationSchemeImpl) Delete(ctx context.Context, schemeID st func (i *internalNotificationSchemeImpl) Remove(ctx context.Context, schemeID, notificationID string) (*model.ResponseScheme, error) { if schemeID == "" { - return nil, model.ErrNoNotificationSchemeIDError + return nil, model.ErrNoNotificationSchemeID } if notificationID == "" { - return nil, model.ErrNoNotificationIDError + return nil, model.ErrNoNotificationID } endpoint := fmt.Sprintf("rest/api/%v/notificationscheme/%v/notification/%v", i.version, schemeID, notificationID) diff --git a/jira/internal/notification_scheme_impl_test.go b/jira/internal/notification_scheme_impl_test.go index c4866f2a..ec81487c 100644 --- a/jira/internal/notification_scheme_impl_test.go +++ b/jira/internal/notification_scheme_impl_test.go @@ -402,7 +402,7 @@ func Test_internalNotificationSchemeImpl_Get(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoNotificationSchemeIDError, + Err: model.ErrNoNotificationSchemeID, }, { @@ -555,7 +555,7 @@ func Test_internalNotificationSchemeImpl_Update(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoNotificationSchemeIDError, + Err: model.ErrNoNotificationSchemeID, }, { @@ -718,7 +718,7 @@ func Test_internalNotificationSchemeImpl_Append(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoNotificationSchemeIDError, + Err: model.ErrNoNotificationSchemeID, }, { @@ -865,7 +865,7 @@ func Test_internalNotificationSchemeImpl_Remove(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoNotificationSchemeIDError, + Err: model.ErrNoNotificationSchemeID, }, { @@ -876,7 +876,7 @@ func Test_internalNotificationSchemeImpl_Remove(t *testing.T) { schemeID: "10001", }, wantErr: true, - Err: model.ErrNoNotificationIDError, + Err: model.ErrNoNotificationID, }, { @@ -1020,7 +1020,7 @@ func Test_internalNotificationSchemeImpl_Delete(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoNotificationSchemeIDError, + Err: model.ErrNoNotificationSchemeID, }, { diff --git a/jira/internal/permission_impl.go b/jira/internal/permission_impl.go index d5fc2ee1..ee9b06db 100644 --- a/jira/internal/permission_impl.go +++ b/jira/internal/permission_impl.go @@ -121,7 +121,7 @@ func (i *internalPermissionImpl) Check(ctx context.Context, payload *model.Permi func (i *internalPermissionImpl) Projects(ctx context.Context, permissions []string) (*model.PermittedProjectsScheme, *model.ResponseScheme, error) { if len(permissions) == 0 { - return nil, nil, model.ErrNoPermissionKeysError + return nil, nil, model.ErrNoPermissionKeys } endpoint := fmt.Sprintf("rest/api/%v/permissions/project", i.version) diff --git a/jira/internal/permission_impl_test.go b/jira/internal/permission_impl_test.go index eee3e103..880b7b62 100644 --- a/jira/internal/permission_impl_test.go +++ b/jira/internal/permission_impl_test.go @@ -465,7 +465,7 @@ func Test_internalPermissionImpl_Projects(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoPermissionKeysError, + Err: model.ErrNoPermissionKeys, }, } diff --git a/jira/internal/permission_scheme_grant_impl.go b/jira/internal/permission_scheme_grant_impl.go index adc802b5..f92dd4e3 100644 --- a/jira/internal/permission_scheme_grant_impl.go +++ b/jira/internal/permission_scheme_grant_impl.go @@ -74,7 +74,7 @@ type internalPermissionSchemeGrantImpl struct { func (i *internalPermissionSchemeGrantImpl) Create(ctx context.Context, permissionSchemeID int, payload *model.PermissionGrantPayloadScheme) (*model.PermissionGrantScheme, *model.ResponseScheme, error) { if permissionSchemeID == 0 { - return nil, nil, model.ErrNoPermissionSchemeIDError + return nil, nil, model.ErrNoPermissionSchemeID } endpoint := fmt.Sprintf("rest/api/%v/permissionscheme/%v/permission", i.version, permissionSchemeID) @@ -96,7 +96,7 @@ func (i *internalPermissionSchemeGrantImpl) Create(ctx context.Context, permissi func (i *internalPermissionSchemeGrantImpl) Gets(ctx context.Context, permissionSchemeID int, expand []string) (*model.PermissionSchemeGrantsScheme, *model.ResponseScheme, error) { if permissionSchemeID == 0 { - return nil, nil, model.ErrNoPermissionSchemeIDError + return nil, nil, model.ErrNoPermissionSchemeID } var endpoint strings.Builder @@ -127,11 +127,11 @@ func (i *internalPermissionSchemeGrantImpl) Gets(ctx context.Context, permission func (i *internalPermissionSchemeGrantImpl) Get(ctx context.Context, permissionSchemeID, permissionGrantID int, expand []string) (*model.PermissionGrantScheme, *model.ResponseScheme, error) { if permissionSchemeID == 0 { - return nil, nil, model.ErrNoPermissionSchemeIDError + return nil, nil, model.ErrNoPermissionSchemeID } if permissionGrantID == 0 { - return nil, nil, model.ErrNoPermissionGrantIDError + return nil, nil, model.ErrNoPermissionGrantID } var endpoint strings.Builder @@ -162,11 +162,11 @@ func (i *internalPermissionSchemeGrantImpl) Get(ctx context.Context, permissionS func (i *internalPermissionSchemeGrantImpl) Delete(ctx context.Context, permissionSchemeID, permissionGrantID int) (*model.ResponseScheme, error) { if permissionSchemeID == 0 { - return nil, model.ErrNoPermissionSchemeIDError + return nil, model.ErrNoPermissionSchemeID } if permissionGrantID == 0 { - return nil, model.ErrNoPermissionGrantIDError + return nil, model.ErrNoPermissionGrantID } endpoint := fmt.Sprintf("rest/api/%v/permissionscheme/%v/permission/%v", i.version, permissionSchemeID, permissionGrantID) diff --git a/jira/internal/permission_scheme_grant_impl_test.go b/jira/internal/permission_scheme_grant_impl_test.go index 605a4eb6..1a4ab909 100644 --- a/jira/internal/permission_scheme_grant_impl_test.go +++ b/jira/internal/permission_scheme_grant_impl_test.go @@ -109,7 +109,7 @@ func TestPermissionSchemeGrantService_Create(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoPermissionSchemeIDError, + Err: model.ErrNoPermissionSchemeID, }, { @@ -257,7 +257,7 @@ func TestPermissionSchemeGrantService_Gets(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoPermissionSchemeIDError, + Err: model.ErrNoPermissionSchemeID, }, { @@ -408,7 +408,7 @@ func TestPermissionSchemeGrantService_Get(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoPermissionSchemeIDError, + Err: model.ErrNoPermissionSchemeID, }, { @@ -419,7 +419,7 @@ func TestPermissionSchemeGrantService_Get(t *testing.T) { permissionSchemeID: 10001, }, wantErr: true, - Err: model.ErrNoPermissionGrantIDError, + Err: model.ErrNoPermissionGrantID, }, { @@ -569,7 +569,7 @@ func TestPermissionSchemeGrantService_Delete(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoPermissionSchemeIDError, + Err: model.ErrNoPermissionSchemeID, }, { @@ -580,7 +580,7 @@ func TestPermissionSchemeGrantService_Delete(t *testing.T) { permissionSchemeID: 10001, }, wantErr: true, - Err: model.ErrNoPermissionGrantIDError, + Err: model.ErrNoPermissionGrantID, }, { diff --git a/jira/internal/permission_scheme_impl.go b/jira/internal/permission_scheme_impl.go index 6af7cc83..c80d00dc 100644 --- a/jira/internal/permission_scheme_impl.go +++ b/jira/internal/permission_scheme_impl.go @@ -113,7 +113,7 @@ func (i *internalPermissionSchemeImpl) Gets(ctx context.Context) (*model.Permiss func (i *internalPermissionSchemeImpl) Get(ctx context.Context, permissionSchemeID int, expand []string) (*model.PermissionSchemeScheme, *model.ResponseScheme, error) { if permissionSchemeID == 0 { - return nil, nil, model.ErrNoPermissionSchemeIDError + return nil, nil, model.ErrNoPermissionSchemeID } var endpoint strings.Builder @@ -144,7 +144,7 @@ func (i *internalPermissionSchemeImpl) Get(ctx context.Context, permissionScheme func (i *internalPermissionSchemeImpl) Delete(ctx context.Context, permissionSchemeID int) (*model.ResponseScheme, error) { if permissionSchemeID == 0 { - return nil, model.ErrNoPermissionSchemeIDError + return nil, model.ErrNoPermissionSchemeID } endpoint := fmt.Sprintf("rest/api/%v/permissionscheme/%v", i.version, permissionSchemeID) @@ -178,7 +178,7 @@ func (i *internalPermissionSchemeImpl) Create(ctx context.Context, payload *mode func (i *internalPermissionSchemeImpl) Update(ctx context.Context, permissionSchemeID int, payload *model.PermissionSchemeScheme) (*model.PermissionSchemeScheme, *model.ResponseScheme, error) { if permissionSchemeID == 0 { - return nil, nil, model.ErrNoPermissionSchemeIDError + return nil, nil, model.ErrNoPermissionSchemeID } endpoint := fmt.Sprintf("rest/api/%v/permissionscheme/%v", i.version, permissionSchemeID) diff --git a/jira/internal/permission_scheme_impl_test.go b/jira/internal/permission_scheme_impl_test.go index f53afb85..e8b47e9e 100644 --- a/jira/internal/permission_scheme_impl_test.go +++ b/jira/internal/permission_scheme_impl_test.go @@ -231,7 +231,7 @@ func TestPermissionSchemeService_Get(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoPermissionSchemeIDError, + Err: model.ErrNoPermissionSchemeID, }, { @@ -376,7 +376,7 @@ func TestPermissionSchemeService_Delete(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoPermissionSchemeIDError, + Err: model.ErrNoPermissionSchemeID, }, { diff --git a/jira/internal/priority_impl.go b/jira/internal/priority_impl.go index 89cb89c7..941527db 100644 --- a/jira/internal/priority_impl.go +++ b/jira/internal/priority_impl.go @@ -72,7 +72,7 @@ func (i *internalPriorityImpl) Gets(ctx context.Context) ([]*model.PrioritySchem func (i *internalPriorityImpl) Get(ctx context.Context, priorityID string) (*model.PriorityScheme, *model.ResponseScheme, error) { if priorityID == "" { - return nil, nil, model.ErrNoPriorityIDError + return nil, nil, model.ErrNoPriorityID } endpoint := fmt.Sprintf("rest/api/%v/priority/%v", i.version, priorityID) diff --git a/jira/internal/priority_impl_test.go b/jira/internal/priority_impl_test.go index 24278ca1..c237bc76 100644 --- a/jira/internal/priority_impl_test.go +++ b/jira/internal/priority_impl_test.go @@ -229,7 +229,7 @@ func Test_internalPriorityImpl_Get(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoPriorityIDError, + Err: model.ErrNoPriorityID, }, { diff --git a/jira/internal/project_category_impl.go b/jira/internal/project_category_impl.go index 94ee9a39..41383a66 100644 --- a/jira/internal/project_category_impl.go +++ b/jira/internal/project_category_impl.go @@ -99,7 +99,7 @@ func (i *internalProjectCategoryImpl) Gets(ctx context.Context) ([]*model.Projec func (i *internalProjectCategoryImpl) Get(ctx context.Context, categoryID int) (*model.ProjectCategoryScheme, *model.ResponseScheme, error) { if categoryID == 0 { - return nil, nil, model.ErrNoProjectCategoryIDError + return nil, nil, model.ErrNoProjectCategoryID } endpoint := fmt.Sprintf("rest/api/%v/projectCategory/%v", i.version, categoryID) @@ -139,7 +139,7 @@ func (i *internalProjectCategoryImpl) Create(ctx context.Context, payload *model func (i *internalProjectCategoryImpl) Update(ctx context.Context, categoryID int, payload *model.ProjectCategoryPayloadScheme) (*model.ProjectCategoryScheme, *model.ResponseScheme, error) { if categoryID == 0 { - return nil, nil, model.ErrNoProjectCategoryIDError + return nil, nil, model.ErrNoProjectCategoryID } endpoint := fmt.Sprintf("rest/api/%v/projectCategory/%v", i.version, categoryID) @@ -161,7 +161,7 @@ func (i *internalProjectCategoryImpl) Update(ctx context.Context, categoryID int func (i *internalProjectCategoryImpl) Delete(ctx context.Context, categoryID int) (*model.ResponseScheme, error) { if categoryID == 0 { - return nil, model.ErrNoProjectCategoryIDError + return nil, model.ErrNoProjectCategoryID } endpoint := fmt.Sprintf("rest/api/%v/projectCategory/%v", i.version, categoryID) diff --git a/jira/internal/project_category_impl_test.go b/jira/internal/project_category_impl_test.go index 9ce0307a..721569c8 100644 --- a/jira/internal/project_category_impl_test.go +++ b/jira/internal/project_category_impl_test.go @@ -227,7 +227,7 @@ func Test_internalProjectCategoryImpl_Get(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoProjectCategoryIDError, + Err: model.ErrNoProjectCategoryID, }, { @@ -518,7 +518,7 @@ func Test_internalProjectCategoryImpl_Update(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoProjectCategoryIDError, + Err: model.ErrNoProjectCategoryID, }, { @@ -663,7 +663,7 @@ func Test_internalProjectCategoryImpl_Delete(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoProjectCategoryIDError, + Err: model.ErrNoProjectCategoryID, }, { diff --git a/jira/internal/project_component_impl.go b/jira/internal/project_component_impl.go index aeb81af3..674267a3 100644 --- a/jira/internal/project_component_impl.go +++ b/jira/internal/project_component_impl.go @@ -110,7 +110,7 @@ func (i *internalProjectComponentImpl) Create(ctx context.Context, payload *mode func (i *internalProjectComponentImpl) Gets(ctx context.Context, projectKeyOrID string) ([]*model.ComponentScheme, *model.ResponseScheme, error) { if projectKeyOrID == "" { - return nil, nil, model.ErrNoProjectIDOrKeyError + return nil, nil, model.ErrNoProjectIDOrKey } endpoint := fmt.Sprintf("rest/api/%v/project/%v/components", i.version, projectKeyOrID) @@ -132,7 +132,7 @@ func (i *internalProjectComponentImpl) Gets(ctx context.Context, projectKeyOrID func (i *internalProjectComponentImpl) Count(ctx context.Context, componentID string) (*model.ComponentCountScheme, *model.ResponseScheme, error) { if componentID == "" { - return nil, nil, model.ErrNoComponentIDError + return nil, nil, model.ErrNoComponentID } endpoint := fmt.Sprintf("rest/api/%v/component/%v/relatedIssueCounts", i.version, componentID) @@ -154,7 +154,7 @@ func (i *internalProjectComponentImpl) Count(ctx context.Context, componentID st func (i *internalProjectComponentImpl) Delete(ctx context.Context, componentID string) (*model.ResponseScheme, error) { if componentID == "" { - return nil, model.ErrNoComponentIDError + return nil, model.ErrNoComponentID } endpoint := fmt.Sprintf("rest/api/%v/component/%v", i.version, componentID) @@ -170,7 +170,7 @@ func (i *internalProjectComponentImpl) Delete(ctx context.Context, componentID s func (i *internalProjectComponentImpl) Update(ctx context.Context, componentID string, payload *model.ComponentPayloadScheme) (*model.ComponentScheme, *model.ResponseScheme, error) { if componentID == "" { - return nil, nil, model.ErrNoComponentIDError + return nil, nil, model.ErrNoComponentID } endpoint := fmt.Sprintf("rest/api/%v/component/%v", i.version, componentID) @@ -192,7 +192,7 @@ func (i *internalProjectComponentImpl) Update(ctx context.Context, componentID s func (i *internalProjectComponentImpl) Get(ctx context.Context, componentID string) (*model.ComponentScheme, *model.ResponseScheme, error) { if componentID == "" { - return nil, nil, model.ErrNoComponentIDError + return nil, nil, model.ErrNoComponentID } endpoint := fmt.Sprintf("rest/api/%v/component/%v", i.version, componentID) diff --git a/jira/internal/project_component_impl_test.go b/jira/internal/project_component_impl_test.go index 231a7a11..7802bb2c 100644 --- a/jira/internal/project_component_impl_test.go +++ b/jira/internal/project_component_impl_test.go @@ -254,7 +254,7 @@ func Test_internalProjectComponentImpl_Update(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoComponentIDError, + Err: model.ErrNoComponentID, }, { @@ -399,7 +399,7 @@ func Test_internalProjectComponentImpl_Gets(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoProjectIDOrKeyError, + Err: model.ErrNoProjectIDOrKey, }, { @@ -543,7 +543,7 @@ func Test_internalProjectComponentImpl_Count(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoComponentIDError, + Err: model.ErrNoComponentID, }, { @@ -687,7 +687,7 @@ func Test_internalProjectComponentImpl_Get(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoComponentIDError, + Err: model.ErrNoComponentID, }, { @@ -831,7 +831,7 @@ func Test_internalProjectComponentImpl_Delete(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoComponentIDError, + Err: model.ErrNoComponentID, }, { diff --git a/jira/internal/project_feature_impl.go b/jira/internal/project_feature_impl.go index 37ff5b33..b2ca5bea 100644 --- a/jira/internal/project_feature_impl.go +++ b/jira/internal/project_feature_impl.go @@ -54,7 +54,7 @@ type internalProjectFeatureImpl struct { func (i *internalProjectFeatureImpl) Gets(ctx context.Context, projectKeyOrID string) (*model.ProjectFeaturesScheme, *model.ResponseScheme, error) { if projectKeyOrID == "" { - return nil, nil, model.ErrNoProjectIDOrKeyError + return nil, nil, model.ErrNoProjectIDOrKey } endpoint := fmt.Sprintf("rest/api/%v/project/%v/features", i.version, projectKeyOrID) @@ -76,15 +76,15 @@ func (i *internalProjectFeatureImpl) Gets(ctx context.Context, projectKeyOrID st func (i *internalProjectFeatureImpl) Set(ctx context.Context, projectKeyOrID, featureKey, state string) (*model.ProjectFeaturesScheme, *model.ResponseScheme, error) { if projectKeyOrID == "" { - return nil, nil, model.ErrNoProjectIDOrKeyError + return nil, nil, model.ErrNoProjectIDOrKey } if featureKey == "" { - return nil, nil, model.ErrNoProjectFeatureKeyError + return nil, nil, model.ErrNoProjectFeatureKey } if state == "" { - return nil, nil, model.ErrNoProjectFeatureStateError + return nil, nil, model.ErrNoProjectFeatureState } payload := map[string]interface{}{"state": state} diff --git a/jira/internal/project_feature_impl_test.go b/jira/internal/project_feature_impl_test.go index 8531c211..2b8e4f58 100644 --- a/jira/internal/project_feature_impl_test.go +++ b/jira/internal/project_feature_impl_test.go @@ -104,7 +104,7 @@ func Test_internalProjectFeatureImpl_Set(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoProjectIDOrKeyError, + Err: model.ErrNoProjectIDOrKey, }, { @@ -115,7 +115,7 @@ func Test_internalProjectFeatureImpl_Set(t *testing.T) { projectKeyOrID: "DUMMY", }, wantErr: true, - Err: model.ErrNoProjectFeatureKeyError, + Err: model.ErrNoProjectFeatureKey, }, { @@ -127,7 +127,7 @@ func Test_internalProjectFeatureImpl_Set(t *testing.T) { featureKey: "jsw.classic.roadmap", }, wantErr: true, - Err: model.ErrNoProjectFeatureStateError, + Err: model.ErrNoProjectFeatureState, }, { @@ -274,7 +274,7 @@ func Test_internalProjectFeatureImpl_Gets(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoProjectIDOrKeyError, + Err: model.ErrNoProjectIDOrKey, }, { diff --git a/jira/internal/project_impl.go b/jira/internal/project_impl.go index a968fc2c..4a370f3e 100644 --- a/jira/internal/project_impl.go +++ b/jira/internal/project_impl.go @@ -279,7 +279,7 @@ func (i *internalProjectImpl) Search(ctx context.Context, options *model.Project func (i *internalProjectImpl) Get(ctx context.Context, projectKeyOrID string, expand []string) (*model.ProjectScheme, *model.ResponseScheme, error) { if projectKeyOrID == "" { - return nil, nil, model.ErrNoProjectIDOrKeyError + return nil, nil, model.ErrNoProjectIDOrKey } var endpoint strings.Builder @@ -310,7 +310,7 @@ func (i *internalProjectImpl) Get(ctx context.Context, projectKeyOrID string, ex func (i *internalProjectImpl) Update(ctx context.Context, projectKeyOrID string, payload *model.ProjectUpdateScheme) (*model.ProjectScheme, *model.ResponseScheme, error) { if projectKeyOrID == "" { - return nil, nil, model.ErrNoProjectIDOrKeyError + return nil, nil, model.ErrNoProjectIDOrKey } endpoint := fmt.Sprintf("rest/api/%v/project/%v", i.version, projectKeyOrID) @@ -332,7 +332,7 @@ func (i *internalProjectImpl) Update(ctx context.Context, projectKeyOrID string, func (i *internalProjectImpl) Delete(ctx context.Context, projectKeyOrID string, enableUndo bool) (*model.ResponseScheme, error) { if projectKeyOrID == "" { - return nil, model.ErrNoProjectIDOrKeyError + return nil, model.ErrNoProjectIDOrKey } params := url.Values{} @@ -351,7 +351,7 @@ func (i *internalProjectImpl) Delete(ctx context.Context, projectKeyOrID string, func (i *internalProjectImpl) DeleteAsynchronously(ctx context.Context, projectKeyOrID string) (*model.TaskScheme, *model.ResponseScheme, error) { if projectKeyOrID == "" { - return nil, nil, model.ErrNoProjectIDOrKeyError + return nil, nil, model.ErrNoProjectIDOrKey } endpoint := fmt.Sprintf("rest/api/%v/project/%v/delete", i.version, projectKeyOrID) @@ -373,7 +373,7 @@ func (i *internalProjectImpl) DeleteAsynchronously(ctx context.Context, projectK func (i *internalProjectImpl) Archive(ctx context.Context, projectKeyOrID string) (*model.ResponseScheme, error) { if projectKeyOrID == "" { - return nil, model.ErrNoProjectIDOrKeyError + return nil, model.ErrNoProjectIDOrKey } endpoint := fmt.Sprintf("rest/api/%v/project/%v/archive", i.version, projectKeyOrID) @@ -389,7 +389,7 @@ func (i *internalProjectImpl) Archive(ctx context.Context, projectKeyOrID string func (i *internalProjectImpl) Restore(ctx context.Context, projectKeyOrID string) (*model.ProjectScheme, *model.ResponseScheme, error) { if projectKeyOrID == "" { - return nil, nil, model.ErrNoProjectIDOrKeyError + return nil, nil, model.ErrNoProjectIDOrKey } endpoint := fmt.Sprintf("rest/api/%v/project/%v/restore", i.version, projectKeyOrID) @@ -411,7 +411,7 @@ func (i *internalProjectImpl) Restore(ctx context.Context, projectKeyOrID string func (i *internalProjectImpl) Statuses(ctx context.Context, projectKeyOrID string) ([]*model.ProjectStatusPageScheme, *model.ResponseScheme, error) { if projectKeyOrID == "" { - return nil, nil, model.ErrNoProjectIDOrKeyError + return nil, nil, model.ErrNoProjectIDOrKey } endpoint := fmt.Sprintf("rest/api/%v/project/%v/statuses", i.version, projectKeyOrID) @@ -433,7 +433,7 @@ func (i *internalProjectImpl) Statuses(ctx context.Context, projectKeyOrID strin func (i *internalProjectImpl) NotificationScheme(ctx context.Context, projectKeyOrID string, expand []string) (*model.NotificationSchemeScheme, *model.ResponseScheme, error) { if projectKeyOrID == "" { - return nil, nil, model.ErrNoProjectIDOrKeyError + return nil, nil, model.ErrNoProjectIDOrKey } var endpoint strings.Builder diff --git a/jira/internal/project_impl_test.go b/jira/internal/project_impl_test.go index 50ad03e8..735df313 100644 --- a/jira/internal/project_impl_test.go +++ b/jira/internal/project_impl_test.go @@ -561,7 +561,7 @@ func Test_internalProjectImpl_Update(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoProjectIDOrKeyError, + Err: model.ErrNoProjectIDOrKey, }, { @@ -709,7 +709,7 @@ func Test_internalProjectImpl_Delete(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoProjectIDOrKeyError, + Err: model.ErrNoProjectIDOrKey, }, { @@ -853,7 +853,7 @@ func Test_internalProjectImpl_DeleteAsynchronously(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoProjectIDOrKeyError, + Err: model.ErrNoProjectIDOrKey, }, { @@ -997,7 +997,7 @@ func Test_internalProjectImpl_Archive(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoProjectIDOrKeyError, + Err: model.ErrNoProjectIDOrKey, }, { @@ -1140,7 +1140,7 @@ func Test_internalProjectImpl_Restore(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoProjectIDOrKeyError, + Err: model.ErrNoProjectIDOrKey, }, { @@ -1284,7 +1284,7 @@ func Test_internalProjectImpl_Statuses(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoProjectIDOrKeyError, + Err: model.ErrNoProjectIDOrKey, }, { diff --git a/jira/internal/project_permission_scheme_impl.go b/jira/internal/project_permission_scheme_impl.go index d43fcdaf..01021784 100644 --- a/jira/internal/project_permission_scheme_impl.go +++ b/jira/internal/project_permission_scheme_impl.go @@ -65,7 +65,7 @@ type internalProjectPermissionSchemeImpl struct { func (i *internalProjectPermissionSchemeImpl) Get(ctx context.Context, projectKeyOrID string, expand []string) (*model.PermissionSchemeScheme, *model.ResponseScheme, error) { if projectKeyOrID == "" { - return nil, nil, model.ErrNoProjectIDOrKeyError + return nil, nil, model.ErrNoProjectIDOrKey } var endpoint strings.Builder @@ -95,7 +95,7 @@ func (i *internalProjectPermissionSchemeImpl) Get(ctx context.Context, projectKe func (i *internalProjectPermissionSchemeImpl) Assign(ctx context.Context, projectKeyOrID string, permissionSchemeID int) (*model.PermissionSchemeScheme, *model.ResponseScheme, error) { if projectKeyOrID == "" { - return nil, nil, model.ErrNoProjectIDOrKeyError + return nil, nil, model.ErrNoProjectIDOrKey } endpoint := fmt.Sprintf("rest/api/%v/project/%v/permissionscheme", i.version, projectKeyOrID) @@ -117,7 +117,7 @@ func (i *internalProjectPermissionSchemeImpl) Assign(ctx context.Context, projec func (i *internalProjectPermissionSchemeImpl) SecurityLevels(ctx context.Context, projectKeyOrID string) (*model.IssueSecurityLevelsScheme, *model.ResponseScheme, error) { if projectKeyOrID == "" { - return nil, nil, model.ErrNoProjectIDOrKeyError + return nil, nil, model.ErrNoProjectIDOrKey } endpoint := fmt.Sprintf("rest/api/%v/project/%v/securitylevel", i.version, projectKeyOrID) diff --git a/jira/internal/project_permission_scheme_impl_test.go b/jira/internal/project_permission_scheme_impl_test.go index 7bd0b043..b5b920c6 100644 --- a/jira/internal/project_permission_scheme_impl_test.go +++ b/jira/internal/project_permission_scheme_impl_test.go @@ -101,7 +101,7 @@ func Test_internalProjectPermissionSchemeImpl_Get(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoProjectIDOrKeyError, + Err: model.ErrNoProjectIDOrKey, }, { @@ -246,7 +246,7 @@ func Test_internalProjectPermissionSchemeImpl_SecurityLevels(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoProjectIDOrKeyError, + Err: model.ErrNoProjectIDOrKey, }, { @@ -395,7 +395,7 @@ func Test_internalProjectPermissionSchemeImpl_Assign(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoProjectIDOrKeyError, + Err: model.ErrNoProjectIDOrKey, }, { diff --git a/jira/internal/project_property_impl.go b/jira/internal/project_property_impl.go index b0f70368..7dc5bb0f 100644 --- a/jira/internal/project_property_impl.go +++ b/jira/internal/project_property_impl.go @@ -78,7 +78,7 @@ type internalProjectPropertyImpl struct { func (i *internalProjectPropertyImpl) Gets(ctx context.Context, projectKeyOrID string) (*model.PropertyPageScheme, *model.ResponseScheme, error) { if projectKeyOrID == "" { - return nil, nil, model.ErrNoProjectIDOrKeyError + return nil, nil, model.ErrNoProjectIDOrKey } endpoint := fmt.Sprintf("rest/api/%v/project/%v/properties", i.version, projectKeyOrID) @@ -100,11 +100,11 @@ func (i *internalProjectPropertyImpl) Gets(ctx context.Context, projectKeyOrID s func (i *internalProjectPropertyImpl) Get(ctx context.Context, projectKeyOrID, propertyKey string) (*model.EntityPropertyScheme, *model.ResponseScheme, error) { if projectKeyOrID == "" { - return nil, nil, model.ErrNoProjectIDOrKeyError + return nil, nil, model.ErrNoProjectIDOrKey } if propertyKey == "" { - return nil, nil, model.ErrNoPropertyKeyError + return nil, nil, model.ErrNoPropertyKey } endpoint := fmt.Sprintf("rest/api/%v/project/%v/properties/%v", i.version, projectKeyOrID, propertyKey) @@ -126,11 +126,11 @@ func (i *internalProjectPropertyImpl) Get(ctx context.Context, projectKeyOrID, p func (i *internalProjectPropertyImpl) Set(ctx context.Context, projectKeyOrID, propertyKey string, payload interface{}) (*model.ResponseScheme, error) { if projectKeyOrID == "" { - return nil, model.ErrNoProjectIDOrKeyError + return nil, model.ErrNoProjectIDOrKey } if propertyKey == "" { - return nil, model.ErrNoPropertyKeyError + return nil, model.ErrNoPropertyKey } endpoint := fmt.Sprintf("rest/api/%v/project/%v/properties/%v", i.version, projectKeyOrID, propertyKey) @@ -146,11 +146,11 @@ func (i *internalProjectPropertyImpl) Set(ctx context.Context, projectKeyOrID, p func (i *internalProjectPropertyImpl) Delete(ctx context.Context, projectKeyOrID, propertyKey string) (*model.ResponseScheme, error) { if projectKeyOrID == "" { - return nil, model.ErrNoProjectIDOrKeyError + return nil, model.ErrNoProjectIDOrKey } if propertyKey == "" { - return nil, model.ErrNoPropertyKeyError + return nil, model.ErrNoPropertyKey } endpoint := fmt.Sprintf("rest/api/%v/project/%v/properties/%v", i.version, projectKeyOrID, propertyKey) diff --git a/jira/internal/project_property_impl_test.go b/jira/internal/project_property_impl_test.go index 55992b62..670fb9d1 100644 --- a/jira/internal/project_property_impl_test.go +++ b/jira/internal/project_property_impl_test.go @@ -98,7 +98,7 @@ func Test_internalProjectPropertyImpl_Gets(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoProjectIDOrKeyError, + Err: model.ErrNoProjectIDOrKey, }, { @@ -245,7 +245,7 @@ func Test_internalProjectPropertyImpl_Get(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoProjectIDOrKeyError, + Err: model.ErrNoProjectIDOrKey, }, { @@ -256,7 +256,7 @@ func Test_internalProjectPropertyImpl_Get(t *testing.T) { projectKeyOrID: "DUMMY", }, wantErr: true, - Err: model.ErrNoPropertyKeyError, + Err: model.ErrNoPropertyKey, }, { @@ -404,7 +404,7 @@ func Test_internalProjectPropertyImpl_Delete(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoProjectIDOrKeyError, + Err: model.ErrNoProjectIDOrKey, }, { @@ -415,7 +415,7 @@ func Test_internalProjectPropertyImpl_Delete(t *testing.T) { projectKeyOrID: "DUMMY", }, wantErr: true, - Err: model.ErrNoPropertyKeyError, + Err: model.ErrNoPropertyKey, }, { @@ -570,7 +570,7 @@ func Test_internalProjectPropertyImpl_Set(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoProjectIDOrKeyError, + Err: model.ErrNoProjectIDOrKey, }, { @@ -581,7 +581,7 @@ func Test_internalProjectPropertyImpl_Set(t *testing.T) { projectKeyOrId: "DUMMY", }, wantErr: true, - Err: model.ErrNoPropertyKeyError, + Err: model.ErrNoPropertyKey, }, { diff --git a/jira/internal/project_role_actor_impl.go b/jira/internal/project_role_actor_impl.go index 0676ddf9..44667aad 100644 --- a/jira/internal/project_role_actor_impl.go +++ b/jira/internal/project_role_actor_impl.go @@ -56,11 +56,11 @@ type internalProjectRoleActorImpl struct { func (i *internalProjectRoleActorImpl) Add(ctx context.Context, projectKeyOrID string, roleID int, accountIds, groups []string) (*model.ProjectRoleScheme, *model.ResponseScheme, error) { if projectKeyOrID == "" { - return nil, nil, model.ErrNoProjectIDOrKeyError + return nil, nil, model.ErrNoProjectIDOrKey } if roleID == 0 { - return nil, nil, model.ErrNoProjectRoleIDError + return nil, nil, model.ErrNoProjectRoleID } endpoint := fmt.Sprintf("rest/api/%v/project/%v/role/%v", i.version, projectKeyOrID, roleID) @@ -82,11 +82,11 @@ func (i *internalProjectRoleActorImpl) Add(ctx context.Context, projectKeyOrID s func (i *internalProjectRoleActorImpl) Delete(ctx context.Context, projectKeyOrID string, roleID int, accountID, group string) (*model.ResponseScheme, error) { if projectKeyOrID == "" { - return nil, model.ErrNoProjectIDOrKeyError + return nil, model.ErrNoProjectIDOrKey } if roleID == 0 { - return nil, model.ErrNoProjectRoleIDError + return nil, model.ErrNoProjectRoleID } var endpoint strings.Builder diff --git a/jira/internal/project_role_actor_impl_test.go b/jira/internal/project_role_actor_impl_test.go index ee96ea1e..d8551a1b 100644 --- a/jira/internal/project_role_actor_impl_test.go +++ b/jira/internal/project_role_actor_impl_test.go @@ -108,7 +108,7 @@ func Test_internalProjectRoleActorImpl_Add(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoProjectIDOrKeyError, + Err: model.ErrNoProjectIDOrKey, }, { @@ -119,7 +119,7 @@ func Test_internalProjectRoleActorImpl_Add(t *testing.T) { projectKeyOrID: "DUMMY", }, wantErr: true, - Err: model.ErrNoProjectRoleIDError, + Err: model.ErrNoProjectRoleID, }, { @@ -275,7 +275,7 @@ func Test_internalProjectRoleActorImpl_Delete(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoProjectIDOrKeyError, + Err: model.ErrNoProjectIDOrKey, }, { @@ -286,7 +286,7 @@ func Test_internalProjectRoleActorImpl_Delete(t *testing.T) { projectKeyOrID: "DUMMY", }, wantErr: true, - Err: model.ErrNoProjectRoleIDError, + Err: model.ErrNoProjectRoleID, }, { diff --git a/jira/internal/project_role_impl.go b/jira/internal/project_role_impl.go index fe865ded..1f50db52 100644 --- a/jira/internal/project_role_impl.go +++ b/jira/internal/project_role_impl.go @@ -88,7 +88,7 @@ type internalProjectRoleImpl struct { func (i *internalProjectRoleImpl) Gets(ctx context.Context, projectKeyOrID string) (*map[string]int, *model.ResponseScheme, error) { if projectKeyOrID == "" { - return nil, nil, model.ErrNoProjectIDOrKeyError + return nil, nil, model.ErrNoProjectIDOrKey } endpoint := fmt.Sprintf("rest/api/%v/project/%v/role", i.version, projectKeyOrID) @@ -133,7 +133,7 @@ func (i *internalProjectRoleImpl) Gets(ctx context.Context, projectKeyOrID strin func (i *internalProjectRoleImpl) Get(ctx context.Context, projectKeyOrID string, roleID int) (*model.ProjectRoleScheme, *model.ResponseScheme, error) { if projectKeyOrID == "" { - return nil, nil, model.ErrNoProjectIDOrKeyError + return nil, nil, model.ErrNoProjectIDOrKey } endpoint := fmt.Sprintf("rest/api/%v/project/%v/role/%v", i.version, projectKeyOrID, roleID) @@ -155,7 +155,7 @@ func (i *internalProjectRoleImpl) Get(ctx context.Context, projectKeyOrID string func (i *internalProjectRoleImpl) Details(ctx context.Context, projectKeyOrID string) ([]*model.ProjectRoleDetailScheme, *model.ResponseScheme, error) { if projectKeyOrID == "" { - return nil, nil, model.ErrNoProjectIDOrKeyError + return nil, nil, model.ErrNoProjectIDOrKey } endpoint := fmt.Sprintf("rest/api/%v/project/%v/roledetails", i.version, projectKeyOrID) diff --git a/jira/internal/project_role_impl_test.go b/jira/internal/project_role_impl_test.go index 64d9a356..177a4cd4 100644 --- a/jira/internal/project_role_impl_test.go +++ b/jira/internal/project_role_impl_test.go @@ -103,7 +103,7 @@ func Test_internalProjectRoleImpl_Get(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoProjectIDOrKeyError, + Err: model.ErrNoProjectIDOrKey, }, { @@ -258,7 +258,7 @@ func Test_internalProjectRoleImpl_Gets(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoProjectIDOrKeyError, + Err: model.ErrNoProjectIDOrKey, }, { @@ -431,7 +431,7 @@ func Test_internalProjectRoleImpl_Details(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoProjectIDOrKeyError, + Err: model.ErrNoProjectIDOrKey, }, { diff --git a/jira/internal/project_type_impl.go b/jira/internal/project_type_impl.go index 86fe73e3..a1607815 100644 --- a/jira/internal/project_type_impl.go +++ b/jira/internal/project_type_impl.go @@ -107,7 +107,7 @@ func (i *internalProjectTypeImpl) Licensed(ctx context.Context) ([]*model.Projec func (i *internalProjectTypeImpl) Get(ctx context.Context, projectTypeKey string) (*model.ProjectTypeScheme, *model.ResponseScheme, error) { if projectTypeKey == "" { - return nil, nil, model.ErrProjectTypeKeyError + return nil, nil, model.ErrProjectTypeKey } endpoint := fmt.Sprintf("rest/api/%v/project/type/%v", i.version, projectTypeKey) @@ -129,7 +129,7 @@ func (i *internalProjectTypeImpl) Get(ctx context.Context, projectTypeKey string func (i *internalProjectTypeImpl) Accessible(ctx context.Context, projectTypeKey string) (*model.ProjectTypeScheme, *model.ResponseScheme, error) { if projectTypeKey == "" { - return nil, nil, model.ErrProjectTypeKeyError + return nil, nil, model.ErrProjectTypeKey } endpoint := fmt.Sprintf("rest/api/%v/project/type/%v/accessible", i.version, projectTypeKey) diff --git a/jira/internal/project_type_impl_test.go b/jira/internal/project_type_impl_test.go index 3f0bb986..f4b738aa 100644 --- a/jira/internal/project_type_impl_test.go +++ b/jira/internal/project_type_impl_test.go @@ -358,7 +358,7 @@ func Test_internalProjectTypeImpl_Get(t *testing.T) { projectTypeKey: "", }, wantErr: true, - Err: model.ErrProjectTypeKeyError, + Err: model.ErrProjectTypeKey, }, { @@ -503,7 +503,7 @@ func Test_internalProjectTypeImpl_Accessible(t *testing.T) { projectTypeKey: "", }, wantErr: true, - Err: model.ErrProjectTypeKeyError, + Err: model.ErrProjectTypeKey, }, { diff --git a/jira/internal/project_validator_impl.go b/jira/internal/project_validator_impl.go index 8b24db06..d56fe238 100644 --- a/jira/internal/project_validator_impl.go +++ b/jira/internal/project_validator_impl.go @@ -71,7 +71,7 @@ type internalProjectValidatorImpl struct { func (i *internalProjectValidatorImpl) Validate(ctx context.Context, key string) (*model.ProjectValidationMessageScheme, *model.ResponseScheme, error) { if key == "" { - return nil, nil, model.ErrNoProjectIDOrKeyError + return nil, nil, model.ErrNoProjectIDOrKey } params := url.Values{} @@ -96,7 +96,7 @@ func (i *internalProjectValidatorImpl) Validate(ctx context.Context, key string) func (i *internalProjectValidatorImpl) Key(ctx context.Context, key string) (string, *model.ResponseScheme, error) { if key == "" { - return "", nil, model.ErrNoProjectIDOrKeyError + return "", nil, model.ErrNoProjectIDOrKey } params := url.Values{} @@ -120,7 +120,7 @@ func (i *internalProjectValidatorImpl) Key(ctx context.Context, key string) (str func (i *internalProjectValidatorImpl) Name(ctx context.Context, name string) (string, *model.ResponseScheme, error) { if name == "" { - return "", nil, model.ErrNoProjectNameError + return "", nil, model.ErrNoProjectName } params := url.Values{} diff --git a/jira/internal/project_validator_impl_test.go b/jira/internal/project_validator_impl_test.go index af09ed40..27e11c8d 100644 --- a/jira/internal/project_validator_impl_test.go +++ b/jira/internal/project_validator_impl_test.go @@ -96,7 +96,7 @@ func Test_internalProjectValidatorImpl_Validate(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoProjectIDOrKeyError, + Err: model.ErrNoProjectIDOrKey, }, { @@ -240,7 +240,7 @@ func Test_internalProjectValidatorImpl_Key(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoProjectIDOrKeyError, + Err: model.ErrNoProjectIDOrKey, }, { @@ -384,7 +384,7 @@ func Test_internalProjectValidatorImpl_Name(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoProjectNameError, + Err: model.ErrNoProjectName, }, { diff --git a/jira/internal/project_version_impl.go b/jira/internal/project_version_impl.go index a28f757a..4d6763d4 100644 --- a/jira/internal/project_version_impl.go +++ b/jira/internal/project_version_impl.go @@ -123,7 +123,7 @@ type internalProjectVersionImpl struct { func (i *internalProjectVersionImpl) Gets(ctx context.Context, projectKeyOrID string) ([]*model.VersionScheme, *model.ResponseScheme, error) { if projectKeyOrID == "" { - return nil, nil, model.ErrNoProjectIDOrKeyError + return nil, nil, model.ErrNoProjectIDOrKey } endpoint := fmt.Sprintf("rest/api/%v/project/%v/versions", i.version, projectKeyOrID) @@ -145,7 +145,7 @@ func (i *internalProjectVersionImpl) Gets(ctx context.Context, projectKeyOrID st func (i *internalProjectVersionImpl) Search(ctx context.Context, projectKeyOrID string, options *model.VersionGetsOptions, startAt, maxResults int) (*model.VersionPageScheme, *model.ResponseScheme, error) { if projectKeyOrID == "" { - return nil, nil, model.ErrNoProjectIDOrKeyError + return nil, nil, model.ErrNoProjectIDOrKey } params := url.Values{} @@ -208,7 +208,7 @@ func (i *internalProjectVersionImpl) Create(ctx context.Context, payload *model. func (i *internalProjectVersionImpl) Get(ctx context.Context, versionID string, expand []string) (*model.VersionScheme, *model.ResponseScheme, error) { if versionID == "" { - return nil, nil, model.ErrNoVersionIDError + return nil, nil, model.ErrNoVersionID } var endpoint strings.Builder @@ -239,7 +239,7 @@ func (i *internalProjectVersionImpl) Get(ctx context.Context, versionID string, func (i *internalProjectVersionImpl) Update(ctx context.Context, versionID string, payload *model.VersionPayloadScheme) (*model.VersionScheme, *model.ResponseScheme, error) { if versionID == "" { - return nil, nil, model.ErrNoVersionIDError + return nil, nil, model.ErrNoVersionID } endpoint := fmt.Sprintf("rest/api/%v/version/%v", i.version, versionID) @@ -261,11 +261,11 @@ func (i *internalProjectVersionImpl) Update(ctx context.Context, versionID strin func (i *internalProjectVersionImpl) Merge(ctx context.Context, versionID, versionMoveIssuesTo string) (*model.ResponseScheme, error) { if versionID == "" { - return nil, model.ErrNoVersionIDError + return nil, model.ErrNoVersionID } if versionMoveIssuesTo == "" { - return nil, model.ErrNoVersionIDError + return nil, model.ErrNoVersionID } endpoint := fmt.Sprintf("rest/api/%v/version/%v/mergeto/%v", i.version, versionID, versionMoveIssuesTo) @@ -281,7 +281,7 @@ func (i *internalProjectVersionImpl) Merge(ctx context.Context, versionID, versi func (i *internalProjectVersionImpl) RelatedIssueCounts(ctx context.Context, versionID string) (*model.VersionIssueCountsScheme, *model.ResponseScheme, error) { if versionID == "" { - return nil, nil, model.ErrNoVersionIDError + return nil, nil, model.ErrNoVersionID } endpoint := fmt.Sprintf("rest/api/%v/version/%v/relatedIssueCounts", i.version, versionID) @@ -303,7 +303,7 @@ func (i *internalProjectVersionImpl) RelatedIssueCounts(ctx context.Context, ver func (i *internalProjectVersionImpl) UnresolvedIssueCount(ctx context.Context, versionID string) (*model.VersionUnresolvedIssuesCountScheme, *model.ResponseScheme, error) { if versionID == "" { - return nil, nil, model.ErrNoVersionIDError + return nil, nil, model.ErrNoVersionID } endpoint := fmt.Sprintf("rest/api/%v/version/%v/unresolvedIssueCount", i.version, versionID) diff --git a/jira/internal/project_version_impl_test.go b/jira/internal/project_version_impl_test.go index 6f6308d1..1a7f4bb6 100644 --- a/jira/internal/project_version_impl_test.go +++ b/jira/internal/project_version_impl_test.go @@ -99,7 +99,7 @@ func Test_internalProjectVersionImpl_Gets(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoProjectIDOrKeyError, + Err: model.ErrNoProjectIDOrKey, }, { @@ -261,7 +261,7 @@ func Test_internalProjectVersionImpl_Search(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoProjectIDOrKeyError, + Err: model.ErrNoProjectIDOrKey, }, { @@ -417,7 +417,7 @@ func Test_internalProjectVersionImpl_Get(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoVersionIDError, + Err: model.ErrNoVersionID, }, { @@ -563,7 +563,7 @@ func Test_internalProjectVersionImpl_RelatedIssueCounts(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoVersionIDError, + Err: model.ErrNoVersionID, }, { @@ -707,7 +707,7 @@ func Test_internalProjectVersionImpl_UnresolvedIssueCount(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoVersionIDError, + Err: model.ErrNoVersionID, }, { @@ -853,7 +853,7 @@ func Test_internalProjectVersionImpl_Merge(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoVersionIDError, + Err: model.ErrNoVersionID, }, { @@ -864,7 +864,7 @@ func Test_internalProjectVersionImpl_Merge(t *testing.T) { versionID: "100392", }, wantErr: true, - Err: model.ErrNoVersionIDError, + Err: model.ErrNoVersionID, }, { @@ -1165,7 +1165,7 @@ func Test_internalProjectVersionImpl_Update(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoVersionIDError, + Err: model.ErrNoVersionID, }, { diff --git a/jira/internal/remote_link_impl.go b/jira/internal/remote_link_impl.go index ed35ef36..0421f3bc 100644 --- a/jira/internal/remote_link_impl.go +++ b/jira/internal/remote_link_impl.go @@ -108,7 +108,7 @@ type internalRemoteLinkImpl struct { func (i *internalRemoteLinkImpl) Gets(ctx context.Context, issueKeyOrID, globalID string) ([]*model.RemoteLinkScheme, *model.ResponseScheme, error) { if issueKeyOrID == "" { - return nil, nil, model.ErrNoIssueKeyOrIDError + return nil, nil, model.ErrNoIssueKeyOrID } var endpoint strings.Builder @@ -138,11 +138,11 @@ func (i *internalRemoteLinkImpl) Gets(ctx context.Context, issueKeyOrID, globalI func (i *internalRemoteLinkImpl) Get(ctx context.Context, issueKeyOrID, linkID string) (*model.RemoteLinkScheme, *model.ResponseScheme, error) { if issueKeyOrID == "" { - return nil, nil, model.ErrNoIssueKeyOrIDError + return nil, nil, model.ErrNoIssueKeyOrID } if linkID == "" { - return nil, nil, model.ErrNoRemoteLinkIDError + return nil, nil, model.ErrNoRemoteLinkID } endpoint := fmt.Sprintf("rest/api/%v/issue/%v/remotelink/%v", i.version, issueKeyOrID, linkID) @@ -164,7 +164,7 @@ func (i *internalRemoteLinkImpl) Get(ctx context.Context, issueKeyOrID, linkID s func (i *internalRemoteLinkImpl) Create(ctx context.Context, issueKeyOrID string, payload *model.RemoteLinkScheme) (*model.RemoteLinkIdentify, *model.ResponseScheme, error) { if issueKeyOrID == "" { - return nil, nil, model.ErrNoIssueKeyOrIDError + return nil, nil, model.ErrNoIssueKeyOrID } endpoint := fmt.Sprintf("rest/api/%v/issue/%v/remotelink", i.version, issueKeyOrID) @@ -186,11 +186,11 @@ func (i *internalRemoteLinkImpl) Create(ctx context.Context, issueKeyOrID string func (i *internalRemoteLinkImpl) Update(ctx context.Context, issueKeyOrID, linkID string, payload *model.RemoteLinkScheme) (*model.ResponseScheme, error) { if issueKeyOrID == "" { - return nil, model.ErrNoIssueKeyOrIDError + return nil, model.ErrNoIssueKeyOrID } if linkID == "" { - return nil, model.ErrNoRemoteLinkIDError + return nil, model.ErrNoRemoteLinkID } endpoint := fmt.Sprintf("rest/api/%v/issue/%v/remotelink/%v", i.version, issueKeyOrID, linkID) @@ -206,11 +206,11 @@ func (i *internalRemoteLinkImpl) Update(ctx context.Context, issueKeyOrID, linkI func (i *internalRemoteLinkImpl) DeleteByID(ctx context.Context, issueKeyOrID, linkID string) (*model.ResponseScheme, error) { if issueKeyOrID == "" { - return nil, model.ErrNoIssueKeyOrIDError + return nil, model.ErrNoIssueKeyOrID } if linkID == "" { - return nil, model.ErrNoRemoteLinkIDError + return nil, model.ErrNoRemoteLinkID } endpoint := fmt.Sprintf("rest/api/%v/issue/%v/remotelink/%v", i.version, issueKeyOrID, linkID) @@ -226,11 +226,11 @@ func (i *internalRemoteLinkImpl) DeleteByID(ctx context.Context, issueKeyOrID, l func (i *internalRemoteLinkImpl) DeleteByGlobalID(ctx context.Context, issueKeyOrID, globalID string) (*model.ResponseScheme, error) { if issueKeyOrID == "" { - return nil, model.ErrNoIssueKeyOrIDError + return nil, model.ErrNoIssueKeyOrID } if globalID == "" { - return nil, model.ErrNoRemoteLinkGlobalIDError + return nil, model.ErrNoRemoteLinkGlobalID } params := url.Values{} diff --git a/jira/internal/remote_link_impl_test.go b/jira/internal/remote_link_impl_test.go index 933ed370..f0fdbb54 100644 --- a/jira/internal/remote_link_impl_test.go +++ b/jira/internal/remote_link_impl_test.go @@ -101,7 +101,7 @@ func Test_internalRemoteLinkImpl_Gets(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoIssueKeyOrIDError, + Err: model.ErrNoIssueKeyOrID, }, { @@ -279,7 +279,7 @@ func Test_internalRemoteLinkImpl_Get(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoIssueKeyOrIDError, + Err: model.ErrNoIssueKeyOrID, }, { @@ -290,7 +290,7 @@ func Test_internalRemoteLinkImpl_Get(t *testing.T) { issueKeyOrID: "KP-3", }, wantErr: true, - Err: model.ErrNoRemoteLinkIDError, + Err: model.ErrNoRemoteLinkID, }, { @@ -497,7 +497,7 @@ func Test_internalRemoteLinkImpl_Update(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoIssueKeyOrIDError, + Err: model.ErrNoIssueKeyOrID, }, { @@ -508,7 +508,7 @@ func Test_internalRemoteLinkImpl_Update(t *testing.T) { issueKeyOrID: "KP-3", }, wantErr: true, - Err: model.ErrNoRemoteLinkIDError, + Err: model.ErrNoRemoteLinkID, }, { @@ -715,7 +715,7 @@ func Test_internalRemoteLinkImpl_Create(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoIssueKeyOrIDError, + Err: model.ErrNoIssueKeyOrID, }, { @@ -894,7 +894,7 @@ func Test_internalRemoteLinkImpl_DeleteByID(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoIssueKeyOrIDError, + Err: model.ErrNoIssueKeyOrID, }, { @@ -905,7 +905,7 @@ func Test_internalRemoteLinkImpl_DeleteByID(t *testing.T) { issueKeyOrID: "KP-3", }, wantErr: true, - Err: model.ErrNoRemoteLinkIDError, + Err: model.ErrNoRemoteLinkID, }, { @@ -1082,7 +1082,7 @@ func Test_internalRemoteLinkImpl_DeleteByGlobalID(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoIssueKeyOrIDError, + Err: model.ErrNoIssueKeyOrID, }, { @@ -1093,7 +1093,7 @@ func Test_internalRemoteLinkImpl_DeleteByGlobalID(t *testing.T) { issueKeyOrID: "KP-3", }, wantErr: true, - Err: model.ErrNoRemoteLinkGlobalIDError, + Err: model.ErrNoRemoteLinkGlobalID, }, { diff --git a/jira/internal/resolution_impl.go b/jira/internal/resolution_impl.go index eb81de7f..999853d9 100644 --- a/jira/internal/resolution_impl.go +++ b/jira/internal/resolution_impl.go @@ -72,7 +72,7 @@ func (i *internalResolutionImpl) Gets(ctx context.Context) ([]*model.ResolutionS func (i *internalResolutionImpl) Get(ctx context.Context, resolutionID string) (*model.ResolutionScheme, *model.ResponseScheme, error) { if resolutionID == "" { - return nil, nil, model.ErrNoResolutionIDError + return nil, nil, model.ErrNoResolutionID } endpoint := fmt.Sprintf("rest/api/%v/resolution/%v", i.version, resolutionID) diff --git a/jira/internal/resolution_impl_test.go b/jira/internal/resolution_impl_test.go index d39929c2..1bf5e11d 100644 --- a/jira/internal/resolution_impl_test.go +++ b/jira/internal/resolution_impl_test.go @@ -229,7 +229,7 @@ func Test_internalResolutionImpl_Get(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoResolutionIDError, + Err: model.ErrNoResolutionID, }, { diff --git a/jira/internal/screen_impl.go b/jira/internal/screen_impl.go index 5eadaafa..8e1a3309 100644 --- a/jira/internal/screen_impl.go +++ b/jira/internal/screen_impl.go @@ -110,7 +110,7 @@ type internalScreenImpl struct { func (i *internalScreenImpl) Fields(ctx context.Context, fieldID string, startAt, maxResults int) (*model.ScreenFieldPageScheme, *model.ResponseScheme, error) { if fieldID == "" { - return nil, nil, model.ErrNoFieldIDError + return nil, nil, model.ErrNoFieldID } params := url.Values{} @@ -177,7 +177,7 @@ func (i *internalScreenImpl) Gets(ctx context.Context, options *model.ScreenPara func (i *internalScreenImpl) Create(ctx context.Context, name, description string) (*model.ScreenScheme, *model.ResponseScheme, error) { if name == "" { - return nil, nil, model.ErrNoScreenNameError + return nil, nil, model.ErrNoScreenName } payload := map[string]interface{}{"name": name} @@ -205,7 +205,7 @@ func (i *internalScreenImpl) Create(ctx context.Context, name, description strin func (i *internalScreenImpl) AddToDefault(ctx context.Context, fieldID string) (*model.ResponseScheme, error) { if fieldID == "" { - return nil, model.ErrNoFieldIDError + return nil, model.ErrNoFieldID } endpoint := fmt.Sprintf("rest/api/%v/screens/addToDefault/%v", i.version, fieldID) @@ -221,7 +221,7 @@ func (i *internalScreenImpl) AddToDefault(ctx context.Context, fieldID string) ( func (i *internalScreenImpl) Update(ctx context.Context, screenID int, name, description string) (*model.ScreenScheme, *model.ResponseScheme, error) { if screenID == 0 { - return nil, nil, model.ErrNoScreenIDError + return nil, nil, model.ErrNoScreenID } payload := map[string]interface{}{"name": name} @@ -249,7 +249,7 @@ func (i *internalScreenImpl) Update(ctx context.Context, screenID int, name, des func (i *internalScreenImpl) Delete(ctx context.Context, screenID int) (*model.ResponseScheme, error) { if screenID == 0 { - return nil, model.ErrNoScreenIDError + return nil, model.ErrNoScreenID } endpoint := fmt.Sprintf("rest/api/%v/screens/%v", i.version, screenID) @@ -265,7 +265,7 @@ func (i *internalScreenImpl) Delete(ctx context.Context, screenID int) (*model.R func (i *internalScreenImpl) Available(ctx context.Context, screenID int) ([]*model.AvailableScreenFieldScheme, *model.ResponseScheme, error) { if screenID == 0 { - return nil, nil, model.ErrNoScreenIDError + return nil, nil, model.ErrNoScreenID } endpoint := fmt.Sprintf("rest/api/%v/screens/%v/availableFields", i.version, screenID) diff --git a/jira/internal/screen_impl_test.go b/jira/internal/screen_impl_test.go index 5e8b4cce..dd133c07 100644 --- a/jira/internal/screen_impl_test.go +++ b/jira/internal/screen_impl_test.go @@ -104,7 +104,7 @@ func Test_internalScreenImpl_Fields(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoFieldIDError, + Err: model.ErrNoFieldID, }, { @@ -408,7 +408,7 @@ func Test_internalScreenImpl_AddToDefault(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoFieldIDError, + Err: model.ErrNoFieldID, }, { @@ -551,7 +551,7 @@ func Test_internalScreenImpl_Available(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoScreenIDError, + Err: model.ErrNoScreenID, }, { @@ -699,7 +699,7 @@ func Test_internalScreenImpl_Create(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoScreenNameError, + Err: model.ErrNoScreenName, }, { @@ -851,7 +851,7 @@ func Test_internalScreenImpl_Update(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoScreenIDError, + Err: model.ErrNoScreenID, }, { @@ -998,7 +998,7 @@ func Test_internalScreenImpl_Delete(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoScreenIDError, + Err: model.ErrNoScreenID, }, { diff --git a/jira/internal/screen_scheme_impl.go b/jira/internal/screen_scheme_impl.go index 9447abe1..e31ecf07 100644 --- a/jira/internal/screen_scheme_impl.go +++ b/jira/internal/screen_scheme_impl.go @@ -138,7 +138,7 @@ func (i *internalScreenSchemeImpl) Create(ctx context.Context, payload *model.Sc func (i *internalScreenSchemeImpl) Update(ctx context.Context, screenSchemeID string, payload *model.ScreenSchemePayloadScheme) (*model.ResponseScheme, error) { if screenSchemeID == "" { - return nil, model.ErrNoScreenSchemeIDError + return nil, model.ErrNoScreenSchemeID } endpoint := fmt.Sprintf("rest/api/%v/screenscheme/%v", i.version, screenSchemeID) @@ -154,7 +154,7 @@ func (i *internalScreenSchemeImpl) Update(ctx context.Context, screenSchemeID st func (i *internalScreenSchemeImpl) Delete(ctx context.Context, screenSchemeID string) (*model.ResponseScheme, error) { if screenSchemeID == "" { - return nil, model.ErrNoScreenSchemeIDError + return nil, model.ErrNoScreenSchemeID } endpoint := fmt.Sprintf("rest/api/%v/screenscheme/%v", i.version, screenSchemeID) diff --git a/jira/internal/screen_scheme_impl_test.go b/jira/internal/screen_scheme_impl_test.go index 4475a40c..ad6a9ad8 100644 --- a/jira/internal/screen_scheme_impl_test.go +++ b/jira/internal/screen_scheme_impl_test.go @@ -412,7 +412,7 @@ func Test_internalScreenSchemeImpl_Update(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoScreenSchemeIDError, + Err: model.ErrNoScreenSchemeID, }, { @@ -556,7 +556,7 @@ func Test_internalScreenSchemeImpl_Delete(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoScreenSchemeIDError, + Err: model.ErrNoScreenSchemeID, }, { diff --git a/jira/internal/screen_tab_field_impl.go b/jira/internal/screen_tab_field_impl.go index 69b28755..1fe3fa3e 100644 --- a/jira/internal/screen_tab_field_impl.go +++ b/jira/internal/screen_tab_field_impl.go @@ -74,11 +74,11 @@ type internalScreenTabFieldImpl struct { func (i *internalScreenTabFieldImpl) Gets(ctx context.Context, screenID, tabID int) ([]*model.ScreenTabFieldScheme, *model.ResponseScheme, error) { if screenID == 0 { - return nil, nil, model.ErrNoScreenIDError + return nil, nil, model.ErrNoScreenID } if tabID == 0 { - return nil, nil, model.ErrNoScreenTabIDError + return nil, nil, model.ErrNoScreenTabID } endpoint := fmt.Sprintf("rest/api/%v/screens/%v/tabs/%v/fields", i.version, screenID, tabID) @@ -100,15 +100,15 @@ func (i *internalScreenTabFieldImpl) Gets(ctx context.Context, screenID, tabID i func (i *internalScreenTabFieldImpl) Add(ctx context.Context, screenID, tabID int, fieldID string) (*model.ScreenTabFieldScheme, *model.ResponseScheme, error) { if screenID == 0 { - return nil, nil, model.ErrNoScreenIDError + return nil, nil, model.ErrNoScreenID } if tabID == 0 { - return nil, nil, model.ErrNoScreenTabIDError + return nil, nil, model.ErrNoScreenTabID } if fieldID == "" { - return nil, nil, model.ErrNoFieldIDError + return nil, nil, model.ErrNoFieldID } endpoint := fmt.Sprintf("rest/api/%v/screens/%v/tabs/%v/fields", i.version, screenID, tabID) @@ -130,15 +130,15 @@ func (i *internalScreenTabFieldImpl) Add(ctx context.Context, screenID, tabID in func (i *internalScreenTabFieldImpl) Remove(ctx context.Context, screenID, tabID int, fieldID string) (*model.ResponseScheme, error) { if screenID == 0 { - return nil, model.ErrNoScreenIDError + return nil, model.ErrNoScreenID } if tabID == 0 { - return nil, model.ErrNoScreenTabIDError + return nil, model.ErrNoScreenTabID } if fieldID == "" { - return nil, model.ErrNoFieldIDError + return nil, model.ErrNoFieldID } endpoint := fmt.Sprintf("rest/api/%v/screens/%v/tabs/%v/fields/%v", i.version, screenID, tabID, fieldID) @@ -154,15 +154,15 @@ func (i *internalScreenTabFieldImpl) Remove(ctx context.Context, screenID, tabID func (i *internalScreenTabFieldImpl) Move(ctx context.Context, screenID, tabID int, fieldId, after, position string) (*model.ResponseScheme, error) { if screenID == 0 { - return nil, model.ErrNoScreenIDError + return nil, model.ErrNoScreenID } if tabID == 0 { - return nil, model.ErrNoScreenTabIDError + return nil, model.ErrNoScreenTabID } if fieldId == "" { - return nil, model.ErrNoFieldIDError + return nil, model.ErrNoFieldID } endpoint := fmt.Sprintf("rest/api/%v/screens/%v/tabs/%v/fields/%v/move", i.version, screenID, tabID, fieldId) diff --git a/jira/internal/screen_tab_field_impl_test.go b/jira/internal/screen_tab_field_impl_test.go index 79cb2f99..25dbbbbe 100644 --- a/jira/internal/screen_tab_field_impl_test.go +++ b/jira/internal/screen_tab_field_impl_test.go @@ -101,7 +101,7 @@ func Test_internalScreenTabFieldImpl_Gets(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoScreenIDError, + Err: model.ErrNoScreenID, }, { @@ -112,7 +112,7 @@ func Test_internalScreenTabFieldImpl_Gets(t *testing.T) { screenID: 10001, }, wantErr: true, - Err: model.ErrNoScreenTabIDError, + Err: model.ErrNoScreenTabID, }, { @@ -264,7 +264,7 @@ func Test_internalScreenTabFieldImpl_Add(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoScreenIDError, + Err: model.ErrNoScreenID, }, { @@ -275,7 +275,7 @@ func Test_internalScreenTabFieldImpl_Add(t *testing.T) { screenID: 10001, }, wantErr: true, - Err: model.ErrNoScreenTabIDError, + Err: model.ErrNoScreenTabID, }, { @@ -287,7 +287,7 @@ func Test_internalScreenTabFieldImpl_Add(t *testing.T) { tabID: 10001, }, wantErr: true, - Err: model.ErrNoFieldIDError, + Err: model.ErrNoFieldID, }, { @@ -439,7 +439,7 @@ func Test_internalScreenTabFieldImpl_Remove(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoScreenIDError, + Err: model.ErrNoScreenID, }, { @@ -450,7 +450,7 @@ func Test_internalScreenTabFieldImpl_Remove(t *testing.T) { screenID: 10001, }, wantErr: true, - Err: model.ErrNoScreenTabIDError, + Err: model.ErrNoScreenTabID, }, { @@ -462,7 +462,7 @@ func Test_internalScreenTabFieldImpl_Remove(t *testing.T) { tabID: 10001, }, wantErr: true, - Err: model.ErrNoFieldIDError, + Err: model.ErrNoFieldID, }, { @@ -618,7 +618,7 @@ func Test_internalScreenTabFieldImpl_Move(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoScreenIDError, + Err: model.ErrNoScreenID, }, { @@ -629,7 +629,7 @@ func Test_internalScreenTabFieldImpl_Move(t *testing.T) { screenID: 10001, }, wantErr: true, - Err: model.ErrNoScreenTabIDError, + Err: model.ErrNoScreenTabID, }, { @@ -641,7 +641,7 @@ func Test_internalScreenTabFieldImpl_Move(t *testing.T) { tabID: 10001, }, wantErr: true, - Err: model.ErrNoFieldIDError, + Err: model.ErrNoFieldID, }, { diff --git a/jira/internal/screen_tab_impl.go b/jira/internal/screen_tab_impl.go index 43f1f9cf..79dbb071 100644 --- a/jira/internal/screen_tab_impl.go +++ b/jira/internal/screen_tab_impl.go @@ -86,7 +86,7 @@ type internalScreenTabImpl struct { func (i *internalScreenTabImpl) Gets(ctx context.Context, screenID int, projectKey string) ([]*model.ScreenTabScheme, *model.ResponseScheme, error) { if screenID == 0 { - return nil, nil, model.ErrNoScreenIDError + return nil, nil, model.ErrNoScreenID } var endpoint strings.Builder @@ -117,11 +117,11 @@ func (i *internalScreenTabImpl) Gets(ctx context.Context, screenID int, projectK func (i *internalScreenTabImpl) Create(ctx context.Context, screenID int, tabName string) (*model.ScreenTabScheme, *model.ResponseScheme, error) { if screenID == 0 { - return nil, nil, model.ErrNoScreenIDError + return nil, nil, model.ErrNoScreenID } if tabName == "" { - return nil, nil, model.ErrNoScreenTabNameError + return nil, nil, model.ErrNoScreenTabName } endpoint := fmt.Sprintf("rest/api/%v/screens/%v/tabs", i.version, screenID) @@ -143,15 +143,15 @@ func (i *internalScreenTabImpl) Create(ctx context.Context, screenID int, tabNam func (i *internalScreenTabImpl) Update(ctx context.Context, screenID, tabID int, newTabName string) (*model.ScreenTabScheme, *model.ResponseScheme, error) { if screenID == 0 { - return nil, nil, model.ErrNoScreenIDError + return nil, nil, model.ErrNoScreenID } if tabID == 0 { - return nil, nil, model.ErrNoScreenTabIDError + return nil, nil, model.ErrNoScreenTabID } if newTabName == "" { - return nil, nil, model.ErrNoScreenTabNameError + return nil, nil, model.ErrNoScreenTabName } endpoint := fmt.Sprintf("rest/api/%v/screens/%v/tabs/%v", i.version, screenID, tabID) @@ -173,11 +173,11 @@ func (i *internalScreenTabImpl) Update(ctx context.Context, screenID, tabID int, func (i *internalScreenTabImpl) Delete(ctx context.Context, screenID, tabID int) (*model.ResponseScheme, error) { if screenID == 0 { - return nil, model.ErrNoScreenIDError + return nil, model.ErrNoScreenID } if tabID == 0 { - return nil, model.ErrNoScreenTabIDError + return nil, model.ErrNoScreenTabID } endpoint := fmt.Sprintf("rest/api/%v/screens/%v/tabs/%v", i.version, screenID, tabID) @@ -193,11 +193,11 @@ func (i *internalScreenTabImpl) Delete(ctx context.Context, screenID, tabID int) func (i *internalScreenTabImpl) Move(ctx context.Context, screenID, tabID, position int) (*model.ResponseScheme, error) { if screenID == 0 { - return nil, model.ErrNoScreenIDError + return nil, model.ErrNoScreenID } if tabID == 0 { - return nil, model.ErrNoScreenTabIDError + return nil, model.ErrNoScreenTabID } endpoint := fmt.Sprintf("rest/api/%v/screens/%v/tabs/%v/move/%v", i.version, screenID, tabID, position) diff --git a/jira/internal/screen_tab_impl_test.go b/jira/internal/screen_tab_impl_test.go index 77ecb257..48e38220 100644 --- a/jira/internal/screen_tab_impl_test.go +++ b/jira/internal/screen_tab_impl_test.go @@ -102,7 +102,7 @@ func Test_internalScreenTabImpl_Gets(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoScreenIDError, + Err: model.ErrNoScreenID, }, { @@ -252,7 +252,7 @@ func Test_internalScreenTabImpl_Create(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoScreenIDError, + Err: model.ErrNoScreenID, }, { @@ -263,7 +263,7 @@ func Test_internalScreenTabImpl_Create(t *testing.T) { screenID: 19392, }, wantErr: true, - Err: model.ErrNoScreenTabNameError, + Err: model.ErrNoScreenTabName, }, { @@ -416,7 +416,7 @@ func Test_internalScreenTabImpl_Update(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoScreenIDError, + Err: model.ErrNoScreenID, }, { @@ -427,7 +427,7 @@ func Test_internalScreenTabImpl_Update(t *testing.T) { screenID: 19392, }, wantErr: true, - Err: model.ErrNoScreenTabIDError, + Err: model.ErrNoScreenTabID, }, { @@ -439,7 +439,7 @@ func Test_internalScreenTabImpl_Update(t *testing.T) { tabID: 10001, }, wantErr: true, - Err: model.ErrNoScreenTabNameError, + Err: model.ErrNoScreenTabName, }, { @@ -589,7 +589,7 @@ func Test_internalScreenTabImpl_Delete(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoScreenIDError, + Err: model.ErrNoScreenID, }, { @@ -600,7 +600,7 @@ func Test_internalScreenTabImpl_Delete(t *testing.T) { screenID: 19392, }, wantErr: true, - Err: model.ErrNoScreenTabIDError, + Err: model.ErrNoScreenTabID, }, { @@ -750,7 +750,7 @@ func Test_internalScreenTabImpl_Move(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoScreenIDError, + Err: model.ErrNoScreenID, }, { @@ -761,7 +761,7 @@ func Test_internalScreenTabImpl_Move(t *testing.T) { screenID: 19392, }, wantErr: true, - Err: model.ErrNoScreenTabIDError, + Err: model.ErrNoScreenTabID, }, { diff --git a/jira/internal/search_impl_adf.go b/jira/internal/search_impl_adf.go index 98f2f6af..e9ad0f85 100644 --- a/jira/internal/search_impl_adf.go +++ b/jira/internal/search_impl_adf.go @@ -71,7 +71,7 @@ func (i *internalSearchADFImpl) Checks(ctx context.Context, payload *model.Issue func (i *internalSearchADFImpl) Get(ctx context.Context, jql string, fields, expands []string, startAt, maxResults int, validate string) (*model.IssueSearchScheme, *model.ResponseScheme, error) { if jql == "" { - return nil, nil, model.ErrNoJQLError + return nil, nil, model.ErrNoJQL } params := url.Values{} diff --git a/jira/internal/search_impl_rich_text.go b/jira/internal/search_impl_rich_text.go index 47d4a49a..5baaa996 100644 --- a/jira/internal/search_impl_rich_text.go +++ b/jira/internal/search_impl_rich_text.go @@ -71,7 +71,7 @@ func (i *internalSearchRichTextImpl) Checks(ctx context.Context, payload *model. func (i *internalSearchRichTextImpl) Get(ctx context.Context, jql string, fields, expands []string, startAt, maxResults int, validate string) (*model.IssueSearchSchemeV2, *model.ResponseScheme, error) { if jql == "" { - return nil, nil, model.ErrNoJQLError + return nil, nil, model.ErrNoJQL } params := url.Values{} diff --git a/jira/internal/task_impl.go b/jira/internal/task_impl.go index 9115d655..60fae496 100644 --- a/jira/internal/task_impl.go +++ b/jira/internal/task_impl.go @@ -60,7 +60,7 @@ type internalTaskServiceImpl struct { func (i *internalTaskServiceImpl) Get(ctx context.Context, taskID string) (*model.TaskScheme, *model.ResponseScheme, error) { if taskID == "" { - return nil, nil, model.ErrNoTaskIDError + return nil, nil, model.ErrNoTaskID } endpoint := fmt.Sprintf("rest/api/%v/task/%v", i.version, taskID) @@ -82,7 +82,7 @@ func (i *internalTaskServiceImpl) Get(ctx context.Context, taskID string) (*mode func (i *internalTaskServiceImpl) Cancel(ctx context.Context, taskID string) (*model.ResponseScheme, error) { if taskID == "" { - return nil, model.ErrNoTaskIDError + return nil, model.ErrNoTaskID } endpoint := fmt.Sprintf("rest/api/%v/task/%v/cancel", i.version, taskID) diff --git a/jira/internal/task_impl_test.go b/jira/internal/task_impl_test.go index ce54f352..d2abb362 100644 --- a/jira/internal/task_impl_test.go +++ b/jira/internal/task_impl_test.go @@ -98,7 +98,7 @@ func Test_internalTaskServiceImpl_Get(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoTaskIDError, + Err: model.ErrNoTaskID, }, { @@ -242,7 +242,7 @@ func Test_internalTaskServiceImpl_Cancel(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoTaskIDError, + Err: model.ErrNoTaskID, }, { diff --git a/jira/internal/type_impl.go b/jira/internal/type_impl.go index 06138ea0..78a2eead 100644 --- a/jira/internal/type_impl.go +++ b/jira/internal/type_impl.go @@ -138,7 +138,7 @@ func (i *internalTypeImpl) Create(ctx context.Context, payload *model.IssueTypeP func (i *internalTypeImpl) Get(ctx context.Context, issueTypeID string) (*model.IssueTypeScheme, *model.ResponseScheme, error) { if issueTypeID == "" { - return nil, nil, model.ErrNoIssueTypeIDError + return nil, nil, model.ErrNoIssueTypeID } endpoint := fmt.Sprintf("rest/api/%v/issuetype/%v", i.version, issueTypeID) @@ -160,7 +160,7 @@ func (i *internalTypeImpl) Get(ctx context.Context, issueTypeID string) (*model. func (i *internalTypeImpl) Update(ctx context.Context, issueTypeID string, payload *model.IssueTypePayloadScheme) (*model.IssueTypeScheme, *model.ResponseScheme, error) { if issueTypeID == "" { - return nil, nil, model.ErrNoIssueTypeIDError + return nil, nil, model.ErrNoIssueTypeID } endpoint := fmt.Sprintf("rest/api/%v/issuetype/%v", i.version, issueTypeID) @@ -182,7 +182,7 @@ func (i *internalTypeImpl) Update(ctx context.Context, issueTypeID string, paylo func (i *internalTypeImpl) Delete(ctx context.Context, issueTypeID string) (*model.ResponseScheme, error) { if issueTypeID == "" { - return nil, model.ErrNoIssueTypeIDError + return nil, model.ErrNoIssueTypeID } endpoint := fmt.Sprintf("rest/api/%v/issuetype/%v", i.version, issueTypeID) diff --git a/jira/internal/type_impl_test.go b/jira/internal/type_impl_test.go index 54547fde..738519c2 100644 --- a/jira/internal/type_impl_test.go +++ b/jira/internal/type_impl_test.go @@ -229,7 +229,7 @@ func Test_internalTypeImpl_Get(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoIssueTypeIDError, + Err: model.ErrNoIssueTypeID, }, { @@ -791,7 +791,7 @@ func Test_internalTypeImpl_Delete(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoIssueTypeIDError, + Err: model.ErrNoIssueTypeID, }, { diff --git a/jira/internal/type_scheme_impl.go b/jira/internal/type_scheme_impl.go index b0a3bd8e..b64c0b96 100644 --- a/jira/internal/type_scheme_impl.go +++ b/jira/internal/type_scheme_impl.go @@ -229,11 +229,11 @@ func (i *internalTypeSchemeImpl) Projects(ctx context.Context, projectIDs []int, func (i *internalTypeSchemeImpl) Assign(ctx context.Context, issueTypeSchemeID, projectID string) (*model.ResponseScheme, error) { if issueTypeSchemeID == "" { - return nil, model.ErrNoIssueTypeSchemeIDError + return nil, model.ErrNoIssueTypeSchemeID } if projectID == "" { - return nil, model.ErrNoProjectIDError + return nil, model.ErrNoProjectID } payload := map[string]interface{}{ @@ -254,7 +254,7 @@ func (i *internalTypeSchemeImpl) Assign(ctx context.Context, issueTypeSchemeID, func (i *internalTypeSchemeImpl) Update(ctx context.Context, issueTypeSchemeID int, payload *model.IssueTypeSchemePayloadScheme) (*model.ResponseScheme, error) { if issueTypeSchemeID == 0 { - return nil, model.ErrNoIssueTypeSchemeIDError + return nil, model.ErrNoIssueTypeSchemeID } endpoint := fmt.Sprintf("rest/api/%v/issuetypescheme/%v", i.version, issueTypeSchemeID) @@ -270,7 +270,7 @@ func (i *internalTypeSchemeImpl) Update(ctx context.Context, issueTypeSchemeID i func (i *internalTypeSchemeImpl) Delete(ctx context.Context, issueTypeSchemeID int) (*model.ResponseScheme, error) { if issueTypeSchemeID == 0 { - return nil, model.ErrNoIssueTypeSchemeIDError + return nil, model.ErrNoIssueTypeSchemeID } endpoint := fmt.Sprintf("rest/api/%v/issuetypescheme/%v", i.version, issueTypeSchemeID) @@ -286,7 +286,7 @@ func (i *internalTypeSchemeImpl) Delete(ctx context.Context, issueTypeSchemeID i func (i *internalTypeSchemeImpl) Append(ctx context.Context, issueTypeSchemeID int, issueTypeIDs []int) (*model.ResponseScheme, error) { if len(issueTypeIDs) == 0 { - return nil, model.ErrNoIssueTypesError + return nil, model.ErrNoIssueTypes } var ids []string @@ -307,11 +307,11 @@ func (i *internalTypeSchemeImpl) Append(ctx context.Context, issueTypeSchemeID i func (i *internalTypeSchemeImpl) Remove(ctx context.Context, issueTypeSchemeID, issueTypeID int) (*model.ResponseScheme, error) { if issueTypeSchemeID == 0 { - return nil, model.ErrNoIssueTypeSchemeIDError + return nil, model.ErrNoIssueTypeSchemeID } if issueTypeID == 0 { - return nil, model.ErrNoIssueTypeIDError + return nil, model.ErrNoIssueTypeID } endpoint := fmt.Sprintf("rest/api/%v/issuetypescheme/%v/issuetype/%v", i.version, issueTypeSchemeID, issueTypeID) diff --git a/jira/internal/type_scheme_impl_test.go b/jira/internal/type_scheme_impl_test.go index 183be4ef..a66e56e6 100644 --- a/jira/internal/type_scheme_impl_test.go +++ b/jira/internal/type_scheme_impl_test.go @@ -676,7 +676,7 @@ func Test_internalTypeSchemeImpl_Update(t *testing.T) { payload: payloadMocked, }, wantErr: true, - Err: model.ErrNoIssueTypeSchemeIDError, + Err: model.ErrNoIssueTypeSchemeID, }, { @@ -1235,7 +1235,7 @@ func Test_internalTypeSchemeImpl_Assign(t *testing.T) { issueTypeSchemeID: "10001", }, wantErr: true, - Err: model.ErrNoProjectIDError, + Err: model.ErrNoProjectID, }, { @@ -1246,7 +1246,7 @@ func Test_internalTypeSchemeImpl_Assign(t *testing.T) { projectID: "9", }, wantErr: true, - Err: model.ErrNoIssueTypeSchemeIDError, + Err: model.ErrNoIssueTypeSchemeID, }, { diff --git a/jira/internal/type_screen_scheme_impl.go b/jira/internal/type_screen_scheme_impl.go index 3a439148..63de2e27 100644 --- a/jira/internal/type_screen_scheme_impl.go +++ b/jira/internal/type_screen_scheme_impl.go @@ -205,11 +205,11 @@ func (i *internalTypeScreenSchemeImpl) Create(ctx context.Context, payload *mode func (i *internalTypeScreenSchemeImpl) Assign(ctx context.Context, issueTypeScreenSchemeID, projectID string) (*model.ResponseScheme, error) { if issueTypeScreenSchemeID == "" { - return nil, model.ErrNoIssueTypeScreenSchemeIDError + return nil, model.ErrNoIssueTypeScreenSchemeID } if projectID == "" { - return nil, model.ErrNoProjectIDError + return nil, model.ErrNoProjectID } payload := map[string]interface{}{ @@ -282,7 +282,7 @@ func (i *internalTypeScreenSchemeImpl) Mapping(ctx context.Context, issueTypeScr func (i *internalTypeScreenSchemeImpl) Update(ctx context.Context, issueTypeScreenSchemeID, name, description string) (*model.ResponseScheme, error) { if issueTypeScreenSchemeID == "" { - return nil, model.ErrNoIssueTypeScreenSchemeIDError + return nil, model.ErrNoIssueTypeScreenSchemeID } payload := map[string]interface{}{"name": name} @@ -304,7 +304,7 @@ func (i *internalTypeScreenSchemeImpl) Update(ctx context.Context, issueTypeScre func (i *internalTypeScreenSchemeImpl) Delete(ctx context.Context, issueTypeScreenSchemeID string) (*model.ResponseScheme, error) { if issueTypeScreenSchemeID == "" { - return nil, model.ErrNoIssueTypeScreenSchemeIDError + return nil, model.ErrNoIssueTypeScreenSchemeID } endpoint := fmt.Sprintf("rest/api/%v/issuetypescreenscheme/%v", i.version, issueTypeScreenSchemeID) @@ -320,7 +320,7 @@ func (i *internalTypeScreenSchemeImpl) Delete(ctx context.Context, issueTypeScre func (i *internalTypeScreenSchemeImpl) Append(ctx context.Context, issueTypeScreenSchemeID string, payload *model.IssueTypeScreenSchemePayloadScheme) (*model.ResponseScheme, error) { if issueTypeScreenSchemeID == "" { - return nil, model.ErrNoIssueTypeScreenSchemeIDError + return nil, model.ErrNoIssueTypeScreenSchemeID } endpoint := fmt.Sprintf("rest/api/%v/issuetypescreenscheme/%v/mapping", i.version, issueTypeScreenSchemeID) @@ -336,11 +336,11 @@ func (i *internalTypeScreenSchemeImpl) Append(ctx context.Context, issueTypeScre func (i *internalTypeScreenSchemeImpl) UpdateDefault(ctx context.Context, issueTypeScreenSchemeID, screenSchemeID string) (*model.ResponseScheme, error) { if issueTypeScreenSchemeID == "" { - return nil, model.ErrNoIssueTypeScreenSchemeIDError + return nil, model.ErrNoIssueTypeScreenSchemeID } if screenSchemeID == "" { - return nil, model.ErrNoScreenSchemeIDError + return nil, model.ErrNoScreenSchemeID } endpoint := fmt.Sprintf("rest/api/%v/issuetypescreenscheme/%v/mapping/default", i.version, issueTypeScreenSchemeID) @@ -356,11 +356,11 @@ func (i *internalTypeScreenSchemeImpl) UpdateDefault(ctx context.Context, issueT func (i *internalTypeScreenSchemeImpl) Remove(ctx context.Context, issueTypeScreenSchemeID string, issueTypeIds []string) (*model.ResponseScheme, error) { if issueTypeScreenSchemeID == "" { - return nil, model.ErrNoIssueTypeScreenSchemeIDError + return nil, model.ErrNoIssueTypeScreenSchemeID } if len(issueTypeIds) == 0 { - return nil, model.ErrNoIssueTypesError + return nil, model.ErrNoIssueTypes } endpoint := fmt.Sprintf("rest/api/%v/issuetypescreenscheme/%v/mapping/remove", i.version, issueTypeScreenSchemeID) diff --git a/jira/internal/type_screen_scheme_impl_test.go b/jira/internal/type_screen_scheme_impl_test.go index d1f2eb0f..908c3451 100644 --- a/jira/internal/type_screen_scheme_impl_test.go +++ b/jira/internal/type_screen_scheme_impl_test.go @@ -686,7 +686,7 @@ func Test_internalTypeScreenSchemeImpl_Assign(t *testing.T) { issueTypeScreenSchemeID: "", }, wantErr: true, - Err: model.ErrNoIssueTypeScreenSchemeIDError, + Err: model.ErrNoIssueTypeScreenSchemeID, }, { @@ -697,7 +697,7 @@ func Test_internalTypeScreenSchemeImpl_Assign(t *testing.T) { issueTypeScreenSchemeID: "20001", }, wantErr: true, - Err: model.ErrNoProjectIDError, + Err: model.ErrNoProjectID, }, { @@ -786,7 +786,7 @@ func Test_internalTypeScreenSchemeImpl_Update(t *testing.T) { issueTypeScreenSchemeID: "", }, wantErr: true, - Err: model.ErrNoIssueTypeScreenSchemeIDError, + Err: model.ErrNoIssueTypeScreenSchemeID, }, { name: "when the api version is v3", @@ -936,7 +936,7 @@ func Test_internalTypeScreenSchemeImpl_Delete(t *testing.T) { issueTypeScreenSchemeID: "", }, wantErr: true, - Err: model.ErrNoIssueTypeScreenSchemeIDError, + Err: model.ErrNoIssueTypeScreenSchemeID, }, { name: "when the api version is v3", @@ -1093,7 +1093,7 @@ func Test_internalTypeScreenSchemeImpl_Append(t *testing.T) { issueTypeScreenSchemeID: "", }, wantErr: true, - Err: model.ErrNoIssueTypeScreenSchemeIDError, + Err: model.ErrNoIssueTypeScreenSchemeID, }, { name: "when the api version is v3", @@ -1242,7 +1242,7 @@ func Test_internalTypeScreenSchemeImpl_UpdateDefault(t *testing.T) { issueTypeScreenSchemeID: "", }, wantErr: true, - Err: model.ErrNoIssueTypeScreenSchemeIDError, + Err: model.ErrNoIssueTypeScreenSchemeID, }, { name: "when the screen scheme id is not provided", @@ -1252,7 +1252,7 @@ func Test_internalTypeScreenSchemeImpl_UpdateDefault(t *testing.T) { issueTypeScreenSchemeID: "20001", }, wantErr: true, - Err: model.ErrNoScreenSchemeIDError, + Err: model.ErrNoScreenSchemeID, }, { name: "when the api version is v3", @@ -1402,7 +1402,7 @@ func Test_internalTypeScreenSchemeImpl_Remove(t *testing.T) { issueTypeScreenSchemeID: "", }, wantErr: true, - Err: model.ErrNoIssueTypeScreenSchemeIDError, + Err: model.ErrNoIssueTypeScreenSchemeID, }, { name: "when the issue type id's are not provided", @@ -1412,7 +1412,7 @@ func Test_internalTypeScreenSchemeImpl_Remove(t *testing.T) { issueTypeScreenSchemeID: "2201", }, wantErr: true, - Err: model.ErrNoIssueTypesError, + Err: model.ErrNoIssueTypes, }, { name: "when the api version is v3", diff --git a/jira/internal/user_impl.go b/jira/internal/user_impl.go index b0118674..027507eb 100644 --- a/jira/internal/user_impl.go +++ b/jira/internal/user_impl.go @@ -108,7 +108,7 @@ type internalUserImpl struct { func (i *internalUserImpl) Get(ctx context.Context, accountID string, expand []string) (*model.UserScheme, *model.ResponseScheme, error) { if accountID == "" { - return nil, nil, model.ErrNoAccountIDError + return nil, nil, model.ErrNoAccountID } params := url.Values{} @@ -155,7 +155,7 @@ func (i *internalUserImpl) Create(ctx context.Context, payload *model.UserPayloa func (i *internalUserImpl) Delete(ctx context.Context, accountID string) (*model.ResponseScheme, error) { if accountID == "" { - return nil, model.ErrNoAccountIDError + return nil, model.ErrNoAccountID } params := url.Values{} @@ -173,7 +173,7 @@ func (i *internalUserImpl) Delete(ctx context.Context, accountID string) (*model func (i *internalUserImpl) Find(ctx context.Context, accountIDs []string, startAt, maxResults int) (*model.UserSearchPageScheme, *model.ResponseScheme, error) { if len(accountIDs) == 0 { - return nil, nil, model.ErrNoAccountSliceError + return nil, nil, model.ErrNoAccountSlice } params := url.Values{} @@ -203,7 +203,7 @@ func (i *internalUserImpl) Find(ctx context.Context, accountIDs []string, startA func (i *internalUserImpl) Groups(ctx context.Context, accountID string) ([]*model.UserGroupScheme, *model.ResponseScheme, error) { if accountID == "" { - return nil, nil, model.ErrNoAccountIDError + return nil, nil, model.ErrNoAccountID } params := url.Values{} diff --git a/jira/internal/user_impl_test.go b/jira/internal/user_impl_test.go index c11095d9..c8e45f46 100644 --- a/jira/internal/user_impl_test.go +++ b/jira/internal/user_impl_test.go @@ -102,7 +102,7 @@ func Test_internalUserImpl_Get(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoAccountIDError, + Err: model.ErrNoAccountID, }, { @@ -253,7 +253,7 @@ func Test_internalUserImpl_Find(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoAccountSliceError, + Err: model.ErrNoAccountSlice, }, { @@ -400,7 +400,7 @@ func Test_internalUserImpl_Delete(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoAccountIDError, + Err: model.ErrNoAccountID, }, { @@ -543,7 +543,7 @@ func Test_internalUserImpl_Groups(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoAccountIDError, + Err: model.ErrNoAccountID, }, { diff --git a/jira/internal/user_search_impl.go b/jira/internal/user_search_impl.go index 87489701..06763f75 100644 --- a/jira/internal/user_search_impl.go +++ b/jira/internal/user_search_impl.go @@ -79,7 +79,7 @@ type internalUserSearchImpl struct { func (i *internalUserSearchImpl) Check(ctx context.Context, permission string, options *model.UserPermissionCheckParamsScheme, startAt, maxResults int) ([]*model.UserScheme, *model.ResponseScheme, error) { if permission == "" { - return nil, nil, model.ErrNoPermissionGrantIDError + return nil, nil, model.ErrNoPermissionGrantID } params := url.Values{} @@ -125,7 +125,7 @@ func (i *internalUserSearchImpl) Check(ctx context.Context, permission string, o func (i *internalUserSearchImpl) Projects(ctx context.Context, accountID string, projectKeys []string, startAt, maxResults int) ([]*model.UserScheme, *model.ResponseScheme, error) { if len(projectKeys) == 0 { - return nil, nil, model.ErrNoProjectKeySliceError + return nil, nil, model.ErrNoProjectKeySlice } params := url.Values{} diff --git a/jira/internal/user_search_impl_test.go b/jira/internal/user_search_impl_test.go index 7fc33590..7ab6dc36 100644 --- a/jira/internal/user_search_impl_test.go +++ b/jira/internal/user_search_impl_test.go @@ -108,7 +108,7 @@ func Test_internalUserSearchImpl_Projects(t *testing.T) { projectKeys: nil, }, wantErr: true, - Err: model.ErrNoProjectKeySliceError, + Err: model.ErrNoProjectKeySlice, }, { @@ -387,7 +387,7 @@ func Test_internalUserSearchImpl_Check(t *testing.T) { fields.c = client }, wantErr: true, - Err: model.ErrNoPermissionGrantIDError, + Err: model.ErrNoPermissionGrantID, }, { diff --git a/jira/internal/vote_impl.go b/jira/internal/vote_impl.go index 5523795a..7ec689a6 100644 --- a/jira/internal/vote_impl.go +++ b/jira/internal/vote_impl.go @@ -69,7 +69,7 @@ type internalVoteImpl struct { func (i *internalVoteImpl) Gets(ctx context.Context, issueKeyOrID string) (*model.IssueVoteScheme, *model.ResponseScheme, error) { if issueKeyOrID == "" { - return nil, nil, model.ErrNoIssueKeyOrIDError + return nil, nil, model.ErrNoIssueKeyOrID } endpoint := fmt.Sprintf("rest/api/%v/issue/%v/votes", i.version, issueKeyOrID) @@ -91,7 +91,7 @@ func (i *internalVoteImpl) Gets(ctx context.Context, issueKeyOrID string) (*mode func (i *internalVoteImpl) Add(ctx context.Context, issueKeyOrID string) (*model.ResponseScheme, error) { if issueKeyOrID == "" { - return nil, model.ErrNoIssueKeyOrIDError + return nil, model.ErrNoIssueKeyOrID } endpoint := fmt.Sprintf("rest/api/%v/issue/%v/votes", i.version, issueKeyOrID) @@ -107,7 +107,7 @@ func (i *internalVoteImpl) Add(ctx context.Context, issueKeyOrID string) (*model func (i *internalVoteImpl) Delete(ctx context.Context, issueKeyOrID string) (*model.ResponseScheme, error) { if issueKeyOrID == "" { - return nil, model.ErrNoIssueKeyOrIDError + return nil, model.ErrNoIssueKeyOrID } endpoint := fmt.Sprintf("rest/api/%v/issue/%v/votes", i.version, issueKeyOrID) diff --git a/jira/internal/vote_impl_test.go b/jira/internal/vote_impl_test.go index 45f132bc..5c94b3fc 100644 --- a/jira/internal/vote_impl_test.go +++ b/jira/internal/vote_impl_test.go @@ -101,7 +101,7 @@ func Test_internalVoteImpl_Gets(t *testing.T) { issueKeyOrID: "", }, wantErr: true, - Err: model.ErrNoIssueKeyOrIDError, + Err: model.ErrNoIssueKeyOrID, }, { @@ -249,7 +249,7 @@ func Test_internalVoteImpl_Add(t *testing.T) { issueKeyOrID: "", }, wantErr: true, - Err: model.ErrNoIssueKeyOrIDError, + Err: model.ErrNoIssueKeyOrID, }, { @@ -396,7 +396,7 @@ func Test_internalVoteImpl_Delete(t *testing.T) { issueKeyOrID: "", }, wantErr: true, - Err: model.ErrNoIssueKeyOrIDError, + Err: model.ErrNoIssueKeyOrID, }, { diff --git a/jira/internal/watcher_impl.go b/jira/internal/watcher_impl.go index 7a739493..02f5af03 100644 --- a/jira/internal/watcher_impl.go +++ b/jira/internal/watcher_impl.go @@ -66,7 +66,7 @@ type internalWatcherImpl struct { func (i *internalWatcherImpl) Gets(ctx context.Context, issueKeyOrID string) (*model.IssueWatcherScheme, *model.ResponseScheme, error) { if issueKeyOrID == "" { - return nil, nil, model.ErrNoIssueKeyOrIDError + return nil, nil, model.ErrNoIssueKeyOrID } endpoint := fmt.Sprintf("rest/api/%v/issue/%v/watchers", i.version, issueKeyOrID) @@ -88,7 +88,7 @@ func (i *internalWatcherImpl) Gets(ctx context.Context, issueKeyOrID string) (*m func (i *internalWatcherImpl) Add(ctx context.Context, issueKeyOrID string, accountID ...string) (*model.ResponseScheme, error) { if issueKeyOrID == "" { - return nil, model.ErrNoIssueKeyOrIDError + return nil, model.ErrNoIssueKeyOrID } endpoint := fmt.Sprintf("rest/api/%v/issue/%v/watchers", i.version, issueKeyOrID) @@ -108,11 +108,11 @@ func (i *internalWatcherImpl) Add(ctx context.Context, issueKeyOrID string, acco func (i *internalWatcherImpl) Delete(ctx context.Context, issueKeyOrID, accountID string) (*model.ResponseScheme, error) { if issueKeyOrID == "" { - return nil, model.ErrNoIssueKeyOrIDError + return nil, model.ErrNoIssueKeyOrID } if accountID == "" { - return nil, model.ErrNoAccountIDError + return nil, model.ErrNoAccountID } params := url.Values{} diff --git a/jira/internal/watcher_impl_test.go b/jira/internal/watcher_impl_test.go index 0fa025d3..c7c10405 100644 --- a/jira/internal/watcher_impl_test.go +++ b/jira/internal/watcher_impl_test.go @@ -101,7 +101,7 @@ func Test_internalWatcherImpl_Gets(t *testing.T) { issueKeyOrID: "", }, wantErr: true, - Err: model.ErrNoIssueKeyOrIDError, + Err: model.ErrNoIssueKeyOrID, }, { @@ -315,7 +315,7 @@ func Test_internalWatcherImpl_Add(t *testing.T) { issueKeyOrID: "", }, wantErr: true, - Err: model.ErrNoIssueKeyOrIDError, + Err: model.ErrNoIssueKeyOrID, }, { @@ -466,7 +466,7 @@ func Test_internalWatcherImpl_Delete(t *testing.T) { issueKeyOrID: "", }, wantErr: true, - Err: model.ErrNoIssueKeyOrIDError, + Err: model.ErrNoIssueKeyOrID, }, { @@ -478,7 +478,7 @@ func Test_internalWatcherImpl_Delete(t *testing.T) { accountID: "", }, wantErr: true, - Err: model.ErrNoAccountIDError, + Err: model.ErrNoAccountID, }, { diff --git a/jira/internal/workflow_impl.go b/jira/internal/workflow_impl.go index 8e520353..23f93292 100644 --- a/jira/internal/workflow_impl.go +++ b/jira/internal/workflow_impl.go @@ -444,7 +444,7 @@ func (i *internalWorkflowImpl) Gets(ctx context.Context, options *model.Workflow func (i *internalWorkflowImpl) Delete(ctx context.Context, workflowID string) (*model.ResponseScheme, error) { if workflowID == "" { - return nil, model.ErrNoWorkflowIDError + return nil, model.ErrNoWorkflowID } endpoint := fmt.Sprintf("rest/api/%v/workflow/%v", i.version, workflowID) diff --git a/jira/internal/workflow_impl_test.go b/jira/internal/workflow_impl_test.go index 9b506f23..3d0b9df2 100644 --- a/jira/internal/workflow_impl_test.go +++ b/jira/internal/workflow_impl_test.go @@ -260,7 +260,7 @@ func Test_internalWorkflowImpl_Delete(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoWorkflowIDError, + Err: model.ErrNoWorkflowID, }, { diff --git a/jira/internal/workflow_scheme_impl.go b/jira/internal/workflow_scheme_impl.go index 9c7be77c..04809df8 100644 --- a/jira/internal/workflow_scheme_impl.go +++ b/jira/internal/workflow_scheme_impl.go @@ -159,7 +159,7 @@ func (i *internalWorkflowSchemeImpl) Create(ctx context.Context, payload *model. func (i *internalWorkflowSchemeImpl) Get(ctx context.Context, schemeID int, returnDraftIfExists bool) (*model.WorkflowSchemeScheme, *model.ResponseScheme, error) { if schemeID == 0 { - return nil, nil, model.ErrNoWorkflowSchemeIDError + return nil, nil, model.ErrNoWorkflowSchemeID } var endpoint strings.Builder @@ -190,7 +190,7 @@ func (i *internalWorkflowSchemeImpl) Get(ctx context.Context, schemeID int, retu func (i *internalWorkflowSchemeImpl) Update(ctx context.Context, schemeID int, payload *model.WorkflowSchemePayloadScheme) (*model.WorkflowSchemeScheme, *model.ResponseScheme, error) { if schemeID == 0 { - return nil, nil, model.ErrNoWorkflowSchemeIDError + return nil, nil, model.ErrNoWorkflowSchemeID } endpoint := fmt.Sprintf("rest/api/%v/workflowscheme/%v", i.version, schemeID) @@ -212,7 +212,7 @@ func (i *internalWorkflowSchemeImpl) Update(ctx context.Context, schemeID int, p func (i *internalWorkflowSchemeImpl) Delete(ctx context.Context, schemeID int) (*model.ResponseScheme, error) { if schemeID == 0 { - return nil, model.ErrNoWorkflowSchemeIDError + return nil, model.ErrNoWorkflowSchemeID } endpoint := fmt.Sprintf("rest/api/%v/workflowscheme/%v", i.version, schemeID) @@ -228,7 +228,7 @@ func (i *internalWorkflowSchemeImpl) Delete(ctx context.Context, schemeID int) ( func (i *internalWorkflowSchemeImpl) Associations(ctx context.Context, projectIDs []int) (*model.WorkflowSchemeAssociationPageScheme, *model.ResponseScheme, error) { if len(projectIDs) == 0 { - return nil, nil, model.ErrNoProjectsError + return nil, nil, model.ErrNoProjects } params := url.Values{} @@ -255,11 +255,11 @@ func (i *internalWorkflowSchemeImpl) Associations(ctx context.Context, projectID func (i *internalWorkflowSchemeImpl) Assign(ctx context.Context, schemeID, projectID string) (*model.ResponseScheme, error) { if schemeID == "" { - return nil, model.ErrNoWorkflowSchemeIDError + return nil, model.ErrNoWorkflowSchemeID } if projectID == "" { - return nil, model.ErrNoProjectIDOrKeyError + return nil, model.ErrNoProjectIDOrKey } endpoint := fmt.Sprintf("rest/api/%v/workflowscheme/project", i.version) diff --git a/jira/internal/workflow_scheme_impl_test.go b/jira/internal/workflow_scheme_impl_test.go index 7f50d57d..643ec6e1 100644 --- a/jira/internal/workflow_scheme_impl_test.go +++ b/jira/internal/workflow_scheme_impl_test.go @@ -237,7 +237,7 @@ func Test_internalWorkflowSchemeImpl_Get(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoWorkflowSchemeIDError, + Err: model.ErrNoWorkflowSchemeID, }, { @@ -381,7 +381,7 @@ func Test_internalWorkflowSchemeImpl_Delete(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoWorkflowSchemeIDError, + Err: model.ErrNoWorkflowSchemeID, }, { @@ -523,7 +523,7 @@ func Test_internalWorkflowSchemeImpl_Associations(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoProjectsError, + Err: model.ErrNoProjects, }, { @@ -670,7 +670,7 @@ func Test_internalWorkflowSchemeImpl_Assign(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoWorkflowSchemeIDError, + Err: model.ErrNoWorkflowSchemeID, }, { @@ -681,7 +681,7 @@ func Test_internalWorkflowSchemeImpl_Assign(t *testing.T) { schemeID: "1004561", }, wantErr: true, - Err: model.ErrNoProjectIDOrKeyError, + Err: model.ErrNoProjectIDOrKey, }, { @@ -836,7 +836,7 @@ func Test_internalWorkflowSchemeImpl_Update(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoWorkflowSchemeIDError, + Err: model.ErrNoWorkflowSchemeID, }, { diff --git a/jira/internal/workflow_scheme_issue_type_impl.go b/jira/internal/workflow_scheme_issue_type_impl.go index d85ca6a7..f6d7a0ca 100644 --- a/jira/internal/workflow_scheme_issue_type_impl.go +++ b/jira/internal/workflow_scheme_issue_type_impl.go @@ -85,11 +85,11 @@ type internalWorkflowSchemeIssueTypeImpl struct { func (i *internalWorkflowSchemeIssueTypeImpl) Get(ctx context.Context, schemeID int, issueTypeID string, returnDraft bool) (*model.IssueTypeWorkflowMappingScheme, *model.ResponseScheme, error) { if schemeID == 0 { - return nil, nil, model.ErrNoWorkflowSchemeIDError + return nil, nil, model.ErrNoWorkflowSchemeID } if issueTypeID == "" { - return nil, nil, model.ErrNoIssueTypeIDError + return nil, nil, model.ErrNoIssueTypeID } var endpoint strings.Builder @@ -119,11 +119,11 @@ func (i *internalWorkflowSchemeIssueTypeImpl) Get(ctx context.Context, schemeID func (i *internalWorkflowSchemeIssueTypeImpl) Set(ctx context.Context, schemeID int, issueTypeID string, payload *model.IssueTypeWorkflowPayloadScheme) (*model.WorkflowSchemeScheme, *model.ResponseScheme, error) { if schemeID == 0 { - return nil, nil, model.ErrNoWorkflowSchemeIDError + return nil, nil, model.ErrNoWorkflowSchemeID } if issueTypeID == "" { - return nil, nil, model.ErrNoIssueTypeIDError + return nil, nil, model.ErrNoIssueTypeID } endpoint := fmt.Sprintf("rest/api/%v/workflowscheme/%v/issuetype/%v", i.version, schemeID, issueTypeID) @@ -145,11 +145,11 @@ func (i *internalWorkflowSchemeIssueTypeImpl) Set(ctx context.Context, schemeID func (i *internalWorkflowSchemeIssueTypeImpl) Delete(ctx context.Context, schemeID int, issueTypeID string, updateDraft bool) (*model.WorkflowSchemeScheme, *model.ResponseScheme, error) { if schemeID == 0 { - return nil, nil, model.ErrNoWorkflowSchemeIDError + return nil, nil, model.ErrNoWorkflowSchemeID } if issueTypeID == "" { - return nil, nil, model.ErrNoIssueTypeIDError + return nil, nil, model.ErrNoIssueTypeID } var endpoint strings.Builder @@ -179,7 +179,7 @@ func (i *internalWorkflowSchemeIssueTypeImpl) Delete(ctx context.Context, scheme func (i *internalWorkflowSchemeIssueTypeImpl) Mapping(ctx context.Context, schemeID int, workflowName string, returnDraft bool) ([]*model.IssueTypesWorkflowMappingScheme, *model.ResponseScheme, error) { if schemeID == 0 { - return nil, nil, model.ErrNoWorkflowSchemeIDError + return nil, nil, model.ErrNoWorkflowSchemeID } var endpoint strings.Builder diff --git a/jira/internal/workflow_scheme_issue_type_impl_test.go b/jira/internal/workflow_scheme_issue_type_impl_test.go index 33923cab..360bb703 100644 --- a/jira/internal/workflow_scheme_issue_type_impl_test.go +++ b/jira/internal/workflow_scheme_issue_type_impl_test.go @@ -72,7 +72,7 @@ func Test_internalWorkflowSchemeIssueTypeImpl_Get(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoWorkflowSchemeIDError, + Err: model.ErrNoWorkflowSchemeID, }, { @@ -83,7 +83,7 @@ func Test_internalWorkflowSchemeIssueTypeImpl_Get(t *testing.T) { schemeID: 10002, }, wantErr: true, - Err: model.ErrNoIssueTypeIDError, + Err: model.ErrNoIssueTypeID, }, { @@ -235,7 +235,7 @@ func Test_internalWorkflowSchemeIssueTypeImpl_Mapping(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoWorkflowSchemeIDError, + Err: model.ErrNoWorkflowSchemeID, }, { @@ -387,7 +387,7 @@ func Test_internalWorkflowSchemeIssueTypeImpl_Delete(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoWorkflowSchemeIDError, + Err: model.ErrNoWorkflowSchemeID, }, { @@ -398,7 +398,7 @@ func Test_internalWorkflowSchemeIssueTypeImpl_Delete(t *testing.T) { schemeID: 10002, }, wantErr: true, - Err: model.ErrNoIssueTypeIDError, + Err: model.ErrNoIssueTypeID, }, { @@ -556,7 +556,7 @@ func Test_internalWorkflowSchemeIssueTypeImpl_Set(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoWorkflowSchemeIDError, + Err: model.ErrNoWorkflowSchemeID, }, { @@ -567,7 +567,7 @@ func Test_internalWorkflowSchemeIssueTypeImpl_Set(t *testing.T) { schemeID: 10002, }, wantErr: true, - Err: model.ErrNoIssueTypeIDError, + Err: model.ErrNoIssueTypeID, }, { diff --git a/jira/internal/workflow_status_impl.go b/jira/internal/workflow_status_impl.go index 33fc8ff7..5c4dd1fb 100644 --- a/jira/internal/workflow_status_impl.go +++ b/jira/internal/workflow_status_impl.go @@ -109,7 +109,7 @@ type internalWorkflowStatusImpl struct { func (i *internalWorkflowStatusImpl) Get(ctx context.Context, idOrName string) (*model.StatusDetailScheme, *model.ResponseScheme, error) { if idOrName == "" { - return nil, nil, model.ErrNoWorkflowStatusNameOrIdError + return nil, nil, model.ErrNoWorkflowStatusNameOrId } endpoint := fmt.Sprintf("/rest/api/%v/status/%v", i.version, idOrName) @@ -193,11 +193,11 @@ func (i *internalWorkflowStatusImpl) Update(ctx context.Context, payload *model. func (i *internalWorkflowStatusImpl) Create(ctx context.Context, payload *model.WorkflowStatusPayloadScheme) ([]*model.WorkflowStatusDetailScheme, *model.ResponseScheme, error) { if len(payload.Statuses) == 0 { - return nil, nil, model.ErrNoWorkflowStatusesError + return nil, nil, model.ErrNoWorkflowStatuses } if payload.Scope == nil { - return nil, nil, model.ErrNoWorkflowScopeError + return nil, nil, model.ErrNoWorkflowScope } endpoint := fmt.Sprintf("rest/api/%v/statuses", i.version) @@ -219,7 +219,7 @@ func (i *internalWorkflowStatusImpl) Create(ctx context.Context, payload *model. func (i *internalWorkflowStatusImpl) Delete(ctx context.Context, ids []string) (*model.ResponseScheme, error) { if len(ids) == 0 { - return nil, model.ErrNoWorkflowStatusesError + return nil, model.ErrNoWorkflowStatuses } params := url.Values{} diff --git a/jira/internal/workflow_status_impl_test.go b/jira/internal/workflow_status_impl_test.go index f3125be3..3d338038 100644 --- a/jira/internal/workflow_status_impl_test.go +++ b/jira/internal/workflow_status_impl_test.go @@ -431,7 +431,7 @@ func Test_internalWorkflowStatusImpl_Create(t *testing.T) { fields.c = client }, wantErr: true, - Err: model.ErrNoWorkflowStatusesError, + Err: model.ErrNoWorkflowStatuses, }, { @@ -448,7 +448,7 @@ func Test_internalWorkflowStatusImpl_Create(t *testing.T) { fields.c = client }, wantErr: true, - Err: model.ErrNoWorkflowScopeError, + Err: model.ErrNoWorkflowScope, }, { @@ -592,7 +592,7 @@ func Test_internalWorkflowStatusImpl_Delete(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoWorkflowStatusesError, + Err: model.ErrNoWorkflowStatuses, }, { diff --git a/jira/internal/worklog_impl_adf.go b/jira/internal/worklog_impl_adf.go index cfc5afd1..937b15f4 100644 --- a/jira/internal/worklog_impl_adf.go +++ b/jira/internal/worklog_impl_adf.go @@ -137,7 +137,7 @@ type internalWorklogAdfImpl struct { func (i *internalWorklogAdfImpl) Gets(ctx context.Context, worklogIDs []int, expand []string) ([]*model.IssueWorklogADFScheme, *model.ResponseScheme, error) { if len(worklogIDs) == 0 { - return nil, nil, model.ErrNpWorklogsError + return nil, nil, model.ErrNpWorklogs } params := url.Values{} @@ -169,11 +169,11 @@ func (i *internalWorklogAdfImpl) Gets(ctx context.Context, worklogIDs []int, exp func (i *internalWorklogAdfImpl) Get(ctx context.Context, issueKeyOrID, worklogID string, expand []string) (*model.IssueWorklogADFScheme, *model.ResponseScheme, error) { if issueKeyOrID == "" { - return nil, nil, model.ErrNoIssueKeyOrIDError + return nil, nil, model.ErrNoIssueKeyOrID } if worklogID == "" { - return nil, nil, model.ErrNoWorklogIDError + return nil, nil, model.ErrNoWorklogID } params := url.Values{} @@ -205,7 +205,7 @@ func (i *internalWorklogAdfImpl) Get(ctx context.Context, issueKeyOrID, worklogI func (i *internalWorklogAdfImpl) Issue(ctx context.Context, issueKeyOrID string, startAt, maxResults, after int, expand []string) (*model.IssueWorklogADFPageScheme, *model.ResponseScheme, error) { if issueKeyOrID == "" { - return nil, nil, model.ErrNoIssueKeyOrIDError + return nil, nil, model.ErrNoIssueKeyOrID } params := url.Values{} @@ -239,11 +239,11 @@ func (i *internalWorklogAdfImpl) Issue(ctx context.Context, issueKeyOrID string, func (i *internalWorklogAdfImpl) Delete(ctx context.Context, issueKeyOrID, worklogID string, options *model.WorklogOptionsScheme) (*model.ResponseScheme, error) { if issueKeyOrID == "" { - return nil, model.ErrNoIssueKeyOrIDError + return nil, model.ErrNoIssueKeyOrID } if worklogID == "" { - return nil, model.ErrNoWorklogIDError + return nil, model.ErrNoWorklogID } var endpoint strings.Builder @@ -345,7 +345,7 @@ func (i *internalWorklogAdfImpl) Updated(ctx context.Context, since int, expand func (i *internalWorklogAdfImpl) Add(ctx context.Context, issueKeyOrID string, payload *model.WorklogADFPayloadScheme, options *model.WorklogOptionsScheme) (*model.IssueWorklogADFScheme, *model.ResponseScheme, error) { if issueKeyOrID == "" { - return nil, nil, model.ErrNoIssueKeyOrIDError + return nil, nil, model.ErrNoIssueKeyOrID } var endpoint strings.Builder @@ -394,11 +394,11 @@ func (i *internalWorklogAdfImpl) Add(ctx context.Context, issueKeyOrID string, p func (i *internalWorklogAdfImpl) Update(ctx context.Context, issueKeyOrID, worklogID string, payload *model.WorklogADFPayloadScheme, options *model.WorklogOptionsScheme) (*model.IssueWorklogADFScheme, *model.ResponseScheme, error) { if issueKeyOrID == "" { - return nil, nil, model.ErrNoIssueKeyOrIDError + return nil, nil, model.ErrNoIssueKeyOrID } if worklogID == "" { - return nil, nil, model.ErrNoWorklogIDError + return nil, nil, model.ErrNoWorklogID } var endpoint strings.Builder diff --git a/jira/internal/worklog_impl_adf_test.go b/jira/internal/worklog_impl_adf_test.go index 31b5ae2a..738556a2 100644 --- a/jira/internal/worklog_impl_adf_test.go +++ b/jira/internal/worklog_impl_adf_test.go @@ -104,7 +104,7 @@ func Test_internalWorklogAdfImpl_Gets(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNpWorklogsError, + Err: model.ErrNpWorklogs, }, { @@ -254,7 +254,7 @@ func Test_internalWorklogAdfImpl_Get(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoIssueKeyOrIDError, + Err: model.ErrNoIssueKeyOrID, }, { @@ -265,7 +265,7 @@ func Test_internalWorklogAdfImpl_Get(t *testing.T) { issueKeyOrID: "DUMMY-5", }, wantErr: true, - Err: model.ErrNoWorklogIDError, + Err: model.ErrNoWorklogID, }, { @@ -421,7 +421,7 @@ func Test_internalWorklogAdfImpl_Issue(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoIssueKeyOrIDError, + Err: model.ErrNoIssueKeyOrID, }, { @@ -619,7 +619,7 @@ func Test_internalWorklogAdfImpl_Delete(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoIssueKeyOrIDError, + Err: model.ErrNoIssueKeyOrID, }, { @@ -630,7 +630,7 @@ func Test_internalWorklogAdfImpl_Delete(t *testing.T) { issueKeyOrID: "DUMMY-5", }, wantErr: true, - Err: model.ErrNoWorklogIDError, + Err: model.ErrNoWorklogID, }, { @@ -1285,7 +1285,7 @@ func Test_internalWorklogAdfImpl_Update(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoIssueKeyOrIDError, + Err: model.ErrNoIssueKeyOrID, }, { @@ -1296,7 +1296,7 @@ func Test_internalWorklogAdfImpl_Update(t *testing.T) { issueKeyOrID: "DUMMY-5", }, wantErr: true, - Err: model.ErrNoWorklogIDError, + Err: model.ErrNoWorklogID, }, { diff --git a/jira/internal/worklog_impl_rich_text.go b/jira/internal/worklog_impl_rich_text.go index 94961284..01ba12c2 100644 --- a/jira/internal/worklog_impl_rich_text.go +++ b/jira/internal/worklog_impl_rich_text.go @@ -137,7 +137,7 @@ type internalWorklogRichTextImpl struct { func (i *internalWorklogRichTextImpl) Gets(ctx context.Context, worklogIds []int, expand []string) ([]*model.IssueWorklogRichTextScheme, *model.ResponseScheme, error) { if len(worklogIds) == 0 { - return nil, nil, model.ErrNpWorklogsError + return nil, nil, model.ErrNpWorklogs } params := url.Values{} @@ -169,11 +169,11 @@ func (i *internalWorklogRichTextImpl) Gets(ctx context.Context, worklogIds []int func (i *internalWorklogRichTextImpl) Get(ctx context.Context, issueKeyOrID, worklogId string, expand []string) (*model.IssueWorklogRichTextScheme, *model.ResponseScheme, error) { if issueKeyOrID == "" { - return nil, nil, model.ErrNoIssueKeyOrIDError + return nil, nil, model.ErrNoIssueKeyOrID } if worklogId == "" { - return nil, nil, model.ErrNoWorklogIDError + return nil, nil, model.ErrNoWorklogID } params := url.Values{} @@ -205,7 +205,7 @@ func (i *internalWorklogRichTextImpl) Get(ctx context.Context, issueKeyOrID, wor func (i *internalWorklogRichTextImpl) Issue(ctx context.Context, issueKeyOrID string, startAt, maxResults, after int, expand []string) (*model.IssueWorklogRichTextPageScheme, *model.ResponseScheme, error) { if issueKeyOrID == "" { - return nil, nil, model.ErrNoIssueKeyOrIDError + return nil, nil, model.ErrNoIssueKeyOrID } params := url.Values{} @@ -239,11 +239,11 @@ func (i *internalWorklogRichTextImpl) Issue(ctx context.Context, issueKeyOrID st func (i *internalWorklogRichTextImpl) Delete(ctx context.Context, issueKeyOrID, worklogId string, options *model.WorklogOptionsScheme) (*model.ResponseScheme, error) { if issueKeyOrID == "" { - return nil, model.ErrNoIssueKeyOrIDError + return nil, model.ErrNoIssueKeyOrID } if worklogId == "" { - return nil, model.ErrNoWorklogIDError + return nil, model.ErrNoWorklogID } var endpoint strings.Builder @@ -345,7 +345,7 @@ func (i *internalWorklogRichTextImpl) Updated(ctx context.Context, since int, ex func (i *internalWorklogRichTextImpl) Add(ctx context.Context, issueKeyOrID string, payload *model.WorklogRichTextPayloadScheme, options *model.WorklogOptionsScheme) (*model.IssueWorklogRichTextScheme, *model.ResponseScheme, error) { if issueKeyOrID == "" { - return nil, nil, model.ErrNoIssueKeyOrIDError + return nil, nil, model.ErrNoIssueKeyOrID } var endpoint strings.Builder @@ -394,11 +394,11 @@ func (i *internalWorklogRichTextImpl) Add(ctx context.Context, issueKeyOrID stri func (i *internalWorklogRichTextImpl) Update(ctx context.Context, issueKeyOrID, worklogId string, payload *model.WorklogRichTextPayloadScheme, options *model.WorklogOptionsScheme) (*model.IssueWorklogRichTextScheme, *model.ResponseScheme, error) { if issueKeyOrID == "" { - return nil, nil, model.ErrNoIssueKeyOrIDError + return nil, nil, model.ErrNoIssueKeyOrID } if worklogId == "" { - return nil, nil, model.ErrNoWorklogIDError + return nil, nil, model.ErrNoWorklogID } var endpoint strings.Builder diff --git a/jira/internal/worklog_impl_rich_text_test.go b/jira/internal/worklog_impl_rich_text_test.go index e3a16667..bb5439f9 100644 --- a/jira/internal/worklog_impl_rich_text_test.go +++ b/jira/internal/worklog_impl_rich_text_test.go @@ -74,7 +74,7 @@ func Test_internalWorklogRichTextImpl_Gets(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNpWorklogsError, + Err: model.ErrNpWorklogs, }, { @@ -224,7 +224,7 @@ func Test_internalWorklogRichTextImpl_Get(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoIssueKeyOrIDError, + Err: model.ErrNoIssueKeyOrID, }, { @@ -235,7 +235,7 @@ func Test_internalWorklogRichTextImpl_Get(t *testing.T) { issueKeyOrID: "DUMMY-5", }, wantErr: true, - Err: model.ErrNoWorklogIDError, + Err: model.ErrNoWorklogID, }, { @@ -391,7 +391,7 @@ func Test_internalWorklogRichTextImpl_Issue(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoIssueKeyOrIDError, + Err: model.ErrNoIssueKeyOrID, }, { @@ -589,7 +589,7 @@ func Test_internalWorklogRichTextImpl_Delete(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoIssueKeyOrIDError, + Err: model.ErrNoIssueKeyOrID, }, { @@ -600,7 +600,7 @@ func Test_internalWorklogRichTextImpl_Delete(t *testing.T) { issueKeyOrID: "DUMMY-5", }, wantErr: true, - Err: model.ErrNoWorklogIDError, + Err: model.ErrNoWorklogID, }, { @@ -1227,7 +1227,7 @@ func Test_internalWorklogRichTextImpl_Update(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoIssueKeyOrIDError, + Err: model.ErrNoIssueKeyOrID, }, { @@ -1238,7 +1238,7 @@ func Test_internalWorklogRichTextImpl_Update(t *testing.T) { issueKeyOrID: "DUMMY-5", }, wantErr: true, - Err: model.ErrNoWorklogIDError, + Err: model.ErrNoWorklogID, }, { diff --git a/jira/sm/api_client_impl.go b/jira/sm/api_client_impl.go index 938a941b..28bb13ad 100644 --- a/jira/sm/api_client_impl.go +++ b/jira/sm/api_client_impl.go @@ -5,13 +5,14 @@ import ( "context" "encoding/json" "fmt" - "github.com/ctreminiom/go-atlassian/jira/sm/internal" - model "github.com/ctreminiom/go-atlassian/pkg/infra/models" - "github.com/ctreminiom/go-atlassian/service/common" "io" "net/http" "net/url" "strings" + + "github.com/ctreminiom/go-atlassian/jira/sm/internal" + model "github.com/ctreminiom/go-atlassian/pkg/infra/models" + "github.com/ctreminiom/go-atlassian/service/common" ) const defaultServiceManagementVersion = "latest" @@ -23,7 +24,7 @@ func New(httpClient common.HttpClient, site string) (*Client, error) { } if site == "" { - return nil, model.ErrNoSiteError + return nil, model.ErrNoSite } if !strings.HasSuffix(site, "/") { @@ -188,13 +189,13 @@ func (c *Client) processResponse(response *http.Response, structure interface{}) return res, model.ErrUnauthorized case http.StatusInternalServerError: - return res, model.ErrInternalError + return res, model.ErrInternal case http.StatusBadRequest: - return res, model.ErrBadRequestError + return res, model.ErrBadRequest default: - return res, model.ErrInvalidStatusCodeError + return res, model.ErrInvalidStatusCode } } diff --git a/jira/sm/api_client_impl_test.go b/jira/sm/api_client_impl_test.go index 720821b2..09c8e953 100644 --- a/jira/sm/api_client_impl_test.go +++ b/jira/sm/api_client_impl_test.go @@ -4,16 +4,18 @@ import ( "bytes" "context" "errors" - "github.com/ctreminiom/go-atlassian/jira/sm/internal" - model "github.com/ctreminiom/go-atlassian/pkg/infra/models" - "github.com/ctreminiom/go-atlassian/service/common" - "github.com/ctreminiom/go-atlassian/service/mocks" - "github.com/stretchr/testify/assert" "io" "net/http" "net/url" "strings" "testing" + + "github.com/stretchr/testify/assert" + + "github.com/ctreminiom/go-atlassian/jira/sm/internal" + model "github.com/ctreminiom/go-atlassian/pkg/infra/models" + "github.com/ctreminiom/go-atlassian/service/common" + "github.com/ctreminiom/go-atlassian/service/mocks" ) func TestClient_Call(t *testing.T) { @@ -128,7 +130,7 @@ func TestClient_Call(t *testing.T) { Bytes: *bytes.NewBufferString("Hello, world!"), }, wantErr: true, - Err: model.ErrBadRequestError, + Err: model.ErrBadRequest, }, { @@ -153,7 +155,7 @@ func TestClient_Call(t *testing.T) { Bytes: *bytes.NewBufferString("Hello, world!"), }, wantErr: true, - Err: model.ErrInternalError, + Err: model.ErrInternal, }, { @@ -497,7 +499,7 @@ func TestNew(t *testing.T) { }, want: noURLClientMocked, wantErr: true, - Err: model.ErrNoSiteError, + Err: model.ErrNoSite, }, { name: "when the site url is not valid", diff --git a/jira/sm/internal/approval_impl.go b/jira/sm/internal/approval_impl.go index 13856af2..6ab3538a 100644 --- a/jira/sm/internal/approval_impl.go +++ b/jira/sm/internal/approval_impl.go @@ -63,7 +63,7 @@ type internalServiceRequestApprovalImpl struct { func (i *internalServiceRequestApprovalImpl) Gets(ctx context.Context, issueKeyOrID string, start, limit int) (*model.CustomerApprovalPageScheme, *model.ResponseScheme, error) { if issueKeyOrID == "" { - return nil, nil, model.ErrNoIssueKeyOrIDError + return nil, nil, model.ErrNoIssueKeyOrID } params := url.Values{} @@ -89,11 +89,11 @@ func (i *internalServiceRequestApprovalImpl) Gets(ctx context.Context, issueKeyO func (i *internalServiceRequestApprovalImpl) Get(ctx context.Context, issueKeyOrID string, approvalID int) (*model.CustomerApprovalScheme, *model.ResponseScheme, error) { if issueKeyOrID == "" { - return nil, nil, model.ErrNoIssueKeyOrIDError + return nil, nil, model.ErrNoIssueKeyOrID } if approvalID == 0 { - return nil, nil, model.ErrNoApprovalIDError + return nil, nil, model.ErrNoApprovalID } url := fmt.Sprintf("rest/servicedeskapi/request/%v/approval/%v", issueKeyOrID, approvalID) @@ -115,11 +115,11 @@ func (i *internalServiceRequestApprovalImpl) Get(ctx context.Context, issueKeyOr func (i *internalServiceRequestApprovalImpl) Answer(ctx context.Context, issueKeyOrID string, approvalID int, approve bool) (*model.CustomerApprovalScheme, *model.ResponseScheme, error) { if issueKeyOrID == "" { - return nil, nil, model.ErrNoIssueKeyOrIDError + return nil, nil, model.ErrNoIssueKeyOrID } if approvalID == 0 { - return nil, nil, model.ErrNoApprovalIDError + return nil, nil, model.ErrNoApprovalID } url := fmt.Sprintf("rest/servicedeskapi/request/%v/approval/%v", issueKeyOrID, approvalID) diff --git a/jira/sm/internal/approval_impl_test.go b/jira/sm/internal/approval_impl_test.go index 440f5e82..db7d5608 100644 --- a/jira/sm/internal/approval_impl_test.go +++ b/jira/sm/internal/approval_impl_test.go @@ -3,12 +3,14 @@ package internal import ( "context" "errors" + "net/http" + "testing" + + "github.com/stretchr/testify/assert" + model "github.com/ctreminiom/go-atlassian/pkg/infra/models" "github.com/ctreminiom/go-atlassian/service" "github.com/ctreminiom/go-atlassian/service/mocks" - "github.com/stretchr/testify/assert" - "net/http" - "testing" ) func Test_internalServiceRequestApprovalImpl_Gets(t *testing.T) { @@ -125,7 +127,7 @@ func Test_internalServiceRequestApprovalImpl_Gets(t *testing.T) { on: func(fields *fields) { fields.c = mocks.NewConnector(t) }, - Err: model.ErrNoIssueKeyOrIDError, + Err: model.ErrNoIssueKeyOrID, wantErr: true, }, } @@ -271,7 +273,7 @@ func Test_internalServiceRequestApprovalImpl_Get(t *testing.T) { on: func(fields *fields) { fields.c = mocks.NewConnector(t) }, - Err: model.ErrNoIssueKeyOrIDError, + Err: model.ErrNoIssueKeyOrID, wantErr: true, }, @@ -284,7 +286,7 @@ func Test_internalServiceRequestApprovalImpl_Get(t *testing.T) { on: func(fields *fields) { fields.c = mocks.NewConnector(t) }, - Err: model.ErrNoApprovalIDError, + Err: model.ErrNoApprovalID, wantErr: true, }, } @@ -433,7 +435,7 @@ func Test_internalServiceRequestApprovalImpl_Answer(t *testing.T) { on: func(fields *fields) { fields.c = mocks.NewConnector(t) }, - Err: model.ErrNoIssueKeyOrIDError, + Err: model.ErrNoIssueKeyOrID, wantErr: true, }, @@ -446,7 +448,7 @@ func Test_internalServiceRequestApprovalImpl_Answer(t *testing.T) { on: func(fields *fields) { fields.c = mocks.NewConnector(t) }, - Err: model.ErrNoApprovalIDError, + Err: model.ErrNoApprovalID, wantErr: true, }, } diff --git a/jira/sm/internal/attachment_impl.go b/jira/sm/internal/attachment_impl.go index 5cd0aff9..87c51ef1 100644 --- a/jira/sm/internal/attachment_impl.go +++ b/jira/sm/internal/attachment_impl.go @@ -54,7 +54,7 @@ type internalServiceRequestAttachmentImpl struct { func (i *internalServiceRequestAttachmentImpl) Gets(ctx context.Context, issueKeyOrID string, start, limit int) (*model.RequestAttachmentPageScheme, *model.ResponseScheme, error) { if issueKeyOrID == "" { - return nil, nil, model.ErrNoIssueKeyOrIDError + return nil, nil, model.ErrNoIssueKeyOrID } params := url.Values{} @@ -80,11 +80,11 @@ func (i *internalServiceRequestAttachmentImpl) Gets(ctx context.Context, issueKe func (i *internalServiceRequestAttachmentImpl) Create(ctx context.Context, issueKeyOrID string, payload *model.RequestAttachmentCreationPayloadScheme) (*model.RequestAttachmentCreationScheme, *model.ResponseScheme, error) { if issueKeyOrID == "" { - return nil, nil, model.ErrNoIssueKeyOrIDError + return nil, nil, model.ErrNoIssueKeyOrID } if len(payload.TemporaryAttachmentIDs) == 0 { - return nil, nil, model.ErrNoAttachmentIDError + return nil, nil, model.ErrNoAttachmentID } url := fmt.Sprintf("rest/servicedeskapi/request/%v/attachment", issueKeyOrID) diff --git a/jira/sm/internal/attachment_impl_test.go b/jira/sm/internal/attachment_impl_test.go index 6e3d5928..37380663 100644 --- a/jira/sm/internal/attachment_impl_test.go +++ b/jira/sm/internal/attachment_impl_test.go @@ -127,7 +127,7 @@ func Test_internalServiceRequestAttachmentImpl_Gets(t *testing.T) { on: func(fields *fields) { fields.c = mocks.NewConnector(t) }, - Err: model.ErrNoIssueKeyOrIDError, + Err: model.ErrNoIssueKeyOrID, wantErr: true, }, } @@ -291,7 +291,7 @@ func Test_internalServiceRequestAttachmentImpl_Create(t *testing.T) { on: func(fields *fields) { fields.c = mocks.NewConnector(t) }, - Err: model.ErrNoIssueKeyOrIDError, + Err: model.ErrNoIssueKeyOrID, wantErr: true, }, } diff --git a/jira/sm/internal/comment_impl.go b/jira/sm/internal/comment_impl.go index 0f06ad07..0c4f4ee2 100644 --- a/jira/sm/internal/comment_impl.go +++ b/jira/sm/internal/comment_impl.go @@ -77,7 +77,7 @@ type internalServiceRequestCommentImpl struct { func (i *internalServiceRequestCommentImpl) Gets(ctx context.Context, issueKeyOrID string, options *model.RequestCommentOptionsScheme) (*model.RequestCommentPageScheme, *model.ResponseScheme, error) { if issueKeyOrID == "" { - return nil, nil, model.ErrNoIssueKeyOrIDError + return nil, nil, model.ErrNoIssueKeyOrID } endpoint := fmt.Sprintf("rest/servicedeskapi/request/%v/comment", issueKeyOrID) @@ -108,11 +108,11 @@ func (i *internalServiceRequestCommentImpl) Gets(ctx context.Context, issueKeyOr func (i *internalServiceRequestCommentImpl) Get(ctx context.Context, issueKeyOrID string, commentID int, expand []string) (*model.RequestCommentScheme, *model.ResponseScheme, error) { if issueKeyOrID == "" { - return nil, nil, model.ErrNoIssueKeyOrIDError + return nil, nil, model.ErrNoIssueKeyOrID } if commentID == 0 { - return nil, nil, model.ErrNoCommentIDError + return nil, nil, model.ErrNoCommentID } var endpoint strings.Builder @@ -142,11 +142,11 @@ func (i *internalServiceRequestCommentImpl) Get(ctx context.Context, issueKeyOrI func (i *internalServiceRequestCommentImpl) Create(ctx context.Context, issueKeyOrID, body string, public bool) (*model.RequestCommentScheme, *model.ResponseScheme, error) { if issueKeyOrID == "" { - return nil, nil, model.ErrNoIssueKeyOrIDError + return nil, nil, model.ErrNoIssueKeyOrID } if body == "" { - return nil, nil, model.ErrNoCommentBodyError + return nil, nil, model.ErrNoCommentBody } payload := map[string]interface{}{"public": public, "body": body} @@ -169,11 +169,11 @@ func (i *internalServiceRequestCommentImpl) Create(ctx context.Context, issueKey func (i *internalServiceRequestCommentImpl) Attachments(ctx context.Context, issueKeyOrID string, commentID, start, limit int) (*model.RequestAttachmentPageScheme, *model.ResponseScheme, error) { if issueKeyOrID == "" { - return nil, nil, model.ErrNoIssueKeyOrIDError + return nil, nil, model.ErrNoIssueKeyOrID } if commentID == 0 { - return nil, nil, model.ErrNoContentIDError + return nil, nil, model.ErrNoContentID } params := url.Values{} diff --git a/jira/sm/internal/comment_impl_test.go b/jira/sm/internal/comment_impl_test.go index 2c36bab8..43f11336 100644 --- a/jira/sm/internal/comment_impl_test.go +++ b/jira/sm/internal/comment_impl_test.go @@ -141,7 +141,7 @@ func Test_internalServiceRequestCommentImpl_Gets(t *testing.T) { on: func(fields *fields) { fields.c = mocks.NewConnector(t) }, - Err: model.ErrNoIssueKeyOrIDError, + Err: model.ErrNoIssueKeyOrID, wantErr: true, }, } @@ -290,7 +290,7 @@ func Test_internalServiceRequestCommentImpl_Get(t *testing.T) { on: func(fields *fields) { fields.c = mocks.NewConnector(t) }, - Err: model.ErrNoIssueKeyOrIDError, + Err: model.ErrNoIssueKeyOrID, wantErr: true, }, @@ -303,7 +303,7 @@ func Test_internalServiceRequestCommentImpl_Get(t *testing.T) { on: func(fields *fields) { fields.c = mocks.NewConnector(t) }, - Err: model.ErrNoCommentIDError, + Err: model.ErrNoCommentID, wantErr: true, }, } @@ -452,7 +452,7 @@ func Test_internalServiceRequestCommentImpl_Create(t *testing.T) { on: func(fields *fields) { fields.c = mocks.NewConnector(t) }, - Err: model.ErrNoIssueKeyOrIDError, + Err: model.ErrNoIssueKeyOrID, wantErr: true, }, @@ -465,7 +465,7 @@ func Test_internalServiceRequestCommentImpl_Create(t *testing.T) { on: func(fields *fields) { fields.c = mocks.NewConnector(t) }, - Err: model.ErrNoCommentBodyError, + Err: model.ErrNoCommentBody, wantErr: true, }, } @@ -617,7 +617,7 @@ func Test_internalServiceRequestCommentImpl_Attachments(t *testing.T) { on: func(fields *fields) { fields.c = mocks.NewConnector(t) }, - Err: model.ErrNoIssueKeyOrIDError, + Err: model.ErrNoIssueKeyOrID, wantErr: true, }, } diff --git a/jira/sm/internal/customer_impl.go b/jira/sm/internal/customer_impl.go index d4733b85..2fd4192a 100644 --- a/jira/sm/internal/customer_impl.go +++ b/jira/sm/internal/customer_impl.go @@ -125,11 +125,11 @@ func (i *internalCustomerImpl) Gets(ctx context.Context, serviceDeskID string, q func (i *internalCustomerImpl) Add(ctx context.Context, serviceDeskID string, accountIDs []string) (*model.ResponseScheme, error) { if serviceDeskID == "" { - return nil, model.ErrNoServiceDeskIDError + return nil, model.ErrNoServiceDeskID } if len(accountIDs) == 0 { - return nil, model.ErrNoAccountSliceError + return nil, model.ErrNoAccountSlice } payload := map[string]interface{}{ @@ -149,11 +149,11 @@ func (i *internalCustomerImpl) Add(ctx context.Context, serviceDeskID string, ac func (i *internalCustomerImpl) Remove(ctx context.Context, serviceDeskID string, accountIDs []string) (*model.ResponseScheme, error) { if serviceDeskID == "" { - return nil, model.ErrNoServiceDeskIDError + return nil, model.ErrNoServiceDeskID } if len(accountIDs) == 0 { - return nil, model.ErrNoAccountSliceError + return nil, model.ErrNoAccountSlice } payload := map[string]interface{}{ diff --git a/jira/sm/internal/customer_impl_test.go b/jira/sm/internal/customer_impl_test.go index d9ee5438..1c55f063 100644 --- a/jira/sm/internal/customer_impl_test.go +++ b/jira/sm/internal/customer_impl_test.go @@ -395,7 +395,7 @@ func Test_internalCustomerImpl_Add(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoServiceDeskIDError, + Err: model.ErrNoServiceDeskID, }, { @@ -405,7 +405,7 @@ func Test_internalCustomerImpl_Add(t *testing.T) { serviceDeskID: "10001", }, wantErr: true, - Err: model.ErrNoAccountSliceError, + Err: model.ErrNoAccountSlice, }, } @@ -546,7 +546,7 @@ func Test_internalCustomerImpl_Remove(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoServiceDeskIDError, + Err: model.ErrNoServiceDeskID, }, { @@ -556,7 +556,7 @@ func Test_internalCustomerImpl_Remove(t *testing.T) { serviceDeskID: "10001", }, wantErr: true, - Err: model.ErrNoAccountSliceError, + Err: model.ErrNoAccountSlice, }, } diff --git a/jira/sm/internal/feedback_impl.go b/jira/sm/internal/feedback_impl.go index 9adb73b9..aa71df6f 100644 --- a/jira/sm/internal/feedback_impl.go +++ b/jira/sm/internal/feedback_impl.go @@ -58,7 +58,7 @@ type internalServiceRequestFeedbackImpl struct { func (i *internalServiceRequestFeedbackImpl) Get(ctx context.Context, requestIDOrKey string) (*model.CustomerFeedbackScheme, *model.ResponseScheme, error) { if requestIDOrKey == "" { - return nil, nil, model.ErrNoIssueKeyOrIDError + return nil, nil, model.ErrNoIssueKeyOrID } endpoint := fmt.Sprintf("rest/servicedeskapi/request/%v/feedback", requestIDOrKey) @@ -80,7 +80,7 @@ func (i *internalServiceRequestFeedbackImpl) Get(ctx context.Context, requestIDO func (i *internalServiceRequestFeedbackImpl) Post(ctx context.Context, requestIDOrKey string, rating int, comment string) (*model.CustomerFeedbackScheme, *model.ResponseScheme, error) { if requestIDOrKey == "" { - return nil, nil, model.ErrNoIssueKeyOrIDError + return nil, nil, model.ErrNoIssueKeyOrID } payload := map[string]interface{}{ @@ -110,7 +110,7 @@ func (i *internalServiceRequestFeedbackImpl) Post(ctx context.Context, requestID func (i *internalServiceRequestFeedbackImpl) Delete(ctx context.Context, requestIDOrKey string) (*model.ResponseScheme, error) { if requestIDOrKey == "" { - return nil, model.ErrNoIssueKeyOrIDError + return nil, model.ErrNoIssueKeyOrID } endpoint := fmt.Sprintf("rest/servicedeskapi/request/%v/feedback", requestIDOrKey) diff --git a/jira/sm/internal/feedback_impl_test.go b/jira/sm/internal/feedback_impl_test.go index 026f5e7c..1e7ac799 100644 --- a/jira/sm/internal/feedback_impl_test.go +++ b/jira/sm/internal/feedback_impl_test.go @@ -3,12 +3,14 @@ package internal import ( "context" "errors" + "net/http" + "testing" + + "github.com/stretchr/testify/assert" + model "github.com/ctreminiom/go-atlassian/pkg/infra/models" "github.com/ctreminiom/go-atlassian/service" "github.com/ctreminiom/go-atlassian/service/mocks" - "github.com/stretchr/testify/assert" - "net/http" - "testing" ) func Test_internalServiceRequestFeedbackImpl_Get(t *testing.T) { @@ -115,7 +117,7 @@ func Test_internalServiceRequestFeedbackImpl_Get(t *testing.T) { args: args{ ctx: context.Background(), }, - Err: model.ErrNoIssueKeyOrIDError, + Err: model.ErrNoIssueKeyOrID, wantErr: true, }, } @@ -262,7 +264,7 @@ func Test_internalServiceRequestFeedbackImpl_Post(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoIssueKeyOrIDError, + Err: model.ErrNoIssueKeyOrID, }, } @@ -400,7 +402,7 @@ func Test_internalServiceRequestFeedbackImpl_Delete(t *testing.T) { args: args{ ctx: context.Background(), }, - Err: model.ErrNoIssueKeyOrIDError, + Err: model.ErrNoIssueKeyOrID, wantErr: true, }, } diff --git a/jira/sm/internal/knowledgebase_impl.go b/jira/sm/internal/knowledgebase_impl.go index fa2d1517..6bbe0dcc 100644 --- a/jira/sm/internal/knowledgebase_impl.go +++ b/jira/sm/internal/knowledgebase_impl.go @@ -51,7 +51,7 @@ type internalKnowledgebaseImpl struct { func (i *internalKnowledgebaseImpl) Search(ctx context.Context, query string, highlight bool, start, limit int) (*model.ArticlePageScheme, *model.ResponseScheme, error) { if query == "" { - return nil, nil, model.ErrNoKBQueryError + return nil, nil, model.ErrNoKBQuery } params := url.Values{} @@ -79,11 +79,11 @@ func (i *internalKnowledgebaseImpl) Search(ctx context.Context, query string, hi func (i *internalKnowledgebaseImpl) Gets(ctx context.Context, serviceDeskID int, query string, highlight bool, start, limit int) (*model.ArticlePageScheme, *model.ResponseScheme, error) { if serviceDeskID == 0 { - return nil, nil, model.ErrNoServiceDeskIDError + return nil, nil, model.ErrNoServiceDeskID } if query == "" { - return nil, nil, model.ErrNoKBQueryError + return nil, nil, model.ErrNoKBQuery } params := url.Values{} diff --git a/jira/sm/internal/knowledgebase_impl_test.go b/jira/sm/internal/knowledgebase_impl_test.go index 81c3df73..43260ca2 100644 --- a/jira/sm/internal/knowledgebase_impl_test.go +++ b/jira/sm/internal/knowledgebase_impl_test.go @@ -3,12 +3,14 @@ package internal import ( "context" "errors" + "net/http" + "testing" + + "github.com/stretchr/testify/assert" + model "github.com/ctreminiom/go-atlassian/pkg/infra/models" "github.com/ctreminiom/go-atlassian/service" "github.com/ctreminiom/go-atlassian/service/mocks" - "github.com/stretchr/testify/assert" - "net/http" - "testing" ) func Test_internalKnowledgebaseImpl_Search(t *testing.T) { @@ -127,7 +129,7 @@ func Test_internalKnowledgebaseImpl_Search(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoKBQueryError, + Err: model.ErrNoKBQuery, }, } @@ -284,7 +286,7 @@ func Test_internalKnowledgebaseImpl_Gets(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoServiceDeskIDError, + Err: model.ErrNoServiceDeskID, }, { @@ -294,7 +296,7 @@ func Test_internalKnowledgebaseImpl_Gets(t *testing.T) { serviceDeskID: 10001, }, wantErr: true, - Err: model.ErrNoKBQueryError, + Err: model.ErrNoKBQuery, }, } diff --git a/jira/sm/internal/organization_impl.go b/jira/sm/internal/organization_impl.go index 788720f9..7c56b3af 100644 --- a/jira/sm/internal/organization_impl.go +++ b/jira/sm/internal/organization_impl.go @@ -171,7 +171,7 @@ func (i *internalOrganizationImpl) Gets(ctx context.Context, accountID string, s func (i *internalOrganizationImpl) Get(ctx context.Context, organizationID int) (*model.OrganizationScheme, *model.ResponseScheme, error) { if organizationID == 0 { - return nil, nil, model.ErrNoOrganizationIDError + return nil, nil, model.ErrNoOrganizationID } endpoint := fmt.Sprintf("rest/servicedeskapi/organization/%v", organizationID) @@ -193,7 +193,7 @@ func (i *internalOrganizationImpl) Get(ctx context.Context, organizationID int) func (i *internalOrganizationImpl) Delete(ctx context.Context, organizationID int) (*model.ResponseScheme, error) { if organizationID == 0 { - return nil, model.ErrNoOrganizationIDError + return nil, model.ErrNoOrganizationID } endpoint := fmt.Sprintf("rest/servicedeskapi/organization/%v", organizationID) @@ -209,7 +209,7 @@ func (i *internalOrganizationImpl) Delete(ctx context.Context, organizationID in func (i *internalOrganizationImpl) Create(ctx context.Context, name string) (*model.OrganizationScheme, *model.ResponseScheme, error) { if name == "" { - return nil, nil, model.ErrNoOrganizationNameError + return nil, nil, model.ErrNoOrganizationName } endpoint := "rest/servicedeskapi/organization" @@ -231,7 +231,7 @@ func (i *internalOrganizationImpl) Create(ctx context.Context, name string) (*mo func (i *internalOrganizationImpl) Users(ctx context.Context, organizationID, start, limit int) (*model.OrganizationUsersPageScheme, *model.ResponseScheme, error) { if organizationID == 0 { - return nil, nil, model.ErrNoOrganizationIDError + return nil, nil, model.ErrNoOrganizationID } params := url.Values{} @@ -257,11 +257,11 @@ func (i *internalOrganizationImpl) Users(ctx context.Context, organizationID, st func (i *internalOrganizationImpl) Add(ctx context.Context, organizationID int, accountIDs []string) (*model.ResponseScheme, error) { if organizationID == 0 { - return nil, model.ErrNoOrganizationIDError + return nil, model.ErrNoOrganizationID } if len(accountIDs) == 0 { - return nil, model.ErrNoAccountSliceError + return nil, model.ErrNoAccountSlice } endpoint := fmt.Sprintf("rest/servicedeskapi/organization/%v/user", organizationID) @@ -277,11 +277,11 @@ func (i *internalOrganizationImpl) Add(ctx context.Context, organizationID int, func (i *internalOrganizationImpl) Remove(ctx context.Context, organizationID int, accountIDs []string) (*model.ResponseScheme, error) { if organizationID == 0 { - return nil, model.ErrNoOrganizationIDError + return nil, model.ErrNoOrganizationID } if len(accountIDs) == 0 { - return nil, model.ErrNoAccountSliceError + return nil, model.ErrNoAccountSlice } endpoint := fmt.Sprintf("rest/servicedeskapi/organization/%v/user", organizationID) @@ -297,7 +297,7 @@ func (i *internalOrganizationImpl) Remove(ctx context.Context, organizationID in func (i *internalOrganizationImpl) Project(ctx context.Context, accountID string, serviceDeskID, start, limit int) (*model.OrganizationPageScheme, *model.ResponseScheme, error) { if serviceDeskID == 0 { - return nil, nil, model.ErrNoServiceDeskIDError + return nil, nil, model.ErrNoServiceDeskID } params := url.Values{} @@ -327,11 +327,11 @@ func (i *internalOrganizationImpl) Project(ctx context.Context, accountID string func (i *internalOrganizationImpl) Associate(ctx context.Context, serviceDeskID, organizationID int) (*model.ResponseScheme, error) { if serviceDeskID == 0 { - return nil, model.ErrNoServiceDeskIDError + return nil, model.ErrNoServiceDeskID } if organizationID == 0 { - return nil, model.ErrNoOrganizationIDError + return nil, model.ErrNoOrganizationID } endpoint := fmt.Sprintf("rest/servicedeskapi/servicedesk/%v/organization", serviceDeskID) @@ -347,11 +347,11 @@ func (i *internalOrganizationImpl) Associate(ctx context.Context, serviceDeskID, func (i *internalOrganizationImpl) Detach(ctx context.Context, serviceDeskID, organizationID int) (*model.ResponseScheme, error) { if serviceDeskID == 0 { - return nil, model.ErrNoServiceDeskIDError + return nil, model.ErrNoServiceDeskID } if organizationID == 0 { - return nil, model.ErrNoOrganizationIDError + return nil, model.ErrNoOrganizationID } endpoint := fmt.Sprintf("rest/servicedeskapi/servicedesk/%v/organization", serviceDeskID) diff --git a/jira/sm/internal/participant_impl.go b/jira/sm/internal/participant_impl.go index 96fc3533..7d614408 100644 --- a/jira/sm/internal/participant_impl.go +++ b/jira/sm/internal/participant_impl.go @@ -61,7 +61,7 @@ type internalServiceRequestParticipantImpl struct { func (i *internalServiceRequestParticipantImpl) Gets(ctx context.Context, issueKeyOrID string, start, limit int) (*model.RequestParticipantPageScheme, *model.ResponseScheme, error) { if issueKeyOrID == "" { - return nil, nil, model.ErrNoIssueKeyOrIDError + return nil, nil, model.ErrNoIssueKeyOrID } params := url.Values{} @@ -87,11 +87,11 @@ func (i *internalServiceRequestParticipantImpl) Gets(ctx context.Context, issueK func (i *internalServiceRequestParticipantImpl) Add(ctx context.Context, issueKeyOrID string, accountIDs []string) (*model.RequestParticipantPageScheme, *model.ResponseScheme, error) { if issueKeyOrID == "" { - return nil, nil, model.ErrNoIssueKeyOrIDError + return nil, nil, model.ErrNoIssueKeyOrID } if len(accountIDs) == 0 { - return nil, nil, model.ErrNoAccountSliceError + return nil, nil, model.ErrNoAccountSlice } endpoint := fmt.Sprintf("rest/servicedeskapi/request/%v/participant", issueKeyOrID) @@ -113,11 +113,11 @@ func (i *internalServiceRequestParticipantImpl) Add(ctx context.Context, issueKe func (i *internalServiceRequestParticipantImpl) Remove(ctx context.Context, issueKeyOrID string, accountIDs []string) (*model.RequestParticipantPageScheme, *model.ResponseScheme, error) { if issueKeyOrID == "" { - return nil, nil, model.ErrNoIssueKeyOrIDError + return nil, nil, model.ErrNoIssueKeyOrID } if len(accountIDs) == 0 { - return nil, nil, model.ErrNoAccountSliceError + return nil, nil, model.ErrNoAccountSlice } endpoint := fmt.Sprintf("rest/servicedeskapi/request/%v/participant", issueKeyOrID) diff --git a/jira/sm/internal/participant_impl_test.go b/jira/sm/internal/participant_impl_test.go index b74ceaef..69c67a26 100644 --- a/jira/sm/internal/participant_impl_test.go +++ b/jira/sm/internal/participant_impl_test.go @@ -122,7 +122,7 @@ func Test_internalServiceRequestParticipantImpl_Gets(t *testing.T) { args: args{ ctx: context.Background(), }, - Err: model.ErrNoIssueKeyOrIDError, + Err: model.ErrNoIssueKeyOrID, wantErr: true, }, } @@ -264,7 +264,7 @@ func Test_internalServiceRequestParticipantImpl_Add(t *testing.T) { args: args{ ctx: context.Background(), }, - Err: model.ErrNoIssueKeyOrIDError, + Err: model.ErrNoIssueKeyOrID, wantErr: true, }, @@ -274,7 +274,7 @@ func Test_internalServiceRequestParticipantImpl_Add(t *testing.T) { ctx: context.Background(), issueKeyOrID: "DESK-1", }, - Err: model.ErrNoAccountSliceError, + Err: model.ErrNoAccountSlice, wantErr: true, }, } @@ -416,7 +416,7 @@ func Test_internalServiceRequestParticipantImpl_Remove(t *testing.T) { args: args{ ctx: context.Background(), }, - Err: model.ErrNoIssueKeyOrIDError, + Err: model.ErrNoIssueKeyOrID, wantErr: true, }, @@ -426,7 +426,7 @@ func Test_internalServiceRequestParticipantImpl_Remove(t *testing.T) { ctx: context.Background(), issueKeyOrID: "DESK-1", }, - Err: model.ErrNoAccountSliceError, + Err: model.ErrNoAccountSlice, wantErr: true, }, } diff --git a/jira/sm/internal/queue_impl.go b/jira/sm/internal/queue_impl.go index c6881aad..34153444 100644 --- a/jira/sm/internal/queue_impl.go +++ b/jira/sm/internal/queue_impl.go @@ -61,7 +61,7 @@ type internalQueueServiceImpl struct { func (i *internalQueueServiceImpl) Gets(ctx context.Context, serviceDeskID int, includeCount bool, start, limit int) (*model.ServiceDeskQueuePageScheme, *model.ResponseScheme, error) { if serviceDeskID == 0 { - return nil, nil, model.ErrNoServiceDeskIDError + return nil, nil, model.ErrNoServiceDeskID } params := url.Values{} @@ -88,11 +88,11 @@ func (i *internalQueueServiceImpl) Gets(ctx context.Context, serviceDeskID int, func (i *internalQueueServiceImpl) Get(ctx context.Context, serviceDeskID, queueID int, includeCount bool) (*model.ServiceDeskQueueScheme, *model.ResponseScheme, error) { if serviceDeskID == 0 { - return nil, nil, model.ErrNoServiceDeskIDError + return nil, nil, model.ErrNoServiceDeskID } if queueID == 0 { - return nil, nil, model.ErrNoQueueIDError + return nil, nil, model.ErrNoQueueID } params := url.Values{} @@ -117,11 +117,11 @@ func (i *internalQueueServiceImpl) Get(ctx context.Context, serviceDeskID, queue func (i *internalQueueServiceImpl) Issues(ctx context.Context, serviceDeskID, queueID, start, limit int) (*model.ServiceDeskIssueQueueScheme, *model.ResponseScheme, error) { if serviceDeskID == 0 { - return nil, nil, model.ErrNoServiceDeskIDError + return nil, nil, model.ErrNoServiceDeskID } if queueID == 0 { - return nil, nil, model.ErrNoQueueIDError + return nil, nil, model.ErrNoQueueID } params := url.Values{} diff --git a/jira/sm/internal/queue_impl_test.go b/jira/sm/internal/queue_impl_test.go index 49d32e78..21d7980a 100644 --- a/jira/sm/internal/queue_impl_test.go +++ b/jira/sm/internal/queue_impl_test.go @@ -126,7 +126,7 @@ func Test_internalQueueServiceImpl_Gets(t *testing.T) { args: args{ ctx: context.Background(), }, - Err: model.ErrNoServiceDeskIDError, + Err: model.ErrNoServiceDeskID, wantErr: true, }, } @@ -273,7 +273,7 @@ func Test_internalQueueServiceImpl_Get(t *testing.T) { args: args{ ctx: context.Background(), }, - Err: model.ErrNoServiceDeskIDError, + Err: model.ErrNoServiceDeskID, wantErr: true, }, @@ -283,7 +283,7 @@ func Test_internalQueueServiceImpl_Get(t *testing.T) { ctx: context.Background(), serviceDeskID: 10001, }, - Err: model.ErrNoQueueIDError, + Err: model.ErrNoQueueID, wantErr: true, }, } @@ -437,7 +437,7 @@ func Test_internalQueueServiceImpl_Issues(t *testing.T) { args: args{ ctx: context.Background(), }, - Err: model.ErrNoServiceDeskIDError, + Err: model.ErrNoServiceDeskID, wantErr: true, }, } diff --git a/jira/sm/internal/request_impl.go b/jira/sm/internal/request_impl.go index 7c8ea81b..098745f1 100644 --- a/jira/sm/internal/request_impl.go +++ b/jira/sm/internal/request_impl.go @@ -229,7 +229,7 @@ func (i *internalServiceRequestImpl) Gets(ctx context.Context, options *model.Se func (i *internalServiceRequestImpl) Get(ctx context.Context, issueKeyOrID string, expand []string) (*model.CustomerRequestScheme, *model.ResponseScheme, error) { if issueKeyOrID == "" { - return nil, nil, model.ErrNoIssueKeyOrIDError + return nil, nil, model.ErrNoIssueKeyOrID } var endpoint strings.Builder @@ -259,7 +259,7 @@ func (i *internalServiceRequestImpl) Get(ctx context.Context, issueKeyOrID strin func (i *internalServiceRequestImpl) Subscribe(ctx context.Context, issueKeyOrID string) (*model.ResponseScheme, error) { if issueKeyOrID == "" { - return nil, model.ErrNoIssueKeyOrIDError + return nil, model.ErrNoIssueKeyOrID } endpoint := fmt.Sprintf("rest/servicedeskapi/request/%v/notification", issueKeyOrID) @@ -275,7 +275,7 @@ func (i *internalServiceRequestImpl) Subscribe(ctx context.Context, issueKeyOrID func (i *internalServiceRequestImpl) Unsubscribe(ctx context.Context, issueKeyOrID string) (*model.ResponseScheme, error) { if issueKeyOrID == "" { - return nil, model.ErrNoIssueKeyOrIDError + return nil, model.ErrNoIssueKeyOrID } endpoint := fmt.Sprintf("rest/servicedeskapi/request/%v/notification", issueKeyOrID) @@ -291,7 +291,7 @@ func (i *internalServiceRequestImpl) Unsubscribe(ctx context.Context, issueKeyOr func (i *internalServiceRequestImpl) Transitions(ctx context.Context, issueKeyOrID string, start, limit int) (*model.CustomerRequestTransitionPageScheme, *model.ResponseScheme, error) { if issueKeyOrID == "" { - return nil, nil, model.ErrNoIssueKeyOrIDError + return nil, nil, model.ErrNoIssueKeyOrID } params := url.Values{} @@ -317,11 +317,11 @@ func (i *internalServiceRequestImpl) Transitions(ctx context.Context, issueKeyOr func (i internalServiceRequestImpl) Transition(ctx context.Context, issueKeyOrID, transitionID, comment string) (*model.ResponseScheme, error) { if issueKeyOrID == "" { - return nil, model.ErrNoIssueKeyOrIDError + return nil, model.ErrNoIssueKeyOrID } if transitionID == "" { - return nil, model.ErrNoTransitionIDError + return nil, model.ErrNoTransitionID } payload := map[string]interface{}{"id": transitionID} diff --git a/jira/sm/internal/request_impl_test.go b/jira/sm/internal/request_impl_test.go index 7a8bba81..d5db2d34 100644 --- a/jira/sm/internal/request_impl_test.go +++ b/jira/sm/internal/request_impl_test.go @@ -3,12 +3,14 @@ package internal import ( "context" "errors" + "net/http" + "testing" + + "github.com/stretchr/testify/assert" + model "github.com/ctreminiom/go-atlassian/pkg/infra/models" "github.com/ctreminiom/go-atlassian/service" "github.com/ctreminiom/go-atlassian/service/mocks" - "github.com/stretchr/testify/assert" - "net/http" - "testing" ) func Test_internalServiceRequestImpl_Gets(t *testing.T) { @@ -288,7 +290,7 @@ func Test_internalServiceRequestImpl_Transitions(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoIssueKeyOrIDError, + Err: model.ErrNoIssueKeyOrID, }, } @@ -432,7 +434,7 @@ func Test_internalServiceRequestImpl_Get(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoIssueKeyOrIDError, + Err: model.ErrNoIssueKeyOrID, }, } @@ -571,7 +573,7 @@ func Test_internalServiceRequestImpl_Subscribe(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoIssueKeyOrIDError, + Err: model.ErrNoIssueKeyOrID, }, } @@ -709,7 +711,7 @@ func Test_internalServiceRequestImpl_Unsubscribe(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoIssueKeyOrIDError, + Err: model.ErrNoIssueKeyOrID, }, } @@ -881,7 +883,7 @@ func Test_internalServiceRequestImpl_Transition(t *testing.T) { ctx: context.Background(), }, wantErr: true, - Err: model.ErrNoIssueKeyOrIDError, + Err: model.ErrNoIssueKeyOrID, }, { @@ -891,7 +893,7 @@ func Test_internalServiceRequestImpl_Transition(t *testing.T) { issueKeyOrID: "DESK-1", }, wantErr: true, - Err: model.ErrNoTransitionIDError, + Err: model.ErrNoTransitionID, }, } diff --git a/jira/sm/internal/service_desk_impl.go b/jira/sm/internal/service_desk_impl.go index 43427b55..07b685e3 100644 --- a/jira/sm/internal/service_desk_impl.go +++ b/jira/sm/internal/service_desk_impl.go @@ -99,7 +99,7 @@ func (i *internalServiceDeskImpl) Gets(ctx context.Context, start, limit int) (* func (i *internalServiceDeskImpl) Get(ctx context.Context, serviceDeskID string) (*model.ServiceDeskScheme, *model.ResponseScheme, error) { if serviceDeskID == "" { - return nil, nil, model.ErrNoServiceDeskIDError + return nil, nil, model.ErrNoServiceDeskID } endpoint := fmt.Sprintf("rest/servicedeskapi/servicedesk/%v", serviceDeskID) @@ -121,15 +121,15 @@ func (i *internalServiceDeskImpl) Get(ctx context.Context, serviceDeskID string) func (i *internalServiceDeskImpl) Attach(ctx context.Context, serviceDeskID string, fileName string, file io.Reader) (*model.ServiceDeskTemporaryFileScheme, *model.ResponseScheme, error) { if serviceDeskID == "" { - return nil, nil, model.ErrNoServiceDeskIDError + return nil, nil, model.ErrNoServiceDeskID } if fileName == "" { - return nil, nil, model.ErrNoFileNameError + return nil, nil, model.ErrNoFileName } if file == nil { - return nil, nil, model.ErrNoFileReaderError + return nil, nil, model.ErrNoFileReader } endpoint := fmt.Sprintf("rest/servicedeskapi/servicedesk/%v/attachTemporaryFile", serviceDeskID) diff --git a/jira/sm/internal/service_desk_impl_test.go b/jira/sm/internal/service_desk_impl_test.go index d3b079e5..6161e12a 100644 --- a/jira/sm/internal/service_desk_impl_test.go +++ b/jira/sm/internal/service_desk_impl_test.go @@ -254,7 +254,7 @@ func Test_internalServiceDeskImpl_Get(t *testing.T) { args: args{ ctx: context.Background(), }, - Err: model.ErrNoServiceDeskIDError, + Err: model.ErrNoServiceDeskID, wantErr: true, }, } @@ -411,7 +411,7 @@ func Test_internalServiceDeskImpl_Attach(t *testing.T) { args: args{ ctx: context.Background(), }, - Err: model.ErrNoServiceDeskIDError, + Err: model.ErrNoServiceDeskID, wantErr: true, }, @@ -421,7 +421,7 @@ func Test_internalServiceDeskImpl_Attach(t *testing.T) { ctx: context.Background(), serviceDeskID: "10001", }, - Err: model.ErrNoFileNameError, + Err: model.ErrNoFileName, wantErr: true, }, @@ -432,7 +432,7 @@ func Test_internalServiceDeskImpl_Attach(t *testing.T) { serviceDeskID: "10001", fileName: "LICENSE", }, - Err: model.ErrNoFileReaderError, + Err: model.ErrNoFileReader, wantErr: true, }, } diff --git a/jira/sm/internal/sla_impl.go b/jira/sm/internal/sla_impl.go index 9e2d83a7..df8c37a3 100644 --- a/jira/sm/internal/sla_impl.go +++ b/jira/sm/internal/sla_impl.go @@ -54,7 +54,7 @@ type internalServiceLevelAgreementImpl struct { func (i *internalServiceLevelAgreementImpl) Gets(ctx context.Context, issueKeyOrID string, start, limit int) (*model.RequestSLAPageScheme, *model.ResponseScheme, error) { if issueKeyOrID == "" { - return nil, nil, model.ErrNoIssueKeyOrIDError + return nil, nil, model.ErrNoIssueKeyOrID } params := url.Values{} @@ -80,11 +80,11 @@ func (i *internalServiceLevelAgreementImpl) Gets(ctx context.Context, issueKeyOr func (i *internalServiceLevelAgreementImpl) Get(ctx context.Context, issueKeyOrID string, metricID int) (*model.RequestSLAScheme, *model.ResponseScheme, error) { if issueKeyOrID == "" { - return nil, nil, model.ErrNoIssueKeyOrIDError + return nil, nil, model.ErrNoIssueKeyOrID } if metricID == 0 { - return nil, nil, model.ErrNoSLAMetricIDError + return nil, nil, model.ErrNoSLAMetricID } endpoint := fmt.Sprintf("rest/servicedeskapi/request/%v/sla/%v", issueKeyOrID, metricID) diff --git a/jira/sm/internal/sla_impl_test.go b/jira/sm/internal/sla_impl_test.go index 928dcf73..08521873 100644 --- a/jira/sm/internal/sla_impl_test.go +++ b/jira/sm/internal/sla_impl_test.go @@ -122,7 +122,7 @@ func Test_internalServiceLevelAgreementImpl_Gets(t *testing.T) { args: args{ ctx: context.Background(), }, - Err: model.ErrNoIssueKeyOrIDError, + Err: model.ErrNoIssueKeyOrID, wantErr: true, }, } @@ -265,7 +265,7 @@ func Test_internalServiceLevelAgreementImpl_Get(t *testing.T) { args: args{ ctx: context.Background(), }, - Err: model.ErrNoIssueKeyOrIDError, + Err: model.ErrNoIssueKeyOrID, wantErr: true, }, @@ -275,7 +275,7 @@ func Test_internalServiceLevelAgreementImpl_Get(t *testing.T) { ctx: context.Background(), issueKeyOrID: "DESK-1", }, - Err: model.ErrNoSLAMetricIDError, + Err: model.ErrNoSLAMetricID, wantErr: true, }, } diff --git a/jira/sm/internal/type_impl.go b/jira/sm/internal/type_impl.go index ec8c5130..047e62e6 100644 --- a/jira/sm/internal/type_impl.go +++ b/jira/sm/internal/type_impl.go @@ -125,7 +125,7 @@ func (i *internalTypeImpl) Search(ctx context.Context, query string, start, limi func (i *internalTypeImpl) Gets(ctx context.Context, serviceDeskID, groupID, start, limit int) (*model.ProjectRequestTypePageScheme, *model.ResponseScheme, error) { if serviceDeskID == 0 { - return nil, nil, model.ErrNoServiceDeskIDError + return nil, nil, model.ErrNoServiceDeskID } params := url.Values{} @@ -155,7 +155,7 @@ func (i *internalTypeImpl) Gets(ctx context.Context, serviceDeskID, groupID, sta func (i *internalTypeImpl) Create(ctx context.Context, serviceDeskID int, payload *model.RequestTypePayloadScheme) (*model.RequestTypeScheme, *model.ResponseScheme, error) { if serviceDeskID == 0 { - return nil, nil, model.ErrNoServiceDeskIDError + return nil, nil, model.ErrNoServiceDeskID } endpoint := fmt.Sprintf("rest/servicedeskapi/servicedesk/%v/requesttype", serviceDeskID) @@ -177,11 +177,11 @@ func (i *internalTypeImpl) Create(ctx context.Context, serviceDeskID int, payloa func (i *internalTypeImpl) Get(ctx context.Context, serviceDeskID, requestTypeID int) (*model.RequestTypeScheme, *model.ResponseScheme, error) { if serviceDeskID == 0 { - return nil, nil, model.ErrNoServiceDeskIDError + return nil, nil, model.ErrNoServiceDeskID } if requestTypeID == 0 { - return nil, nil, model.ErrNoRequestTypeIDError + return nil, nil, model.ErrNoRequestTypeID } endpoint := fmt.Sprintf("rest/servicedeskapi/servicedesk/%v/requesttype/%v", serviceDeskID, requestTypeID) @@ -203,11 +203,11 @@ func (i *internalTypeImpl) Get(ctx context.Context, serviceDeskID, requestTypeID func (i *internalTypeImpl) Delete(ctx context.Context, serviceDeskID, requestTypeID int) (*model.ResponseScheme, error) { if serviceDeskID == 0 { - return nil, model.ErrNoServiceDeskIDError + return nil, model.ErrNoServiceDeskID } if requestTypeID == 0 { - return nil, model.ErrNoRequestTypeIDError + return nil, model.ErrNoRequestTypeID } endpoint := fmt.Sprintf("rest/servicedeskapi/servicedesk/%v/requesttype/%v", serviceDeskID, requestTypeID) @@ -223,11 +223,11 @@ func (i *internalTypeImpl) Delete(ctx context.Context, serviceDeskID, requestTyp func (i *internalTypeImpl) Fields(ctx context.Context, serviceDeskID, requestTypeID int) (*model.RequestTypeFieldsScheme, *model.ResponseScheme, error) { if serviceDeskID == 0 { - return nil, nil, model.ErrNoServiceDeskIDError + return nil, nil, model.ErrNoServiceDeskID } if requestTypeID == 0 { - return nil, nil, model.ErrNoRequestTypeIDError + return nil, nil, model.ErrNoRequestTypeID } endpoint := fmt.Sprintf("rest/servicedeskapi/servicedesk/%v/requesttype/%v/field", serviceDeskID, requestTypeID) @@ -249,7 +249,7 @@ func (i *internalTypeImpl) Fields(ctx context.Context, serviceDeskID, requestTyp func (i *internalTypeImpl) Groups(ctx context.Context, serviceDeskID int) (*model.RequestTypeGroupPageScheme, *model.ResponseScheme, error) { if serviceDeskID == 0 { - return nil, nil, model.ErrNoServiceDeskIDError + return nil, nil, model.ErrNoServiceDeskID } endpoint := fmt.Sprintf("rest/servicedeskapi/servicedesk/%v/requesttypegroup", serviceDeskID) diff --git a/jira/sm/internal/type_impl_test.go b/jira/sm/internal/type_impl_test.go index f466dc28..8073edd7 100644 --- a/jira/sm/internal/type_impl_test.go +++ b/jira/sm/internal/type_impl_test.go @@ -264,7 +264,7 @@ func Test_internalTypeImpl_Gets(t *testing.T) { args: args{ ctx: context.Background(), }, - Err: model.ErrNoServiceDeskIDError, + Err: model.ErrNoServiceDeskID, wantErr: true, }, } @@ -406,7 +406,7 @@ func Test_internalTypeImpl_Get(t *testing.T) { args: args{ ctx: context.Background(), }, - Err: model.ErrNoServiceDeskIDError, + Err: model.ErrNoServiceDeskID, wantErr: true, }, @@ -416,7 +416,7 @@ func Test_internalTypeImpl_Get(t *testing.T) { ctx: context.Background(), serviceDeskID: 10001, }, - Err: model.ErrNoRequestTypeIDError, + Err: model.ErrNoRequestTypeID, wantErr: true, }, } @@ -558,7 +558,7 @@ func Test_internalTypeImpl_Fields(t *testing.T) { args: args{ ctx: context.Background(), }, - Err: model.ErrNoServiceDeskIDError, + Err: model.ErrNoServiceDeskID, wantErr: true, }, @@ -568,7 +568,7 @@ func Test_internalTypeImpl_Fields(t *testing.T) { ctx: context.Background(), serviceDeskID: 10001, }, - Err: model.ErrNoRequestTypeIDError, + Err: model.ErrNoRequestTypeID, wantErr: true, }, } @@ -710,7 +710,7 @@ func Test_internalTypeImpl_Delete(t *testing.T) { args: args{ ctx: context.Background(), }, - Err: model.ErrNoServiceDeskIDError, + Err: model.ErrNoServiceDeskID, wantErr: true, }, @@ -720,7 +720,7 @@ func Test_internalTypeImpl_Delete(t *testing.T) { ctx: context.Background(), serviceDeskID: 10001, }, - Err: model.ErrNoRequestTypeIDError, + Err: model.ErrNoRequestTypeID, wantErr: true, }, } @@ -883,7 +883,7 @@ func Test_internalTypeImpl_Create(t *testing.T) { args: args{ ctx: context.Background(), }, - Err: model.ErrNoServiceDeskIDError, + Err: model.ErrNoServiceDeskID, wantErr: true, }, } diff --git a/jira/v2/api_client_impl.go b/jira/v2/api_client_impl.go index 80d4b9eb..9ff45f21 100644 --- a/jira/v2/api_client_impl.go +++ b/jira/v2/api_client_impl.go @@ -24,7 +24,7 @@ func New(httpClient common.HttpClient, site string) (*Client, error) { } if site == "" { - return nil, models.ErrNoSiteError + return nil, models.ErrNoSite } if !strings.HasSuffix(site, "/") { @@ -515,13 +515,13 @@ func (c *Client) processResponse(response *http.Response, structure interface{}) return res, models.ErrUnauthorized case http.StatusInternalServerError: - return res, models.ErrInternalError + return res, models.ErrInternal case http.StatusBadRequest: - return res, models.ErrBadRequestError + return res, models.ErrBadRequest default: - return res, models.ErrInvalidStatusCodeError + return res, models.ErrInvalidStatusCode } } diff --git a/jira/v2/api_client_impl_test.go b/jira/v2/api_client_impl_test.go index d1805bcd..f28b19c0 100644 --- a/jira/v2/api_client_impl_test.go +++ b/jira/v2/api_client_impl_test.go @@ -128,7 +128,7 @@ func TestClient_Call(t *testing.T) { Bytes: *bytes.NewBufferString("Hello, world!"), }, wantErr: true, - Err: model.ErrBadRequestError, + Err: model.ErrBadRequest, }, { @@ -153,7 +153,7 @@ func TestClient_Call(t *testing.T) { Bytes: *bytes.NewBufferString("Hello, world!"), }, wantErr: true, - Err: model.ErrInternalError, + Err: model.ErrInternal, }, { @@ -514,7 +514,7 @@ func TestNew(t *testing.T) { }, want: noURLClientMocked, wantErr: true, - Err: model.ErrNoSiteError, + Err: model.ErrNoSite, }, { name: "when the site url is not valid", diff --git a/jira/v3/api_client_impl.go b/jira/v3/api_client_impl.go index f376e333..69058218 100644 --- a/jira/v3/api_client_impl.go +++ b/jira/v3/api_client_impl.go @@ -24,7 +24,7 @@ func New(httpClient common.HttpClient, site string) (*Client, error) { } if site == "" { - return nil, models.ErrNoSiteError + return nil, models.ErrNoSite } if !strings.HasSuffix(site, "/") { @@ -516,13 +516,13 @@ func (c *Client) processResponse(response *http.Response, structure interface{}) return res, models.ErrUnauthorized case http.StatusInternalServerError: - return res, models.ErrInternalError + return res, models.ErrInternal case http.StatusBadRequest: - return res, models.ErrBadRequestError + return res, models.ErrBadRequest default: - return res, models.ErrInvalidStatusCodeError + return res, models.ErrInvalidStatusCode } } diff --git a/jira/v3/api_client_impl_test.go b/jira/v3/api_client_impl_test.go index 1e105415..7fe347a1 100644 --- a/jira/v3/api_client_impl_test.go +++ b/jira/v3/api_client_impl_test.go @@ -128,7 +128,7 @@ func TestClient_Call(t *testing.T) { Bytes: *bytes.NewBufferString("Hello, world!"), }, wantErr: true, - Err: model.ErrBadRequestError, + Err: model.ErrBadRequest, }, { @@ -153,7 +153,7 @@ func TestClient_Call(t *testing.T) { Bytes: *bytes.NewBufferString("Hello, world!"), }, wantErr: true, - Err: model.ErrInternalError, + Err: model.ErrInternal, }, { @@ -514,7 +514,7 @@ func TestNew(t *testing.T) { }, want: noURLClientMocked, wantErr: true, - Err: model.ErrNoSiteError, + Err: model.ErrNoSite, }, { name: "when the site url is not valid", diff --git a/pkg/infra/models/admin_scim_user.go b/pkg/infra/models/admin_scim_user.go index 5fce5d0c..f7819f3c 100644 --- a/pkg/infra/models/admin_scim_user.go +++ b/pkg/infra/models/admin_scim_user.go @@ -99,15 +99,15 @@ type SCIMUserToPathScheme struct { // AddStringOperation adds a string operation to the SCIM user path scheme. func (s *SCIMUserToPathScheme) AddStringOperation(operation, path, value string) error { if operation == "" { - return ErrNoSCIMOperationError + return ErrNoSCIMOperation } if path == "" { - return ErrNoSCIMPathError + return ErrNoSCIMPath } if value == "" { - return ErrNoSCIMValueError + return ErrNoSCIMValue } s.Operations = append(s.Operations, &SCIMUserToPathOperationScheme{ @@ -122,11 +122,11 @@ func (s *SCIMUserToPathScheme) AddStringOperation(operation, path, value string) // AddBoolOperation adds a boolean operation to the SCIM user path scheme. func (s *SCIMUserToPathScheme) AddBoolOperation(operation, path string, value bool) error { if operation == "" { - return ErrNoSCIMOperationError + return ErrNoSCIMOperation } if path == "" { - return ErrNoSCIMPathError + return ErrNoSCIMPath } s.Operations = append(s.Operations, &SCIMUserToPathOperationScheme{ @@ -141,19 +141,19 @@ func (s *SCIMUserToPathScheme) AddBoolOperation(operation, path string, value bo // AddComplexOperation adds a complex operation to the SCIM user path scheme. func (s *SCIMUserToPathScheme) AddComplexOperation(operation, path string, values []*SCIMUserComplexOperationScheme) error { if operation == "" { - return ErrNoSCIMOperationError + return ErrNoSCIMOperation } if path == "" { - return ErrNoSCIMPathError + return ErrNoSCIMPath } if values == nil { - return ErrNoSCIMComplexValueError + return ErrNoSCIMComplexValue } if len(values) == 0 { - return ErrNoSCIMComplexValueError + return ErrNoSCIMComplexValue } s.Operations = append(s.Operations, &SCIMUserToPathOperationScheme{ diff --git a/pkg/infra/models/admin_scim_user_test.go b/pkg/infra/models/admin_scim_user_test.go index e832fa2e..20c7abf0 100644 --- a/pkg/infra/models/admin_scim_user_test.go +++ b/pkg/infra/models/admin_scim_user_test.go @@ -2,8 +2,9 @@ package models import ( + "testing" // Standard Go testing package + "github.com/stretchr/testify/assert" // Assert package for testing - "testing" // Standard Go testing package ) // TestSCIMUserToPathScheme_AddStringOperation tests the AddStringOperation method of the SCIMUserToPathScheme struct. @@ -49,7 +50,7 @@ func TestSCIMUserToPathScheme_AddStringOperation(t *testing.T) { value: "value_sample", }, wantErr: true, - Err: ErrNoSCIMOperationError, + Err: ErrNoSCIMOperation, }, // Test case when the path is not provided { @@ -61,7 +62,7 @@ func TestSCIMUserToPathScheme_AddStringOperation(t *testing.T) { value: "value_sample", }, wantErr: true, - Err: ErrNoSCIMPathError, + Err: ErrNoSCIMPath, }, // Test case when the value is not provided { @@ -73,7 +74,7 @@ func TestSCIMUserToPathScheme_AddStringOperation(t *testing.T) { value: "", }, wantErr: true, - Err: ErrNoSCIMValueError, + Err: ErrNoSCIMValue, }, } // Loop over each test case @@ -147,7 +148,7 @@ func TestSCIMUserToPathScheme_AddBoolOperation(t *testing.T) { value: true, }, wantErr: true, - Err: ErrNoSCIMOperationError, + Err: ErrNoSCIMOperation, }, // Test case when the path is not provided { @@ -159,7 +160,7 @@ func TestSCIMUserToPathScheme_AddBoolOperation(t *testing.T) { value: true, }, wantErr: true, - Err: ErrNoSCIMPathError, + Err: ErrNoSCIMPath, }, } // Loop over each test case @@ -238,7 +239,7 @@ func TestSCIMUserToPathScheme_AddComplexOperation(t *testing.T) { path: "path_sample", }, wantErr: true, - Err: ErrNoSCIMOperationError, + Err: ErrNoSCIMOperation, }, // Test case when the path is not provided { @@ -249,7 +250,7 @@ func TestSCIMUserToPathScheme_AddComplexOperation(t *testing.T) { path: "", }, wantErr: true, - Err: ErrNoSCIMPathError, + Err: ErrNoSCIMPath, }, // Test case when the value is not provided { @@ -261,7 +262,7 @@ func TestSCIMUserToPathScheme_AddComplexOperation(t *testing.T) { values: nil, }, wantErr: true, - Err: ErrNoSCIMComplexValueError, + Err: ErrNoSCIMComplexValue, }, } // Loop over each test case diff --git a/pkg/infra/models/errors.go b/pkg/infra/models/errors.go index 332c3f77..730301c3 100644 --- a/pkg/infra/models/errors.go +++ b/pkg/infra/models/errors.go @@ -5,182 +5,171 @@ import ( ) var ( - ErrNoSCIMComplexValueError = errors.New("admin: no scim complex value set") - ErrNoSCIMValueError = errors.New("admin: no scim value set") - ErrNoSCIMPathError = errors.New("admin: no scim path set") - ErrNoSCIMOperationError = errors.New("admin: no scim operation value set") - ErrNoAdminOrganizationError = errors.New("admin: no organization id set") - ErrNoAdminDomainIDError = errors.New("admin: no domain id set") - ErrNoEventIDError = errors.New("admin: no event id set") - ErrNoAdminPolicyError = errors.New("admin: no organization policy id set") - ErrNoAdminDirectoryIDError = errors.New("admin: no directory id set") - ErrNoAdminGroupIDError = errors.New("admin: no group id set") - ErrNoAdminGroupNameError = errors.New("admin: no group name set") - ErrNoAdminUserIDError = errors.New("admin: no user id set") - ErrNoAdminAccountIDError = errors.New("admin: no account id set") - ErrNoAdminUserTokenError = errors.New("admin: no user token id set") - ErrNoCustomerMailError = errors.New("sm: no customer mail set") - ErrNoCustomerDisplayNameError = errors.New("sm: no customer display name set") - ErrNoKBQueryError = errors.New("sm: no knowledge base query set") - ErrNoOrganizationNameError = errors.New("sm: no organization name set") - ErrNoOrganizationIDError = errors.New("sm: no organization id set") - ErrNoCommentBodyError = errors.New("sm/jira: no comment body set") - ErrNoServiceDeskIDError = errors.New("sm: no service desk id set") - ErrNoQueueIDError = errors.New("sm: no service desk queue id set") - ErrNoRequestTypeIDError = errors.New("sm: no request type id set") - ErrNoFileNameError = errors.New("sm: no file name set") - ErrNoFileReaderError = errors.New("sm: no io.Reader set") - ErrNoCustomRequestFieldsError = errors.New("sm: no customer request fields set") - ErrNoSLAMetricIDError = errors.New("sm: no sla metric id set") - ErrNoContentAttachmentIDError = errors.New("confluence: no attachment id set") - ErrNoContentAttachmentNameError = errors.New("confluence: no attachment filename set") - ErrNoContentReaderError = errors.New("confluence: no reader set") - ErrNoContentIDError = errors.New("confluence: no content id set") - ErrNoCustomContentTypeError = errors.New("confluence: no custom content type set") - ErrNoCustomContentIDError = errors.New("confluence: no custom content id set") - ErrNoPageIDError = errors.New("confluence: no page id set") - ErrNoSpaceIDError = errors.New("confluence: no space id set") - ErrNoTargetIDError = errors.New("confluence: no target id set") - ErrNoPositionError = errors.New("confluence: no position set") - ErrInvalidPositionError = errors.New("confluence: invalid position: (before, after, append)") - ValidPositions = map[string]bool{"before": true, "after": true, "append": true} - ErrNoLabelIDError = errors.New("confluence: no label id set") - ErrNoCQLError = errors.New("confluence: no CQL query set") - ErrNoContentTypeError = errors.New("confluence: no content type set") - ErrNoEntityIDError = errors.New("confluence: no entity id set") - ValidEntityValues = []string{"blogposts", "custom-content", "labels", "pages"} - ErrNoEntityValue = errors.New("confluence: no valid entity id set") - ErrInvalidContentTypeError = errors.New("confluence: invalid content type: (page, comment, attachment)") - ValidContentTypes = []string{"page", "comment", "attachment"} - ErrNoContentLabelError = errors.New("confluence: no content label set") - ErrNoContentPropertyError = errors.New("confluence: no content property set") - ErrNoSpaceNameError = errors.New("confluence: no space name set") - ErrNoSpaceKeyError = errors.New("confluence: no space key set") - ErrNoContentRestrictionKeyError = errors.New("confluence: no content restriction operation key set") - ErrNoConfluenceGroupError = errors.New("confluence: no group id or name set") - ErrNoLabelNameError = errors.New("confluence: no label name set") - ErrNoBoardIDError = errors.New("agile: no board id set") - ErrNoFilterIDError = errors.New("agile: no filter id set") - ErrNoNotificationSchemeIDError = errors.New("jira: no notification scheme id set") - ErrNoNotificationIDError = errors.New("jira: no notification id set") - ErrNoEpicIDError = errors.New("agile: no epic id set") - ErrNoSprintIDError = errors.New("agile: no sprint id set") - ErrNoApplicationRoleError = errors.New("jira: no application role key set") - ErrNoDashboardIDError = errors.New("jira: no dashboard id set") - ErrNoGroupNameError = errors.New("jira: no group name set") - ErrNoGroupIDError = errors.New("jira: no group name set") - ErrNoGroupsNameError = errors.New("jira: no groups names set") - ErrNoIssueKeyOrIDError = errors.New("jira: no issue key/id set") - ErrNoRemoteLinkIDError = errors.New("jira: no remote link id set") - ErrNoRemoteLinkGlobalIDError = errors.New("jira: no global remote link id set") - ErrNoTransitionIDError = errors.New("jira: no transition id set") - ErrNoAttachmentIDError = errors.New("jira: no attachment id set") - ErrNoAttachmentNameError = errors.New("jira: no attachment filename set") - ErrNoReaderError = errors.New("jira: no reader set") - ErrNoCommentIDError = errors.New("jira: no comment id set") - ErrNoProjectIDError = errors.New("jira: no project id set") - ErrNoProjectIDOrKeyError = errors.New("jira: no project id or key set") - ErrNoProjectRoleIDError = errors.New("jira: no project role id set") - ErrNoProjectCategoryIDError = errors.New("jira: no project category id set") - ErrNoPropertyKeyError = errors.New("jira: no property key set") - ErrNoProjectFeatureKeyError = errors.New("jira: no project feature key set") - ErrNoProjectFeatureStateError = errors.New("jira: no project state key set") - ErrNoFieldIDError = errors.New("jira: no field id set") - ErrNoEditOperatorError = errors.New("jira: no update operation set") - ErrNoOperatorError = errors.New("jira: no operation set") - ErrNoEditValueError = errors.New("jira: no update operation value set") - ErrNoCustomFieldError = errors.New("jira: no custom-fields set") - ErrNoCustomFieldIDError = errors.New("jira: no custom-field id set") - ErrNoWorkflowStatusesError = errors.New("jira: no workflow statuses set") - ErrNoWorkflowScopeError = errors.New("jira: no workflow scope set") - ErrNoWorkflowStatusNameOrIdError = errors.New("jira: no workflow status name or id set") - ErrNoFieldContextIDError = errors.New("jira: no field context id set") - ErrNoIssueTypesError = errors.New("jira: no issue types id's set") - ErrNoProjectsError = errors.New("jira: no projects set") - ErrNoContextOptionIDError = errors.New("jira: no field context option id set") - ErrNoTypeIDError = errors.New("jira: no link id set") - ErrNoLinkTypeIDError = errors.New("jira: no link type id set") - ErrNoPriorityIDError = errors.New("jira: no priority id set") - ErrNoResolutionIDError = errors.New("jira: no resolution id set") - ErrNoJQLError = errors.New("jira: no sql set") - ErrNoIssueTypeIDError = errors.New("jira: no issue type id set") - ErrNoIssueTypeScreenSchemeIDError = errors.New("jira: no issue type screen scheme id set") - ErrNoScreenSchemeIDError = errors.New("jira: no screen scheme id set") - ErrNoAccountIDError = errors.New("jira: no account id set") - ErrNoWorklogIDError = errors.New("jira: no worklog id set") - ErrNpWorklogsError = errors.New("jira: no worklog's id set") - ErrNoPermissionSchemeIDError = errors.New("jira: no permission scheme id set") - ErrNoPermissionGrantIDError = errors.New("jira: no permission grant id set") - ErrNoPermissionKeysError = errors.New("jira: no permission keys set") - ErrNoComponentIDError = errors.New("jira: no component id set") - ErrProjectTypeKeyError = errors.New("jira: no project type key set") - ErrNoProjectNameError = errors.New("jira: no project name set") - ErrNoVersionIDError = errors.New("jira: no version id set") - ErrNoScreenNameError = errors.New("jira: no screen name set") - ErrNoScreenTabNameError = errors.New("jira: no screen tab name set") - ErrNoAccountSliceError = errors.New("jira: no account id's set") - ErrNoProjectKeySliceError = errors.New("jira: no project key's set") - ErrNoProjectIDsError = errors.New("jira: no project id's set") - ErrNoWorkflowIDError = errors.New("jira: no workflow id set") - ErrNoWorkflowSchemeIDError = errors.New("jira: no workflow scheme id set") - ErrNoScreenIDError = errors.New("jira: no screen id set") - ErrNoScreenTabIDError = errors.New("jira: no screen tab id set") - ErrNoFieldConfigurationNameError = errors.New("jira: no field configuration name set") - ErrNoFieldConfigurationIDError = errors.New("jira: no field configuration id set") - ErrNoFieldConfigurationSchemeNameError = errors.New("jira: no field configuration scheme name set") - ErrNoFieldConfigurationSchemeIDError = errors.New("jira: no field configuration scheme id set") - ErrNoQueryError = errors.New("jira: no query set") - ErrNoVersionProvided = errors.New("client: no module version set") - ErrNoIssueTypeSchemeIDError = errors.New("jira: no issue type scheme id set") - ErrNoTaskIDError = errors.New("atlassian: no task id set") - ErrNoApprovalIDError = errors.New("jira: no approval id set") - ErrInvalidStatusCodeError = errors.New("client: invalid http response status, please refer the response.body for more details") - ErrNotFound = errors.New("client: no atlassian resource found") - ErrUnauthorized = errors.New("client: atlassian insufficient permissions") - ErrInternalError = errors.New("client: atlassian internal error") - ErrBadRequestError = errors.New("client: atlassian invalid payload") - ErrNoSiteError = errors.New("client: no atlassian site set") - ErrNoFloatTypeError = errors.New("custom-field: no float type set") - ErrNoSprintTypeError = errors.New("custom-field: no sprint type found") - ErrNoMultiVersionTypeError = errors.New("custom-field: no multiversion type found") - ErrNilPayloadError = errors.New("client: please provide the necessary payload struct") - ErrNonPayloadPointerError = errors.New("client: please provide a valid payload struct pointer (&)") - ErrNoFieldInformationError = errors.New("custom-field: please provide a buffer with a valid fields object") - ErrNoCustomFieldUnmarshalError = errors.New("custom-field: no valid json provided") - ErrNoMultiSelectTypeError = errors.New("custom-field: no multiselect type found") - ErrNoAssetTypeError = errors.New("custom-field: no asset type found") - ErrNoUrlTypeError = errors.New("custom-field: no url type set") - ErrNoTextTypeError = errors.New("custom-field: no text type set") - ErrNoDatePickerTypeError = errors.New("custom-field: no datepicker type set") - ErrNoDateTimeTypeError = errors.New("custom-field: no datetime type set") - ErrNoSelectTypeError = errors.New("custom-field: no select type set") - ErrNoButtonTypeError = errors.New("custom-field: no button type set") - ErrNoUserTypeError = errors.New("custom-field: no user type set") - ErrNoLabelsTypeError = errors.New("custom-field: no labels type set") - ErrNoMultiUserTypeError = errors.New("custom-field: no multi-user type set") - ErrNoCheckBoxTypeError = errors.New("custom-field: no check-box type set") - ErrNoCascadingParentError = errors.New("custom-field: no cascading parent value set") - ErrNoCascadingChildError = errors.New("custom-field: no cascading child value set") - ErrNoValueTypeError = errors.New("custom-field: no value set") - ErrNoRequestTypeError = errors.New("custom-field: no request type value set") - ErrNoTempoAccountTypeError = errors.New("custom-field: no tempo account value set") - ErrNoAttachmentIdsError = errors.New("sm: no attachment id's set") - ErrNoLabelsError = errors.New("sm: no label names set") - ErrNoComponentsError = errors.New("sm: no components set") - ErrNoIssuesSliceError = errors.New("jira: no issues object set") - ErrNoMapValuesError = errors.New("jira: no map values set") - ErrNCoComponentError = errors.New("sm: no component set") - ErrNoWorkspaceIDError = errors.New("assets: no workspace id set") - ErrNoAqlQueryError = errors.New("assets: no aql query id set") - ErrNoIconIDError = errors.New("assets: no icon id set") - ErrNoObjectIDError = errors.New("assets: no object id set") - ErrNoObjectSchemaIDError = errors.New("assets: no object schema id set") - ErrNoObjectTypeIDError = errors.New("assets: no object type id set") - ErrNoObjectTypeAttributeIDError = errors.New("assets: no object type attribute id set") - ErrNoCreateIssuesError = errors.New("jira: no issues payload set") - ErrNoIssueSchemeError = errors.New("jira: no issue instance set") - ErrNoWorkspaceError = errors.New("bitbucket: no workspace set") - ErrNoMemberIDError = errors.New("bitbucket: no member id set") - ErrNoWebhookIDError = errors.New("bitbucket: no webhook id set") - ErrNoRepositoryError = errors.New("bitbucket: no repository set") + ErrNoSCIMComplexValue = errors.New("admin: no scim complex value set") + ErrNoSCIMValue = errors.New("admin: no scim value set") + ErrNoSCIMPath = errors.New("admin: no scim path set") + ErrNoSCIMOperation = errors.New("admin: no scim operation value set") + ErrNoAdminOrganization = errors.New("admin: no organization id set") + ErrNoAdminDomainID = errors.New("admin: no domain id set") + ErrNoEventID = errors.New("admin: no event id set") + ErrNoAdminPolicy = errors.New("admin: no organization policy id set") + ErrNoAdminDirectoryID = errors.New("admin: no directory id set") + ErrNoAdminGroupID = errors.New("admin: no group id set") + ErrNoAdminGroupName = errors.New("admin: no group name set") + ErrNoAdminUserID = errors.New("admin: no user id set") + ErrNoAdminAccountID = errors.New("admin: no account id set") + ErrNoAdminUserToken = errors.New("admin: no user token id set") + ErrNoKBQuery = errors.New("sm: no knowledge base query set") + ErrNoOrganizationName = errors.New("sm: no organization name set") + ErrNoOrganizationID = errors.New("sm: no organization id set") + ErrNoCommentBody = errors.New("sm/jira: no comment body set") + ErrNoServiceDeskID = errors.New("sm: no service desk id set") + ErrNoQueueID = errors.New("sm: no service desk queue id set") + ErrNoRequestTypeID = errors.New("sm: no request type id set") + ErrNoFileName = errors.New("sm: no file name set") + ErrNoFileReader = errors.New("sm: no io.Reader set") + ErrNoSLAMetricID = errors.New("sm: no sla metric id set") + ErrNoContentAttachmentID = errors.New("confluence: no attachment id set") + ErrNoContentAttachmentName = errors.New("confluence: no attachment filename set") + ErrNoContentReader = errors.New("confluence: no reader set") + ErrNoContentID = errors.New("confluence: no content id set") + ErrNoCustomContentType = errors.New("confluence: no custom content type set") + ErrNoCustomContentID = errors.New("confluence: no custom content id set") + ErrNoPageID = errors.New("confluence: no page id set") + ErrNoSpaceID = errors.New("confluence: no space id set") + ErrNoTargetID = errors.New("confluence: no target id set") + ErrNoPosition = errors.New("confluence: no position set") + ErrInvalidPosition = errors.New("confluence: invalid position: (before, after, append)") + ValidPositions = map[string]bool{"before": true, "after": true, "append": true} + ErrNoLabelID = errors.New("confluence: no label id set") + ErrNoCQL = errors.New("confluence: no CQL query set") + ErrNoContentType = errors.New("confluence: no content type set") + ErrNoEntityID = errors.New("confluence: no entity id set") + ValidEntityValues = []string{"blogposts", "custom-content", "labels", "pages"} + ErrNoEntityValue = errors.New("confluence: no valid entity id set") + ErrNoContentLabel = errors.New("confluence: no content label set") + ErrNoContentProperty = errors.New("confluence: no content property set") + ErrNoSpaceName = errors.New("confluence: no space name set") + ErrNoSpaceKey = errors.New("confluence: no space key set") + ErrNoContentRestrictionKey = errors.New("confluence: no content restriction operation key set") + ErrNoConfluenceGroup = errors.New("confluence: no group id or name set") + ErrNoLabelName = errors.New("confluence: no label name set") + ErrNoBoardID = errors.New("agile: no board id set") + ErrNoFilterID = errors.New("agile: no filter id set") + ErrNoNotificationSchemeID = errors.New("jira: no notification scheme id set") + ErrNoNotificationID = errors.New("jira: no notification id set") + ErrNoEpicID = errors.New("agile: no epic id set") + ErrNoSprintID = errors.New("agile: no sprint id set") + ErrNoApplicationRole = errors.New("jira: no application role key set") + ErrNoDashboardID = errors.New("jira: no dashboard id set") + ErrNoGroupName = errors.New("jira: no group name set") + ErrNoGroupsName = errors.New("jira: no groups names set") + ErrNoIssueKeyOrID = errors.New("jira: no issue key/id set") + ErrNoRemoteLinkID = errors.New("jira: no remote link id set") + ErrNoRemoteLinkGlobalID = errors.New("jira: no global remote link id set") + ErrNoTransitionID = errors.New("jira: no transition id set") + ErrNoAttachmentID = errors.New("jira: no attachment id set") + ErrNoAttachmentName = errors.New("jira: no attachment filename set") + ErrNoReader = errors.New("jira: no reader set") + ErrNoCommentID = errors.New("jira: no comment id set") + ErrNoProjectID = errors.New("jira: no project id set") + ErrNoProjectIDOrKey = errors.New("jira: no project id or key set") + ErrNoProjectRoleID = errors.New("jira: no project role id set") + ErrNoProjectCategoryID = errors.New("jira: no project category id set") + ErrNoPropertyKey = errors.New("jira: no property key set") + ErrNoProjectFeatureKey = errors.New("jira: no project feature key set") + ErrNoProjectFeatureState = errors.New("jira: no project state key set") + ErrNoFieldID = errors.New("jira: no field id set") + ErrNoEditOperator = errors.New("jira: no update operation set") + ErrNoOperator = errors.New("jira: no operation set") + ErrNoEditValue = errors.New("jira: no update operation value set") + ErrNoCustomField = errors.New("jira: no custom-fields set") + ErrNoCustomFieldID = errors.New("jira: no custom-field id set") + ErrNoWorkflowStatuses = errors.New("jira: no workflow statuses set") + ErrNoWorkflowScope = errors.New("jira: no workflow scope set") + ErrNoWorkflowStatusNameOrId = errors.New("jira: no workflow status name or id set") + ErrNoFieldContextID = errors.New("jira: no field context id set") + ErrNoIssueTypes = errors.New("jira: no issue types id's set") + ErrNoProjects = errors.New("jira: no projects set") + ErrNoContextOptionID = errors.New("jira: no field context option id set") + ErrNoTypeID = errors.New("jira: no link id set") + ErrNoLinkTypeID = errors.New("jira: no link type id set") + ErrNoPriorityID = errors.New("jira: no priority id set") + ErrNoResolutionID = errors.New("jira: no resolution id set") + ErrNoJQL = errors.New("jira: no sql set") + ErrNoIssueTypeID = errors.New("jira: no issue type id set") + ErrNoIssueTypeScreenSchemeID = errors.New("jira: no issue type screen scheme id set") + ErrNoScreenSchemeID = errors.New("jira: no screen scheme id set") + ErrNoAccountID = errors.New("jira: no account id set") + ErrNoWorklogID = errors.New("jira: no worklog id set") + ErrNpWorklogs = errors.New("jira: no worklog's id set") + ErrNoPermissionSchemeID = errors.New("jira: no permission scheme id set") + ErrNoPermissionGrantID = errors.New("jira: no permission grant id set") + ErrNoPermissionKeys = errors.New("jira: no permission keys set") + ErrNoComponentID = errors.New("jira: no component id set") + ErrProjectTypeKey = errors.New("jira: no project type key set") + ErrNoProjectName = errors.New("jira: no project name set") + ErrNoVersionID = errors.New("jira: no version id set") + ErrNoScreenName = errors.New("jira: no screen name set") + ErrNoScreenTabName = errors.New("jira: no screen tab name set") + ErrNoAccountSlice = errors.New("jira: no account id's set") + ErrNoProjectKeySlice = errors.New("jira: no project key's set") + ErrNoProjectIDs = errors.New("jira: no project id's set") + ErrNoWorkflowID = errors.New("jira: no workflow id set") + ErrNoWorkflowSchemeID = errors.New("jira: no workflow scheme id set") + ErrNoScreenID = errors.New("jira: no screen id set") + ErrNoScreenTabID = errors.New("jira: no screen tab id set") + ErrNoFieldConfigurationName = errors.New("jira: no field configuration name set") + ErrNoFieldConfigurationID = errors.New("jira: no field configuration id set") + ErrNoFieldConfigurationSchemeName = errors.New("jira: no field configuration scheme name set") + ErrNoFieldConfigurationSchemeID = errors.New("jira: no field configuration scheme id set") + ErrNoQuery = errors.New("jira: no query set") + ErrNoVersionProvided = errors.New("client: no module version set") + ErrNoIssueTypeSchemeID = errors.New("jira: no issue type scheme id set") + ErrNoTaskID = errors.New("atlassian: no task id set") + ErrNoApprovalID = errors.New("jira: no approval id set") + ErrInvalidStatusCode = errors.New("client: invalid http response status, please refer the response.body for more details") + ErrNotFound = errors.New("client: no atlassian resource found") + ErrUnauthorized = errors.New("client: atlassian insufficient permissions") + ErrInternal = errors.New("client: atlassian internal error") + ErrBadRequest = errors.New("client: atlassian invalid payload") + ErrNoSite = errors.New("client: no atlassian site set") + ErrNoFloatType = errors.New("custom-field: no float type set") + ErrNoSprintType = errors.New("custom-field: no sprint type found") + ErrNoMultiVersionType = errors.New("custom-field: no multiversion type found") + ErrNoFieldInformation = errors.New("custom-field: please provide a buffer with a valid fields object") + ErrNoMultiSelectType = errors.New("custom-field: no multiselect type found") + ErrNoAssetType = errors.New("custom-field: no asset type found") + ErrNoUrlType = errors.New("custom-field: no url type set") + ErrNoTextType = errors.New("custom-field: no text type set") + ErrNoDatePickerType = errors.New("custom-field: no datepicker type set") + ErrNoDateTimeType = errors.New("custom-field: no datetime type set") + ErrNoSelectType = errors.New("custom-field: no select type set") + ErrNoButtonType = errors.New("custom-field: no button type set") + ErrNoUserType = errors.New("custom-field: no user type set") + ErrNoLabelsType = errors.New("custom-field: no labels type set") + ErrNoMultiUserType = errors.New("custom-field: no multi-user type set") + ErrNoCheckBoxType = errors.New("custom-field: no check-box type set") + ErrNoCascadingParent = errors.New("custom-field: no cascading parent value set") + ErrNoCascadingChild = errors.New("custom-field: no cascading child value set") + ErrNoValueType = errors.New("custom-field: no value set") + ErrNoRequestType = errors.New("custom-field: no request type value set") + ErrNoTempoAccountType = errors.New("custom-field: no tempo account value set") + ErrNoComponents = errors.New("sm: no components set") + ErrNoIssuesSlice = errors.New("jira: no issues object set") + ErrNoMapValues = errors.New("jira: no map values set") + ErrNCoComponent = errors.New("sm: no component set") + ErrNoWorkspaceID = errors.New("assets: no workspace id set") + ErrNoAqlQuery = errors.New("assets: no aql query id set") + ErrNoIconID = errors.New("assets: no icon id set") + ErrNoObjectID = errors.New("assets: no object id set") + ErrNoObjectSchemaID = errors.New("assets: no object schema id set") + ErrNoObjectTypeID = errors.New("assets: no object type id set") + ErrNoObjectTypeAttributeID = errors.New("assets: no object type attribute id set") + ErrNoCreateIssues = errors.New("jira: no issues payload set") + ErrNoIssueScheme = errors.New("jira: no issue instance set") + ErrNoWorkspace = errors.New("bitbucket: no workspace set") + ErrNoMemberID = errors.New("bitbucket: no member id set") + ErrNoWebhookID = errors.New("bitbucket: no webhook id set") + ErrNoRepository = errors.New("bitbucket: no repository set") ) diff --git a/pkg/infra/models/jira_custom_fields.go b/pkg/infra/models/jira_custom_fields.go index cab2313f..c0633f5f 100644 --- a/pkg/infra/models/jira_custom_fields.go +++ b/pkg/infra/models/jira_custom_fields.go @@ -12,11 +12,11 @@ type CustomFields struct{ Fields []map[string]interface{} } func (c *CustomFields) Groups(customFieldID string, groups []string) error { if len(customFieldID) == 0 { - return ErrNoFieldIDError + return ErrNoFieldID } if len(groups) == 0 { - return ErrNoGroupsNameError + return ErrNoGroupsName } var groupsNode []map[string]interface{} @@ -42,11 +42,11 @@ func (c *CustomFields) Groups(customFieldID string, groups []string) error { func (c *CustomFields) Group(customFieldID, group string) error { if len(customFieldID) == 0 { - return ErrNoFieldIDError + return ErrNoFieldID } if len(group) == 0 { - return ErrNoGroupNameError + return ErrNoGroupName } var groupNode = map[string]interface{}{} @@ -66,11 +66,11 @@ func (c *CustomFields) Group(customFieldID, group string) error { func (c *CustomFields) URL(customFieldID, URL string) error { if len(customFieldID) == 0 { - return ErrNoFieldIDError + return ErrNoFieldID } if len(URL) == 0 { - return ErrNoUrlTypeError + return ErrNoUrlType } var urlNode = map[string]interface{}{} @@ -87,11 +87,11 @@ func (c *CustomFields) URL(customFieldID, URL string) error { func (c *CustomFields) Text(customFieldID, textValue string) error { if len(customFieldID) == 0 { - return ErrNoFieldIDError + return ErrNoFieldID } if len(textValue) == 0 { - return ErrNoTextTypeError + return ErrNoTextType } var textNode = map[string]interface{}{} @@ -108,11 +108,11 @@ func (c *CustomFields) Text(customFieldID, textValue string) error { func (c *CustomFields) DateTime(customFieldID string, dateValue time.Time) error { if len(customFieldID) == 0 { - return ErrNoFieldIDError + return ErrNoFieldID } if dateValue.IsZero() { - return ErrNoDatePickerTypeError + return ErrNoDatePickerType } var dateNode = map[string]interface{}{} @@ -129,11 +129,11 @@ func (c *CustomFields) DateTime(customFieldID string, dateValue time.Time) error func (c *CustomFields) Date(customFieldID string, dateTimeValue time.Time) (err error) { if len(customFieldID) == 0 { - return ErrNoFieldIDError + return ErrNoFieldID } if dateTimeValue.IsZero() { - return ErrNoDateTimeTypeError + return ErrNoDateTimeType } var dateTimeNode = map[string]interface{}{} @@ -150,11 +150,11 @@ func (c *CustomFields) Date(customFieldID string, dateTimeValue time.Time) (err func (c *CustomFields) MultiSelect(customFieldID string, options []string) error { if len(customFieldID) == 0 { - return ErrNoFieldIDError + return ErrNoFieldID } if len(options) == 0 { - return ErrNoMultiSelectTypeError + return ErrNoMultiSelectType } var groupsNode []map[string]interface{} @@ -180,11 +180,11 @@ func (c *CustomFields) MultiSelect(customFieldID string, options []string) error func (c *CustomFields) Select(customFieldID string, option string) error { if len(customFieldID) == 0 { - return ErrNoFieldIDError + return ErrNoFieldID } if len(option) == 0 { - return ErrNoSelectTypeError + return ErrNoSelectType } var selectNode = map[string]interface{}{} @@ -204,11 +204,11 @@ func (c *CustomFields) Select(customFieldID string, option string) error { func (c *CustomFields) RadioButton(customFieldID, button string) error { if len(customFieldID) == 0 { - return ErrNoFieldIDError + return ErrNoFieldID } if len(button) == 0 { - return ErrNoButtonTypeError + return ErrNoButtonType } var selectNode = map[string]interface{}{} @@ -228,11 +228,11 @@ func (c *CustomFields) RadioButton(customFieldID, button string) error { func (c *CustomFields) User(customFieldID string, accountID string) error { if len(customFieldID) == 0 { - return ErrNoFieldIDError + return ErrNoFieldID } if len(accountID) == 0 { - return ErrNoUserTypeError + return ErrNoUserType } var userNode = map[string]interface{}{} @@ -252,11 +252,11 @@ func (c *CustomFields) User(customFieldID string, accountID string) error { func (c *CustomFields) Users(customFieldID string, accountIDs []string) error { if len(customFieldID) == 0 { - return ErrNoFieldIDError + return ErrNoFieldID } if len(accountIDs) == 0 { - return ErrNoMultiUserTypeError + return ErrNoMultiUserType } var accountsNode []map[string]interface{} @@ -282,7 +282,7 @@ func (c *CustomFields) Users(customFieldID string, accountIDs []string) error { func (c *CustomFields) Number(customFieldID string, numberValue float64) error { if len(customFieldID) == 0 { - return ErrNoFieldIDError + return ErrNoFieldID } var numberNode = map[string]interface{}{} @@ -299,11 +299,11 @@ func (c *CustomFields) Number(customFieldID string, numberValue float64) error { func (c *CustomFields) CheckBox(customFieldID string, options []string) error { if len(customFieldID) == 0 { - return ErrNoFieldIDError + return ErrNoFieldID } if len(options) == 0 { - return ErrNoCheckBoxTypeError + return ErrNoCheckBoxType } var groupsNode []map[string]interface{} @@ -329,15 +329,15 @@ func (c *CustomFields) CheckBox(customFieldID string, options []string) error { func (c *CustomFields) Cascading(customFieldID, parent, child string) error { if len(customFieldID) == 0 { - return ErrNoFieldIDError + return ErrNoFieldID } if parent == "" { - return ErrNoCascadingParentError + return ErrNoCascadingParent } if child == "" { - return ErrNoCascadingChildError + return ErrNoCascadingChild } var childNode = map[string]interface{}{} @@ -361,11 +361,11 @@ func (c *CustomFields) Cascading(customFieldID, parent, child string) error { func (c *CustomFields) Raw(customFieldID string, value interface{}) error { if len(customFieldID) == 0 { - return ErrNoFieldIDError + return ErrNoFieldID } if value == nil { - return ErrNoValueTypeError + return ErrNoValueType } var valueNode = map[string]interface{}{} diff --git a/pkg/infra/models/jira_custom_fields_test.go b/pkg/infra/models/jira_custom_fields_test.go index 3d9f40d3..20c6b9ec 100644 --- a/pkg/infra/models/jira_custom_fields_test.go +++ b/pkg/infra/models/jira_custom_fields_test.go @@ -42,7 +42,7 @@ func TestCustomFields_Cascading(t *testing.T) { child: "US", }, wantErr: true, - Err: ErrNoFieldIDError, + Err: ErrNoFieldID, }, { @@ -54,7 +54,7 @@ func TestCustomFields_Cascading(t *testing.T) { child: "US", }, wantErr: true, - Err: ErrNoCascadingParentError, + Err: ErrNoCascadingParent, }, { @@ -66,7 +66,7 @@ func TestCustomFields_Cascading(t *testing.T) { child: "", }, wantErr: true, - Err: ErrNoCascadingChildError, + Err: ErrNoCascadingChild, }, } for _, testCase := range testCases { @@ -124,7 +124,7 @@ func TestCustomFields_CheckBox(t *testing.T) { options: []string{"Value"}, }, wantErr: true, - Err: ErrNoFieldIDError, + Err: ErrNoFieldID, }, { @@ -135,7 +135,7 @@ func TestCustomFields_CheckBox(t *testing.T) { options: nil, }, wantErr: true, - Err: ErrNoCheckBoxTypeError, + Err: ErrNoCheckBoxType, }, } for _, testCase := range testCases { @@ -193,7 +193,7 @@ func TestCustomFields_Date(t *testing.T) { dateTimeValue: time.Now().AddDate(0, -1, 0), }, wantErr: true, - Err: ErrNoFieldIDError, + Err: ErrNoFieldID, }, { @@ -204,7 +204,7 @@ func TestCustomFields_Date(t *testing.T) { dateTimeValue: time.Time{}, }, wantErr: true, - Err: ErrNoDateTimeTypeError, + Err: ErrNoDateTimeType, }, } for _, testCase := range testCases { @@ -264,7 +264,7 @@ func TestCustomFields_DateTime(t *testing.T) { dateValue: time.Now().AddDate(0, -1, 0), }, wantErr: true, - Err: ErrNoFieldIDError, + Err: ErrNoFieldID, }, { @@ -275,7 +275,7 @@ func TestCustomFields_DateTime(t *testing.T) { dateValue: time.Time{}, }, wantErr: true, - Err: ErrNoDatePickerTypeError, + Err: ErrNoDatePickerType, }, } for _, testCase := range testCases { @@ -334,7 +334,7 @@ func TestCustomFields_Group(t *testing.T) { group: "jira-users", }, wantErr: true, - Err: ErrNoFieldIDError, + Err: ErrNoFieldID, }, { @@ -345,7 +345,7 @@ func TestCustomFields_Group(t *testing.T) { group: "", }, wantErr: true, - Err: ErrNoGroupNameError, + Err: ErrNoGroupName, }, } @@ -404,7 +404,7 @@ func TestCustomFields_Groups(t *testing.T) { groups: []string{"jira-users", "jira-admins"}, }, wantErr: true, - Err: ErrNoFieldIDError, + Err: ErrNoFieldID, }, { @@ -415,7 +415,7 @@ func TestCustomFields_Groups(t *testing.T) { groups: nil, }, wantErr: true, - Err: ErrNoGroupsNameError, + Err: ErrNoGroupsName, }, } for _, testCase := range testCases { @@ -473,7 +473,7 @@ func TestCustomFields_MultiSelect(t *testing.T) { options: []string{"options"}, }, wantErr: true, - Err: ErrNoFieldIDError, + Err: ErrNoFieldID, }, { @@ -484,7 +484,7 @@ func TestCustomFields_MultiSelect(t *testing.T) { options: nil, }, wantErr: true, - Err: ErrNoMultiSelectTypeError, + Err: ErrNoMultiSelectType, }, } for _, testCase := range testCases { @@ -589,7 +589,7 @@ func TestCustomFields_RadioButton(t *testing.T) { button: "Button 1 ", }, wantErr: true, - Err: ErrNoFieldIDError, + Err: ErrNoFieldID, }, { @@ -600,7 +600,7 @@ func TestCustomFields_RadioButton(t *testing.T) { button: "", }, wantErr: true, - Err: ErrNoButtonTypeError, + Err: ErrNoButtonType, }, } for _, testCase := range testCases { @@ -658,7 +658,7 @@ func TestCustomFields_Select(t *testing.T) { option: "Option 1", }, wantErr: true, - Err: ErrNoFieldIDError, + Err: ErrNoFieldID, }, { @@ -669,7 +669,7 @@ func TestCustomFields_Select(t *testing.T) { option: "", }, wantErr: true, - Err: ErrNoSelectTypeError, + Err: ErrNoSelectType, }, } for _, testCase := range testCases { @@ -727,7 +727,7 @@ func TestCustomFields_Text(t *testing.T) { textValue: "Application", }, wantErr: true, - Err: ErrNoFieldIDError, + Err: ErrNoFieldID, }, { @@ -738,7 +738,7 @@ func TestCustomFields_Text(t *testing.T) { textValue: "", }, wantErr: true, - Err: ErrNoTextTypeError, + Err: ErrNoTextType, }, } for _, testCase := range testCases { @@ -796,7 +796,7 @@ func TestCustomFields_URL(t *testing.T) { URL: "https://www.google.com/", }, wantErr: true, - Err: ErrNoFieldIDError, + Err: ErrNoFieldID, }, { @@ -807,7 +807,7 @@ func TestCustomFields_URL(t *testing.T) { URL: "", }, wantErr: true, - Err: ErrNoUrlTypeError, + Err: ErrNoUrlType, }, } for _, testCase := range testCases { @@ -865,7 +865,7 @@ func TestCustomFields_User(t *testing.T) { accountID: "uuid-sample", }, wantErr: true, - Err: ErrNoFieldIDError, + Err: ErrNoFieldID, }, { @@ -876,7 +876,7 @@ func TestCustomFields_User(t *testing.T) { accountID: "", }, wantErr: true, - Err: ErrNoUserTypeError, + Err: ErrNoUserType, }, } for _, testCase := range testCases { @@ -934,7 +934,7 @@ func TestCustomFields_Users(t *testing.T) { accountIDs: []string{"user-1", "user-2"}, }, wantErr: true, - Err: ErrNoFieldIDError, + Err: ErrNoFieldID, }, { name: "when the users are not provided", @@ -944,7 +944,7 @@ func TestCustomFields_Users(t *testing.T) { accountIDs: nil, }, wantErr: true, - Err: ErrNoMultiUserTypeError, + Err: ErrNoMultiUserType, }, } for _, testCase := range testCases { diff --git a/pkg/infra/models/jira_issue_custom_fields.go b/pkg/infra/models/jira_issue_custom_fields.go index 92f39af9..6493872c 100644 --- a/pkg/infra/models/jira_issue_custom_fields.go +++ b/pkg/infra/models/jira_issue_custom_fields.go @@ -49,18 +49,18 @@ func ParseMultiSelectCustomField(buffer bytes.Buffer, customField string) ([]*Cu // Check if the buffer contains the "issues" object if !raw.Get("fields").Exists() { - return nil, ErrNoFieldInformationError + return nil, ErrNoFieldInformation } // Check if the issue iteration contains information on the customfield selected, // if not, continue if raw.Get(path).Type == gjson.Null { - return nil, ErrNoMultiSelectTypeError + return nil, ErrNoMultiSelectType } var options []*CustomFieldContextOptionScheme if err := json.Unmarshal([]byte(raw.Get(path).String()), &options); err != nil { - return nil, ErrNoMultiSelectTypeError + return nil, ErrNoMultiSelectType } return options, nil @@ -114,7 +114,7 @@ func ParseMultiSelectCustomFields(buffer bytes.Buffer, customField string) (map[ // Check if the buffer contains the "issues" object if !raw.Get("issues").Exists() { - return nil, ErrNoIssuesSliceError + return nil, ErrNoIssuesSlice } // Loop through each custom field, extract the information and stores the data on a map @@ -141,7 +141,7 @@ func ParseMultiSelectCustomFields(buffer bytes.Buffer, customField string) (map[ // Check if the map processed contains elements // if so, return an error interface if len(customfieldsAsMap) == 0 { - return nil, ErrNoMapValuesError + return nil, ErrNoMapValues } return customfieldsAsMap, nil @@ -184,18 +184,18 @@ func ParseMultiGroupPickerCustomField(buffer bytes.Buffer, customField string) ( // Check if the buffer contains the "issues" object if !raw.Get("fields").Exists() { - return nil, ErrNoFieldInformationError + return nil, ErrNoFieldInformation } // Check if the issue iteration contains information on the customfield selected, // if not, continue if raw.Get(path).Type == gjson.Null { - return nil, ErrNoMultiSelectTypeError + return nil, ErrNoMultiSelectType } var options []*GroupDetailScheme if err := json.Unmarshal([]byte(raw.Get(path).String()), &options); err != nil { - return nil, ErrNoMultiSelectTypeError + return nil, ErrNoMultiSelectType } return options, nil @@ -249,7 +249,7 @@ func ParseMultiGroupPickerCustomFields(buffer bytes.Buffer, customField string) // Check if the buffer contains the "issues" object if !raw.Get("issues").Exists() { - return nil, ErrNoIssuesSliceError + return nil, ErrNoIssuesSlice } // Loop through each custom field, extract the information and stores the data on a map @@ -276,7 +276,7 @@ func ParseMultiGroupPickerCustomFields(buffer bytes.Buffer, customField string) // Check if the map processed contains elements // if so, return an error interface if len(customfieldsAsMap) == 0 { - return nil, ErrNoMapValuesError + return nil, ErrNoMapValues } return customfieldsAsMap, nil @@ -319,18 +319,18 @@ func ParseMultiUserPickerCustomField(buffer bytes.Buffer, customField string) ([ // Check if the buffer contains the "issues" object if !raw.Get("fields").Exists() { - return nil, ErrNoFieldInformationError + return nil, ErrNoFieldInformation } // Check if the issue iteration contains information on the customfield selected, // if not, continue if raw.Get(path).Type == gjson.Null { - return nil, ErrNoMultiSelectTypeError + return nil, ErrNoMultiSelectType } var users []*UserDetailScheme if err := json.Unmarshal([]byte(raw.Get(path).String()), &users); err != nil { - return nil, ErrNoMultiSelectTypeError + return nil, ErrNoMultiSelectType } return users, nil @@ -384,7 +384,7 @@ func ParseMultiUserPickerCustomFields(buffer bytes.Buffer, customField string) ( // Check if the buffer contains the "issues" object if !raw.Get("issues").Exists() { - return nil, ErrNoIssuesSliceError + return nil, ErrNoIssuesSlice } // Loop through each custom field, extract the information and stores the data on a map @@ -411,7 +411,7 @@ func ParseMultiUserPickerCustomFields(buffer bytes.Buffer, customField string) ( // Check if the map processed contains elements // if so, return an error interface if len(customfieldsAsMap) == 0 { - return nil, ErrNoMapValuesError + return nil, ErrNoMapValues } return customfieldsAsMap, nil @@ -452,18 +452,18 @@ func ParseCascadingSelectCustomField(buffer bytes.Buffer, customField string) (* // Check if the buffer contains the "issues" object if !raw.Get("fields").Exists() { - return nil, ErrNoFieldInformationError + return nil, ErrNoFieldInformation } // Check if the issue iteration contains information on the customfield selected, // if not, continue if raw.Get(path).Type == gjson.Null { - return nil, ErrNoCascadingParentError + return nil, ErrNoCascadingParent } var cascading CascadingSelectScheme if err := json.Unmarshal([]byte(raw.Get(path).String()), &cascading); err != nil { - return nil, ErrNoCascadingParentError + return nil, ErrNoCascadingParent } return &cascading, nil @@ -517,7 +517,7 @@ func ParseCascadingCustomFields(buffer bytes.Buffer, customField string) (map[st // Check if the buffer contains the "issues" object if !raw.Get("issues").Exists() { - return nil, ErrNoIssuesSliceError + return nil, ErrNoIssuesSlice } // Loop through each custom field, extract the information and stores the data on a map @@ -544,7 +544,7 @@ func ParseCascadingCustomFields(buffer bytes.Buffer, customField string) (map[st // Check if the map processed contains elements // if so, return an error interface if len(customfieldsAsMap) == 0 { - return nil, ErrNoMapValuesError + return nil, ErrNoMapValues } return customfieldsAsMap, nil @@ -587,18 +587,18 @@ func ParseMultiVersionCustomField(buffer bytes.Buffer, customField string) ([]*V // Check if the buffer contains the "fields" object if !raw.Get("fields").Exists() { - return nil, ErrNoFieldInformationError + return nil, ErrNoFieldInformation } // Check if the issue iteration contains information on the customfield selected, // if not, continue if raw.Get(path).Type == gjson.Null { - return nil, ErrNoMultiVersionTypeError + return nil, ErrNoMultiVersionType } var versions []*VersionDetailScheme if err := json.Unmarshal([]byte(raw.Get(path).String()), &versions); err != nil { - return nil, ErrNoMultiSelectTypeError + return nil, ErrNoMultiSelectType } return versions, nil @@ -652,7 +652,7 @@ func ParseMultiVersionCustomFields(buffer bytes.Buffer, customField string) (map // Check if the buffer contains the "issues" object if !raw.Get("issues").Exists() { - return nil, ErrNoIssuesSliceError + return nil, ErrNoIssuesSlice } // Loop through each custom field, extract the information and stores the data on a map @@ -679,7 +679,7 @@ func ParseMultiVersionCustomFields(buffer bytes.Buffer, customField string) (map // Check if the map processed contains elements // if so, return an error interface if len(customfieldsAsMap) == 0 { - return nil, ErrNoMapValuesError + return nil, ErrNoMapValues } return customfieldsAsMap, nil @@ -720,18 +720,18 @@ func ParseUserPickerCustomField(buffer bytes.Buffer, customField string) (*UserD // Check if the buffer contains the "fields" object if !raw.Get("fields").Exists() { - return nil, ErrNoFieldInformationError + return nil, ErrNoFieldInformation } // Check if the issue iteration contains information on the customfield selected, // if not, continue if raw.Get(path).Type == gjson.Null { - return nil, ErrNoUserTypeError + return nil, ErrNoUserType } var user UserDetailScheme if err := json.Unmarshal([]byte(raw.Get(path).String()), &user); err != nil { - return nil, ErrNoMultiSelectTypeError + return nil, ErrNoMultiSelectType } return &user, nil @@ -785,7 +785,7 @@ func ParseUserPickerCustomFields(buffer bytes.Buffer, customField string) (map[s // Check if the buffer contains the "issues" object if !raw.Get("issues").Exists() { - return nil, ErrNoIssuesSliceError + return nil, ErrNoIssuesSlice } // Loop through each custom field, extract the information and stores the data on a map @@ -812,7 +812,7 @@ func ParseUserPickerCustomFields(buffer bytes.Buffer, customField string) (map[s // Check if the map processed contains elements // if so, return an error interface if len(customfieldsAsMap) == 0 { - return nil, ErrNoMapValuesError + return nil, ErrNoMapValues } return customfieldsAsMap, nil @@ -847,13 +847,13 @@ func ParseStringCustomField(buffer bytes.Buffer, customField string) (string, er // Check if the buffer contains the "fields" object if !raw.Get("fields").Exists() { - return "", ErrNoFieldInformationError + return "", ErrNoFieldInformation } // Check if the issue iteration contains information on the customfield selected, // if not, continue if raw.Get(path).Type == gjson.Null { - return "", ErrNoTextTypeError + return "", ErrNoTextType } return raw.Get(path).String(), nil @@ -905,7 +905,7 @@ func ParseStringCustomFields(buffer bytes.Buffer, customField string) (map[strin // Check if the buffer contains the "issues" object if !raw.Get("issues").Exists() { - return nil, ErrNoIssuesSliceError + return nil, ErrNoIssuesSlice } // Loop through each custom field, extract the information and stores the data on a map @@ -931,7 +931,7 @@ func ParseStringCustomFields(buffer bytes.Buffer, customField string) (map[strin // Check if the map processed contains elements // if so, return an error interface if len(customfieldsAsMap) == 0 { - return nil, ErrNoMapValuesError + return nil, ErrNoMapValues } return customfieldsAsMap, nil @@ -966,18 +966,18 @@ func ParseFloatCustomField(buffer bytes.Buffer, customField string) (float64, er // Check if the buffer contains the "fields" object if !raw.Get("fields").Exists() { - return 0, ErrNoFieldInformationError + return 0, ErrNoFieldInformation } // Check if the issue iteration contains information on the customfield selected, // if not, continue if raw.Get(path).Type == gjson.Null { - return 0, ErrNoFloatTypeError + return 0, ErrNoFloatType } var textFloat float64 if err := json.Unmarshal([]byte(raw.Get(path).String()), &textFloat); err != nil { - return 0, ErrNoFloatTypeError + return 0, ErrNoFloatType } return textFloat, nil @@ -1029,7 +1029,7 @@ func ParseFloatCustomFields(buffer bytes.Buffer, customField string) (map[string // Check if the buffer contains the "issues" object if !raw.Get("issues").Exists() { - return nil, ErrNoIssuesSliceError + return nil, ErrNoIssuesSlice } // Loop through each custom field, extract the information and stores the data on a map @@ -1056,7 +1056,7 @@ func ParseFloatCustomFields(buffer bytes.Buffer, customField string) (map[string // Check if the map processed contains elements // if so, return an error interface if len(customfieldsAsMap) == 0 { - return nil, ErrNoMapValuesError + return nil, ErrNoMapValues } return customfieldsAsMap, nil @@ -1091,18 +1091,18 @@ func ParseLabelCustomField(buffer bytes.Buffer, customField string) ([]string, e // Check if the buffer contains the "fields" object if !raw.Get("fields").Exists() { - return nil, ErrNoFieldInformationError + return nil, ErrNoFieldInformation } // Check if the issue iteration contains information on the customfield selected, // if not, continue if raw.Get(path).Type == gjson.Null { - return nil, ErrNoLabelsTypeError + return nil, ErrNoLabelsType } var labels []string if err := json.Unmarshal([]byte(raw.Get(path).String()), &labels); err != nil { - return nil, ErrNoLabelsTypeError + return nil, ErrNoLabelsType } return labels, nil @@ -1154,7 +1154,7 @@ func ParseLabelCustomFields(buffer bytes.Buffer, customField string) (map[string // Check if the buffer contains the "issues" object if !raw.Get("issues").Exists() { - return nil, ErrNoIssuesSliceError + return nil, ErrNoIssuesSlice } // Loop through each custom field, extract the information and stores the data on a map @@ -1181,7 +1181,7 @@ func ParseLabelCustomFields(buffer bytes.Buffer, customField string) (map[string // Check if the map processed contains elements // if so, return an error interface if len(customfieldsAsMap) == 0 { - return nil, ErrNoMapValuesError + return nil, ErrNoMapValues } return customfieldsAsMap, nil @@ -1216,18 +1216,18 @@ func ParseSprintCustomField(buffer bytes.Buffer, customField string) ([]*SprintD // Check if the buffer contains the "fields" object if !raw.Get("fields").Exists() { - return nil, ErrNoFieldInformationError + return nil, ErrNoFieldInformation } // Check if the issue iteration contains information on the customfield selected, // if not, continue if raw.Get(path).Type == gjson.Null { - return nil, ErrNoSprintTypeError + return nil, ErrNoSprintType } var sprints []*SprintDetailScheme if err := json.Unmarshal([]byte(raw.Get(path).String()), &sprints); err != nil { - return nil, ErrNoSprintTypeError + return nil, ErrNoSprintType } return sprints, nil @@ -1281,7 +1281,7 @@ func ParseSprintCustomFields(buffer bytes.Buffer, customField string) (map[strin // Check if the buffer contains the "issues" object if !raw.Get("issues").Exists() { - return nil, ErrNoIssuesSliceError + return nil, ErrNoIssuesSlice } // Loop through each custom field, extract the information and stores the data on a map @@ -1308,7 +1308,7 @@ func ParseSprintCustomFields(buffer bytes.Buffer, customField string) (map[strin // Check if the map processed contains elements // if so, return an error interface if len(customfieldsAsMap) == 0 { - return nil, ErrNoMapValuesError + return nil, ErrNoMapValues } return customfieldsAsMap, nil @@ -1343,18 +1343,18 @@ func ParseSelectCustomField(buffer bytes.Buffer, customField string) (*CustomFie // Check if the buffer contains the "fields" object if !raw.Get("fields").Exists() { - return nil, ErrNoFieldInformationError + return nil, ErrNoFieldInformation } // Check if the issue iteration contains information on the customfield selected, // if not, continue if raw.Get(path).Type == gjson.Null { - return nil, ErrNoSelectTypeError + return nil, ErrNoSelectType } var sprints *CustomFieldContextOptionScheme if err := json.Unmarshal([]byte(raw.Get(path).String()), &sprints); err != nil { - return nil, ErrNoSelectTypeError + return nil, ErrNoSelectType } return sprints, nil @@ -1408,7 +1408,7 @@ func ParseSelectCustomFields(buffer bytes.Buffer, customField string) (map[strin // Check if the buffer contains the "issues" object if !raw.Get("issues").Exists() { - return nil, ErrNoIssuesSliceError + return nil, ErrNoIssuesSlice } // Loop through each custom field, extract the information and stores the data on a map @@ -1435,7 +1435,7 @@ func ParseSelectCustomFields(buffer bytes.Buffer, customField string) (map[strin // Check if the map processed contains elements // if so, return an error interface if len(customfieldsAsMap) == 0 { - return nil, ErrNoMapValuesError + return nil, ErrNoMapValues } return customfieldsAsMap, nil @@ -1470,18 +1470,18 @@ func ParseAssetCustomField(buffer bytes.Buffer, customField string) ([]*CustomFi // Check if the buffer contains the "fields" object if !raw.Get("fields").Exists() { - return nil, ErrNoFieldInformationError + return nil, ErrNoFieldInformation } // Check if the issue iteration contains information on the customfield selected, // if not, continue if raw.Get(path).Type == gjson.Null { - return nil, ErrNoAssetTypeError + return nil, ErrNoAssetType } var assets []*CustomFieldAssetScheme if err := json.Unmarshal([]byte(raw.Get(path).String()), &assets); err != nil { - return nil, ErrNoAssetTypeError + return nil, ErrNoAssetType } return assets, nil @@ -1535,7 +1535,7 @@ func ParseAssetCustomFields(buffer bytes.Buffer, customField string) (map[string // Check if the buffer contains the "issues" object if !raw.Get("issues").Exists() { - return nil, ErrNoIssuesSliceError + return nil, ErrNoIssuesSlice } // Loop through each custom field, extract the information and stores the data on a map @@ -1562,7 +1562,7 @@ func ParseAssetCustomFields(buffer bytes.Buffer, customField string) (map[string // Check if the map processed contains elements // if so, return an error interface if len(customfieldsAsMap) == 0 { - return nil, ErrNoMapValuesError + return nil, ErrNoMapValues } return customfieldsAsMap, nil @@ -1597,18 +1597,18 @@ func ParseDatePickerCustomField(buffer bytes.Buffer, customField string) (time.T // Check if the buffer contains the "issues" object if !raw.Get("fields").Exists() { - return time.Time{}, ErrNoFieldInformationError + return time.Time{}, ErrNoFieldInformation } // Check if the issue iteration contains information on the customfield selected, // if not, continue if raw.Get(path).Type == gjson.Null { - return time.Time{}, ErrNoDatePickerTypeError + return time.Time{}, ErrNoDatePickerType } value, err := time.Parse("2006-01-02", raw.Get(path).String()) if err != nil { - return time.Time{}, ErrNoDatePickerTypeError + return time.Time{}, ErrNoDatePickerType } return value, nil @@ -1661,7 +1661,7 @@ func ParseDatePickerCustomFields(buffer bytes.Buffer, customField string) (map[s // Check if the buffer contains the "issues" object if !raw.Get("issues").Exists() { - return nil, ErrNoIssuesSliceError + return nil, ErrNoIssuesSlice } // Loop through each custom field, extract the information and stores the data on a map @@ -1688,7 +1688,7 @@ func ParseDatePickerCustomFields(buffer bytes.Buffer, customField string) (map[s // Check if the map processed contains elements // if so, return an error interface if len(customfieldsAsMap) == 0 { - return nil, ErrNoMapValuesError + return nil, ErrNoMapValues } return customfieldsAsMap, nil @@ -1723,18 +1723,18 @@ func ParseDateTimeCustomField(buffer bytes.Buffer, customField string) (time.Tim // Check if the buffer contains the "issues" object if !raw.Get("fields").Exists() { - return time.Time{}, ErrNoFieldInformationError + return time.Time{}, ErrNoFieldInformation } // Check if the issue iteration contains information on the customfield selected, // if not, continue if raw.Get(path).Type == gjson.Null { - return time.Time{}, ErrNoDateTimeTypeError + return time.Time{}, ErrNoDateTimeType } value, err := time.Parse("2006-01-02T15:04:05.000-0700", raw.Get(path).String()) if err != nil { - return time.Time{}, ErrNoDateTimeTypeError + return time.Time{}, ErrNoDateTimeType } return value, nil @@ -1787,7 +1787,7 @@ func ParseDateTimeCustomFields(buffer bytes.Buffer, customField string) (map[str // Check if the buffer contains the "issues" object if !raw.Get("issues").Exists() { - return nil, ErrNoIssuesSliceError + return nil, ErrNoIssuesSlice } // Loop through each custom field, extract the information and stores the data on a map @@ -1814,7 +1814,7 @@ func ParseDateTimeCustomFields(buffer bytes.Buffer, customField string) (map[str // Check if the map processed contains elements // if so, return an error interface if len(customfieldsAsMap) == 0 { - return nil, ErrNoMapValuesError + return nil, ErrNoMapValues } return customfieldsAsMap, nil @@ -1849,18 +1849,18 @@ func ParseRequestTypeCustomField(buffer bytes.Buffer, customField string) (*Cust // Check if the buffer contains the "fields" object if !raw.Get("fields").Exists() { - return nil, ErrNoFieldInformationError + return nil, ErrNoFieldInformation } // Check if the issue iteration contains information on the customfield selected, // if not, continue if raw.Get(path).Type == gjson.Null { - return nil, ErrNoRequestTypeError + return nil, ErrNoRequestType } var requestType *CustomFieldRequestTypeScheme if err := json.Unmarshal([]byte(raw.Get(path).String()), &requestType); err != nil { - return nil, ErrNoRequestTypeError + return nil, ErrNoRequestType } return requestType, nil @@ -1913,7 +1913,7 @@ func ParseRequestTypeCustomFields(buffer bytes.Buffer, customField string) (map[ // Check if the buffer contains the "issues" object if !raw.Get("issues").Exists() { - return nil, ErrNoIssuesSliceError + return nil, ErrNoIssuesSlice } // Loop through each custom field, extract the information and stores the data on a map @@ -1940,7 +1940,7 @@ func ParseRequestTypeCustomFields(buffer bytes.Buffer, customField string) (map[ // Check if the map processed contains elements // if so, return an error interface if len(customfieldsAsMap) == 0 { - return nil, ErrNoMapValuesError + return nil, ErrNoMapValues } return customfieldsAsMap, nil diff --git a/pkg/infra/models/jira_issue_custom_fields_tempo.go b/pkg/infra/models/jira_issue_custom_fields_tempo.go index ebd45399..d849a110 100644 --- a/pkg/infra/models/jira_issue_custom_fields_tempo.go +++ b/pkg/infra/models/jira_issue_custom_fields_tempo.go @@ -36,18 +36,18 @@ func ParseTempoAccountCustomField(buffer bytes.Buffer, customField string) (*Cus // Check if the buffer contains the "fields" object if !raw.Get("fields").Exists() { - return nil, ErrNoFieldInformationError + return nil, ErrNoFieldInformation } // Check if the issue iteration contains information on the customfield selected, // if not, continue if raw.Get(path).Type == gjson.Null { - return nil, ErrNoTempoAccountTypeError + return nil, ErrNoTempoAccountType } var tempoAccount *CustomFieldTempoAccountScheme if err := json.Unmarshal([]byte(raw.Get(path).String()), &tempoAccount); err != nil { - return nil, ErrNoTempoAccountTypeError + return nil, ErrNoTempoAccountType } return tempoAccount, nil @@ -100,7 +100,7 @@ func ParseTempoAccountCustomFields(buffer bytes.Buffer, customField string) (map // Check if the buffer contains the "issues" object if !raw.Get("issues").Exists() { - return nil, ErrNoIssuesSliceError + return nil, ErrNoIssuesSlice } // Loop through each custom field, extract the information and stores the data on a map @@ -127,7 +127,7 @@ func ParseTempoAccountCustomFields(buffer bytes.Buffer, customField string) (map // Check if the map processed contains elements // if so, return an error interface if len(customfieldsAsMap) == 0 { - return nil, ErrNoMapValuesError + return nil, ErrNoMapValues } return customfieldsAsMap, nil diff --git a/pkg/infra/models/jira_issue_custom_fields_tempo_test.go b/pkg/infra/models/jira_issue_custom_fields_tempo_test.go index 90932abd..54889a4b 100644 --- a/pkg/infra/models/jira_issue_custom_fields_tempo_test.go +++ b/pkg/infra/models/jira_issue_custom_fields_tempo_test.go @@ -83,7 +83,7 @@ func TestParseTempoAccountCustomField(t *testing.T) { }, want: nil, wantErr: true, - Err: ErrNoTempoAccountTypeError, + Err: ErrNoTempoAccountType, }, { @@ -94,7 +94,7 @@ func TestParseTempoAccountCustomField(t *testing.T) { }, want: nil, wantErr: true, - Err: ErrNoFieldInformationError, + Err: ErrNoFieldInformation, }, { @@ -105,7 +105,7 @@ func TestParseTempoAccountCustomField(t *testing.T) { }, want: nil, wantErr: true, - Err: ErrNoTempoAccountTypeError, + Err: ErrNoTempoAccountType, }, { @@ -116,7 +116,7 @@ func TestParseTempoAccountCustomField(t *testing.T) { }, want: nil, wantErr: true, - Err: ErrNoFieldInformationError, + Err: ErrNoFieldInformation, }, } for _, testCase := range testCases { @@ -257,7 +257,7 @@ func TestParseTempoAccountCustomFields(t *testing.T) { customField: "customfield_10036", }, wantErr: true, - Err: ErrNoIssuesSliceError, + Err: ErrNoIssuesSlice, }, { @@ -267,7 +267,7 @@ func TestParseTempoAccountCustomFields(t *testing.T) { customField: "customfield_10036", }, wantErr: true, - Err: ErrNoMapValuesError, + Err: ErrNoMapValues, }, } for _, testCase := range tests { diff --git a/pkg/infra/models/jira_issue_custom_fields_test.go b/pkg/infra/models/jira_issue_custom_fields_test.go index 55250e30..0ff60333 100644 --- a/pkg/infra/models/jira_issue_custom_fields_test.go +++ b/pkg/infra/models/jira_issue_custom_fields_test.go @@ -119,7 +119,7 @@ func TestParseMultiSelectCustomField(t *testing.T) { }, want: nil, wantErr: true, - Err: ErrNoMultiSelectTypeError, + Err: ErrNoMultiSelectType, }, { @@ -130,7 +130,7 @@ func TestParseMultiSelectCustomField(t *testing.T) { }, want: nil, wantErr: true, - Err: ErrNoFieldInformationError, + Err: ErrNoFieldInformation, }, { @@ -141,7 +141,7 @@ func TestParseMultiSelectCustomField(t *testing.T) { }, want: nil, wantErr: true, - Err: ErrNoMultiSelectTypeError, + Err: ErrNoMultiSelectType, }, { @@ -152,7 +152,7 @@ func TestParseMultiSelectCustomField(t *testing.T) { }, want: nil, wantErr: true, - Err: ErrNoFieldInformationError, + Err: ErrNoFieldInformation, }, } for _, testCase := range testCases { @@ -272,7 +272,7 @@ func TestParseMultiGroupPickerField(t *testing.T) { }, want: nil, wantErr: true, - Err: ErrNoMultiSelectTypeError, + Err: ErrNoMultiSelectType, }, { @@ -283,7 +283,7 @@ func TestParseMultiGroupPickerField(t *testing.T) { }, want: nil, wantErr: true, - Err: ErrNoFieldInformationError, + Err: ErrNoFieldInformation, }, { @@ -294,7 +294,7 @@ func TestParseMultiGroupPickerField(t *testing.T) { }, want: nil, wantErr: true, - Err: ErrNoMultiSelectTypeError, + Err: ErrNoMultiSelectType, }, { @@ -305,7 +305,7 @@ func TestParseMultiGroupPickerField(t *testing.T) { }, want: nil, wantErr: true, - Err: ErrNoFieldInformationError, + Err: ErrNoFieldInformation, }, } for _, testCase := range testCases { @@ -495,7 +495,7 @@ func TestParseMultiUserPickerField(t *testing.T) { }, want: nil, wantErr: true, - Err: ErrNoMultiSelectTypeError, + Err: ErrNoMultiSelectType, }, { @@ -507,7 +507,7 @@ func TestParseMultiUserPickerField(t *testing.T) { want: nil, want1: false, wantErr: true, - Err: ErrNoFieldInformationError, + Err: ErrNoFieldInformation, }, { @@ -519,7 +519,7 @@ func TestParseMultiUserPickerField(t *testing.T) { want: nil, want1: false, wantErr: true, - Err: ErrNoMultiSelectTypeError, + Err: ErrNoMultiSelectType, }, { @@ -531,7 +531,7 @@ func TestParseMultiUserPickerField(t *testing.T) { want: nil, want1: false, wantErr: true, - Err: ErrNoFieldInformationError, + Err: ErrNoFieldInformation, }, } for _, testCase := range testCases { @@ -648,7 +648,7 @@ func TestParseCascadingSelectField(t *testing.T) { want: nil, want1: false, wantErr: true, - Err: ErrNoCascadingParentError, + Err: ErrNoCascadingParent, }, { @@ -660,7 +660,7 @@ func TestParseCascadingSelectField(t *testing.T) { want: nil, want1: false, wantErr: true, - Err: ErrNoFieldInformationError, + Err: ErrNoFieldInformation, }, { @@ -672,7 +672,7 @@ func TestParseCascadingSelectField(t *testing.T) { want: nil, want1: false, wantErr: true, - Err: ErrNoCascadingParentError, + Err: ErrNoCascadingParent, }, { @@ -684,7 +684,7 @@ func TestParseCascadingSelectField(t *testing.T) { want: nil, want1: false, wantErr: true, - Err: ErrNoFieldInformationError, + Err: ErrNoFieldInformation, }, } for _, testCase := range testCases { @@ -832,7 +832,7 @@ func TestParseMultiVersionCustomField(t *testing.T) { want: nil, want1: false, wantErr: true, - Err: ErrNoMultiVersionTypeError, + Err: ErrNoMultiVersionType, }, { @@ -844,7 +844,7 @@ func TestParseMultiVersionCustomField(t *testing.T) { want: nil, want1: false, wantErr: true, - Err: ErrNoFieldInformationError, + Err: ErrNoFieldInformation, }, { @@ -856,7 +856,7 @@ func TestParseMultiVersionCustomField(t *testing.T) { want: nil, want1: false, wantErr: true, - Err: ErrNoMultiSelectTypeError, + Err: ErrNoMultiSelectType, }, { @@ -868,7 +868,7 @@ func TestParseMultiVersionCustomField(t *testing.T) { want: nil, want1: false, wantErr: true, - Err: ErrNoFieldInformationError, + Err: ErrNoFieldInformation, }, } for _, testCase := range testCases { @@ -994,7 +994,7 @@ func TestParseUserPickerCustomField(t *testing.T) { want: nil, want1: false, wantErr: true, - Err: ErrNoUserTypeError, + Err: ErrNoUserType, }, { @@ -1006,7 +1006,7 @@ func TestParseUserPickerCustomField(t *testing.T) { want: nil, want1: false, wantErr: true, - Err: ErrNoFieldInformationError, + Err: ErrNoFieldInformation, }, { @@ -1018,7 +1018,7 @@ func TestParseUserPickerCustomField(t *testing.T) { want: nil, want1: false, wantErr: true, - Err: ErrNoMultiSelectTypeError, + Err: ErrNoMultiSelectType, }, { @@ -1030,7 +1030,7 @@ func TestParseUserPickerCustomField(t *testing.T) { want: nil, want1: false, wantErr: true, - Err: ErrNoFieldInformationError, + Err: ErrNoFieldInformation, }, } for _, testCase := range testCases { @@ -1118,7 +1118,7 @@ func TestParseStringCustomField(t *testing.T) { }, want: "", wantErr: true, - Err: ErrNoFieldInformationError, + Err: ErrNoFieldInformation, }, { @@ -1129,7 +1129,7 @@ func TestParseStringCustomField(t *testing.T) { }, want: "", wantErr: true, - Err: ErrNoTextTypeError, + Err: ErrNoTextType, }, { @@ -1140,7 +1140,7 @@ func TestParseStringCustomField(t *testing.T) { }, want: "", wantErr: true, - Err: ErrNoTextTypeError, + Err: ErrNoTextType, }, } for _, testCase := range testCases { @@ -1227,7 +1227,7 @@ func TestParseDatePickerCustomField(t *testing.T) { customField: "customfield_10045", }, wantErr: true, - Err: ErrNoFieldInformationError, + Err: ErrNoFieldInformation, }, { @@ -1237,7 +1237,7 @@ func TestParseDatePickerCustomField(t *testing.T) { customField: "customfield_10045", }, wantErr: true, - Err: ErrNoDatePickerTypeError, + Err: ErrNoDatePickerType, }, { @@ -1247,7 +1247,7 @@ func TestParseDatePickerCustomField(t *testing.T) { customField: "customfield_10045", }, wantErr: true, - Err: ErrNoDatePickerTypeError, + Err: ErrNoDatePickerType, }, } for _, testCase := range testCases { @@ -1339,7 +1339,7 @@ func TestParseDateTimeCustomField(t *testing.T) { customField: "customfield_10045", }, wantErr: true, - Err: ErrNoFieldInformationError, + Err: ErrNoFieldInformation, }, { @@ -1349,7 +1349,7 @@ func TestParseDateTimeCustomField(t *testing.T) { customField: "customfield_10045", }, wantErr: true, - Err: ErrNoDateTimeTypeError, + Err: ErrNoDateTimeType, }, { @@ -1359,7 +1359,7 @@ func TestParseDateTimeCustomField(t *testing.T) { customField: "customfield_10045", }, wantErr: true, - Err: ErrNoDateTimeTypeError, + Err: ErrNoDateTimeType, }, } for _, testCase := range testCases { @@ -1447,7 +1447,7 @@ func TestParseFloatCustomField(t *testing.T) { }, want: 0, wantErr: true, - Err: ErrNoFloatTypeError, + Err: ErrNoFloatType, }, { @@ -1458,7 +1458,7 @@ func TestParseFloatCustomField(t *testing.T) { }, want: 0, wantErr: true, - Err: ErrNoFieldInformationError, + Err: ErrNoFieldInformation, }, { @@ -1469,7 +1469,7 @@ func TestParseFloatCustomField(t *testing.T) { }, want: 0, wantErr: true, - Err: ErrNoFloatTypeError, + Err: ErrNoFloatType, }, { @@ -1480,7 +1480,7 @@ func TestParseFloatCustomField(t *testing.T) { }, want: 0, wantErr: true, - Err: ErrNoFieldInformationError, + Err: ErrNoFieldInformation, }, } for _, testCase := range testCases { @@ -1574,7 +1574,7 @@ func TestParseLabelCustomField(t *testing.T) { }, want: nil, wantErr: true, - Err: ErrNoLabelsTypeError, + Err: ErrNoLabelsType, }, { @@ -1585,7 +1585,7 @@ func TestParseLabelCustomField(t *testing.T) { }, want: nil, wantErr: true, - Err: ErrNoFieldInformationError, + Err: ErrNoFieldInformation, }, { @@ -1596,7 +1596,7 @@ func TestParseLabelCustomField(t *testing.T) { }, want: nil, wantErr: true, - Err: ErrNoLabelsTypeError, + Err: ErrNoLabelsType, }, { @@ -1607,7 +1607,7 @@ func TestParseLabelCustomField(t *testing.T) { }, want: nil, wantErr: true, - Err: ErrNoFieldInformationError, + Err: ErrNoFieldInformation, }, } for _, testCase := range testCases { @@ -1728,7 +1728,7 @@ func TestParseSprintCustomField(t *testing.T) { customField: "customfield_10046", }, wantErr: true, - Err: ErrNoSprintTypeError, + Err: ErrNoSprintType, }, { @@ -1740,7 +1740,7 @@ func TestParseSprintCustomField(t *testing.T) { want: nil, want1: false, wantErr: true, - Err: ErrNoFieldInformationError, + Err: ErrNoFieldInformation, }, { @@ -1752,7 +1752,7 @@ func TestParseSprintCustomField(t *testing.T) { want: nil, want1: false, wantErr: true, - Err: ErrNoSprintTypeError, + Err: ErrNoSprintType, }, { @@ -1764,7 +1764,7 @@ func TestParseSprintCustomField(t *testing.T) { want: nil, want1: false, wantErr: true, - Err: ErrNoFieldInformationError, + Err: ErrNoFieldInformation, }, } for _, testCase := range testCases { @@ -1862,7 +1862,7 @@ func TestParseSelectCustomField(t *testing.T) { }, want: nil, wantErr: true, - Err: ErrNoSelectTypeError, + Err: ErrNoSelectType, }, { @@ -1873,7 +1873,7 @@ func TestParseSelectCustomField(t *testing.T) { }, want: nil, wantErr: true, - Err: ErrNoFieldInformationError, + Err: ErrNoFieldInformation, }, { @@ -1884,7 +1884,7 @@ func TestParseSelectCustomField(t *testing.T) { }, want: nil, wantErr: true, - Err: ErrNoSelectTypeError, + Err: ErrNoSelectType, }, { @@ -1895,7 +1895,7 @@ func TestParseSelectCustomField(t *testing.T) { }, want: nil, wantErr: true, - Err: ErrNoFieldInformationError, + Err: ErrNoFieldInformation, }, } for _, testCase := range testCases { @@ -2002,7 +2002,7 @@ func TestParseAssetCustomField(t *testing.T) { }, want: nil, wantErr: true, - Err: ErrNoAssetTypeError, + Err: ErrNoAssetType, }, { @@ -2013,7 +2013,7 @@ func TestParseAssetCustomField(t *testing.T) { }, want: nil, wantErr: true, - Err: ErrNoFieldInformationError, + Err: ErrNoFieldInformation, }, { @@ -2024,7 +2024,7 @@ func TestParseAssetCustomField(t *testing.T) { }, want: nil, wantErr: true, - Err: ErrNoAssetTypeError, + Err: ErrNoAssetType, }, { @@ -2035,7 +2035,7 @@ func TestParseAssetCustomField(t *testing.T) { }, want: nil, wantErr: true, - Err: ErrNoFieldInformationError, + Err: ErrNoFieldInformation, }, } for _, testCase := range testCases { @@ -2219,7 +2219,7 @@ func TestParseRequestTypeCustomField(t *testing.T) { }, want: nil, wantErr: true, - Err: ErrNoRequestTypeError, + Err: ErrNoRequestType, }, { name: "when the buffer contains no fields", @@ -2229,7 +2229,7 @@ func TestParseRequestTypeCustomField(t *testing.T) { }, want: nil, wantErr: true, - Err: ErrNoFieldInformationError, + Err: ErrNoFieldInformation, }, { name: "when the buffer contains wrong type", @@ -2239,7 +2239,7 @@ func TestParseRequestTypeCustomField(t *testing.T) { }, want: nil, wantErr: true, - Err: ErrNoRequestTypeError, + Err: ErrNoRequestType, }, } for _, tt := range tests { @@ -2402,7 +2402,7 @@ func TestParseMultiSelectCustomFields(t *testing.T) { customField: "customfield_10046", }, wantErr: true, - Err: ErrNoIssuesSliceError, + Err: ErrNoIssuesSlice, }, { @@ -2681,7 +2681,7 @@ func TestParseMultiGroupPickerCustomFields(t *testing.T) { customField: "customfield_10046", }, wantErr: true, - Err: ErrNoIssuesSliceError, + Err: ErrNoIssuesSlice, }, { @@ -3149,7 +3149,7 @@ func TestParseMultiUserPickerCustomFields(t *testing.T) { customField: "customfield_10046", }, wantErr: true, - Err: ErrNoIssuesSliceError, + Err: ErrNoIssuesSlice, }, { @@ -3509,7 +3509,7 @@ func TestParseCascadingCustomFields(t *testing.T) { customField: "customfield_10046", }, wantErr: true, - Err: ErrNoIssuesSliceError, + Err: ErrNoIssuesSlice, }, { @@ -3540,7 +3540,7 @@ func TestParseCascadingCustomFields(t *testing.T) { customField: "customfield_10046", }, wantErr: true, - Err: ErrNoMapValuesError, + Err: ErrNoMapValues, }, } for _, testCase := range tests { @@ -3829,7 +3829,7 @@ func TestParseMultiVersionCustomFields(t *testing.T) { customField: "customfield_10046", }, wantErr: true, - Err: ErrNoIssuesSliceError, + Err: ErrNoIssuesSlice, }, { @@ -3871,7 +3871,7 @@ func TestParseMultiVersionCustomFields(t *testing.T) { customField: "customfield_10046", }, wantErr: true, - Err: ErrNoMapValuesError, + Err: ErrNoMapValues, }, } for _, testCase := range tests { @@ -4168,7 +4168,7 @@ func TestParseUserPickerCustomFields(t *testing.T) { customField: "customfield_10046", }, wantErr: true, - Err: ErrNoIssuesSliceError, + Err: ErrNoIssuesSlice, }, { @@ -4198,7 +4198,7 @@ func TestParseUserPickerCustomFields(t *testing.T) { customField: "customfield_10046", }, wantErr: true, - Err: ErrNoMapValuesError, + Err: ErrNoMapValues, }, } for _, testCase := range tests { @@ -4437,7 +4437,7 @@ func TestParseStringCustomFields(t *testing.T) { customField: "customfield_10046", }, wantErr: true, - Err: ErrNoIssuesSliceError, + Err: ErrNoIssuesSlice, }, { @@ -4459,7 +4459,7 @@ func TestParseStringCustomFields(t *testing.T) { customField: "customfield_10046", }, wantErr: true, - Err: ErrNoMapValuesError, + Err: ErrNoMapValues, }, } for _, testCase := range tests { @@ -4698,7 +4698,7 @@ func TestParseFloatCustomFields(t *testing.T) { customField: "customfield_10046", }, wantErr: true, - Err: ErrNoIssuesSliceError, + Err: ErrNoIssuesSlice, }, { @@ -4720,7 +4720,7 @@ func TestParseFloatCustomFields(t *testing.T) { customField: "customfield_10046", }, wantErr: true, - Err: ErrNoMapValuesError, + Err: ErrNoMapValues, }, } for _, testCase := range tests { @@ -4959,7 +4959,7 @@ func TestParseLabelCustomFields(t *testing.T) { customField: "customfield_10046", }, wantErr: true, - Err: ErrNoIssuesSliceError, + Err: ErrNoIssuesSlice, }, { @@ -4981,7 +4981,7 @@ func TestParseLabelCustomFields(t *testing.T) { customField: "customfield_10046", }, wantErr: true, - Err: ErrNoMapValuesError, + Err: ErrNoMapValues, }, } for _, testCase := range tests { @@ -5228,7 +5228,7 @@ func TestParseSprintCustomFields(t *testing.T) { customField: "customfield_10046", }, wantErr: true, - Err: ErrNoIssuesSliceError, + Err: ErrNoIssuesSlice, }, { @@ -5260,7 +5260,7 @@ func TestParseSprintCustomFields(t *testing.T) { customField: "customfield_10046", }, wantErr: true, - Err: ErrNoMapValuesError, + Err: ErrNoMapValues, }, } for _, testCase := range tests { @@ -5472,7 +5472,7 @@ func TestParseSelectCustomFields(t *testing.T) { customField: "customfield_10046", }, wantErr: true, - Err: ErrNoIssuesSliceError, + Err: ErrNoIssuesSlice, }, { @@ -5497,7 +5497,7 @@ func TestParseSelectCustomFields(t *testing.T) { customField: "customfield_10046", }, wantErr: true, - Err: ErrNoMapValuesError, + Err: ErrNoMapValues, }, } for _, testCase := range tests { @@ -5773,7 +5773,7 @@ func TestParseAssetCustomFields(t *testing.T) { customField: "customfield_10046", }, wantErr: true, - Err: ErrNoIssuesSliceError, + Err: ErrNoIssuesSlice, }, { @@ -6013,7 +6013,7 @@ func TestParseDatePickerCustomFields(t *testing.T) { customField: "customfield_10046", }, wantErr: true, - Err: ErrNoIssuesSliceError, + Err: ErrNoIssuesSlice, }, { @@ -6035,7 +6035,7 @@ func TestParseDatePickerCustomFields(t *testing.T) { customField: "customfield_10046", }, wantErr: true, - Err: ErrNoMapValuesError, + Err: ErrNoMapValues, }, } for _, testCase := range tests { @@ -6234,7 +6234,7 @@ func TestParseDateTimeCustomFields(t *testing.T) { customField: "customfield_10046", }, wantErr: true, - Err: ErrNoIssuesSliceError, + Err: ErrNoIssuesSlice, }, { @@ -6256,7 +6256,7 @@ func TestParseDateTimeCustomFields(t *testing.T) { customField: "customfield_10046", }, wantErr: true, - Err: ErrNoMapValuesError, + Err: ErrNoMapValues, }, } for _, testCase := range tests { @@ -6562,7 +6562,7 @@ func TestParseRequestTypeCustomFields(t *testing.T) { customField: "customfield_10010", }, wantErr: true, - Err: ErrNoIssuesSliceError, + Err: ErrNoIssuesSlice, }, { name: "when the buffer does not contain the fields object", @@ -6571,7 +6571,7 @@ func TestParseRequestTypeCustomFields(t *testing.T) { customField: "customfield_10010", }, wantErr: true, - Err: ErrNoMapValuesError, + Err: ErrNoMapValues, }, { name: "when the buffer contains invalid types", @@ -6580,7 +6580,7 @@ func TestParseRequestTypeCustomFields(t *testing.T) { customField: "customfield_10010", }, wantErr: true, - Err: ErrNoMapValuesError, + Err: ErrNoMapValues, }, } for _, testCase := range tests { diff --git a/pkg/infra/models/jira_issue_operations.go b/pkg/infra/models/jira_issue_operations.go index 3abcd1d4..42c2452b 100644 --- a/pkg/infra/models/jira_issue_operations.go +++ b/pkg/infra/models/jira_issue_operations.go @@ -6,7 +6,7 @@ type UpdateOperations struct{ Fields []map[string]interface{} } // AddArrayOperation adds an array operation to the collection. // It takes a custom field ID and a mapping of string to string as parameters. -// If the custom field ID is not provided, it returns an ErrNoFieldIDError. +// If the custom field ID is not provided, it returns an ErrNoFieldID. // It creates an operation node for each value-operation pair in the mapping, // with the operation as the key and the value as the value, // and appends the operation node to the operations. @@ -17,7 +17,7 @@ type UpdateOperations struct{ Fields []map[string]interface{} } func (u *UpdateOperations) AddArrayOperation(customFieldID string, mapping map[string]string) error { if len(customFieldID) == 0 { - return ErrNoFieldIDError + return ErrNoFieldID } var operations []map[string]interface{} @@ -41,9 +41,9 @@ func (u *UpdateOperations) AddArrayOperation(customFieldID string, mapping map[s // AddStringOperation adds a string operation to the collection. // It takes a custom field ID, an operation, and a value as parameters. -// If the custom field ID is not provided, it returns an ErrNoFieldIDError. -// If the operation is not provided, it returns an ErrNoEditOperatorError. -// If the value is not provided, it returns an ErrNoEditValueError. +// If the custom field ID is not provided, it returns an ErrNoFieldID. +// If the operation is not provided, it returns an ErrNoEditOperator. +// If the value is not provided, it returns an ErrNoEditValue. // It creates an operation node with the operation as the key and the value as the value, // appends the operation node to the operations, // creates a field node with the custom field ID as the key and the operations as the value, @@ -53,15 +53,15 @@ func (u *UpdateOperations) AddArrayOperation(customFieldID string, mapping map[s func (u *UpdateOperations) AddStringOperation(customFieldID, operation, value string) error { if len(customFieldID) == 0 { - return ErrNoFieldIDError + return ErrNoFieldID } if len(operation) == 0 { - return ErrNoEditOperatorError + return ErrNoEditOperator } if len(value) == 0 { - return ErrNoEditValueError + return ErrNoEditValue } var operations []map[string]interface{} @@ -84,14 +84,14 @@ func (u *UpdateOperations) AddStringOperation(customFieldID, operation, value st // AddMultiRawOperation adds a multi raw operation to the collection. // It takes a custom field ID and a slice of mappings as parameters. // Each mapping is a map with string keys and interface{} values. -// If the custom field ID is not provided, it returns an ErrNoFieldIDError. +// If the custom field ID is not provided, it returns an ErrNoFieldID. // It appends the mappings to the operations, creates a field node with the custom field ID and the operations, // creates an update node with the "update" key and the field node, and appends the update node to the Fields of the UpdateOperations. // It returns nil if the operation is successful. func (u *UpdateOperations) AddMultiRawOperation(customFieldID string, mappings []map[string]interface{}) error { if len(customFieldID) == 0 { - return ErrNoFieldIDError + return ErrNoFieldID } var operations []map[string]interface{} diff --git a/pkg/infra/models/jira_issue_operations_test.go b/pkg/infra/models/jira_issue_operations_test.go index a4710076..9991fb30 100644 --- a/pkg/infra/models/jira_issue_operations_test.go +++ b/pkg/infra/models/jira_issue_operations_test.go @@ -45,7 +45,7 @@ func TestUpdateOperations_AddArrayOperation(t *testing.T) { "value1": "verb"}, }, wantErr: true, - Err: ErrNoFieldIDError, + Err: ErrNoFieldID, }, } for _, testCase := range testCases { @@ -102,7 +102,7 @@ func TestUpdateOperations_AddStringOperation(t *testing.T) { value: "value_sample", }, wantErr: true, - Err: ErrNoFieldIDError, + Err: ErrNoFieldID, }, { @@ -114,7 +114,7 @@ func TestUpdateOperations_AddStringOperation(t *testing.T) { value: "value_sample", }, wantErr: true, - Err: ErrNoEditOperatorError, + Err: ErrNoEditOperator, }, { @@ -126,7 +126,7 @@ func TestUpdateOperations_AddStringOperation(t *testing.T) { value: "", }, wantErr: true, - Err: ErrNoEditValueError, + Err: ErrNoEditValue, }, } for _, testCase := range testCases { diff --git a/pkg/infra/models/jira_issue_v2.go b/pkg/infra/models/jira_issue_v2.go index d953b612..819c4f50 100644 --- a/pkg/infra/models/jira_issue_v2.go +++ b/pkg/infra/models/jira_issue_v2.go @@ -23,7 +23,7 @@ type IssueSchemeV2 struct { func (i *IssueSchemeV2) MergeCustomFields(fields *CustomFields) (map[string]interface{}, error) { if fields == nil || len(fields.Fields) == 0 { - return nil, ErrNoCustomFieldError + return nil, ErrNoCustomField } // Convert the IssueScheme struct to map[string]interface{} @@ -53,7 +53,7 @@ func (i *IssueSchemeV2) MergeCustomFields(fields *CustomFields) (map[string]inte func (i *IssueSchemeV2) MergeOperations(operations *UpdateOperations) (map[string]interface{}, error) { if operations == nil || len(operations.Fields) == 0 { - return nil, ErrNoOperatorError + return nil, ErrNoOperator } // Convert the IssueScheme struct to map[string]interface{} diff --git a/pkg/infra/models/jira_issue_v2_test.go b/pkg/infra/models/jira_issue_v2_test.go index 547c712e..fe52a3be 100644 --- a/pkg/infra/models/jira_issue_v2_test.go +++ b/pkg/infra/models/jira_issue_v2_test.go @@ -57,7 +57,7 @@ func TestIssueSchemeV2_MergeCustomFields(t *testing.T) { }, want: nil, wantErr: true, - Err: ErrNoCustomFieldError, + Err: ErrNoCustomField, }, { @@ -68,7 +68,7 @@ func TestIssueSchemeV2_MergeCustomFields(t *testing.T) { }, want: nil, wantErr: true, - Err: ErrNoCustomFieldError, + Err: ErrNoCustomField, }, } for _, testCase := range testCases { @@ -152,7 +152,7 @@ func TestIssueSchemeV2_MergeOperations(t *testing.T) { }, want: nil, wantErr: true, - Err: ErrNoOperatorError, + Err: ErrNoOperator, }, { @@ -163,7 +163,7 @@ func TestIssueSchemeV2_MergeOperations(t *testing.T) { }, want: nil, wantErr: true, - Err: ErrNoOperatorError, + Err: ErrNoOperator, }, } for _, testCase := range testCases { diff --git a/pkg/infra/models/jira_issue_v3.go b/pkg/infra/models/jira_issue_v3.go index 36ff1f79..e0cb727c 100644 --- a/pkg/infra/models/jira_issue_v3.go +++ b/pkg/infra/models/jira_issue_v3.go @@ -23,7 +23,7 @@ type IssueScheme struct { func (i *IssueScheme) MergeCustomFields(fields *CustomFields) (map[string]interface{}, error) { if fields == nil || len(fields.Fields) == 0 { - return nil, ErrNoCustomFieldError + return nil, ErrNoCustomField } //Convert the IssueScheme struct to map[string]interface{} @@ -53,7 +53,7 @@ func (i *IssueScheme) MergeCustomFields(fields *CustomFields) (map[string]interf func (i *IssueScheme) MergeOperations(operations *UpdateOperations) (map[string]interface{}, error) { if operations == nil || len(operations.Fields) == 0 { - return nil, ErrNoOperatorError + return nil, ErrNoOperator } //Convert the IssueScheme struct to map[string]interface{} diff --git a/pkg/infra/models/jira_issue_v3_test.go b/pkg/infra/models/jira_issue_v3_test.go index c7d20781..0f77cc27 100644 --- a/pkg/infra/models/jira_issue_v3_test.go +++ b/pkg/infra/models/jira_issue_v3_test.go @@ -56,7 +56,7 @@ func TestIssueScheme_MergeCustomFields(t *testing.T) { }, want: nil, wantErr: true, - Err: ErrNoCustomFieldError, + Err: ErrNoCustomField, }, { @@ -67,7 +67,7 @@ func TestIssueScheme_MergeCustomFields(t *testing.T) { }, want: nil, wantErr: true, - Err: ErrNoCustomFieldError, + Err: ErrNoCustomField, }, } for _, testCase := range testCases { @@ -151,7 +151,7 @@ func TestIssueScheme_MergeOperations(t *testing.T) { }, want: nil, wantErr: true, - Err: ErrNoOperatorError, + Err: ErrNoOperator, }, { @@ -162,7 +162,7 @@ func TestIssueScheme_MergeOperations(t *testing.T) { }, want: nil, wantErr: true, - Err: ErrNoOperatorError, + Err: ErrNoOperator, }, } for _, testCase := range testCases { diff --git a/pkg/infra/models/sm_request_field.go b/pkg/infra/models/sm_request_field.go index b0ff15db..a5a68225 100644 --- a/pkg/infra/models/sm_request_field.go +++ b/pkg/infra/models/sm_request_field.go @@ -42,11 +42,11 @@ func (c *CreateCustomerRequestPayloadScheme) AddCustomField(key string, value in func (c *CreateCustomerRequestPayloadScheme) DateTimeCustomField(id string, value time.Time) error { if id == "" { - return ErrNoCustomFieldIDError + return ErrNoCustomFieldID } if value.IsZero() { - return ErrNoDatePickerTypeError + return ErrNoDatePickerType } return c.AddCustomField(id, value.Format(time.RFC3339)) @@ -59,11 +59,11 @@ func (c *CreateCustomerRequestPayloadScheme) DateTimeCustomField(id string, valu func (c *CreateCustomerRequestPayloadScheme) DateCustomField(id string, value time.Time) error { if id == "" { - return ErrNoCustomFieldIDError + return ErrNoCustomFieldID } if value.IsZero() { - return ErrNoDatePickerTypeError + return ErrNoDatePickerType } return c.AddCustomField(id, value.Format("2006-01-02")) @@ -75,11 +75,11 @@ func (c *CreateCustomerRequestPayloadScheme) DateCustomField(id string, value ti func (c *CreateCustomerRequestPayloadScheme) MultiSelectOrCheckBoxCustomField(id string, values []string) error { if id == "" { - return ErrNoCustomFieldIDError + return ErrNoCustomFieldID } if len(values) == 0 { - return ErrNoMultiSelectTypeError + return ErrNoMultiSelectType } var options []map[string]interface{} @@ -98,11 +98,11 @@ func (c *CreateCustomerRequestPayloadScheme) MultiSelectOrCheckBoxCustomField(id func (c *CreateCustomerRequestPayloadScheme) UserCustomField(id, accountID string) error { if id == "" { - return ErrNoCustomFieldIDError + return ErrNoCustomFieldID } if accountID == "" { - return ErrNoUserTypeError + return ErrNoUserType } return c.AddCustomField(id, map[string]interface{}{"accountId": accountID}) @@ -114,18 +114,18 @@ func (c *CreateCustomerRequestPayloadScheme) UserCustomField(id, accountID strin func (c *CreateCustomerRequestPayloadScheme) UsersCustomField(id string, accountIDs []string) error { if id == "" { - return ErrNoCustomFieldIDError + return ErrNoCustomFieldID } if len(accountIDs) == 0 { - return ErrNoMultiUserTypeError + return ErrNoMultiUserType } var accounts []map[string]interface{} for _, accountID := range accountIDs { if accountID == "" { - return ErrNoUserTypeError + return ErrNoUserType } accounts = append(accounts, map[string]interface{}{"accountId": accountID}) @@ -141,15 +141,15 @@ func (c *CreateCustomerRequestPayloadScheme) UsersCustomField(id string, account func (c *CreateCustomerRequestPayloadScheme) CascadingCustomField(id, parent, child string) error { if id == "" { - return ErrNoCustomFieldIDError + return ErrNoCustomFieldID } if parent == "" { - return ErrNoCascadingParentError + return ErrNoCascadingParent } if child == "" { - return ErrNoCascadingChildError + return ErrNoCascadingChild } childNode := map[string]interface{}{"value": child} @@ -162,18 +162,18 @@ func (c *CreateCustomerRequestPayloadScheme) CascadingCustomField(id, parent, ch func (c *CreateCustomerRequestPayloadScheme) GroupsCustomField(id string, names []string) error { if id == "" { - return ErrNoCustomFieldIDError + return ErrNoCustomFieldID } if len(names) == 0 { - return ErrNoGroupsNameError + return ErrNoGroupsName } var groups []map[string]interface{} for _, name := range names { if name == "" { - return ErrNoGroupNameError + return ErrNoGroupName } groups = append(groups, map[string]interface{}{"name": name}) @@ -188,11 +188,11 @@ func (c *CreateCustomerRequestPayloadScheme) GroupsCustomField(id string, names func (c *CreateCustomerRequestPayloadScheme) GroupCustomField(id, name string) error { if id == "" { - return ErrNoCustomFieldIDError + return ErrNoCustomFieldID } if name == "" { - return ErrNoGroupNameError + return ErrNoGroupName } return c.AddCustomField(id, map[string]interface{}{"name": name}) @@ -204,11 +204,11 @@ func (c *CreateCustomerRequestPayloadScheme) GroupCustomField(id, name string) e func (c *CreateCustomerRequestPayloadScheme) RadioButtonOrSelectCustomField(id string, option string) error { if id == "" { - return ErrNoCustomFieldIDError + return ErrNoCustomFieldID } if option == "" { - return ErrNoSelectTypeError + return ErrNoSelectType } return c.AddCustomField(id, map[string]interface{}{"value": option}) @@ -220,14 +220,14 @@ func (c *CreateCustomerRequestPayloadScheme) RadioButtonOrSelectCustomField(id s func (c *CreateCustomerRequestPayloadScheme) Components(components []string) error { if len(components) == 0 { - return ErrNoComponentsError + return ErrNoComponents } var values []map[string]interface{} for _, component := range components { if component == "" { - return ErrNCoComponentError + return ErrNCoComponent } values = append(values, map[string]interface{}{"name": component}) diff --git a/pkg/infra/models/sm_request_field_test.go b/pkg/infra/models/sm_request_field_test.go index 97e3658c..a0a78725 100644 --- a/pkg/infra/models/sm_request_field_test.go +++ b/pkg/infra/models/sm_request_field_test.go @@ -1,9 +1,10 @@ package models import ( - "github.com/stretchr/testify/assert" "testing" "time" + + "github.com/stretchr/testify/assert" ) func TestCreateCustomerRequestPayloadScheme_DateTimeCustomField(t *testing.T) { @@ -53,7 +54,7 @@ func TestCreateCustomerRequestPayloadScheme_DateTimeCustomField(t *testing.T) { value: time.Date(2019, 1, 1, 0, 0, 0, 0, time.UTC), }, wantErr: true, - Err: ErrNoCustomFieldIDError, + Err: ErrNoCustomFieldID, }, { @@ -64,7 +65,7 @@ func TestCreateCustomerRequestPayloadScheme_DateTimeCustomField(t *testing.T) { value: time.Time{}, }, wantErr: true, - Err: ErrNoDatePickerTypeError, + Err: ErrNoDatePickerType, }, } for _, tt := range tests { @@ -144,7 +145,7 @@ func TestCreateCustomerRequestPayloadScheme_DateCustomField(t *testing.T) { value: time.Date(2019, 1, 1, 0, 0, 0, 0, time.UTC), }, wantErr: true, - Err: ErrNoCustomFieldIDError, + Err: ErrNoCustomFieldID, }, { @@ -155,7 +156,7 @@ func TestCreateCustomerRequestPayloadScheme_DateCustomField(t *testing.T) { value: time.Time{}, }, wantErr: true, - Err: ErrNoDatePickerTypeError, + Err: ErrNoDatePickerType, }, } for _, tt := range tests { @@ -234,7 +235,7 @@ func TestCreateCustomerRequestPayloadScheme_MultiSelectOrCheckBoxCustomField(t * id: "", }, wantErr: true, - Err: ErrNoCustomFieldIDError, + Err: ErrNoCustomFieldID, }, { @@ -244,7 +245,7 @@ func TestCreateCustomerRequestPayloadScheme_MultiSelectOrCheckBoxCustomField(t * id: "customfield_10021", }, wantErr: true, - Err: ErrNoMultiSelectTypeError, + Err: ErrNoMultiSelectType, }, } for _, tt := range tests { @@ -323,7 +324,7 @@ func TestCreateCustomerRequestPayloadScheme_UserCustomField(t *testing.T) { id: "", }, wantErr: true, - Err: ErrNoCustomFieldIDError, + Err: ErrNoCustomFieldID, }, { @@ -333,7 +334,7 @@ func TestCreateCustomerRequestPayloadScheme_UserCustomField(t *testing.T) { id: "customfield_10021", }, wantErr: true, - Err: ErrNoUserTypeError, + Err: ErrNoUserType, }, } for _, tt := range tests { @@ -412,7 +413,7 @@ func TestCreateCustomerRequestPayloadScheme_UsersCustomField(t *testing.T) { id: "", }, wantErr: true, - Err: ErrNoCustomFieldIDError, + Err: ErrNoCustomFieldID, }, { @@ -422,7 +423,7 @@ func TestCreateCustomerRequestPayloadScheme_UsersCustomField(t *testing.T) { id: "customfield_10021", }, wantErr: true, - Err: ErrNoMultiUserTypeError, + Err: ErrNoMultiUserType, }, { @@ -433,7 +434,7 @@ func TestCreateCustomerRequestPayloadScheme_UsersCustomField(t *testing.T) { options: []string{"uuid-sample", ""}, }, wantErr: true, - Err: ErrNoUserTypeError, + Err: ErrNoUserType, }, } for _, tt := range tests { @@ -512,7 +513,7 @@ func TestCreateCustomerRequestPayloadScheme_CascadingCustomField(t *testing.T) { id: "", }, wantErr: true, - Err: ErrNoCustomFieldIDError, + Err: ErrNoCustomFieldID, }, { @@ -522,7 +523,7 @@ func TestCreateCustomerRequestPayloadScheme_CascadingCustomField(t *testing.T) { id: "customfield_10021", }, wantErr: true, - Err: ErrNoCascadingParentError, + Err: ErrNoCascadingParent, }, { @@ -533,7 +534,7 @@ func TestCreateCustomerRequestPayloadScheme_CascadingCustomField(t *testing.T) { parent: "America", }, wantErr: true, - Err: ErrNoCascadingChildError, + Err: ErrNoCascadingChild, }, } for _, tt := range tests { @@ -612,7 +613,7 @@ func TestCreateCustomerRequestPayloadScheme_GroupsCustomField(t *testing.T) { id: "", }, wantErr: true, - Err: ErrNoCustomFieldIDError, + Err: ErrNoCustomFieldID, }, { @@ -622,7 +623,7 @@ func TestCreateCustomerRequestPayloadScheme_GroupsCustomField(t *testing.T) { id: "customfield_10021", }, wantErr: true, - Err: ErrNoGroupsNameError, + Err: ErrNoGroupsName, }, { @@ -633,7 +634,7 @@ func TestCreateCustomerRequestPayloadScheme_GroupsCustomField(t *testing.T) { options: []string{"group-name-01", ""}, }, wantErr: true, - Err: ErrNoGroupNameError, + Err: ErrNoGroupName, }, } for _, tt := range tests { @@ -712,7 +713,7 @@ func TestCreateCustomerRequestPayloadScheme_GroupCustomField(t *testing.T) { id: "", }, wantErr: true, - Err: ErrNoCustomFieldIDError, + Err: ErrNoCustomFieldID, }, { @@ -722,7 +723,7 @@ func TestCreateCustomerRequestPayloadScheme_GroupCustomField(t *testing.T) { id: "customfield_10021", }, wantErr: true, - Err: ErrNoGroupNameError, + Err: ErrNoGroupName, }, } for _, tt := range tests { @@ -801,7 +802,7 @@ func TestCreateCustomerRequestPayloadScheme_RadioButtonOrSelectCustomField(t *te id: "", }, wantErr: true, - Err: ErrNoCustomFieldIDError, + Err: ErrNoCustomFieldID, }, { @@ -811,7 +812,7 @@ func TestCreateCustomerRequestPayloadScheme_RadioButtonOrSelectCustomField(t *te id: "customfield_10021", }, wantErr: true, - Err: ErrNoSelectTypeError, + Err: ErrNoSelectType, }, } for _, tt := range tests { @@ -888,7 +889,7 @@ func TestCreateCustomerRequestPayloadScheme_Components(t *testing.T) { components: nil, }, wantErr: true, - Err: ErrNoComponentsError, + Err: ErrNoComponents, }, { @@ -898,7 +899,7 @@ func TestCreateCustomerRequestPayloadScheme_Components(t *testing.T) { components: []string{"Jira Cloud", ""}, }, wantErr: true, - Err: ErrNCoComponentError, + Err: ErrNCoComponent, }, } for _, tt := range tests {