@@ -384,7 +384,7 @@ public NetworkingApiBuilder(IServiceType serviceType, IAuthenticationProvider au
384384 }
385385 #endregion
386386
387- #region Level 3 Extension
387+ #region Layer 3 Extension
388388
389389 #region Routers
390390 /// <summary>
@@ -667,6 +667,80 @@ public NetworkingApiBuilder(IServiceType serviceType, IAuthenticationProvider au
667667 }
668668 #endregion
669669
670+ #region SecurityGroup
671+ /// <summary>
672+ /// Lists all network security groups associated with the account.
673+ /// </summary>
674+ /// <param name="queryString">Options for filtering.</param>
675+ /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
676+ /// <returns>
677+ /// A collection of network security group resources associated with the account.
678+ /// </returns>
679+ public async Task < T > ListSecurityGroupsAsync < T > ( IQueryStringBuilder queryString , CancellationToken cancellationToken = default ( CancellationToken ) )
680+ where T : IEnumerable < IServiceResource >
681+ {
682+ return await BuildListSecurityGroupsRequest ( queryString , cancellationToken )
683+ . SendAsync ( )
684+ . ReceiveJson < T > ( )
685+ . PropogateOwnerToChildren ( this ) . ConfigureAwait ( false ) ;
686+ }
687+
688+ /// <summary>
689+ /// Builds a <see cref="ListSecurityGroupsAsync{T}"/> request.
690+ /// </summary>
691+ /// <param name="queryString">Options for filtering.</param>
692+ /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
693+ public async Task < PreparedRequest > BuildListSecurityGroupsRequest ( IQueryStringBuilder queryString , CancellationToken cancellationToken = default ( CancellationToken ) )
694+ {
695+ Url endpoint = await Endpoint . GetEndpoint ( cancellationToken ) . ConfigureAwait ( false ) ;
696+
697+ var request = endpoint
698+ . AppendPathSegments ( "security-groups" )
699+ . Authenticate ( AuthenticationProvider )
700+ . PrepareGet ( cancellationToken ) ;
701+
702+ request . Url . SetQueryParams ( queryString ? . Build ( ) ) ;
703+
704+ return request ;
705+ }
706+
707+ /// <summary>
708+ /// Lists all network security group rules associated with the account.
709+ /// </summary>
710+ /// <param name="queryString">Options for filtering.</param>
711+ /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
712+ /// <returns>
713+ /// A collection of network security group rule resources associated with the account.
714+ /// </returns>
715+ public async Task < T > ListSecurityGroupRulesAsync < T > ( IQueryStringBuilder queryString , CancellationToken cancellationToken = default ( CancellationToken ) )
716+ where T : IEnumerable < IServiceResource >
717+ {
718+ return await BuildListSecurityGroupRulesRequest ( queryString , cancellationToken )
719+ . SendAsync ( )
720+ . ReceiveJson < T > ( )
721+ . PropogateOwnerToChildren ( this ) . ConfigureAwait ( false ) ;
722+ }
723+
724+ /// <summary>
725+ /// Builds a <see cref="ListSecurityGroupRulesAsync{T}"/> request.
726+ /// </summary>
727+ /// <param name="queryString">Options for filtering.</param>
728+ /// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
729+ public async Task < PreparedRequest > BuildListSecurityGroupRulesRequest ( IQueryStringBuilder queryString , CancellationToken cancellationToken = default ( CancellationToken ) )
730+ {
731+ Url endpoint = await Endpoint . GetEndpoint ( cancellationToken ) . ConfigureAwait ( false ) ;
732+
733+ var request = endpoint
734+ . AppendPathSegments ( "security-group-rules" )
735+ . Authenticate ( AuthenticationProvider )
736+ . PrepareGet ( cancellationToken ) ;
737+
738+ request . Url . SetQueryParams ( queryString ? . Build ( ) ) ;
739+
740+ return request ;
741+ }
742+ #endregion
743+
670744 #region Floating IPs
671745 /// <summary>
672746 /// Shows details for a server group.
0 commit comments