package github
import (
"context"
"fmt"
)
type OIDCSubjectClaimCustomTemplate struct {
UseDefault *bool `json:"use_default,omitempty"`
IncludeClaimKeys []string `json:"include_claim_keys,omitempty"`
}
func (s *ActionsService ) GetOrgOIDCSubjectClaimCustomTemplate (ctx context .Context , org string ) (*OIDCSubjectClaimCustomTemplate , *Response , error ) {
u := fmt .Sprintf ("orgs/%v/actions/oidc/customization/sub" , org )
return s .getOIDCSubjectClaimCustomTemplate (ctx , u )
}
func (s *ActionsService ) GetRepoOIDCSubjectClaimCustomTemplate (ctx context .Context , owner , repo string ) (*OIDCSubjectClaimCustomTemplate , *Response , error ) {
u := fmt .Sprintf ("repos/%v/%v/actions/oidc/customization/sub" , owner , repo )
return s .getOIDCSubjectClaimCustomTemplate (ctx , u )
}
func (s *ActionsService ) getOIDCSubjectClaimCustomTemplate (ctx context .Context , url string ) (*OIDCSubjectClaimCustomTemplate , *Response , error ) {
req , err := s .client .NewRequest ("GET" , url , nil )
if err != nil {
return nil , nil , err
}
tmpl := new (OIDCSubjectClaimCustomTemplate )
resp , err := s .client .Do (ctx , req , tmpl )
if err != nil {
return nil , resp , err
}
return tmpl , resp , nil
}
func (s *ActionsService ) SetOrgOIDCSubjectClaimCustomTemplate (ctx context .Context , org string , template *OIDCSubjectClaimCustomTemplate ) (*Response , error ) {
u := fmt .Sprintf ("orgs/%v/actions/oidc/customization/sub" , org )
return s .setOIDCSubjectClaimCustomTemplate (ctx , u , template )
}
func (s *ActionsService ) SetRepoOIDCSubjectClaimCustomTemplate (ctx context .Context , owner , repo string , template *OIDCSubjectClaimCustomTemplate ) (*Response , error ) {
u := fmt .Sprintf ("repos/%v/%v/actions/oidc/customization/sub" , owner , repo )
return s .setOIDCSubjectClaimCustomTemplate (ctx , u , template )
}
func (s *ActionsService ) setOIDCSubjectClaimCustomTemplate (ctx context .Context , url string , template *OIDCSubjectClaimCustomTemplate ) (*Response , error ) {
req , err := s .client .NewRequest ("PUT" , url , template )
if err != nil {
return nil , err
}
return s .client .Do (ctx , req , nil )
}
The pages are generated with Golds v0.8.2 . (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu .
PR and bug reports are welcome and can be submitted to the issue list .
Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds .