Skip to content

Commit

Permalink
Added get_tags() support for subscriptions. (#26)
Browse files Browse the repository at this point in the history
* Added get_tags() support for subscriptions.

* missed a parameter

* Update DESCRIPTION

* Update DESCRIPTION
  • Loading branch information
bertneef authored Sep 10, 2023
1 parent fe43bb7 commit 4774b9b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions R/az_subscription.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#' - `list_role_assignments()`: Lists role assignments.
#' - `get_role_definition(id)`: Retrieves an existing role definition.
#' - `list_role_definitions()` Lists role definitions.
#' - `get_tags()` Get the tags on this subscription.
#'
#' @section Details:
#' Generally, the easiest way to create a subscription object is via the `get_subscription` or `list_subscriptions` methods of the [az_rm] class. To create a subscription object in isolation, call the `new()` method and supply an Oauth 2.0 token of class [AzureToken], along with the ID of the subscription.
Expand Down Expand Up @@ -85,6 +86,7 @@ public=list(
state=NULL,
policies=NULL,
authorization_source=NULL,
tags=NULL,
token=NULL,

initialize=function(token, id=NULL, parms=list())
Expand All @@ -102,6 +104,7 @@ public=list(
self$state <- parms$state
self$policies <- parms$subscriptionPolicies
self$authorization_source <- parms$authorizationSource
self$tags <- parms$tags
NULL
},

Expand Down Expand Up @@ -155,6 +158,13 @@ public=list(
else sapply(apis, select_version)
}
},

get_tags=function()
{
if(is.null(self$tags))
named_list()
else self$tags
},

get_resource_group=function(name)
{
Expand Down

0 comments on commit 4774b9b

Please sign in to comment.