From 08b1efc55812cd50968ff9c05e140658873bfd35 Mon Sep 17 00:00:00 2001 From: duoertai Date: Mon, 25 Mar 2024 04:04:01 -0700 Subject: [PATCH] add start delay --- gen/iwfidl/.openapi-generator/VERSION | 2 +- gen/iwfidl/README.md | 6 +- gen/iwfidl/api/openapi.yaml | 83 ++++++++++--------- gen/iwfidl/client.go | 14 ++-- gen/iwfidl/docs/WorkflowStartOptions.md | 26 ++++++ gen/iwfidl/model_command_request.go | 38 +++++++++ gen/iwfidl/model_context.go | 40 +++++++++ .../model_inter_state_channel_command.go | 39 +++++++++ .../model_inter_state_channel_publishing.go | 38 +++++++++ .../model_inter_state_channel_result.go | 40 +++++++++ gen/iwfidl/model_signal_command.go | 39 +++++++++ gen/iwfidl/model_signal_result.go | 40 +++++++++ gen/iwfidl/model_state_completion_output.go | 39 +++++++++ gen/iwfidl/model_state_movement.go | 38 +++++++++ gen/iwfidl/model_timer_command.go | 39 +++++++++ gen/iwfidl/model_timer_result.go | 39 +++++++++ .../model_workflow_config_update_request.go | 39 +++++++++ gen/iwfidl/model_workflow_dump_request.go | 41 +++++++++ gen/iwfidl/model_workflow_dump_response.go | 40 +++++++++ ...model_workflow_get_data_objects_request.go | 38 +++++++++ gen/iwfidl/model_workflow_get_request.go | 38 +++++++++ gen/iwfidl/model_workflow_get_response.go | 39 +++++++++ ..._workflow_get_search_attributes_request.go | 38 +++++++++ gen/iwfidl/model_workflow_reset_request.go | 39 +++++++++ gen/iwfidl/model_workflow_reset_response.go | 38 +++++++++ gen/iwfidl/model_workflow_rpc_request.go | 39 +++++++++ gen/iwfidl/model_workflow_search_request.go | 38 +++++++++ .../model_workflow_search_response_entry.go | 39 +++++++++ gen/iwfidl/model_workflow_signal_request.go | 39 +++++++++ .../model_workflow_skip_timer_request.go | 39 +++++++++ gen/iwfidl/model_workflow_start_options.go | 48 +++++++++-- gen/iwfidl/model_workflow_start_request.go | 41 +++++++++ .../model_workflow_state_execute_request.go | 40 +++++++++ ...model_workflow_state_wait_until_request.go | 40 +++++++++ gen/iwfidl/model_workflow_stop_request.go | 38 +++++++++ ...kflow_wait_for_state_completion_request.go | 39 +++++++++ .../model_workflow_worker_rpc_request.go | 40 +++++++++ iwf/client_impl.go | 1 + iwf/unregistered_client_impl.go | 9 +- iwf/unregistered_workflow_options.go | 11 +-- iwf/workflow_options.go | 7 +- 41 files changed, 1349 insertions(+), 69 deletions(-) diff --git a/gen/iwfidl/.openapi-generator/VERSION b/gen/iwfidl/.openapi-generator/VERSION index 73a86b1..3769235 100644 --- a/gen/iwfidl/.openapi-generator/VERSION +++ b/gen/iwfidl/.openapi-generator/VERSION @@ -1 +1 @@ -7.0.1 \ No newline at end of file +7.1.0 \ No newline at end of file diff --git a/gen/iwfidl/README.md b/gen/iwfidl/README.md index e35ede4..afd7fc4 100644 --- a/gen/iwfidl/README.md +++ b/gen/iwfidl/README.md @@ -36,7 +36,7 @@ Default configuration comes with `Servers` field that contains server objects as ### Select Server Configuration -For using other server than the one defined on index 0 set context value `sw.ContextServerIndex` of type `int`. +For using other server than the one defined on index 0 set context value `iwfidl.ContextServerIndex` of type `int`. ```golang ctx := context.WithValue(context.Background(), iwfidl.ContextServerIndex, 1) @@ -44,7 +44,7 @@ ctx := context.WithValue(context.Background(), iwfidl.ContextServerIndex, 1) ### Templated Server URL -Templated server URL is formatted using default variables from configuration or from context value `sw.ContextServerVariables` of type `map[string]string`. +Templated server URL is formatted using default variables from configuration or from context value `iwfidl.ContextServerVariables` of type `map[string]string`. ```golang ctx := context.WithValue(context.Background(), iwfidl.ContextServerVariables, map[string]string{ @@ -58,7 +58,7 @@ Note, enum values are always validated and all unused variables are silently ign Each operation can use different server URL defined using `OperationServers` map in the `Configuration`. An operation is uniquely identified by `"{classname}Service.{nickname}"` string. -Similar rules for overriding default operation server index and variables applies by using `sw.ContextOperationServerIndices` and `sw.ContextOperationServerVariables` context maps. +Similar rules for overriding default operation server index and variables applies by using `iwfidl.ContextOperationServerIndices` and `iwfidl.ContextOperationServerVariables` context maps. ```golang ctx := context.WithValue(context.Background(), iwfidl.ContextOperationServerIndices, map[string]int{ diff --git a/gen/iwfidl/api/openapi.yaml b/gen/iwfidl/api/openapi.yaml index 43d150f..183e877 100644 --- a/gen/iwfidl/api/openapi.yaml +++ b/gen/iwfidl/api/openapi.yaml @@ -438,7 +438,7 @@ components: valueType: null integerValue: 1 boolValue: true - doubleValue: 1.0246457001441578 + doubleValue: 1.4894159098541704 stringArrayValue: - stringArrayValue - stringArrayValue @@ -485,10 +485,10 @@ components: type: object WorkflowRetryPolicy: example: - maximumAttempts: 7 - initialIntervalSeconds: 3 - maximumIntervalSeconds: 4 - backoffCoefficient: 2.027123 + maximumAttempts: 1 + initialIntervalSeconds: 2 + maximumIntervalSeconds: 7 + backoffCoefficient: 4.145608 properties: initialIntervalSeconds: type: integer @@ -573,22 +573,23 @@ components: type: object WorkflowStartOptions: example: + workflowStartDelaySeconds: 3 retryPolicy: - maximumAttempts: 7 - initialIntervalSeconds: 3 - maximumIntervalSeconds: 4 - backoffCoefficient: 2.027123 + maximumAttempts: 1 + initialIntervalSeconds: 2 + maximumIntervalSeconds: 7 + backoffCoefficient: 4.145608 workflowConfigOverride: disableSystemSearchAttribute: true - continueAsNewThreshold: 1 - continueAsNewPageSizeInBytes: 6 + continueAsNewThreshold: 6 + continueAsNewPageSizeInBytes: 7 idReusePolicy: null searchAttributes: - stringValue: stringValue valueType: null integerValue: 1 boolValue: true - doubleValue: 1.0246457001441578 + doubleValue: 1.4894159098541704 stringArrayValue: - stringArrayValue - stringArrayValue @@ -597,7 +598,7 @@ components: valueType: null integerValue: 1 boolValue: true - doubleValue: 1.0246457001441578 + doubleValue: 1.4894159098541704 stringArrayValue: - stringArrayValue - stringArrayValue @@ -609,6 +610,9 @@ components: $ref: '#/components/schemas/IDReusePolicy' cronSchedule: type: string + workflowStartDelaySeconds: + format: int32 + type: integer retryPolicy: $ref: '#/components/schemas/WorkflowRetryPolicy' searchAttributes: @@ -741,22 +745,23 @@ components: persistenceLoadingType: null iwfWorkflowType: iwfWorkflowType workflowStartOptions: + workflowStartDelaySeconds: 3 retryPolicy: - maximumAttempts: 7 - initialIntervalSeconds: 3 - maximumIntervalSeconds: 4 - backoffCoefficient: 2.027123 + maximumAttempts: 1 + initialIntervalSeconds: 2 + maximumIntervalSeconds: 7 + backoffCoefficient: 4.145608 workflowConfigOverride: disableSystemSearchAttribute: true - continueAsNewThreshold: 1 - continueAsNewPageSizeInBytes: 6 + continueAsNewThreshold: 6 + continueAsNewPageSizeInBytes: 7 idReusePolicy: null searchAttributes: - stringValue: stringValue valueType: null integerValue: 1 boolValue: true - doubleValue: 1.0246457001441578 + doubleValue: 1.4894159098541704 stringArrayValue: - stringArrayValue - stringArrayValue @@ -765,7 +770,7 @@ components: valueType: null integerValue: 1 boolValue: true - doubleValue: 1.0246457001441578 + doubleValue: 1.4894159098541704 stringArrayValue: - stringArrayValue - stringArrayValue @@ -923,7 +928,7 @@ components: valueType: null integerValue: 1 boolValue: true - doubleValue: 1.0246457001441578 + doubleValue: 1.4894159098541704 stringArrayValue: - stringArrayValue - stringArrayValue @@ -932,7 +937,7 @@ components: valueType: null integerValue: 1 boolValue: true - doubleValue: 1.0246457001441578 + doubleValue: 1.4894159098541704 stringArrayValue: - stringArrayValue - stringArrayValue @@ -1249,7 +1254,7 @@ components: valueType: null integerValue: 1 boolValue: true - doubleValue: 1.0246457001441578 + doubleValue: 1.4894159098541704 stringArrayValue: - stringArrayValue - stringArrayValue @@ -1258,7 +1263,7 @@ components: valueType: null integerValue: 1 boolValue: true - doubleValue: 1.0246457001441578 + doubleValue: 1.4894159098541704 stringArrayValue: - stringArrayValue - stringArrayValue @@ -1305,7 +1310,7 @@ components: valueType: null integerValue: 1 boolValue: true - doubleValue: 1.0246457001441578 + doubleValue: 1.4894159098541704 stringArrayValue: - stringArrayValue - stringArrayValue @@ -1314,7 +1319,7 @@ components: valueType: null integerValue: 1 boolValue: true - doubleValue: 1.0246457001441578 + doubleValue: 1.4894159098541704 stringArrayValue: - stringArrayValue - stringArrayValue @@ -1494,7 +1499,7 @@ components: valueType: null integerValue: 1 boolValue: true - doubleValue: 1.0246457001441578 + doubleValue: 1.4894159098541704 stringArrayValue: - stringArrayValue - stringArrayValue @@ -1503,7 +1508,7 @@ components: valueType: null integerValue: 1 boolValue: true - doubleValue: 1.0246457001441578 + doubleValue: 1.4894159098541704 stringArrayValue: - stringArrayValue - stringArrayValue @@ -1559,8 +1564,8 @@ components: example: workflowConfig: disableSystemSearchAttribute: true - continueAsNewThreshold: 1 - continueAsNewPageSizeInBytes: 6 + continueAsNewThreshold: 6 + continueAsNewPageSizeInBytes: 7 workflowRunId: workflowRunId workflowId: workflowId properties: @@ -1581,7 +1586,7 @@ components: valueType: null integerValue: 1 boolValue: true - doubleValue: 1.0246457001441578 + doubleValue: 1.4894159098541704 stringArrayValue: - stringArrayValue - stringArrayValue @@ -1590,7 +1595,7 @@ components: valueType: null integerValue: 1 boolValue: true - doubleValue: 1.0246457001441578 + doubleValue: 1.4894159098541704 stringArrayValue: - stringArrayValue - stringArrayValue @@ -1737,7 +1742,7 @@ components: valueType: null integerValue: 1 boolValue: true - doubleValue: 1.0246457001441578 + doubleValue: 1.4894159098541704 stringArrayValue: - stringArrayValue - stringArrayValue @@ -1746,7 +1751,7 @@ components: valueType: null integerValue: 1 boolValue: true - doubleValue: 1.0246457001441578 + doubleValue: 1.4894159098541704 stringArrayValue: - stringArrayValue - stringArrayValue @@ -1798,7 +1803,7 @@ components: valueType: null integerValue: 1 boolValue: true - doubleValue: 1.0246457001441578 + doubleValue: 1.4894159098541704 stringArrayValue: - stringArrayValue - stringArrayValue @@ -1807,7 +1812,7 @@ components: valueType: null integerValue: 1 boolValue: true - doubleValue: 1.0246457001441578 + doubleValue: 1.4894159098541704 stringArrayValue: - stringArrayValue - stringArrayValue @@ -2396,8 +2401,8 @@ components: WorkflowConfig: example: disableSystemSearchAttribute: true - continueAsNewThreshold: 1 - continueAsNewPageSizeInBytes: 6 + continueAsNewThreshold: 6 + continueAsNewPageSizeInBytes: 7 properties: disableSystemSearchAttribute: type: boolean diff --git a/gen/iwfidl/client.go b/gen/iwfidl/client.go index 3191b8c..f94f021 100644 --- a/gen/iwfidl/client.go +++ b/gen/iwfidl/client.go @@ -34,8 +34,8 @@ import ( ) var ( - jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?json)`) - xmlCheck = regexp.MustCompile(`(?i:(?:application|text)/xml)`) + JsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:[^;]+\+)?json)`) + XmlCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:[^;]+\+)?xml)`) queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`) queryDescape = strings.NewReplacer("%5B", "[", "%5D", "]") ) @@ -435,7 +435,6 @@ func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err err return } _, err = f.Seek(0, io.SeekStart) - err = os.Remove(f.Name()) return } if f, ok := v.(**os.File); ok { @@ -448,16 +447,15 @@ func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err err return } _, err = (*f).Seek(0, io.SeekStart) - err = os.Remove((*f).Name()) return } - if xmlCheck.MatchString(contentType) { + if XmlCheck.MatchString(contentType) { if err = xml.Unmarshal(b, v); err != nil { return err } return nil } - if jsonCheck.MatchString(contentType) { + if JsonCheck.MatchString(contentType) { if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined if err = unmarshalObj.UnmarshalJSON(b); err != nil { @@ -522,9 +520,9 @@ func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err e _, err = bodyBuf.WriteString(s) } else if s, ok := body.(*string); ok { _, err = bodyBuf.WriteString(*s) - } else if jsonCheck.MatchString(contentType) { + } else if JsonCheck.MatchString(contentType) { err = json.NewEncoder(bodyBuf).Encode(body) - } else if xmlCheck.MatchString(contentType) { + } else if XmlCheck.MatchString(contentType) { var bs []byte bs, err = xml.Marshal(body) if err == nil { diff --git a/gen/iwfidl/docs/WorkflowStartOptions.md b/gen/iwfidl/docs/WorkflowStartOptions.md index 304c888..22baae7 100644 --- a/gen/iwfidl/docs/WorkflowStartOptions.md +++ b/gen/iwfidl/docs/WorkflowStartOptions.md @@ -6,6 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **IdReusePolicy** | Pointer to [**IDReusePolicy**](IDReusePolicy.md) | | [optional] **CronSchedule** | Pointer to **string** | | [optional] +**WorkflowStartDelaySeconds** | Pointer to **int32** | | [optional] **RetryPolicy** | Pointer to [**WorkflowRetryPolicy**](WorkflowRetryPolicy.md) | | [optional] **SearchAttributes** | Pointer to [**[]SearchAttribute**](SearchAttribute.md) | | [optional] **WorkflowConfigOverride** | Pointer to [**WorkflowConfig**](WorkflowConfig.md) | | [optional] @@ -80,6 +81,31 @@ SetCronSchedule sets CronSchedule field to given value. HasCronSchedule returns a boolean if a field has been set. +### GetWorkflowStartDelaySeconds + +`func (o *WorkflowStartOptions) GetWorkflowStartDelaySeconds() int32` + +GetWorkflowStartDelaySeconds returns the WorkflowStartDelaySeconds field if non-nil, zero value otherwise. + +### GetWorkflowStartDelaySecondsOk + +`func (o *WorkflowStartOptions) GetWorkflowStartDelaySecondsOk() (*int32, bool)` + +GetWorkflowStartDelaySecondsOk returns a tuple with the WorkflowStartDelaySeconds field if it's non-nil, zero value otherwise +and a boolean to check if the value has been set. + +### SetWorkflowStartDelaySeconds + +`func (o *WorkflowStartOptions) SetWorkflowStartDelaySeconds(v int32)` + +SetWorkflowStartDelaySeconds sets WorkflowStartDelaySeconds field to given value. + +### HasWorkflowStartDelaySeconds + +`func (o *WorkflowStartOptions) HasWorkflowStartDelaySeconds() bool` + +HasWorkflowStartDelaySeconds returns a boolean if a field has been set. + ### GetRetryPolicy `func (o *WorkflowStartOptions) GetRetryPolicy() WorkflowRetryPolicy` diff --git a/gen/iwfidl/model_command_request.go b/gen/iwfidl/model_command_request.go index b27dbc9..f1af497 100644 --- a/gen/iwfidl/model_command_request.go +++ b/gen/iwfidl/model_command_request.go @@ -12,6 +12,7 @@ package iwfidl import ( "encoding/json" + "fmt" ) // checks if the CommandRequest type satisfies the MappedNullable interface at compile time @@ -26,6 +27,8 @@ type CommandRequest struct { CommandCombinations []CommandCombination `json:"commandCombinations,omitempty"` } +type _CommandRequest CommandRequest + // NewCommandRequest instantiates a new CommandRequest object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -222,6 +225,41 @@ func (o CommandRequest) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +func (o *CommandRequest) UnmarshalJSON(bytes []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "commandWaitingType", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(bytes, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCommandRequest := _CommandRequest{} + + err = json.Unmarshal(bytes, &varCommandRequest) + + if err != nil { + return err + } + + *o = CommandRequest(varCommandRequest) + + return err +} + type NullableCommandRequest struct { value *CommandRequest isSet bool diff --git a/gen/iwfidl/model_context.go b/gen/iwfidl/model_context.go index 7f61614..e0fdd63 100644 --- a/gen/iwfidl/model_context.go +++ b/gen/iwfidl/model_context.go @@ -12,6 +12,7 @@ package iwfidl import ( "encoding/json" + "fmt" ) // checks if the Context type satisfies the MappedNullable interface at compile time @@ -27,6 +28,8 @@ type Context struct { Attempt *int32 `json:"attempt,omitempty"` } +type _Context Context + // NewContext instantiates a new Context object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -240,6 +243,43 @@ func (o Context) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +func (o *Context) UnmarshalJSON(bytes []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "workflowId", + "workflowRunId", + "workflowStartedTimestamp", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(bytes, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varContext := _Context{} + + err = json.Unmarshal(bytes, &varContext) + + if err != nil { + return err + } + + *o = Context(varContext) + + return err +} + type NullableContext struct { value *Context isSet bool diff --git a/gen/iwfidl/model_inter_state_channel_command.go b/gen/iwfidl/model_inter_state_channel_command.go index 30affec..894e54a 100644 --- a/gen/iwfidl/model_inter_state_channel_command.go +++ b/gen/iwfidl/model_inter_state_channel_command.go @@ -12,6 +12,7 @@ package iwfidl import ( "encoding/json" + "fmt" ) // checks if the InterStateChannelCommand type satisfies the MappedNullable interface at compile time @@ -23,6 +24,8 @@ type InterStateChannelCommand struct { ChannelName string `json:"channelName"` } +type _InterStateChannelCommand InterStateChannelCommand + // NewInterStateChannelCommand instantiates a new InterStateChannelCommand object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -105,6 +108,42 @@ func (o InterStateChannelCommand) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +func (o *InterStateChannelCommand) UnmarshalJSON(bytes []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "commandId", + "channelName", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(bytes, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varInterStateChannelCommand := _InterStateChannelCommand{} + + err = json.Unmarshal(bytes, &varInterStateChannelCommand) + + if err != nil { + return err + } + + *o = InterStateChannelCommand(varInterStateChannelCommand) + + return err +} + type NullableInterStateChannelCommand struct { value *InterStateChannelCommand isSet bool diff --git a/gen/iwfidl/model_inter_state_channel_publishing.go b/gen/iwfidl/model_inter_state_channel_publishing.go index 86033d4..1e4e6c7 100644 --- a/gen/iwfidl/model_inter_state_channel_publishing.go +++ b/gen/iwfidl/model_inter_state_channel_publishing.go @@ -12,6 +12,7 @@ package iwfidl import ( "encoding/json" + "fmt" ) // checks if the InterStateChannelPublishing type satisfies the MappedNullable interface at compile time @@ -23,6 +24,8 @@ type InterStateChannelPublishing struct { Value *EncodedObject `json:"value,omitempty"` } +type _InterStateChannelPublishing InterStateChannelPublishing + // NewInterStateChannelPublishing instantiates a new InterStateChannelPublishing object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -114,6 +117,41 @@ func (o InterStateChannelPublishing) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +func (o *InterStateChannelPublishing) UnmarshalJSON(bytes []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "channelName", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(bytes, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varInterStateChannelPublishing := _InterStateChannelPublishing{} + + err = json.Unmarshal(bytes, &varInterStateChannelPublishing) + + if err != nil { + return err + } + + *o = InterStateChannelPublishing(varInterStateChannelPublishing) + + return err +} + type NullableInterStateChannelPublishing struct { value *InterStateChannelPublishing isSet bool diff --git a/gen/iwfidl/model_inter_state_channel_result.go b/gen/iwfidl/model_inter_state_channel_result.go index 1e6ff3a..9b2b378 100644 --- a/gen/iwfidl/model_inter_state_channel_result.go +++ b/gen/iwfidl/model_inter_state_channel_result.go @@ -12,6 +12,7 @@ package iwfidl import ( "encoding/json" + "fmt" ) // checks if the InterStateChannelResult type satisfies the MappedNullable interface at compile time @@ -25,6 +26,8 @@ type InterStateChannelResult struct { Value *EncodedObject `json:"value,omitempty"` } +type _InterStateChannelResult InterStateChannelResult + // NewInterStateChannelResult instantiates a new InterStateChannelResult object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -168,6 +171,43 @@ func (o InterStateChannelResult) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +func (o *InterStateChannelResult) UnmarshalJSON(bytes []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "commandId", + "requestStatus", + "channelName", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(bytes, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varInterStateChannelResult := _InterStateChannelResult{} + + err = json.Unmarshal(bytes, &varInterStateChannelResult) + + if err != nil { + return err + } + + *o = InterStateChannelResult(varInterStateChannelResult) + + return err +} + type NullableInterStateChannelResult struct { value *InterStateChannelResult isSet bool diff --git a/gen/iwfidl/model_signal_command.go b/gen/iwfidl/model_signal_command.go index 45b3221..0af4256 100644 --- a/gen/iwfidl/model_signal_command.go +++ b/gen/iwfidl/model_signal_command.go @@ -12,6 +12,7 @@ package iwfidl import ( "encoding/json" + "fmt" ) // checks if the SignalCommand type satisfies the MappedNullable interface at compile time @@ -23,6 +24,8 @@ type SignalCommand struct { SignalChannelName string `json:"signalChannelName"` } +type _SignalCommand SignalCommand + // NewSignalCommand instantiates a new SignalCommand object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -105,6 +108,42 @@ func (o SignalCommand) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +func (o *SignalCommand) UnmarshalJSON(bytes []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "commandId", + "signalChannelName", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(bytes, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varSignalCommand := _SignalCommand{} + + err = json.Unmarshal(bytes, &varSignalCommand) + + if err != nil { + return err + } + + *o = SignalCommand(varSignalCommand) + + return err +} + type NullableSignalCommand struct { value *SignalCommand isSet bool diff --git a/gen/iwfidl/model_signal_result.go b/gen/iwfidl/model_signal_result.go index 5aea632..41940ae 100644 --- a/gen/iwfidl/model_signal_result.go +++ b/gen/iwfidl/model_signal_result.go @@ -12,6 +12,7 @@ package iwfidl import ( "encoding/json" + "fmt" ) // checks if the SignalResult type satisfies the MappedNullable interface at compile time @@ -25,6 +26,8 @@ type SignalResult struct { SignalValue *EncodedObject `json:"signalValue,omitempty"` } +type _SignalResult SignalResult + // NewSignalResult instantiates a new SignalResult object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -168,6 +171,43 @@ func (o SignalResult) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +func (o *SignalResult) UnmarshalJSON(bytes []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "commandId", + "signalRequestStatus", + "signalChannelName", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(bytes, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varSignalResult := _SignalResult{} + + err = json.Unmarshal(bytes, &varSignalResult) + + if err != nil { + return err + } + + *o = SignalResult(varSignalResult) + + return err +} + type NullableSignalResult struct { value *SignalResult isSet bool diff --git a/gen/iwfidl/model_state_completion_output.go b/gen/iwfidl/model_state_completion_output.go index d86b6cc..f15187b 100644 --- a/gen/iwfidl/model_state_completion_output.go +++ b/gen/iwfidl/model_state_completion_output.go @@ -12,6 +12,7 @@ package iwfidl import ( "encoding/json" + "fmt" ) // checks if the StateCompletionOutput type satisfies the MappedNullable interface at compile time @@ -24,6 +25,8 @@ type StateCompletionOutput struct { CompletedStateOutput *EncodedObject `json:"completedStateOutput,omitempty"` } +type _StateCompletionOutput StateCompletionOutput + // NewStateCompletionOutput instantiates a new StateCompletionOutput object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -141,6 +144,42 @@ func (o StateCompletionOutput) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +func (o *StateCompletionOutput) UnmarshalJSON(bytes []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "completedStateId", + "completedStateExecutionId", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(bytes, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varStateCompletionOutput := _StateCompletionOutput{} + + err = json.Unmarshal(bytes, &varStateCompletionOutput) + + if err != nil { + return err + } + + *o = StateCompletionOutput(varStateCompletionOutput) + + return err +} + type NullableStateCompletionOutput struct { value *StateCompletionOutput isSet bool diff --git a/gen/iwfidl/model_state_movement.go b/gen/iwfidl/model_state_movement.go index 46e6006..ee3e879 100644 --- a/gen/iwfidl/model_state_movement.go +++ b/gen/iwfidl/model_state_movement.go @@ -12,6 +12,7 @@ package iwfidl import ( "encoding/json" + "fmt" ) // checks if the StateMovement type satisfies the MappedNullable interface at compile time @@ -24,6 +25,8 @@ type StateMovement struct { StateOptions *WorkflowStateOptions `json:"stateOptions,omitempty"` } +type _StateMovement StateMovement + // NewStateMovement instantiates a new StateMovement object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -150,6 +153,41 @@ func (o StateMovement) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +func (o *StateMovement) UnmarshalJSON(bytes []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "stateId", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(bytes, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varStateMovement := _StateMovement{} + + err = json.Unmarshal(bytes, &varStateMovement) + + if err != nil { + return err + } + + *o = StateMovement(varStateMovement) + + return err +} + type NullableStateMovement struct { value *StateMovement isSet bool diff --git a/gen/iwfidl/model_timer_command.go b/gen/iwfidl/model_timer_command.go index 0ff406a..f4f8e1e 100644 --- a/gen/iwfidl/model_timer_command.go +++ b/gen/iwfidl/model_timer_command.go @@ -12,6 +12,7 @@ package iwfidl import ( "encoding/json" + "fmt" ) // checks if the TimerCommand type satisfies the MappedNullable interface at compile time @@ -23,6 +24,8 @@ type TimerCommand struct { FiringUnixTimestampSeconds int64 `json:"firingUnixTimestampSeconds"` } +type _TimerCommand TimerCommand + // NewTimerCommand instantiates a new TimerCommand object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -105,6 +108,42 @@ func (o TimerCommand) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +func (o *TimerCommand) UnmarshalJSON(bytes []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "commandId", + "firingUnixTimestampSeconds", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(bytes, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varTimerCommand := _TimerCommand{} + + err = json.Unmarshal(bytes, &varTimerCommand) + + if err != nil { + return err + } + + *o = TimerCommand(varTimerCommand) + + return err +} + type NullableTimerCommand struct { value *TimerCommand isSet bool diff --git a/gen/iwfidl/model_timer_result.go b/gen/iwfidl/model_timer_result.go index db4380b..2ef63e8 100644 --- a/gen/iwfidl/model_timer_result.go +++ b/gen/iwfidl/model_timer_result.go @@ -12,6 +12,7 @@ package iwfidl import ( "encoding/json" + "fmt" ) // checks if the TimerResult type satisfies the MappedNullable interface at compile time @@ -23,6 +24,8 @@ type TimerResult struct { TimerStatus TimerStatus `json:"timerStatus"` } +type _TimerResult TimerResult + // NewTimerResult instantiates a new TimerResult object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -105,6 +108,42 @@ func (o TimerResult) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +func (o *TimerResult) UnmarshalJSON(bytes []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "commandId", + "timerStatus", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(bytes, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varTimerResult := _TimerResult{} + + err = json.Unmarshal(bytes, &varTimerResult) + + if err != nil { + return err + } + + *o = TimerResult(varTimerResult) + + return err +} + type NullableTimerResult struct { value *TimerResult isSet bool diff --git a/gen/iwfidl/model_workflow_config_update_request.go b/gen/iwfidl/model_workflow_config_update_request.go index 0877a5e..68d4703 100644 --- a/gen/iwfidl/model_workflow_config_update_request.go +++ b/gen/iwfidl/model_workflow_config_update_request.go @@ -12,6 +12,7 @@ package iwfidl import ( "encoding/json" + "fmt" ) // checks if the WorkflowConfigUpdateRequest type satisfies the MappedNullable interface at compile time @@ -24,6 +25,8 @@ type WorkflowConfigUpdateRequest struct { WorkflowConfig WorkflowConfig `json:"workflowConfig"` } +type _WorkflowConfigUpdateRequest WorkflowConfigUpdateRequest + // NewWorkflowConfigUpdateRequest instantiates a new WorkflowConfigUpdateRequest object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -141,6 +144,42 @@ func (o WorkflowConfigUpdateRequest) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +func (o *WorkflowConfigUpdateRequest) UnmarshalJSON(bytes []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "workflowId", + "workflowConfig", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(bytes, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWorkflowConfigUpdateRequest := _WorkflowConfigUpdateRequest{} + + err = json.Unmarshal(bytes, &varWorkflowConfigUpdateRequest) + + if err != nil { + return err + } + + *o = WorkflowConfigUpdateRequest(varWorkflowConfigUpdateRequest) + + return err +} + type NullableWorkflowConfigUpdateRequest struct { value *WorkflowConfigUpdateRequest isSet bool diff --git a/gen/iwfidl/model_workflow_dump_request.go b/gen/iwfidl/model_workflow_dump_request.go index 671c539..678dedd 100644 --- a/gen/iwfidl/model_workflow_dump_request.go +++ b/gen/iwfidl/model_workflow_dump_request.go @@ -12,6 +12,7 @@ package iwfidl import ( "encoding/json" + "fmt" ) // checks if the WorkflowDumpRequest type satisfies the MappedNullable interface at compile time @@ -25,6 +26,8 @@ type WorkflowDumpRequest struct { PageNum int32 `json:"pageNum"` } +type _WorkflowDumpRequest WorkflowDumpRequest + // NewWorkflowDumpRequest instantiates a new WorkflowDumpRequest object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -159,6 +162,44 @@ func (o WorkflowDumpRequest) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +func (o *WorkflowDumpRequest) UnmarshalJSON(bytes []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "workflowId", + "workflowRunId", + "pageSizeInBytes", + "pageNum", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(bytes, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWorkflowDumpRequest := _WorkflowDumpRequest{} + + err = json.Unmarshal(bytes, &varWorkflowDumpRequest) + + if err != nil { + return err + } + + *o = WorkflowDumpRequest(varWorkflowDumpRequest) + + return err +} + type NullableWorkflowDumpRequest struct { value *WorkflowDumpRequest isSet bool diff --git a/gen/iwfidl/model_workflow_dump_response.go b/gen/iwfidl/model_workflow_dump_response.go index c816f67..6b39a0e 100644 --- a/gen/iwfidl/model_workflow_dump_response.go +++ b/gen/iwfidl/model_workflow_dump_response.go @@ -12,6 +12,7 @@ package iwfidl import ( "encoding/json" + "fmt" ) // checks if the WorkflowDumpResponse type satisfies the MappedNullable interface at compile time @@ -24,6 +25,8 @@ type WorkflowDumpResponse struct { JsonData string `json:"jsonData"` } +type _WorkflowDumpResponse WorkflowDumpResponse + // NewWorkflowDumpResponse instantiates a new WorkflowDumpResponse object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -132,6 +135,43 @@ func (o WorkflowDumpResponse) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +func (o *WorkflowDumpResponse) UnmarshalJSON(bytes []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "checksum", + "totalPages", + "jsonData", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(bytes, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWorkflowDumpResponse := _WorkflowDumpResponse{} + + err = json.Unmarshal(bytes, &varWorkflowDumpResponse) + + if err != nil { + return err + } + + *o = WorkflowDumpResponse(varWorkflowDumpResponse) + + return err +} + type NullableWorkflowDumpResponse struct { value *WorkflowDumpResponse isSet bool diff --git a/gen/iwfidl/model_workflow_get_data_objects_request.go b/gen/iwfidl/model_workflow_get_data_objects_request.go index 0c7aea7..8f793f6 100644 --- a/gen/iwfidl/model_workflow_get_data_objects_request.go +++ b/gen/iwfidl/model_workflow_get_data_objects_request.go @@ -12,6 +12,7 @@ package iwfidl import ( "encoding/json" + "fmt" ) // checks if the WorkflowGetDataObjectsRequest type satisfies the MappedNullable interface at compile time @@ -25,6 +26,8 @@ type WorkflowGetDataObjectsRequest struct { UseMemoForDataAttributes *bool `json:"useMemoForDataAttributes,omitempty"` } +type _WorkflowGetDataObjectsRequest WorkflowGetDataObjectsRequest + // NewWorkflowGetDataObjectsRequest instantiates a new WorkflowGetDataObjectsRequest object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -186,6 +189,41 @@ func (o WorkflowGetDataObjectsRequest) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +func (o *WorkflowGetDataObjectsRequest) UnmarshalJSON(bytes []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "workflowId", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(bytes, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWorkflowGetDataObjectsRequest := _WorkflowGetDataObjectsRequest{} + + err = json.Unmarshal(bytes, &varWorkflowGetDataObjectsRequest) + + if err != nil { + return err + } + + *o = WorkflowGetDataObjectsRequest(varWorkflowGetDataObjectsRequest) + + return err +} + type NullableWorkflowGetDataObjectsRequest struct { value *WorkflowGetDataObjectsRequest isSet bool diff --git a/gen/iwfidl/model_workflow_get_request.go b/gen/iwfidl/model_workflow_get_request.go index 4eb209b..684491f 100644 --- a/gen/iwfidl/model_workflow_get_request.go +++ b/gen/iwfidl/model_workflow_get_request.go @@ -12,6 +12,7 @@ package iwfidl import ( "encoding/json" + "fmt" ) // checks if the WorkflowGetRequest type satisfies the MappedNullable interface at compile time @@ -25,6 +26,8 @@ type WorkflowGetRequest struct { WaitTimeSeconds *int32 `json:"waitTimeSeconds,omitempty"` } +type _WorkflowGetRequest WorkflowGetRequest + // NewWorkflowGetRequest instantiates a new WorkflowGetRequest object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -186,6 +189,41 @@ func (o WorkflowGetRequest) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +func (o *WorkflowGetRequest) UnmarshalJSON(bytes []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "workflowId", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(bytes, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWorkflowGetRequest := _WorkflowGetRequest{} + + err = json.Unmarshal(bytes, &varWorkflowGetRequest) + + if err != nil { + return err + } + + *o = WorkflowGetRequest(varWorkflowGetRequest) + + return err +} + type NullableWorkflowGetRequest struct { value *WorkflowGetRequest isSet bool diff --git a/gen/iwfidl/model_workflow_get_response.go b/gen/iwfidl/model_workflow_get_response.go index 0f78cf9..e3bcb03 100644 --- a/gen/iwfidl/model_workflow_get_response.go +++ b/gen/iwfidl/model_workflow_get_response.go @@ -12,6 +12,7 @@ package iwfidl import ( "encoding/json" + "fmt" ) // checks if the WorkflowGetResponse type satisfies the MappedNullable interface at compile time @@ -26,6 +27,8 @@ type WorkflowGetResponse struct { ErrorMessage *string `json:"errorMessage,omitempty"` } +type _WorkflowGetResponse WorkflowGetResponse + // NewWorkflowGetResponse instantiates a new WorkflowGetResponse object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -213,6 +216,42 @@ func (o WorkflowGetResponse) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +func (o *WorkflowGetResponse) UnmarshalJSON(bytes []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "workflowRunId", + "workflowStatus", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(bytes, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWorkflowGetResponse := _WorkflowGetResponse{} + + err = json.Unmarshal(bytes, &varWorkflowGetResponse) + + if err != nil { + return err + } + + *o = WorkflowGetResponse(varWorkflowGetResponse) + + return err +} + type NullableWorkflowGetResponse struct { value *WorkflowGetResponse isSet bool diff --git a/gen/iwfidl/model_workflow_get_search_attributes_request.go b/gen/iwfidl/model_workflow_get_search_attributes_request.go index 4f4d9f3..434b5cb 100644 --- a/gen/iwfidl/model_workflow_get_search_attributes_request.go +++ b/gen/iwfidl/model_workflow_get_search_attributes_request.go @@ -12,6 +12,7 @@ package iwfidl import ( "encoding/json" + "fmt" ) // checks if the WorkflowGetSearchAttributesRequest type satisfies the MappedNullable interface at compile time @@ -24,6 +25,8 @@ type WorkflowGetSearchAttributesRequest struct { Keys []SearchAttributeKeyAndType `json:"keys,omitempty"` } +type _WorkflowGetSearchAttributesRequest WorkflowGetSearchAttributesRequest + // NewWorkflowGetSearchAttributesRequest instantiates a new WorkflowGetSearchAttributesRequest object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -150,6 +153,41 @@ func (o WorkflowGetSearchAttributesRequest) ToMap() (map[string]interface{}, err return toSerialize, nil } +func (o *WorkflowGetSearchAttributesRequest) UnmarshalJSON(bytes []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "workflowId", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(bytes, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWorkflowGetSearchAttributesRequest := _WorkflowGetSearchAttributesRequest{} + + err = json.Unmarshal(bytes, &varWorkflowGetSearchAttributesRequest) + + if err != nil { + return err + } + + *o = WorkflowGetSearchAttributesRequest(varWorkflowGetSearchAttributesRequest) + + return err +} + type NullableWorkflowGetSearchAttributesRequest struct { value *WorkflowGetSearchAttributesRequest isSet bool diff --git a/gen/iwfidl/model_workflow_reset_request.go b/gen/iwfidl/model_workflow_reset_request.go index ac6f7df..bf3242b 100644 --- a/gen/iwfidl/model_workflow_reset_request.go +++ b/gen/iwfidl/model_workflow_reset_request.go @@ -12,6 +12,7 @@ package iwfidl import ( "encoding/json" + "fmt" ) // checks if the WorkflowResetRequest type satisfies the MappedNullable interface at compile time @@ -30,6 +31,8 @@ type WorkflowResetRequest struct { SkipSignalReapply *bool `json:"skipSignalReapply,omitempty"` } +type _WorkflowResetRequest WorkflowResetRequest + // NewWorkflowResetRequest instantiates a new WorkflowResetRequest object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -357,6 +360,42 @@ func (o WorkflowResetRequest) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +func (o *WorkflowResetRequest) UnmarshalJSON(bytes []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "workflowId", + "resetType", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(bytes, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWorkflowResetRequest := _WorkflowResetRequest{} + + err = json.Unmarshal(bytes, &varWorkflowResetRequest) + + if err != nil { + return err + } + + *o = WorkflowResetRequest(varWorkflowResetRequest) + + return err +} + type NullableWorkflowResetRequest struct { value *WorkflowResetRequest isSet bool diff --git a/gen/iwfidl/model_workflow_reset_response.go b/gen/iwfidl/model_workflow_reset_response.go index a74514a..a407603 100644 --- a/gen/iwfidl/model_workflow_reset_response.go +++ b/gen/iwfidl/model_workflow_reset_response.go @@ -12,6 +12,7 @@ package iwfidl import ( "encoding/json" + "fmt" ) // checks if the WorkflowResetResponse type satisfies the MappedNullable interface at compile time @@ -22,6 +23,8 @@ type WorkflowResetResponse struct { WorkflowRunId string `json:"workflowRunId"` } +type _WorkflowResetResponse WorkflowResetResponse + // NewWorkflowResetResponse instantiates a new WorkflowResetResponse object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -78,6 +81,41 @@ func (o WorkflowResetResponse) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +func (o *WorkflowResetResponse) UnmarshalJSON(bytes []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "workflowRunId", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(bytes, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWorkflowResetResponse := _WorkflowResetResponse{} + + err = json.Unmarshal(bytes, &varWorkflowResetResponse) + + if err != nil { + return err + } + + *o = WorkflowResetResponse(varWorkflowResetResponse) + + return err +} + type NullableWorkflowResetResponse struct { value *WorkflowResetResponse isSet bool diff --git a/gen/iwfidl/model_workflow_rpc_request.go b/gen/iwfidl/model_workflow_rpc_request.go index 1bd94f2..8fe4023 100644 --- a/gen/iwfidl/model_workflow_rpc_request.go +++ b/gen/iwfidl/model_workflow_rpc_request.go @@ -12,6 +12,7 @@ package iwfidl import ( "encoding/json" + "fmt" ) // checks if the WorkflowRpcRequest type satisfies the MappedNullable interface at compile time @@ -30,6 +31,8 @@ type WorkflowRpcRequest struct { SearchAttributes []SearchAttributeKeyAndType `json:"searchAttributes,omitempty"` } +type _WorkflowRpcRequest WorkflowRpcRequest + // NewWorkflowRpcRequest instantiates a new WorkflowRpcRequest object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -357,6 +360,42 @@ func (o WorkflowRpcRequest) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +func (o *WorkflowRpcRequest) UnmarshalJSON(bytes []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "workflowId", + "rpcName", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(bytes, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWorkflowRpcRequest := _WorkflowRpcRequest{} + + err = json.Unmarshal(bytes, &varWorkflowRpcRequest) + + if err != nil { + return err + } + + *o = WorkflowRpcRequest(varWorkflowRpcRequest) + + return err +} + type NullableWorkflowRpcRequest struct { value *WorkflowRpcRequest isSet bool diff --git a/gen/iwfidl/model_workflow_search_request.go b/gen/iwfidl/model_workflow_search_request.go index 7172020..f697eb7 100644 --- a/gen/iwfidl/model_workflow_search_request.go +++ b/gen/iwfidl/model_workflow_search_request.go @@ -12,6 +12,7 @@ package iwfidl import ( "encoding/json" + "fmt" ) // checks if the WorkflowSearchRequest type satisfies the MappedNullable interface at compile time @@ -24,6 +25,8 @@ type WorkflowSearchRequest struct { NextPageToken *string `json:"nextPageToken,omitempty"` } +type _WorkflowSearchRequest WorkflowSearchRequest + // NewWorkflowSearchRequest instantiates a new WorkflowSearchRequest object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -150,6 +153,41 @@ func (o WorkflowSearchRequest) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +func (o *WorkflowSearchRequest) UnmarshalJSON(bytes []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "query", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(bytes, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWorkflowSearchRequest := _WorkflowSearchRequest{} + + err = json.Unmarshal(bytes, &varWorkflowSearchRequest) + + if err != nil { + return err + } + + *o = WorkflowSearchRequest(varWorkflowSearchRequest) + + return err +} + type NullableWorkflowSearchRequest struct { value *WorkflowSearchRequest isSet bool diff --git a/gen/iwfidl/model_workflow_search_response_entry.go b/gen/iwfidl/model_workflow_search_response_entry.go index 819a8f3..f619d41 100644 --- a/gen/iwfidl/model_workflow_search_response_entry.go +++ b/gen/iwfidl/model_workflow_search_response_entry.go @@ -12,6 +12,7 @@ package iwfidl import ( "encoding/json" + "fmt" ) // checks if the WorkflowSearchResponseEntry type satisfies the MappedNullable interface at compile time @@ -23,6 +24,8 @@ type WorkflowSearchResponseEntry struct { WorkflowRunId string `json:"workflowRunId"` } +type _WorkflowSearchResponseEntry WorkflowSearchResponseEntry + // NewWorkflowSearchResponseEntry instantiates a new WorkflowSearchResponseEntry object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -105,6 +108,42 @@ func (o WorkflowSearchResponseEntry) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +func (o *WorkflowSearchResponseEntry) UnmarshalJSON(bytes []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "workflowId", + "workflowRunId", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(bytes, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWorkflowSearchResponseEntry := _WorkflowSearchResponseEntry{} + + err = json.Unmarshal(bytes, &varWorkflowSearchResponseEntry) + + if err != nil { + return err + } + + *o = WorkflowSearchResponseEntry(varWorkflowSearchResponseEntry) + + return err +} + type NullableWorkflowSearchResponseEntry struct { value *WorkflowSearchResponseEntry isSet bool diff --git a/gen/iwfidl/model_workflow_signal_request.go b/gen/iwfidl/model_workflow_signal_request.go index 13ded5a..2eba2b4 100644 --- a/gen/iwfidl/model_workflow_signal_request.go +++ b/gen/iwfidl/model_workflow_signal_request.go @@ -12,6 +12,7 @@ package iwfidl import ( "encoding/json" + "fmt" ) // checks if the WorkflowSignalRequest type satisfies the MappedNullable interface at compile time @@ -25,6 +26,8 @@ type WorkflowSignalRequest struct { SignalValue *EncodedObject `json:"signalValue,omitempty"` } +type _WorkflowSignalRequest WorkflowSignalRequest + // NewWorkflowSignalRequest instantiates a new WorkflowSignalRequest object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -177,6 +180,42 @@ func (o WorkflowSignalRequest) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +func (o *WorkflowSignalRequest) UnmarshalJSON(bytes []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "workflowId", + "signalChannelName", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(bytes, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWorkflowSignalRequest := _WorkflowSignalRequest{} + + err = json.Unmarshal(bytes, &varWorkflowSignalRequest) + + if err != nil { + return err + } + + *o = WorkflowSignalRequest(varWorkflowSignalRequest) + + return err +} + type NullableWorkflowSignalRequest struct { value *WorkflowSignalRequest isSet bool diff --git a/gen/iwfidl/model_workflow_skip_timer_request.go b/gen/iwfidl/model_workflow_skip_timer_request.go index fa29535..f51c246 100644 --- a/gen/iwfidl/model_workflow_skip_timer_request.go +++ b/gen/iwfidl/model_workflow_skip_timer_request.go @@ -12,6 +12,7 @@ package iwfidl import ( "encoding/json" + "fmt" ) // checks if the WorkflowSkipTimerRequest type satisfies the MappedNullable interface at compile time @@ -26,6 +27,8 @@ type WorkflowSkipTimerRequest struct { TimerCommandIndex *int32 `json:"timerCommandIndex,omitempty"` } +type _WorkflowSkipTimerRequest WorkflowSkipTimerRequest + // NewWorkflowSkipTimerRequest instantiates a new WorkflowSkipTimerRequest object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -213,6 +216,42 @@ func (o WorkflowSkipTimerRequest) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +func (o *WorkflowSkipTimerRequest) UnmarshalJSON(bytes []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "workflowId", + "workflowStateExecutionId", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(bytes, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWorkflowSkipTimerRequest := _WorkflowSkipTimerRequest{} + + err = json.Unmarshal(bytes, &varWorkflowSkipTimerRequest) + + if err != nil { + return err + } + + *o = WorkflowSkipTimerRequest(varWorkflowSkipTimerRequest) + + return err +} + type NullableWorkflowSkipTimerRequest struct { value *WorkflowSkipTimerRequest isSet bool diff --git a/gen/iwfidl/model_workflow_start_options.go b/gen/iwfidl/model_workflow_start_options.go index fb68bf3..b9856e6 100644 --- a/gen/iwfidl/model_workflow_start_options.go +++ b/gen/iwfidl/model_workflow_start_options.go @@ -19,12 +19,13 @@ var _ MappedNullable = &WorkflowStartOptions{} // WorkflowStartOptions struct for WorkflowStartOptions type WorkflowStartOptions struct { - IdReusePolicy *IDReusePolicy `json:"idReusePolicy,omitempty"` - CronSchedule *string `json:"cronSchedule,omitempty"` - RetryPolicy *WorkflowRetryPolicy `json:"retryPolicy,omitempty"` - SearchAttributes []SearchAttribute `json:"searchAttributes,omitempty"` - WorkflowConfigOverride *WorkflowConfig `json:"workflowConfigOverride,omitempty"` - UseMemoForDataAttributes *bool `json:"useMemoForDataAttributes,omitempty"` + IdReusePolicy *IDReusePolicy `json:"idReusePolicy,omitempty"` + CronSchedule *string `json:"cronSchedule,omitempty"` + WorkflowStartDelaySeconds *int32 `json:"workflowStartDelaySeconds,omitempty"` + RetryPolicy *WorkflowRetryPolicy `json:"retryPolicy,omitempty"` + SearchAttributes []SearchAttribute `json:"searchAttributes,omitempty"` + WorkflowConfigOverride *WorkflowConfig `json:"workflowConfigOverride,omitempty"` + UseMemoForDataAttributes *bool `json:"useMemoForDataAttributes,omitempty"` } // NewWorkflowStartOptions instantiates a new WorkflowStartOptions object @@ -108,6 +109,38 @@ func (o *WorkflowStartOptions) SetCronSchedule(v string) { o.CronSchedule = &v } +// GetWorkflowStartDelaySeconds returns the WorkflowStartDelaySeconds field value if set, zero value otherwise. +func (o *WorkflowStartOptions) GetWorkflowStartDelaySeconds() int32 { + if o == nil || IsNil(o.WorkflowStartDelaySeconds) { + var ret int32 + return ret + } + return *o.WorkflowStartDelaySeconds +} + +// GetWorkflowStartDelaySecondsOk returns a tuple with the WorkflowStartDelaySeconds field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *WorkflowStartOptions) GetWorkflowStartDelaySecondsOk() (*int32, bool) { + if o == nil || IsNil(o.WorkflowStartDelaySeconds) { + return nil, false + } + return o.WorkflowStartDelaySeconds, true +} + +// HasWorkflowStartDelaySeconds returns a boolean if a field has been set. +func (o *WorkflowStartOptions) HasWorkflowStartDelaySeconds() bool { + if o != nil && !IsNil(o.WorkflowStartDelaySeconds) { + return true + } + + return false +} + +// SetWorkflowStartDelaySeconds gets a reference to the given int32 and assigns it to the WorkflowStartDelaySeconds field. +func (o *WorkflowStartOptions) SetWorkflowStartDelaySeconds(v int32) { + o.WorkflowStartDelaySeconds = &v +} + // GetRetryPolicy returns the RetryPolicy field value if set, zero value otherwise. func (o *WorkflowStartOptions) GetRetryPolicy() WorkflowRetryPolicy { if o == nil || IsNil(o.RetryPolicy) { @@ -252,6 +285,9 @@ func (o WorkflowStartOptions) ToMap() (map[string]interface{}, error) { if !IsNil(o.CronSchedule) { toSerialize["cronSchedule"] = o.CronSchedule } + if !IsNil(o.WorkflowStartDelaySeconds) { + toSerialize["workflowStartDelaySeconds"] = o.WorkflowStartDelaySeconds + } if !IsNil(o.RetryPolicy) { toSerialize["retryPolicy"] = o.RetryPolicy } diff --git a/gen/iwfidl/model_workflow_start_request.go b/gen/iwfidl/model_workflow_start_request.go index 081f8f7..9d7df70 100644 --- a/gen/iwfidl/model_workflow_start_request.go +++ b/gen/iwfidl/model_workflow_start_request.go @@ -12,6 +12,7 @@ package iwfidl import ( "encoding/json" + "fmt" ) // checks if the WorkflowStartRequest type satisfies the MappedNullable interface at compile time @@ -30,6 +31,8 @@ type WorkflowStartRequest struct { WorkflowStartOptions *WorkflowStartOptions `json:"workflowStartOptions,omitempty"` } +type _WorkflowStartRequest WorkflowStartRequest + // NewWorkflowStartRequest instantiates a new WorkflowStartRequest object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -339,6 +342,44 @@ func (o WorkflowStartRequest) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +func (o *WorkflowStartRequest) UnmarshalJSON(bytes []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "workflowId", + "iwfWorkflowType", + "workflowTimeoutSeconds", + "iwfWorkerUrl", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(bytes, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWorkflowStartRequest := _WorkflowStartRequest{} + + err = json.Unmarshal(bytes, &varWorkflowStartRequest) + + if err != nil { + return err + } + + *o = WorkflowStartRequest(varWorkflowStartRequest) + + return err +} + type NullableWorkflowStartRequest struct { value *WorkflowStartRequest isSet bool diff --git a/gen/iwfidl/model_workflow_state_execute_request.go b/gen/iwfidl/model_workflow_state_execute_request.go index 9bb8745..8dfcda9 100644 --- a/gen/iwfidl/model_workflow_state_execute_request.go +++ b/gen/iwfidl/model_workflow_state_execute_request.go @@ -12,6 +12,7 @@ package iwfidl import ( "encoding/json" + "fmt" ) // checks if the WorkflowStateExecuteRequest type satisfies the MappedNullable interface at compile time @@ -29,6 +30,8 @@ type WorkflowStateExecuteRequest struct { CommandResults *CommandResults `json:"commandResults,omitempty"` } +type _WorkflowStateExecuteRequest WorkflowStateExecuteRequest + // NewWorkflowStateExecuteRequest instantiates a new WorkflowStateExecuteRequest object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -312,6 +315,43 @@ func (o WorkflowStateExecuteRequest) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +func (o *WorkflowStateExecuteRequest) UnmarshalJSON(bytes []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "context", + "workflowType", + "workflowStateId", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(bytes, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWorkflowStateExecuteRequest := _WorkflowStateExecuteRequest{} + + err = json.Unmarshal(bytes, &varWorkflowStateExecuteRequest) + + if err != nil { + return err + } + + *o = WorkflowStateExecuteRequest(varWorkflowStateExecuteRequest) + + return err +} + type NullableWorkflowStateExecuteRequest struct { value *WorkflowStateExecuteRequest isSet bool diff --git a/gen/iwfidl/model_workflow_state_wait_until_request.go b/gen/iwfidl/model_workflow_state_wait_until_request.go index 821cb42..48845cf 100644 --- a/gen/iwfidl/model_workflow_state_wait_until_request.go +++ b/gen/iwfidl/model_workflow_state_wait_until_request.go @@ -12,6 +12,7 @@ package iwfidl import ( "encoding/json" + "fmt" ) // checks if the WorkflowStateWaitUntilRequest type satisfies the MappedNullable interface at compile time @@ -27,6 +28,8 @@ type WorkflowStateWaitUntilRequest struct { DataObjects []KeyValue `json:"dataObjects,omitempty"` } +type _WorkflowStateWaitUntilRequest WorkflowStateWaitUntilRequest + // NewWorkflowStateWaitUntilRequest instantiates a new WorkflowStateWaitUntilRequest object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -240,6 +243,43 @@ func (o WorkflowStateWaitUntilRequest) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +func (o *WorkflowStateWaitUntilRequest) UnmarshalJSON(bytes []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "context", + "workflowType", + "workflowStateId", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(bytes, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWorkflowStateWaitUntilRequest := _WorkflowStateWaitUntilRequest{} + + err = json.Unmarshal(bytes, &varWorkflowStateWaitUntilRequest) + + if err != nil { + return err + } + + *o = WorkflowStateWaitUntilRequest(varWorkflowStateWaitUntilRequest) + + return err +} + type NullableWorkflowStateWaitUntilRequest struct { value *WorkflowStateWaitUntilRequest isSet bool diff --git a/gen/iwfidl/model_workflow_stop_request.go b/gen/iwfidl/model_workflow_stop_request.go index 796dc69..272ce5f 100644 --- a/gen/iwfidl/model_workflow_stop_request.go +++ b/gen/iwfidl/model_workflow_stop_request.go @@ -12,6 +12,7 @@ package iwfidl import ( "encoding/json" + "fmt" ) // checks if the WorkflowStopRequest type satisfies the MappedNullable interface at compile time @@ -25,6 +26,8 @@ type WorkflowStopRequest struct { StopType *WorkflowStopType `json:"stopType,omitempty"` } +type _WorkflowStopRequest WorkflowStopRequest + // NewWorkflowStopRequest instantiates a new WorkflowStopRequest object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -186,6 +189,41 @@ func (o WorkflowStopRequest) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +func (o *WorkflowStopRequest) UnmarshalJSON(bytes []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "workflowId", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(bytes, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWorkflowStopRequest := _WorkflowStopRequest{} + + err = json.Unmarshal(bytes, &varWorkflowStopRequest) + + if err != nil { + return err + } + + *o = WorkflowStopRequest(varWorkflowStopRequest) + + return err +} + type NullableWorkflowStopRequest struct { value *WorkflowStopRequest isSet bool diff --git a/gen/iwfidl/model_workflow_wait_for_state_completion_request.go b/gen/iwfidl/model_workflow_wait_for_state_completion_request.go index d123eac..8da4422 100644 --- a/gen/iwfidl/model_workflow_wait_for_state_completion_request.go +++ b/gen/iwfidl/model_workflow_wait_for_state_completion_request.go @@ -12,6 +12,7 @@ package iwfidl import ( "encoding/json" + "fmt" ) // checks if the WorkflowWaitForStateCompletionRequest type satisfies the MappedNullable interface at compile time @@ -24,6 +25,8 @@ type WorkflowWaitForStateCompletionRequest struct { WaitTimeSeconds *int32 `json:"waitTimeSeconds,omitempty"` } +type _WorkflowWaitForStateCompletionRequest WorkflowWaitForStateCompletionRequest + // NewWorkflowWaitForStateCompletionRequest instantiates a new WorkflowWaitForStateCompletionRequest object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -141,6 +144,42 @@ func (o WorkflowWaitForStateCompletionRequest) ToMap() (map[string]interface{}, return toSerialize, nil } +func (o *WorkflowWaitForStateCompletionRequest) UnmarshalJSON(bytes []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "workflowId", + "stateExecutionId", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(bytes, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWorkflowWaitForStateCompletionRequest := _WorkflowWaitForStateCompletionRequest{} + + err = json.Unmarshal(bytes, &varWorkflowWaitForStateCompletionRequest) + + if err != nil { + return err + } + + *o = WorkflowWaitForStateCompletionRequest(varWorkflowWaitForStateCompletionRequest) + + return err +} + type NullableWorkflowWaitForStateCompletionRequest struct { value *WorkflowWaitForStateCompletionRequest isSet bool diff --git a/gen/iwfidl/model_workflow_worker_rpc_request.go b/gen/iwfidl/model_workflow_worker_rpc_request.go index cf0ac60..4566c25 100644 --- a/gen/iwfidl/model_workflow_worker_rpc_request.go +++ b/gen/iwfidl/model_workflow_worker_rpc_request.go @@ -12,6 +12,7 @@ package iwfidl import ( "encoding/json" + "fmt" ) // checks if the WorkflowWorkerRpcRequest type satisfies the MappedNullable interface at compile time @@ -27,6 +28,8 @@ type WorkflowWorkerRpcRequest struct { DataAttributes []KeyValue `json:"dataAttributes,omitempty"` } +type _WorkflowWorkerRpcRequest WorkflowWorkerRpcRequest + // NewWorkflowWorkerRpcRequest instantiates a new WorkflowWorkerRpcRequest object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments @@ -240,6 +243,43 @@ func (o WorkflowWorkerRpcRequest) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +func (o *WorkflowWorkerRpcRequest) UnmarshalJSON(bytes []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "context", + "workflowType", + "rpcName", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(bytes, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varWorkflowWorkerRpcRequest := _WorkflowWorkerRpcRequest{} + + err = json.Unmarshal(bytes, &varWorkflowWorkerRpcRequest) + + if err != nil { + return err + } + + *o = WorkflowWorkerRpcRequest(varWorkflowWorkerRpcRequest) + + return err +} + type NullableWorkflowWorkerRpcRequest struct { value *WorkflowWorkerRpcRequest isSet bool diff --git a/iwf/client_impl.go b/iwf/client_impl.go index 826e593..1e3f25f 100644 --- a/iwf/client_impl.go +++ b/iwf/client_impl.go @@ -37,6 +37,7 @@ func (c *clientImpl) StartWorkflow(ctx context.Context, workflow ObjectWorkflow, unregOpt.WorkflowIdReusePolicy = options.WorkflowIdReusePolicy unregOpt.WorkflowRetryPolicy = options.WorkflowRetryPolicy unregOpt.WorkflowCronSchedule = options.WorkflowCronSchedule + unregOpt.WorkflowStartDelaySeconds = options.WorkflowStartDelaySeconds saTypes := c.registry.getSearchAttributeTypeStore(wfType) diff --git a/iwf/unregistered_client_impl.go b/iwf/unregistered_client_impl.go index 24e22cd..9bb97bd 100644 --- a/iwf/unregistered_client_impl.go +++ b/iwf/unregistered_client_impl.go @@ -39,10 +39,11 @@ func (u *unregisteredClientImpl) StartWorkflow(ctx context.Context, workflowType } stateOptions = options.StartStateOptions startOptions = &iwfidl.WorkflowStartOptions{ - IdReusePolicy: options.WorkflowIdReusePolicy, - CronSchedule: options.WorkflowCronSchedule, - RetryPolicy: options.WorkflowRetryPolicy, - SearchAttributes: options.InitialSearchAttributes, + IdReusePolicy: options.WorkflowIdReusePolicy, + CronSchedule: options.WorkflowCronSchedule, + WorkflowStartDelaySeconds: options.WorkflowStartDelaySeconds, + RetryPolicy: options.WorkflowRetryPolicy, + SearchAttributes: options.InitialSearchAttributes, } } diff --git a/iwf/unregistered_workflow_options.go b/iwf/unregistered_workflow_options.go index 3dcc294..13a9174 100644 --- a/iwf/unregistered_workflow_options.go +++ b/iwf/unregistered_workflow_options.go @@ -3,9 +3,10 @@ package iwf import "github.com/indeedeng/iwf-golang-sdk/gen/iwfidl" type UnregisteredWorkflowOptions struct { - WorkflowIdReusePolicy *iwfidl.IDReusePolicy - WorkflowCronSchedule *string - WorkflowRetryPolicy *iwfidl.WorkflowRetryPolicy - StartStateOptions *iwfidl.WorkflowStateOptions - InitialSearchAttributes []iwfidl.SearchAttribute + WorkflowIdReusePolicy *iwfidl.IDReusePolicy + WorkflowCronSchedule *string + WorkflowStartDelaySeconds *int32 + WorkflowRetryPolicy *iwfidl.WorkflowRetryPolicy + StartStateOptions *iwfidl.WorkflowStateOptions + InitialSearchAttributes []iwfidl.SearchAttribute } diff --git a/iwf/workflow_options.go b/iwf/workflow_options.go index f441b54..b1c000c 100644 --- a/iwf/workflow_options.go +++ b/iwf/workflow_options.go @@ -3,9 +3,10 @@ package iwf import "github.com/indeedeng/iwf-golang-sdk/gen/iwfidl" type WorkflowOptions struct { - WorkflowIdReusePolicy *iwfidl.IDReusePolicy - WorkflowCronSchedule *string - WorkflowRetryPolicy *iwfidl.WorkflowRetryPolicy + WorkflowIdReusePolicy *iwfidl.IDReusePolicy + WorkflowCronSchedule *string + WorkflowStartDelaySeconds *int32 + WorkflowRetryPolicy *iwfidl.WorkflowRetryPolicy // InitialSearchAttributes set the initial search attributes to start a workflow // key is search attribute key, value much match with PersistenceSchema of the workflow definition // For iwfidl.DATETIME , the value can be either time.Time or a string value in format of DateTimeFormat