Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions pkg/models/shared/appresourceinput.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down
13 changes: 13 additions & 0 deletions pkg/models/shared/automationexecutionref.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 13 additions & 0 deletions pkg/models/shared/executeautomationresponse.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 13 additions & 0 deletions pkg/models/shared/facetrange.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
Expand Down
13 changes: 13 additions & 0 deletions pkg/models/shared/facets.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
Expand Down
13 changes: 13 additions & 0 deletions pkg/models/shared/facetvalue.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
Expand Down
13 changes: 13 additions & 0 deletions pkg/models/shared/filefield.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down
13 changes: 13 additions & 0 deletions pkg/models/shared/int64field.go
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down
13 changes: 13 additions & 0 deletions pkg/models/shared/int64rules.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
13 changes: 13 additions & 0 deletions pkg/models/shared/numberfield.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

package shared

import "github.com/conductorone/conductorone-sdk-go/pkg/utils"

// The NumberField message.
type NumberField struct {
// The maxValue field.
Expand All @@ -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
Expand Down
13 changes: 13 additions & 0 deletions pkg/models/shared/payloadworkflowstep.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand All @@ -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
Expand Down
13 changes: 13 additions & 0 deletions pkg/models/shared/requestcatalogview.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
Expand Down
13 changes: 13 additions & 0 deletions pkg/models/shared/searchautomationexecutionsrequest.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

package shared

import "github.com/conductorone/conductorone-sdk-go/pkg/utils"

type ExecutionStepStates string

const (
Expand Down Expand Up @@ -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
Expand Down
13 changes: 13 additions & 0 deletions pkg/models/shared/sfixed64rules.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Loading
Loading