@@ -632,38 +632,22 @@ func listCertsPageFromGenerated(i generated.KeyVaultClientGetCertificatesRespons
632632 }
633633}
634634
635- // ListPropertiesOfCertificates retrieves a list of the certificates in the Key Vault as JSON Web Key structures that contain the
635+ // NewListPropertiesOfCertificatesPager retrieves a list of the certificates in the Key Vault as JSON Web Key structures that contain the
636636// public part of a stored certificate. The LIST operation is applicable to all certificate types, however only the
637637// base certificate identifier, attributes, and tags are provided in the response. Individual versions of a
638638// certificate are not listed in the response. This operation requires the certificates/list permission.
639- func (c * Client ) ListPropertiesOfCertificates (options * ListCertificatesOptions ) * runtime.Pager [ListPropertiesOfCertificatesResponse ] {
639+ func (c * Client ) NewListPropertiesOfCertificatesPager (options * ListCertificatesOptions ) * runtime.Pager [ListPropertiesOfCertificatesResponse ] {
640+ pager := c .genClient .NewGetCertificatesPager (c .vaultURL , nil )
640641 return runtime .NewPager (runtime.PageProcessor [ListPropertiesOfCertificatesResponse ]{
641642 More : func (page ListPropertiesOfCertificatesResponse ) bool {
642- return page . NextLink != nil && len ( * page . NextLink ) > 0
643+ return pager . More ()
643644 },
644- Fetcher : func (ctx context.Context , page * ListPropertiesOfCertificatesResponse ) (ListPropertiesOfCertificatesResponse , error ) {
645- var req * policy.Request
646- var err error
647- if page == nil {
648- req , err = c .genClient .GetCertificatesCreateRequest (ctx , c .vaultURL , & generated.KeyVaultClientGetCertificatesOptions {})
649- } else {
650- req , err = runtime .NewRequest (ctx , http .MethodGet , * page .NextLink )
651- }
652- if err != nil {
653- return ListPropertiesOfCertificatesResponse {}, err
654- }
655- resp , err := c .genClient .Pl .Do (req )
656- if err != nil {
657- return ListPropertiesOfCertificatesResponse {}, err
658- }
659- if ! runtime .HasStatusCode (resp , http .StatusOK ) {
660- return ListPropertiesOfCertificatesResponse {}, runtime .NewResponseError (resp )
661- }
662- genResp , err := c .genClient .GetCertificatesHandleResponse (resp )
645+ Fetcher : func (ctx context.Context , cur * ListPropertiesOfCertificatesResponse ) (ListPropertiesOfCertificatesResponse , error ) {
646+ page , err := pager .NextPage (ctx )
663647 if err != nil {
664648 return ListPropertiesOfCertificatesResponse {}, err
665649 }
666- return listCertsPageFromGenerated (genResp ), nil
650+ return listCertsPageFromGenerated (page ), nil
667651 },
668652 })
669653}
@@ -698,37 +682,21 @@ func listCertificateVersionsPageFromGenerated(i generated.KeyVaultClientGetCerti
698682 }
699683}
700684
701- // ListPropertiesOfCertificateVersions lists all versions of the specified certificate. The full certificate identifer and
685+ // NewListPropertiesOfCertificateVersionsPager lists all versions of the specified certificate. The full certificate identifer and
702686// attributes are provided in the response. No values are returned for the certificates. This operation
703687// requires the certificates/list permission.
704- func (c * Client ) ListPropertiesOfCertificateVersions (certificateName string , options * ListCertificateVersionsOptions ) * runtime.Pager [ListPropertiesOfCertificateVersionsResponse ] {
688+ func (c * Client ) NewListPropertiesOfCertificateVersionsPager (certificateName string , options * ListCertificateVersionsOptions ) * runtime.Pager [ListPropertiesOfCertificateVersionsResponse ] {
689+ pager := c .genClient .NewGetCertificateVersionsPager (c .vaultURL , certificateName , nil )
705690 return runtime .NewPager (runtime.PageProcessor [ListPropertiesOfCertificateVersionsResponse ]{
706691 More : func (page ListPropertiesOfCertificateVersionsResponse ) bool {
707- return page . NextLink != nil && len ( * page . NextLink ) > 0
692+ return pager . More ()
708693 },
709- Fetcher : func (ctx context.Context , page * ListPropertiesOfCertificateVersionsResponse ) (ListPropertiesOfCertificateVersionsResponse , error ) {
710- var req * policy.Request
711- var err error
712- if page == nil {
713- req , err = c .genClient .GetCertificateVersionsCreateRequest (ctx , c .vaultURL , certificateName , & generated.KeyVaultClientGetCertificateVersionsOptions {})
714- } else {
715- req , err = runtime .NewRequest (ctx , http .MethodGet , * page .NextLink )
716- }
717- if err != nil {
718- return ListPropertiesOfCertificateVersionsResponse {}, err
719- }
720- resp , err := c .genClient .Pl .Do (req )
721- if err != nil {
722- return ListPropertiesOfCertificateVersionsResponse {}, err
723- }
724- if ! runtime .HasStatusCode (resp , http .StatusOK ) {
725- return ListPropertiesOfCertificateVersionsResponse {}, runtime .NewResponseError (resp )
726- }
727- genResp , err := c .genClient .GetCertificateVersionsHandleResponse (resp )
694+ Fetcher : func (ctx context.Context , cur * ListPropertiesOfCertificateVersionsResponse ) (ListPropertiesOfCertificateVersionsResponse , error ) {
695+ page , err := pager .NextPage (ctx )
728696 if err != nil {
729697 return ListPropertiesOfCertificateVersionsResponse {}, err
730698 }
731- return listCertificateVersionsPageFromGenerated (genResp ), nil
699+ return listCertificateVersionsPageFromGenerated (page ), nil
732700 },
733701 })
734702}
@@ -916,36 +884,20 @@ func listIssuersPageFromGenerated(i generated.KeyVaultClientGetCertificateIssuer
916884 return ListIssuersPropertiesOfIssuersResponse {Issuers : vals , NextLink : i .NextLink }
917885}
918886
919- // ListPropertiesOfIssuers returns a pager that can be used to get the set of certificate issuer resources in the specified key vault. This operation
887+ // NewListPropertiesOfIssuersPager returns a pager that can be used to get the set of certificate issuer resources in the specified key vault. This operation
920888// requires the certificates/manageissuers/getissuers permission.
921- func (c * Client ) ListPropertiesOfIssuers (options * ListPropertiesOfIssuersOptions ) * runtime.Pager [ListIssuersPropertiesOfIssuersResponse ] {
889+ func (c * Client ) NewListPropertiesOfIssuersPager (options * ListPropertiesOfIssuersOptions ) * runtime.Pager [ListIssuersPropertiesOfIssuersResponse ] {
890+ pager := c .genClient .NewGetCertificateIssuersPager (c .vaultURL , nil )
922891 return runtime .NewPager (runtime.PageProcessor [ListIssuersPropertiesOfIssuersResponse ]{
923892 More : func (page ListIssuersPropertiesOfIssuersResponse ) bool {
924- return page . NextLink != nil && len ( * page . NextLink ) > 0
893+ return pager . More ()
925894 },
926- Fetcher : func (ctx context.Context , page * ListIssuersPropertiesOfIssuersResponse ) (ListIssuersPropertiesOfIssuersResponse , error ) {
927- var req * policy.Request
928- var err error
929- if page == nil {
930- req , err = c .genClient .GetCertificateIssuersCreateRequest (ctx , c .vaultURL , & generated.KeyVaultClientGetCertificateIssuersOptions {})
931- } else {
932- req , err = runtime .NewRequest (ctx , http .MethodGet , * page .NextLink )
933- }
934- if err != nil {
935- return ListIssuersPropertiesOfIssuersResponse {}, err
936- }
937- resp , err := c .genClient .Pl .Do (req )
938- if err != nil {
939- return ListIssuersPropertiesOfIssuersResponse {}, err
940- }
941- if ! runtime .HasStatusCode (resp , http .StatusOK ) {
942- return ListIssuersPropertiesOfIssuersResponse {}, runtime .NewResponseError (resp )
943- }
944- genResp , err := c .genClient .GetCertificateIssuersHandleResponse (resp )
895+ Fetcher : func (ctx context.Context , cur * ListIssuersPropertiesOfIssuersResponse ) (ListIssuersPropertiesOfIssuersResponse , error ) {
896+ page , err := pager .NextPage (ctx )
945897 if err != nil {
946898 return ListIssuersPropertiesOfIssuersResponse {}, err
947899 }
948- return listIssuersPageFromGenerated (genResp ), nil
900+ return listIssuersPageFromGenerated (page ), nil
949901 },
950902 })
951903}
@@ -1577,37 +1529,21 @@ type ListDeletedCertificatesOptions struct {
15771529 // placeholder for future optional parameters
15781530}
15791531
1580- // ListDeletedCertificates retrieves the certificates in the current vault which are in a deleted state and ready for recovery or purging.
1532+ // NewListDeletedCertificatesPager retrieves the certificates in the current vault which are in a deleted state and ready for recovery or purging.
15811533// This operation includes deletion-specific information. This operation requires the certificates/get/list permission. This operation can
15821534// only be enabled on soft-delete enabled vaults.
1583- func (c * Client ) ListDeletedCertificates (options * ListDeletedCertificatesOptions ) * runtime.Pager [ListDeletedCertificatesResponse ] {
1535+ func (c * Client ) NewListDeletedCertificatesPager (options * ListDeletedCertificatesOptions ) * runtime.Pager [ListDeletedCertificatesResponse ] {
1536+ pager := c .genClient .NewGetDeletedCertificatesPager (c .vaultURL , nil )
15841537 return runtime .NewPager (runtime.PageProcessor [ListDeletedCertificatesResponse ]{
15851538 More : func (page ListDeletedCertificatesResponse ) bool {
1586- return page . NextLink != nil && len ( * page . NextLink ) > 0
1539+ return pager . More ()
15871540 },
1588- Fetcher : func (ctx context.Context , page * ListDeletedCertificatesResponse ) (ListDeletedCertificatesResponse , error ) {
1589- var req * policy.Request
1590- var err error
1591- if page == nil {
1592- req , err = c .genClient .GetDeletedCertificatesCreateRequest (ctx , c .vaultURL , & generated.KeyVaultClientGetDeletedCertificatesOptions {})
1593- } else {
1594- req , err = runtime .NewRequest (ctx , http .MethodGet , * page .NextLink )
1595- }
1596- if err != nil {
1597- return ListDeletedCertificatesResponse {}, err
1598- }
1599- resp , err := c .genClient .Pl .Do (req )
1600- if err != nil {
1601- return ListDeletedCertificatesResponse {}, err
1602- }
1603- if ! runtime .HasStatusCode (resp , http .StatusOK ) {
1604- return ListDeletedCertificatesResponse {}, runtime .NewResponseError (resp )
1605- }
1606- genResp , err := c .genClient .GetDeletedCertificatesHandleResponse (resp )
1541+ Fetcher : func (ctx context.Context , cur * ListDeletedCertificatesResponse ) (ListDeletedCertificatesResponse , error ) {
1542+ page , err := pager .NextPage (ctx )
16071543 if err != nil {
16081544 return ListDeletedCertificatesResponse {}, err
16091545 }
1610- return listDeletedCertsPageFromGenerated (genResp ), nil
1546+ return listDeletedCertsPageFromGenerated (page ), nil
16111547 },
16121548 })
16131549}
0 commit comments