@@ -227,7 +227,7 @@ func (i *inMemoryClient) CreateProjectDeployToken(ctx context.Context, path stri
227227 }
228228 i .internalCounter ++
229229 var tokenId = i .internalCounter
230- key := fmt .Sprintf ("%s_%v_%v" , t .TokenTypeProjectDeploy .String (), projectId , tokenId )
230+ key := fmt .Sprintf ("%s_%v_%v" , t .TypeProjectDeploy .String (), projectId , tokenId )
231231 var entryToken = & gitlab.TokenProjectDeploy {
232232 TokenWithScopes : gitlab.TokenWithScopes {
233233 Token : gitlab.Token {
@@ -236,7 +236,7 @@ func (i *inMemoryClient) CreateProjectDeployToken(ctx context.Context, path stri
236236 Path : path ,
237237 Name : name ,
238238 Token : fmt .Sprintf ("glpat-%s" , uuid .New ().String ()),
239- TokenType : t .TokenTypeProjectDeploy ,
239+ TokenType : t .TypeProjectDeploy ,
240240 ExpiresAt : expiresAt ,
241241 CreatedAt : g .Ptr (time .Now ())},
242242 Scopes : scopes ,
@@ -255,7 +255,7 @@ func (i *inMemoryClient) CreateGroupDeployToken(ctx context.Context, path string
255255 }
256256 i .internalCounter ++
257257 var tokenId = i .internalCounter
258- key := fmt .Sprintf ("%s_%v_%v" , t .TokenTypeGroupDeploy .String (), groupId , tokenId )
258+ key := fmt .Sprintf ("%s_%v_%v" , t .TypeGroupDeploy .String (), groupId , tokenId )
259259 var entryToken = & gitlab.TokenGroupDeploy {
260260 TokenWithScopes : gitlab.TokenWithScopes {
261261 Token : gitlab.Token {
@@ -264,7 +264,7 @@ func (i *inMemoryClient) CreateGroupDeployToken(ctx context.Context, path string
264264 Path : path ,
265265 Name : name ,
266266 Token : fmt .Sprintf ("glpat-%s" , uuid .New ().String ()),
267- TokenType : t .TokenTypeGroupDeploy ,
267+ TokenType : t .TypeGroupDeploy ,
268268 ExpiresAt : expiresAt ,
269269 CreatedAt : g .Ptr (time .Now ()),
270270 },
@@ -282,7 +282,7 @@ func (i *inMemoryClient) RevokeProjectDeployToken(ctx context.Context, projectId
282282 if i .revokeProjectDeployTokenError {
283283 return errors .New ("revoke project deploy token error" )
284284 }
285- key := fmt .Sprintf ("%s_%v_%v" , t .TokenTypeProjectDeploy .String (), projectId , deployTokenId )
285+ key := fmt .Sprintf ("%s_%v_%v" , t .TypeProjectDeploy .String (), projectId , deployTokenId )
286286 delete (i .accessTokens , key )
287287 return nil
288288}
@@ -293,7 +293,7 @@ func (i *inMemoryClient) RevokeGroupDeployToken(ctx context.Context, groupId, de
293293 if i .revokeGroupDeployTokenError {
294294 return errors .New ("revoke group deploy token error" )
295295 }
296- key := fmt .Sprintf ("%s_%v_%v" , t .TokenTypeGroupDeploy .String (), groupId , deployTokenId )
296+ key := fmt .Sprintf ("%s_%v_%v" , t .TypeGroupDeploy .String (), groupId , deployTokenId )
297297 delete (i .accessTokens , key )
298298 return nil
299299}
@@ -317,15 +317,15 @@ func (i *inMemoryClient) CreatePipelineProjectTriggerAccessToken(ctx context.Con
317317 }
318318 i .internalCounter ++
319319 var tokenId = i .internalCounter
320- key := fmt .Sprintf ("%s_%v_%v" , t .TokenTypePipelineProjectTrigger .String (), projectId , tokenId )
320+ key := fmt .Sprintf ("%s_%v_%v" , t .TypePipelineProjectTrigger .String (), projectId , tokenId )
321321 var entryToken = & gitlab.TokenPipelineProjectTrigger {
322322 Token : gitlab.Token {
323323 TokenID : tokenId ,
324324 ParentID : strconv .Itoa (projectId ),
325325 Path : strconv .Itoa (projectId ),
326326 Name : name ,
327327 Token : fmt .Sprintf ("glptt-%s" , uuid .New ().String ()),
328- TokenType : t .TokenTypePipelineProjectTrigger ,
328+ TokenType : t .TypePipelineProjectTrigger ,
329329 ExpiresAt : expiresAt ,
330330 CreatedAt : g .Ptr (time .Now ()),
331331 },
@@ -340,7 +340,7 @@ func (i *inMemoryClient) RevokePipelineProjectTriggerAccessToken(ctx context.Con
340340 if i .revokePipelineProjectTriggerAccessTokenError {
341341 return fmt .Errorf ("RevokePipelineProjectTriggerAccessToken" )
342342 }
343- key := fmt .Sprintf ("%s_%v_%v" , t .TokenTypePipelineProjectTrigger .String (), projectId , tokenId )
343+ key := fmt .Sprintf ("%s_%v_%v" , t .TypePipelineProjectTrigger .String (), projectId , tokenId )
344344 delete (i .accessTokens , key )
345345 return nil
346346}
@@ -383,7 +383,7 @@ func (i *inMemoryClient) CreateUserServiceAccountAccessToken(ctx context.Context
383383 Token : gitlab.Token {
384384 CreatedAt : cpat .CreatedAt ,
385385 ExpiresAt : cpat .ExpiresAt ,
386- TokenType : t .TokenTypeUserServiceAccount ,
386+ TokenType : t .TypeUserServiceAccount ,
387387 Token : cpat .Token .Token ,
388388 TokenID : cpat .TokenID ,
389389 ParentID : cpat .ParentID ,
@@ -404,7 +404,7 @@ func (i *inMemoryClient) RevokeUserServiceAccountAccessToken(ctx context.Context
404404 if i .revokeUserServiceAccountPersonalAccessTokenError {
405405 return errors .New ("RevokeServiceAccountPersonalAccessToken" )
406406 }
407- delete (i .accessTokens , fmt .Sprintf ("%s_%v" , t .TokenTypeUserServiceAccount .String (), token ))
407+ delete (i .accessTokens , fmt .Sprintf ("%s_%v" , t .TypeUserServiceAccount .String (), token ))
408408 return nil
409409}
410410
@@ -414,7 +414,7 @@ func (i *inMemoryClient) RevokeGroupServiceAccountAccessToken(ctx context.Contex
414414 if i .revokeGroupServiceAccountPersonalAccessTokenError {
415415 return errors .New ("RevokeServiceAccountPersonalAccessToken" )
416416 }
417- delete (i .accessTokens , fmt .Sprintf ("%s_%v" , t .TokenTypeGroupServiceAccount .String (), token ))
417+ delete (i .accessTokens , fmt .Sprintf ("%s_%v" , t .TypeGroupServiceAccount .String (), token ))
418418 return nil
419419}
420420
@@ -455,15 +455,15 @@ func (i *inMemoryClient) CreatePersonalAccessToken(ctx context.Context, username
455455 Path : username ,
456456 Name : name ,
457457 Token : fmt .Sprintf ("glpat-%s" , uuid .New ().String ()),
458- TokenType : t .TokenTypePersonal ,
458+ TokenType : t .TypePersonal ,
459459 CreatedAt : g .Ptr (time .Now ()),
460460 ExpiresAt : & expiresAt ,
461461 },
462462 Scopes : scopes ,
463463 },
464464 UserID : userId ,
465465 }
466- i .accessTokens [fmt .Sprintf ("%s_%v" , t .TokenTypePersonal .String (), tokenId )] = entryToken
466+ i .accessTokens [fmt .Sprintf ("%s_%v" , t .TypePersonal .String (), tokenId )] = entryToken
467467 return entryToken , nil
468468}
469469
@@ -483,15 +483,15 @@ func (i *inMemoryClient) CreateGroupAccessToken(ctx context.Context, groupId str
483483 Path : groupId ,
484484 Name : name ,
485485 Token : fmt .Sprintf ("glgat-%s" , uuid .New ().String ()),
486- TokenType : t .TokenTypeGroup ,
486+ TokenType : t .TypeGroup ,
487487 CreatedAt : g .Ptr (time .Now ()),
488488 ExpiresAt : & expiresAt ,
489489 },
490490 Scopes : scopes ,
491491 AccessLevel : accessLevel ,
492492 },
493493 }
494- i .accessTokens [fmt .Sprintf ("%s_%v" , t .TokenTypeGroup .String (), tokenId )] = entryToken
494+ i .accessTokens [fmt .Sprintf ("%s_%v" , t .TypeGroup .String (), tokenId )] = entryToken
495495 return entryToken , nil
496496}
497497
@@ -507,7 +507,7 @@ func (i *inMemoryClient) CreateProjectAccessToken(ctx context.Context, projectId
507507 TokenWithScopesAndAccessLevel : gitlab.TokenWithScopesAndAccessLevel {
508508 Token : gitlab.Token {
509509 Token : fmt .Sprintf ("glpat-%s" , uuid .New ().String ()),
510- TokenType : t .TokenTypeProject ,
510+ TokenType : t .TypeProject ,
511511 CreatedAt : g .Ptr (time .Now ()),
512512 ExpiresAt : & expiresAt ,
513513 TokenID : tokenId ,
@@ -519,7 +519,7 @@ func (i *inMemoryClient) CreateProjectAccessToken(ctx context.Context, projectId
519519 AccessLevel : accessLevel ,
520520 },
521521 }
522- i .accessTokens [fmt .Sprintf ("%s_%v" , t .TokenTypeProject .String (), tokenId )] = entryToken
522+ i .accessTokens [fmt .Sprintf ("%s_%v" , t .TypeProject .String (), tokenId )] = entryToken
523523 return entryToken , nil
524524}
525525
@@ -529,7 +529,7 @@ func (i *inMemoryClient) RevokePersonalAccessToken(ctx context.Context, tokenId
529529 if i .personalAccessTokenRevokeError {
530530 return fmt .Errorf ("RevokePersonalAccessToken" )
531531 }
532- delete (i .accessTokens , fmt .Sprintf ("%s_%v" , t .TokenTypePersonal .String (), tokenId ))
532+ delete (i .accessTokens , fmt .Sprintf ("%s_%v" , t .TypePersonal .String (), tokenId ))
533533 return nil
534534}
535535
@@ -539,7 +539,7 @@ func (i *inMemoryClient) RevokeProjectAccessToken(ctx context.Context, tokenId i
539539 if i .projectAccessTokenRevokeError {
540540 return fmt .Errorf ("RevokeProjectAccessToken" )
541541 }
542- delete (i .accessTokens , fmt .Sprintf ("%s_%v" , t .TokenTypeProject .String (), tokenId ))
542+ delete (i .accessTokens , fmt .Sprintf ("%s_%v" , t .TypeProject .String (), tokenId ))
543543 return nil
544544}
545545
@@ -549,7 +549,7 @@ func (i *inMemoryClient) RevokeGroupAccessToken(ctx context.Context, tokenId int
549549 if i .groupAccessTokenRevokeError {
550550 return fmt .Errorf ("RevokeGroupAccessToken" )
551551 }
552- delete (i .accessTokens , fmt .Sprintf ("%s_%v" , t .TokenTypeGroup .String (), tokenId ))
552+ delete (i .accessTokens , fmt .Sprintf ("%s_%v" , t .TypeGroup .String (), tokenId ))
553553 return nil
554554}
555555
0 commit comments