-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #301 from OctopusDeploy/fnm/scoped-common-tenant-v…
…ariables Add support for new tenant variables endpoints with environment scoping
- Loading branch information
Showing
7 changed files
with
155 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package configuration | ||
|
||
type FeatureToggleConfigurationQuery struct { | ||
Name string `uri:"Name,omitempty" url:"Name,omitempty"` | ||
} | ||
|
||
type FeatureToggleConfigurationResponse struct { | ||
FeatureToggles []ConfiguredFeatureToggle `json:"FeatureToggles"` | ||
} | ||
|
||
type ConfiguredFeatureToggle struct { | ||
Name string `json:"Name"` | ||
IsEnabled bool `json:"IsEnabled"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package configuration | ||
|
||
import ( | ||
"github.com/OctopusDeploy/go-octopusdeploy/v2/pkg/newclient" | ||
) | ||
|
||
type FeatureToggleConfigurationService struct{} | ||
|
||
const template = "/api/configuration/feature-toggles{?Name}" | ||
|
||
func Get(client newclient.Client, query *FeatureToggleConfigurationQuery) (*FeatureToggleConfigurationResponse, error) { | ||
return newclient.GetByQueryWithoutSpace[FeatureToggleConfigurationResponse](client, template, query) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package variables | ||
|
||
import ( | ||
"github.com/OctopusDeploy/go-octopusdeploy/v2/pkg/actiontemplates" | ||
"github.com/OctopusDeploy/go-octopusdeploy/v2/pkg/core" | ||
"github.com/OctopusDeploy/go-octopusdeploy/v2/pkg/resources" | ||
) | ||
|
||
type TenantCommonVariablesResponse struct { | ||
TenantID string `json:"TenantId,omitempty"` | ||
CommonVariables []TenantCommonVariable `json:"CommonVariables,omitempty"` | ||
|
||
resources.Resource | ||
} | ||
|
||
type TenantCommonVariable struct { | ||
LibraryVariableSetId string `json:"LibraryVariableSetId"` | ||
LibraryVariableSetName string `json:"LibraryVariableSetName,omitempty"` | ||
TemplateID string `json:"TemplateId"` | ||
Template actiontemplates.ActionTemplateParameter `json:"Template"` | ||
Value core.PropertyValue `json:"Value"` | ||
Scope TenantVariableScope `json:"Scope"` | ||
|
||
resources.Resource | ||
} | ||
|
||
type ModifyTenantCommonVariablesCommand struct { | ||
Variables []TenantCommonVariableCommand `json:"Variables"` | ||
} | ||
|
||
type TenantCommonVariableCommand struct { | ||
ID string `json:"Id,omitempty"` | ||
LibraryVariableSetId string `json:"LibraryVariableSetId"` | ||
TemplateID string `json:"TemplateId"` | ||
Value core.PropertyValue `json:"Value"` | ||
Scope TenantVariableScope `json:"Scope"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package variables | ||
|
||
import ( | ||
"github.com/OctopusDeploy/go-octopusdeploy/v2/pkg/actiontemplates" | ||
"github.com/OctopusDeploy/go-octopusdeploy/v2/pkg/core" | ||
"github.com/OctopusDeploy/go-octopusdeploy/v2/pkg/resources" | ||
) | ||
|
||
type TenantProjectVariablesResponse struct { | ||
TenantID string `json:"TenantId,omitempty"` | ||
ProjectVariables []TenantProjectVariable `json:"ProjectVariables,omitempty"` | ||
|
||
resources.Resource | ||
} | ||
|
||
type TenantProjectVariable struct { | ||
ProjectID string `json:"ProjectId"` | ||
ProjectName string `json:"ProjectName,omitempty"` | ||
TemplateID string `json:"TemplateId"` | ||
Template actiontemplates.ActionTemplateParameter `json:"Template"` | ||
Value core.PropertyValue `json:"Value"` | ||
Scope TenantVariableScope `json:"Scope"` | ||
Links map[string]string `json:"Links,omitempty"` | ||
|
||
resources.Resource | ||
} | ||
|
||
type ModifyTenantProjectVariablesCommand struct { | ||
Variables []TenantProjectVariableCommand `json:"Variables"` | ||
} | ||
|
||
type TenantProjectVariableCommand struct { | ||
ID string `json:"Id,omitempty"` | ||
ProjectID string `json:"ProjectId"` | ||
TemplateID string `json:"TemplateId"` | ||
Value core.PropertyValue `json:"Value"` | ||
Scope TenantVariableScope `json:"Scope"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package variables | ||
|
||
import "github.com/OctopusDeploy/go-octopusdeploy/v2/pkg/resources" | ||
|
||
type TenantVariableScope struct { | ||
EnvironmentIds []string `json:"EnvironmentIds"` | ||
|
||
resources.Resource | ||
} |