Skip to content

Commit a7d71f1

Browse files
authored
Latest Actions Updates (#524)
1 parent c4a30f5 commit a7d71f1

File tree

7 files changed

+108
-19
lines changed

7 files changed

+108
-19
lines changed

actions_test.go

+16
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package opslevel_test
22

33
import (
4+
"encoding/json"
45
"testing"
56

67
ol "github.com/opslevel/opslevel-go/v2025"
@@ -375,3 +376,18 @@ func TestListExtendedTeamAccess(t *testing.T) {
375376
autopilot.Equals(t, "example", result[0].Alias)
376377
autopilot.Equals(t, id1, result[0].TeamId.Id)
377378
}
379+
380+
func TestApprovalConfigInput(t *testing.T) {
381+
// Arrange
382+
v1 := ol.ApprovalConfigInput{}
383+
v2 := ol.ApprovalConfigInput{Teams: &[]ol.IdentifierInput{}}
384+
// Act
385+
j1, err1 := json.Marshal(v1)
386+
j2, err2 := json.Marshal(v2)
387+
// Assert
388+
autopilot.Ok(t, err1)
389+
autopilot.Ok(t, err2)
390+
autopilot.Equals(t, `{}`, string(j1))
391+
autopilot.Equals(t, `{"teams":[]}`, string(j2))
392+
// Assert
393+
}

enum.go

+44-6
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,20 @@ var AllApiDocumentSourceEnum = []string{
8181
string(ApiDocumentSourceEnumPush),
8282
}
8383

84+
// ApprovalDecisionEnum The set of possible outcomes for an approval decision
85+
type ApprovalDecisionEnum string
86+
87+
var (
88+
ApprovalDecisionEnumApproved ApprovalDecisionEnum = "APPROVED" //
89+
ApprovalDecisionEnumDenied ApprovalDecisionEnum = "DENIED" //
90+
)
91+
92+
// All ApprovalDecisionEnum as []string
93+
var AllApprovalDecisionEnum = []string{
94+
string(ApprovalDecisionEnumApproved),
95+
string(ApprovalDecisionEnumDenied),
96+
}
97+
8498
// BasicTypeEnum Operations that can be used on filters
8599
type BasicTypeEnum string
86100

@@ -2545,15 +2559,17 @@ var AllCustomActionsTriggerDefinitionAccessControlEnum = []string{
25452559
type CustomActionsTriggerEventStatusEnum string
25462560

25472561
var (
2548-
CustomActionsTriggerEventStatusEnumFailure CustomActionsTriggerEventStatusEnum = "FAILURE" // The action failed to complete
2549-
CustomActionsTriggerEventStatusEnumPending CustomActionsTriggerEventStatusEnum = "PENDING" // A result has not been determined
2550-
CustomActionsTriggerEventStatusEnumSuccess CustomActionsTriggerEventStatusEnum = "SUCCESS" // The action completed successfully
2562+
CustomActionsTriggerEventStatusEnumFailure CustomActionsTriggerEventStatusEnum = "FAILURE" // The action failed to complete
2563+
CustomActionsTriggerEventStatusEnumPending CustomActionsTriggerEventStatusEnum = "PENDING" // A result has not been determined
2564+
CustomActionsTriggerEventStatusEnumPendingApproval CustomActionsTriggerEventStatusEnum = "PENDING_APPROVAL" // The action is waiting for an approval before it executes
2565+
CustomActionsTriggerEventStatusEnumSuccess CustomActionsTriggerEventStatusEnum = "SUCCESS" // The action completed successfully
25512566
)
25522567

25532568
// All CustomActionsTriggerEventStatusEnum as []string
25542569
var AllCustomActionsTriggerEventStatusEnum = []string{
25552570
string(CustomActionsTriggerEventStatusEnumFailure),
25562571
string(CustomActionsTriggerEventStatusEnumPending),
2572+
string(CustomActionsTriggerEventStatusEnumPendingApproval),
25572573
string(CustomActionsTriggerEventStatusEnumSuccess),
25582574
}
25592575

@@ -2581,6 +2597,28 @@ var AllDayOfWeekEnum = []string{
25812597
string(DayOfWeekEnumWednesday),
25822598
}
25832599

2600+
// DeployStatusEnum The possible statuses of a deploy
2601+
type DeployStatusEnum string
2602+
2603+
var (
2604+
DeployStatusEnumCanceled DeployStatusEnum = "canceled" // The deploy was canceled
2605+
DeployStatusEnumFailure DeployStatusEnum = "failure" // The deploy failed
2606+
DeployStatusEnumNoStatus DeployStatusEnum = "no_status" // The deploy has no recognized status
2607+
DeployStatusEnumQueued DeployStatusEnum = "queued" // The deploy is queued
2608+
DeployStatusEnumRunning DeployStatusEnum = "running" // The deploy is currently running
2609+
DeployStatusEnumSuccess DeployStatusEnum = "success" // The deploy was successful
2610+
)
2611+
2612+
// All DeployStatusEnum as []string
2613+
var AllDeployStatusEnum = []string{
2614+
string(DeployStatusEnumCanceled),
2615+
string(DeployStatusEnumFailure),
2616+
string(DeployStatusEnumNoStatus),
2617+
string(DeployStatusEnumQueued),
2618+
string(DeployStatusEnumRunning),
2619+
string(DeployStatusEnumSuccess),
2620+
}
2621+
25842622
// EventIntegrationEnum The type of event integration
25852623
type EventIntegrationEnum string
25862624

@@ -2925,12 +2963,12 @@ var AllPropertyDefinitionDisplayTypeEnum = []string{
29252963
string(PropertyDefinitionDisplayTypeEnumText),
29262964
}
29272965

2928-
// PropertyDisplayStatusEnum The display status of a custom property on service pages
2966+
// PropertyDisplayStatusEnum The UI display status of a custom property
29292967
type PropertyDisplayStatusEnum string
29302968

29312969
var (
2932-
PropertyDisplayStatusEnumHidden PropertyDisplayStatusEnum = "hidden" // The property is not shown on the service page
2933-
PropertyDisplayStatusEnumVisible PropertyDisplayStatusEnum = "visible" // The property is shown on the service page
2970+
PropertyDisplayStatusEnumHidden PropertyDisplayStatusEnum = "hidden" // The property is not shown on resource pages
2971+
PropertyDisplayStatusEnumVisible PropertyDisplayStatusEnum = "visible" // The property is shown on resource pages
29342972
)
29352973

29362974
// All PropertyDisplayStatusEnum as []string

input.go

+16-5
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,13 @@ type AliasDeleteInput struct {
3333
OwnerType AliasOwnerTypeEnum `json:"ownerType" yaml:"ownerType" example:"domain"` // The resource the alias you wish to delete belongs to (Required)
3434
}
3535

36+
// ApprovalConfigInput Config for approval
37+
type ApprovalConfigInput struct {
38+
ApprovalRequired *bool `json:"approvalRequired,omitempty" yaml:"approvalRequired,omitempty" example:"false"` // Flag indicating approval is required (Optional)
39+
Teams *[]IdentifierInput `json:"teams,omitempty" yaml:"teams,omitempty" example:"[]"` // Teams that can approve (Optional)
40+
Users *[]UserIdentifierInput `json:"users,omitempty" yaml:"users,omitempty" example:"[]"` // Users that can approve (Optional)
41+
}
42+
3643
// AwsIntegrationInput Specifies the input fields used to create and update an AWS integration
3744
type AwsIntegrationInput struct {
3845
AwsTagsOverrideOwnership *Nullable[bool] `json:"awsTagsOverrideOwnership,omitempty" yaml:"awsTagsOverrideOwnership,omitempty" example:"false"` // Allow tags imported from AWS to override ownership set in OpsLevel directly (Optional)
@@ -651,7 +658,7 @@ type ComponentTypeIconInput struct {
651658
// ComponentTypeInput Specifies the input fields used to create a component type
652659
type ComponentTypeInput struct {
653660
Alias *Nullable[string] `json:"alias,omitempty" yaml:"alias,omitempty" example:"example_value"` // The unique alias of the component type (Optional)
654-
Description *Nullable[string] `json:"description,omitempty" yaml:"description,omitempty" example:"example_value"` // The unique alias of the component type (Optional)
661+
Description *Nullable[string] `json:"description,omitempty" yaml:"description,omitempty" example:"example_value"` // The description of the component type (Optional)
655662
Icon *ComponentTypeIconInput `json:"icon,omitempty" yaml:"icon,omitempty"` // The icon associated with the component type (Optional)
656663
Name *Nullable[string] `json:"name,omitempty" yaml:"name,omitempty" example:"example_value"` // The unique name of the component type (Optional)
657664
Properties *[]ComponentTypePropertyDefinitionInput `json:"properties,omitempty" yaml:"properties,omitempty" example:"[]"` // A list of property definitions for the component type (Optional)
@@ -664,7 +671,7 @@ type ComponentTypePropertyDefinitionInput struct {
664671
Description string `json:"description" yaml:"description" example:"example_value"` // The description of the property definition (Required)
665672
LockedStatus *PropertyLockedStatusEnum `json:"lockedStatus,omitempty" yaml:"lockedStatus,omitempty" example:"ui_locked"` // Restricts what sources are able to assign values to this property (Optional)
666673
Name string `json:"name" yaml:"name" example:"example_value"` // The name of the property definition (Required)
667-
PropertyDisplayStatus PropertyDisplayStatusEnum `json:"propertyDisplayStatus" yaml:"propertyDisplayStatus" example:"hidden"` // The display status of the custom property on service pages (Required)
674+
PropertyDisplayStatus PropertyDisplayStatusEnum `json:"propertyDisplayStatus" yaml:"propertyDisplayStatus" example:"hidden"` // The UI display status of the custom property (Required)
668675
Schema JSONSchema `json:"schema" yaml:"schema" example:"SCHEMA_TBD"` // The schema of the property definition (Required)
669676
}
670677

@@ -707,9 +714,10 @@ type ContactUpdateInput struct {
707714
type CustomActionsTriggerDefinitionCreateInput struct {
708715
AccessControl *CustomActionsTriggerDefinitionAccessControlEnum `json:"accessControl,omitempty" yaml:"accessControl,omitempty" example:"admins"` // The set of users that should be able to use the trigger definition (Optional)
709716
ActionId *Nullable[ID] `json:"actionId,omitempty" yaml:"actionId,omitempty" example:"Z2lkOi8vc2VydmljZS8xMjM0NTY3ODk"` // The action that will be triggered by the Trigger Definition (Optional)
717+
ApprovalConfig *ApprovalConfigInput `json:"approvalConfig,omitempty" yaml:"approvalConfig,omitempty"` // Config for approval of action (Optional)
710718
Description *Nullable[string] `json:"description,omitempty" yaml:"description,omitempty" example:"example_value"` // The description of what the Trigger Definition will do, supports Markdown (Optional)
711-
EntityType *CustomActionsEntityTypeEnum `json:"entityType,omitempty" yaml:"entityType,omitempty" example:"GLOBAL"` // The entity type to associate with the Trigger Definition (Optional)
712719
ExtendedTeamAccess *[]IdentifierInput `json:"extendedTeamAccess,omitempty" yaml:"extendedTeamAccess,omitempty" example:"[]"` // The set of additional teams who can invoke this Trigger Definition (Optional)
720+
EntityType *CustomActionsEntityTypeEnum `json:"entityType,omitempty" yaml:"entityType,omitempty" example:"GLOBAL"` // The entity type to associate with the Trigger Definition (Optional Default: SERVICE)
713721
FilterId *Nullable[ID] `json:"filterId,omitempty" yaml:"filterId,omitempty" example:"Z2lkOi8vc2VydmljZS8xMjM0NTY3ODk"` // The filter that will determine which services apply to the Trigger Definition (Optional)
714722
ManualInputsDefinition *Nullable[string] `json:"manualInputsDefinition,omitempty" yaml:"manualInputsDefinition,omitempty" example:"example_value"` // The YAML definition of custom inputs for the Trigger Definition (Optional)
715723
Name string `json:"name" yaml:"name" example:"example_value"` // The name of the Trigger Definition (Required)
@@ -723,9 +731,10 @@ type CustomActionsTriggerDefinitionUpdateInput struct {
723731
AccessControl *CustomActionsTriggerDefinitionAccessControlEnum `json:"accessControl,omitempty" yaml:"accessControl,omitempty" example:"admins"` // The set of users that should be able to use the trigger definition (Optional)
724732
Action *CustomActionsWebhookActionUpdateInput `json:"action,omitempty" yaml:"action,omitempty"` // The details for the action to update for the Trigger Definition (Optional)
725733
ActionId *Nullable[ID] `json:"actionId,omitempty" yaml:"actionId,omitempty" example:"Z2lkOi8vc2VydmljZS8xMjM0NTY3ODk"` // The action that will be triggered by the Trigger Definition (Optional)
734+
ApprovalConfig *ApprovalConfigInput `json:"approvalConfig,omitempty" yaml:"approvalConfig,omitempty"` // Config for approval of action (Optional)
726735
Description *Nullable[string] `json:"description,omitempty" yaml:"description,omitempty" example:"example_value"` // The description of what the Trigger Definition will do, support Markdown (Optional)
727-
EntityType *CustomActionsEntityTypeEnum `json:"entityType,omitempty" yaml:"entityType,omitempty" example:"GLOBAL"` // The entity type to associate with the Trigger Definition (Optional)
728736
ExtendedTeamAccess *[]IdentifierInput `json:"extendedTeamAccess,omitempty" yaml:"extendedTeamAccess,omitempty" example:"[]"` // The set of additional teams who can invoke this Trigger Definition (Optional)
737+
EntityType *CustomActionsEntityTypeEnum `json:"entityType,omitempty" yaml:"entityType,omitempty" example:"GLOBAL"` // The entity type to associate with the Trigger Definition (Optional Default: SERVICE)
729738
FilterId *Nullable[ID] `json:"filterId,omitempty" yaml:"filterId,omitempty" example:"Z2lkOi8vc2VydmljZS8xMjM0NTY3ODk"` // The filter that will determine which services apply to the Trigger Definition (Optional)
730739
Id ID `json:"id" yaml:"id" example:"Z2lkOi8vc2VydmljZS8xMjM0NTY3ODk"` // The ID of the trigger definition (Required)
731740
ManualInputsDefinition *Nullable[string] `json:"manualInputsDefinition,omitempty" yaml:"manualInputsDefinition,omitempty" example:"example_value"` // The YAML definition of custom inputs for the Trigger Definition (Optional)
@@ -737,6 +746,7 @@ type CustomActionsTriggerDefinitionUpdateInput struct {
737746

738747
// CustomActionsWebhookActionCreateInput Specifies the input fields used in the `customActionsWebhookActionCreate` mutation
739748
type CustomActionsWebhookActionCreateInput struct {
749+
Async *bool `json:"async,omitempty" yaml:"async,omitempty" example:"false"` // Whether the action expects an additional, asynchronous response upon completion (Required Default: false)
740750
Description *Nullable[string] `json:"description,omitempty" yaml:"description,omitempty" example:"example_value"` // The description that gets assigned to the Webhook Action you're creating (Optional)
741751
Headers *JSON `json:"headers,omitempty" yaml:"headers,omitempty" example:"{\"name\":\"my-big-query\",\"engine\":\"BigQuery\",\"endpoint\":\"https://google.com\",\"replica\":false}"` // HTTP headers be passed along with your Webhook when triggered (Optional)
742752
HttpMethod CustomActionsHttpMethodEnum `json:"httpMethod" yaml:"httpMethod" example:"DELETE"` // HTTP used when the Webhook is triggered. Either POST or PUT (Required)
@@ -747,6 +757,7 @@ type CustomActionsWebhookActionCreateInput struct {
747757

748758
// CustomActionsWebhookActionUpdateInput Inputs that specify the details of a Webhook Action you wish to update
749759
type CustomActionsWebhookActionUpdateInput struct {
760+
Async *bool `json:"async,omitempty" yaml:"async,omitempty" example:"false"` // Whether the action expects an additional, asynchronous response upon completion (Optional)
750761
Description *Nullable[string] `json:"description,omitempty" yaml:"description,omitempty" example:"example_value"` // The description that gets assigned to the Webhook Action you're creating (Optional)
751762
Headers *JSON `json:"headers,omitempty" yaml:"headers,omitempty" example:"{\"name\":\"my-big-query\",\"engine\":\"BigQuery\",\"endpoint\":\"https://google.com\",\"replica\":false}"` // HTTP headers be passed along with your Webhook when triggered (Optional)
752763
HttpMethod *CustomActionsHttpMethodEnum `json:"httpMethod,omitempty" yaml:"httpMethod,omitempty" example:"DELETE"` // HTTP used when the Webhook is triggered. Either POST or PUT (Optional)
@@ -934,7 +945,7 @@ type PropertyDefinitionInput struct {
934945
Description *Nullable[string] `json:"description,omitempty" yaml:"description,omitempty" example:"example_value"` // The description of the property definition (Optional)
935946
LockedStatus *PropertyLockedStatusEnum `json:"lockedStatus,omitempty" yaml:"lockedStatus,omitempty" example:"ui_locked"` // Restricts what sources are able to assign values to this property (Optional)
936947
Name *Nullable[string] `json:"name,omitempty" yaml:"name,omitempty" example:"example_value"` // The name of the property definition (Optional)
937-
PropertyDisplayStatus *PropertyDisplayStatusEnum `json:"propertyDisplayStatus,omitempty" yaml:"propertyDisplayStatus,omitempty" example:"hidden"` // The display status of the custom property on service pages (Optional)
948+
PropertyDisplayStatus *PropertyDisplayStatusEnum `json:"propertyDisplayStatus,omitempty" yaml:"propertyDisplayStatus,omitempty" example:"hidden"` // The UI display status of the custom property (Optional)
938949
Schema *JSONSchema `json:"schema,omitempty" yaml:"schema,omitempty" example:"SCHEMA_TBD"` // The schema of the property definition (Optional)
939950
}
940951

0 commit comments

Comments
 (0)