diff --git a/pkg/models/shared/appresourceinput.go b/pkg/models/shared/appresourceinput.go index e691db70e..cd5c63411 100644 --- a/pkg/models/shared/appresourceinput.go +++ b/pkg/models/shared/appresourceinput.go @@ -2,6 +2,8 @@ package shared +import "github.com/conductorone/conductorone-sdk-go/pkg/utils" + // AppResourceInput - The app resource message is a single resource that can have entitlements. // // This message contains a oneof named metadata. Only a single field of the following list may be set at a time: @@ -31,6 +33,17 @@ type AppResourceInput struct { ParentAppResourceTypeID *string `json:"parentAppResourceTypeId,omitempty"` } +func (a AppResourceInput) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *AppResourceInput) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, a, "", false, nil); err != nil { + return err + } + return nil +} + func (a *AppResourceInput) GetSecretTrait() *SecretTrait { if a == nil { return nil diff --git a/pkg/models/shared/automationexecutionref.go b/pkg/models/shared/automationexecutionref.go index 7feab2ddb..a8b1b841e 100644 --- a/pkg/models/shared/automationexecutionref.go +++ b/pkg/models/shared/automationexecutionref.go @@ -2,12 +2,25 @@ package shared +import "github.com/conductorone/conductorone-sdk-go/pkg/utils" + // The AutomationExecutionRef message. type AutomationExecutionRef struct { // The id field. ID *int64 `integer:"string" json:"id,omitempty"` } +func (a AutomationExecutionRef) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(a, "", false) +} + +func (a *AutomationExecutionRef) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, a, "", false, nil); err != nil { + return err + } + return nil +} + func (a *AutomationExecutionRef) GetID() *int64 { if a == nil { return nil diff --git a/pkg/models/shared/executeautomationresponse.go b/pkg/models/shared/executeautomationresponse.go index 79119fbb6..0ba2f2c4b 100644 --- a/pkg/models/shared/executeautomationresponse.go +++ b/pkg/models/shared/executeautomationresponse.go @@ -2,12 +2,25 @@ package shared +import "github.com/conductorone/conductorone-sdk-go/pkg/utils" + // The ExecuteAutomationResponse message. type ExecuteAutomationResponse struct { // The executionId field. ExecutionID *int64 `integer:"string" json:"executionId,omitempty"` } +func (e ExecuteAutomationResponse) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(e, "", false) +} + +func (e *ExecuteAutomationResponse) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, e, "", false, nil); err != nil { + return err + } + return nil +} + func (e *ExecuteAutomationResponse) GetExecutionID() *int64 { if e == nil { return nil diff --git a/pkg/models/shared/facetrange.go b/pkg/models/shared/facetrange.go index 0b2a7323b..4c085c853 100644 --- a/pkg/models/shared/facetrange.go +++ b/pkg/models/shared/facetrange.go @@ -2,6 +2,8 @@ package shared +import "github.com/conductorone/conductorone-sdk-go/pkg/utils" + // The FacetRange message. type FacetRange struct { // The count of items in the range. @@ -16,6 +18,17 @@ type FacetRange struct { To *int64 `integer:"string" json:"to,omitempty"` } +func (f FacetRange) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(f, "", false) +} + +func (f *FacetRange) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, f, "", false, nil); err != nil { + return err + } + return nil +} + func (f *FacetRange) GetCount() *int64 { if f == nil { return nil diff --git a/pkg/models/shared/facets.go b/pkg/models/shared/facets.go index 495c3e855..921e9bbd4 100644 --- a/pkg/models/shared/facets.go +++ b/pkg/models/shared/facets.go @@ -2,6 +2,8 @@ package shared +import "github.com/conductorone/conductorone-sdk-go/pkg/utils" + // Facets - Indicates one value of a facet. type Facets struct { // The count of items in this facet. @@ -10,6 +12,17 @@ type Facets struct { Facets []FacetCategory `json:"facets,omitempty"` } +func (f Facets) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(f, "", false) +} + +func (f *Facets) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, f, "", false, nil); err != nil { + return err + } + return nil +} + func (f *Facets) GetCount() *int64 { if f == nil { return nil diff --git a/pkg/models/shared/facetvalue.go b/pkg/models/shared/facetvalue.go index 4801e8581..7354f9c91 100644 --- a/pkg/models/shared/facetvalue.go +++ b/pkg/models/shared/facetvalue.go @@ -2,6 +2,8 @@ package shared +import "github.com/conductorone/conductorone-sdk-go/pkg/utils" + // A FacetValue message contains count and value of the facet entry. type FacetValue struct { // The count of the values in this facet. @@ -14,6 +16,17 @@ type FacetValue struct { Value *string `json:"value,omitempty"` } +func (f FacetValue) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(f, "", false) +} + +func (f *FacetValue) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, f, "", false, nil); err != nil { + return err + } + return nil +} + func (f *FacetValue) GetCount() *int64 { if f == nil { return nil diff --git a/pkg/models/shared/filefield.go b/pkg/models/shared/filefield.go index d91f6820d..08aaf6d5b 100644 --- a/pkg/models/shared/filefield.go +++ b/pkg/models/shared/filefield.go @@ -2,6 +2,8 @@ package shared +import "github.com/conductorone/conductorone-sdk-go/pkg/utils" + // The FileField message. // // This message contains a oneof named view. Only a single field of the following list may be set at a time: @@ -20,6 +22,17 @@ type FileField struct { MaxFileSize *int64 `integer:"string" json:"maxFileSize,omitempty"` } +func (f FileField) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(f, "", false) +} + +func (f *FileField) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, f, "", false, nil); err != nil { + return err + } + return nil +} + func (f *FileField) GetFileInputField() *FileInputField { if f == nil { return nil diff --git a/pkg/models/shared/int64field.go b/pkg/models/shared/int64field.go index 5411d2a28..b7d88d4f4 100644 --- a/pkg/models/shared/int64field.go +++ b/pkg/models/shared/int64field.go @@ -2,6 +2,8 @@ package shared +import "github.com/conductorone/conductorone-sdk-go/pkg/utils" + // The Int64Field message. // // This message contains a oneof named view. Only a single field of the following list may be set at a time: @@ -25,6 +27,17 @@ type Int64Field struct { Placeholder *string `json:"placeholder,omitempty"` } +func (i Int64Field) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(i, "", false) +} + +func (i *Int64Field) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, i, "", false, nil); err != nil { + return err + } + return nil +} + func (i *Int64Field) GetInt64Rules() *Int64Rules { if i == nil { return nil diff --git a/pkg/models/shared/int64rules.go b/pkg/models/shared/int64rules.go index ef63ada8c..f7e1fb69e 100644 --- a/pkg/models/shared/int64rules.go +++ b/pkg/models/shared/int64rules.go @@ -2,6 +2,8 @@ package shared +import "github.com/conductorone/conductorone-sdk-go/pkg/utils" + // Int64Rules describes the constraints applied to `int64` values type Int64Rules struct { // Const specifies that this field must be exactly the specified value @@ -31,6 +33,17 @@ type Int64Rules struct { NotIn []int64 `integer:"string" json:"notIn,omitempty"` } +func (i Int64Rules) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(i, "", false) +} + +func (i *Int64Rules) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, i, "", false, nil); err != nil { + return err + } + return nil +} + func (i *Int64Rules) GetConst() *int64 { if i == nil { return nil diff --git a/pkg/models/shared/numberfield.go b/pkg/models/shared/numberfield.go index 5521fd980..9bf849c20 100644 --- a/pkg/models/shared/numberfield.go +++ b/pkg/models/shared/numberfield.go @@ -2,6 +2,8 @@ package shared +import "github.com/conductorone/conductorone-sdk-go/pkg/utils" + // The NumberField message. type NumberField struct { // The maxValue field. @@ -12,6 +14,17 @@ type NumberField struct { Step *int64 `integer:"string" json:"step,omitempty"` } +func (n NumberField) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(n, "", false) +} + +func (n *NumberField) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, n, "", false, nil); err != nil { + return err + } + return nil +} + func (n *NumberField) GetMaxValue() *int64 { if n == nil { return nil diff --git a/pkg/models/shared/payloadworkflowstep.go b/pkg/models/shared/payloadworkflowstep.go index 496af4b5b..c385f16ec 100644 --- a/pkg/models/shared/payloadworkflowstep.go +++ b/pkg/models/shared/payloadworkflowstep.go @@ -2,6 +2,8 @@ package shared +import "github.com/conductorone/conductorone-sdk-go/pkg/utils" + // The PayloadWorkflowStep message. type PayloadWorkflowStep struct { Context map[string]any `json:"context,omitempty"` @@ -13,6 +15,17 @@ type PayloadWorkflowStep struct { WorkflowID *string `json:"workflowId,omitempty"` } +func (p PayloadWorkflowStep) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(p, "", false) +} + +func (p *PayloadWorkflowStep) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, p, "", false, nil); err != nil { + return err + } + return nil +} + func (p *PayloadWorkflowStep) GetContext() map[string]any { if p == nil { return nil diff --git a/pkg/models/shared/requestcatalogview.go b/pkg/models/shared/requestcatalogview.go index 364cfe44d..b9cc74079 100644 --- a/pkg/models/shared/requestcatalogview.go +++ b/pkg/models/shared/requestcatalogview.go @@ -2,6 +2,8 @@ package shared +import "github.com/conductorone/conductorone-sdk-go/pkg/utils" + // RequestCatalogView - The request catalog view contains the serialized request catalog and paths to objects referenced by the request catalog. type RequestCatalogView struct { // The RequestCatalog is used for managing which entitlements are requestable, and who can request them. @@ -14,6 +16,17 @@ type RequestCatalogView struct { MemberCount *int64 `integer:"string" json:"memberCount,omitempty"` } +func (r RequestCatalogView) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(r, "", false) +} + +func (r *RequestCatalogView) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, r, "", false, nil); err != nil { + return err + } + return nil +} + func (r *RequestCatalogView) GetRequestCatalog() *RequestCatalog { if r == nil { return nil diff --git a/pkg/models/shared/searchautomationexecutionsrequest.go b/pkg/models/shared/searchautomationexecutionsrequest.go index 92f448974..bd4be7bd2 100644 --- a/pkg/models/shared/searchautomationexecutionsrequest.go +++ b/pkg/models/shared/searchautomationexecutionsrequest.go @@ -2,6 +2,8 @@ package shared +import "github.com/conductorone/conductorone-sdk-go/pkg/utils" + type ExecutionStepStates string const ( @@ -52,6 +54,17 @@ type SearchAutomationExecutionsRequest struct { Refs []AutomationExecutionRef `json:"refs,omitempty"` } +func (s SearchAutomationExecutionsRequest) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(s, "", false) +} + +func (s *SearchAutomationExecutionsRequest) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, s, "", false, nil); err != nil { + return err + } + return nil +} + func (s *SearchAutomationExecutionsRequest) GetAutomationExecutionExpandMask() *AutomationExecutionExpandMask { if s == nil { return nil diff --git a/pkg/models/shared/sfixed64rules.go b/pkg/models/shared/sfixed64rules.go index 5d9f651c1..29fe71253 100644 --- a/pkg/models/shared/sfixed64rules.go +++ b/pkg/models/shared/sfixed64rules.go @@ -2,6 +2,8 @@ package shared +import "github.com/conductorone/conductorone-sdk-go/pkg/utils" + // SFixed64Rules describes the constraints applied to `sfixed64` values type SFixed64Rules struct { // Const specifies that this field must be exactly the specified value @@ -31,6 +33,17 @@ type SFixed64Rules struct { NotIn []int64 `integer:"string" json:"notIn,omitempty"` } +func (s SFixed64Rules) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(s, "", false) +} + +func (s *SFixed64Rules) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, s, "", false, nil); err != nil { + return err + } + return nil +} + func (s *SFixed64Rules) GetConst() *int64 { if s == nil { return nil diff --git a/pkg/models/shared/sint64rules.go b/pkg/models/shared/sint64rules.go index b5892c77c..b58b9fe86 100644 --- a/pkg/models/shared/sint64rules.go +++ b/pkg/models/shared/sint64rules.go @@ -2,6 +2,8 @@ package shared +import "github.com/conductorone/conductorone-sdk-go/pkg/utils" + // SInt64Rules describes the constraints applied to `sint64` values type SInt64Rules struct { // Const specifies that this field must be exactly the specified value @@ -31,6 +33,17 @@ type SInt64Rules struct { NotIn []int64 `integer:"string" json:"notIn,omitempty"` } +func (s SInt64Rules) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(s, "", false) +} + +func (s *SInt64Rules) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, s, "", false, nil); err != nil { + return err + } + return nil +} + func (s *SInt64Rules) GetConst() *int64 { if s == nil { return nil diff --git a/pkg/models/shared/taskauditerrorresult.go b/pkg/models/shared/taskauditerrorresult.go index 5c5fe004c..d4685d0b1 100644 --- a/pkg/models/shared/taskauditerrorresult.go +++ b/pkg/models/shared/taskauditerrorresult.go @@ -2,6 +2,8 @@ package shared +import "github.com/conductorone/conductorone-sdk-go/pkg/utils" + // The TaskAuditErrorResult message. type TaskAuditErrorResult struct { // TODO(pquerna): expand @@ -10,6 +12,17 @@ type TaskAuditErrorResult struct { ErrorReason *string `json:"errorReason,omitempty"` } +func (t TaskAuditErrorResult) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(t, "", false) +} + +func (t *TaskAuditErrorResult) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, t, "", false, nil); err != nil { + return err + } + return nil +} + func (t *TaskAuditErrorResult) GetErrorCount() *int64 { if t == nil { return nil diff --git a/pkg/models/shared/webhooksourceworkflowstep.go b/pkg/models/shared/webhooksourceworkflowstep.go index 17e3ca585..2a76cfae9 100644 --- a/pkg/models/shared/webhooksourceworkflowstep.go +++ b/pkg/models/shared/webhooksourceworkflowstep.go @@ -2,6 +2,8 @@ package shared +import "github.com/conductorone/conductorone-sdk-go/pkg/utils" + // The WebhookSourceWorkflowStep message. type WebhookSourceWorkflowStep struct { // The workflowExecutionId field. @@ -10,6 +12,17 @@ type WebhookSourceWorkflowStep struct { WorkflowStepID *string `json:"workflowStepId,omitempty"` } +func (w WebhookSourceWorkflowStep) MarshalJSON() ([]byte, error) { + return utils.MarshalJSON(w, "", false) +} + +func (w *WebhookSourceWorkflowStep) UnmarshalJSON(data []byte) error { + if err := utils.UnmarshalJSON(data, w, "", false, nil); err != nil { + return err + } + return nil +} + func (w *WebhookSourceWorkflowStep) GetWorkflowExecutionID() *int64 { if w == nil { return nil