in unstructured/google/dlp/beta/job_trigger.go [633:1865]
func UnstructuredToJobTrigger(u *unstructured.Resource) (*dclService.JobTrigger, error) {
r := &dclService.JobTrigger{}
if _, ok := u.Object["createTime"]; ok {
if s, ok := u.Object["createTime"].(string); ok {
r.CreateTime = dcl.String(s)
} else {
return nil, fmt.Errorf("r.CreateTime: expected string")
}
}
if _, ok := u.Object["description"]; ok {
if s, ok := u.Object["description"].(string); ok {
r.Description = dcl.String(s)
} else {
return nil, fmt.Errorf("r.Description: expected string")
}
}
if _, ok := u.Object["displayName"]; ok {
if s, ok := u.Object["displayName"].(string); ok {
r.DisplayName = dcl.String(s)
} else {
return nil, fmt.Errorf("r.DisplayName: expected string")
}
}
if _, ok := u.Object["errors"]; ok {
if s, ok := u.Object["errors"].([]interface{}); ok {
for _, o := range s {
if objval, ok := o.(map[string]interface{}); ok {
var rErrors dclService.JobTriggerErrors
if _, ok := objval["details"]; ok {
if rErrorsDetails, ok := objval["details"].(map[string]interface{}); ok {
rErrors.Details = &dclService.JobTriggerErrorsDetails{}
if _, ok := rErrorsDetails["code"]; ok {
if i, ok := rErrorsDetails["code"].(int64); ok {
rErrors.Details.Code = dcl.Int64(i)
} else {
return nil, fmt.Errorf("rErrors.Details.Code: expected int64")
}
}
if _, ok := rErrorsDetails["details"]; ok {
if s, ok := rErrorsDetails["details"].([]interface{}); ok {
for _, o := range s {
if objval, ok := o.(map[string]interface{}); ok {
var rErrorsDetailsDetails dclService.JobTriggerErrorsDetailsDetails
if _, ok := objval["typeUrl"]; ok {
if s, ok := objval["typeUrl"].(string); ok {
rErrorsDetailsDetails.TypeUrl = dcl.String(s)
} else {
return nil, fmt.Errorf("rErrorsDetailsDetails.TypeUrl: expected string")
}
}
if _, ok := objval["value"]; ok {
if s, ok := objval["value"].(string); ok {
rErrorsDetailsDetails.Value = dcl.String(s)
} else {
return nil, fmt.Errorf("rErrorsDetailsDetails.Value: expected string")
}
}
rErrors.Details.Details = append(rErrors.Details.Details, rErrorsDetailsDetails)
}
}
} else {
return nil, fmt.Errorf("rErrors.Details.Details: expected []interface{}")
}
}
if _, ok := rErrorsDetails["message"]; ok {
if s, ok := rErrorsDetails["message"].(string); ok {
rErrors.Details.Message = dcl.String(s)
} else {
return nil, fmt.Errorf("rErrors.Details.Message: expected string")
}
}
} else {
return nil, fmt.Errorf("rErrors.Details: expected map[string]interface{}")
}
}
if _, ok := objval["timestamps"]; ok {
if s, ok := objval["timestamps"].([]interface{}); ok {
for _, ss := range s {
if strval, ok := ss.(string); ok {
rErrors.Timestamps = append(rErrors.Timestamps, strval)
}
}
} else {
return nil, fmt.Errorf("rErrors.Timestamps: expected []interface{}")
}
}
r.Errors = append(r.Errors, rErrors)
}
}
} else {
return nil, fmt.Errorf("r.Errors: expected []interface{}")
}
}
if _, ok := u.Object["inspectJob"]; ok {
if rInspectJob, ok := u.Object["inspectJob"].(map[string]interface{}); ok {
r.InspectJob = &dclService.JobTriggerInspectJob{}
if _, ok := rInspectJob["actions"]; ok {
if s, ok := rInspectJob["actions"].([]interface{}); ok {
for _, o := range s {
if objval, ok := o.(map[string]interface{}); ok {
var rInspectJobActions dclService.JobTriggerInspectJobActions
if _, ok := objval["jobNotificationEmails"]; ok {
if _, ok := objval["jobNotificationEmails"].(map[string]interface{}); ok {
rInspectJobActions.JobNotificationEmails = &dclService.JobTriggerInspectJobActionsJobNotificationEmails{}
} else {
return nil, fmt.Errorf("rInspectJobActions.JobNotificationEmails: expected map[string]interface{}")
}
}
if _, ok := objval["pubSub"]; ok {
if rInspectJobActionsPubSub, ok := objval["pubSub"].(map[string]interface{}); ok {
rInspectJobActions.PubSub = &dclService.JobTriggerInspectJobActionsPubSub{}
if _, ok := rInspectJobActionsPubSub["topic"]; ok {
if s, ok := rInspectJobActionsPubSub["topic"].(string); ok {
rInspectJobActions.PubSub.Topic = dcl.String(s)
} else {
return nil, fmt.Errorf("rInspectJobActions.PubSub.Topic: expected string")
}
}
} else {
return nil, fmt.Errorf("rInspectJobActions.PubSub: expected map[string]interface{}")
}
}
if _, ok := objval["publishFindingsToCloudDataCatalog"]; ok {
if _, ok := objval["publishFindingsToCloudDataCatalog"].(map[string]interface{}); ok {
rInspectJobActions.PublishFindingsToCloudDataCatalog = &dclService.JobTriggerInspectJobActionsPublishFindingsToCloudDataCatalog{}
} else {
return nil, fmt.Errorf("rInspectJobActions.PublishFindingsToCloudDataCatalog: expected map[string]interface{}")
}
}
if _, ok := objval["publishSummaryToCscc"]; ok {
if _, ok := objval["publishSummaryToCscc"].(map[string]interface{}); ok {
rInspectJobActions.PublishSummaryToCscc = &dclService.JobTriggerInspectJobActionsPublishSummaryToCscc{}
} else {
return nil, fmt.Errorf("rInspectJobActions.PublishSummaryToCscc: expected map[string]interface{}")
}
}
if _, ok := objval["publishToStackdriver"]; ok {
if _, ok := objval["publishToStackdriver"].(map[string]interface{}); ok {
rInspectJobActions.PublishToStackdriver = &dclService.JobTriggerInspectJobActionsPublishToStackdriver{}
} else {
return nil, fmt.Errorf("rInspectJobActions.PublishToStackdriver: expected map[string]interface{}")
}
}
if _, ok := objval["saveFindings"]; ok {
if rInspectJobActionsSaveFindings, ok := objval["saveFindings"].(map[string]interface{}); ok {
rInspectJobActions.SaveFindings = &dclService.JobTriggerInspectJobActionsSaveFindings{}
if _, ok := rInspectJobActionsSaveFindings["outputConfig"]; ok {
if rInspectJobActionsSaveFindingsOutputConfig, ok := rInspectJobActionsSaveFindings["outputConfig"].(map[string]interface{}); ok {
rInspectJobActions.SaveFindings.OutputConfig = &dclService.JobTriggerInspectJobActionsSaveFindingsOutputConfig{}
if _, ok := rInspectJobActionsSaveFindingsOutputConfig["dlpStorage"]; ok {
if _, ok := rInspectJobActionsSaveFindingsOutputConfig["dlpStorage"].(map[string]interface{}); ok {
rInspectJobActions.SaveFindings.OutputConfig.DlpStorage = &dclService.JobTriggerInspectJobActionsSaveFindingsOutputConfigDlpStorage{}
} else {
return nil, fmt.Errorf("rInspectJobActions.SaveFindings.OutputConfig.DlpStorage: expected map[string]interface{}")
}
}
if _, ok := rInspectJobActionsSaveFindingsOutputConfig["outputSchema"]; ok {
if s, ok := rInspectJobActionsSaveFindingsOutputConfig["outputSchema"].(string); ok {
rInspectJobActions.SaveFindings.OutputConfig.OutputSchema = dclService.JobTriggerInspectJobActionsSaveFindingsOutputConfigOutputSchemaEnumRef(s)
} else {
return nil, fmt.Errorf("rInspectJobActions.SaveFindings.OutputConfig.OutputSchema: expected string")
}
}
if _, ok := rInspectJobActionsSaveFindingsOutputConfig["table"]; ok {
if rInspectJobActionsSaveFindingsOutputConfigTable, ok := rInspectJobActionsSaveFindingsOutputConfig["table"].(map[string]interface{}); ok {
rInspectJobActions.SaveFindings.OutputConfig.Table = &dclService.JobTriggerInspectJobActionsSaveFindingsOutputConfigTable{}
if _, ok := rInspectJobActionsSaveFindingsOutputConfigTable["datasetId"]; ok {
if s, ok := rInspectJobActionsSaveFindingsOutputConfigTable["datasetId"].(string); ok {
rInspectJobActions.SaveFindings.OutputConfig.Table.DatasetId = dcl.String(s)
} else {
return nil, fmt.Errorf("rInspectJobActions.SaveFindings.OutputConfig.Table.DatasetId: expected string")
}
}
if _, ok := rInspectJobActionsSaveFindingsOutputConfigTable["projectId"]; ok {
if s, ok := rInspectJobActionsSaveFindingsOutputConfigTable["projectId"].(string); ok {
rInspectJobActions.SaveFindings.OutputConfig.Table.ProjectId = dcl.String(s)
} else {
return nil, fmt.Errorf("rInspectJobActions.SaveFindings.OutputConfig.Table.ProjectId: expected string")
}
}
if _, ok := rInspectJobActionsSaveFindingsOutputConfigTable["tableId"]; ok {
if s, ok := rInspectJobActionsSaveFindingsOutputConfigTable["tableId"].(string); ok {
rInspectJobActions.SaveFindings.OutputConfig.Table.TableId = dcl.String(s)
} else {
return nil, fmt.Errorf("rInspectJobActions.SaveFindings.OutputConfig.Table.TableId: expected string")
}
}
} else {
return nil, fmt.Errorf("rInspectJobActions.SaveFindings.OutputConfig.Table: expected map[string]interface{}")
}
}
} else {
return nil, fmt.Errorf("rInspectJobActions.SaveFindings.OutputConfig: expected map[string]interface{}")
}
}
} else {
return nil, fmt.Errorf("rInspectJobActions.SaveFindings: expected map[string]interface{}")
}
}
r.InspectJob.Actions = append(r.InspectJob.Actions, rInspectJobActions)
}
}
} else {
return nil, fmt.Errorf("r.InspectJob.Actions: expected []interface{}")
}
}
if _, ok := rInspectJob["inspectConfig"]; ok {
if rInspectJobInspectConfig, ok := rInspectJob["inspectConfig"].(map[string]interface{}); ok {
r.InspectJob.InspectConfig = &dclService.JobTriggerInspectJobInspectConfig{}
if _, ok := rInspectJobInspectConfig["customInfoTypes"]; ok {
if s, ok := rInspectJobInspectConfig["customInfoTypes"].([]interface{}); ok {
for _, o := range s {
if objval, ok := o.(map[string]interface{}); ok {
var rInspectJobInspectConfigCustomInfoTypes dclService.JobTriggerInspectJobInspectConfigCustomInfoTypes
if _, ok := objval["detectionRules"]; ok {
if s, ok := objval["detectionRules"].([]interface{}); ok {
for _, o := range s {
if objval, ok := o.(map[string]interface{}); ok {
var rInspectJobInspectConfigCustomInfoTypesDetectionRules dclService.JobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRules
if _, ok := objval["hotwordRule"]; ok {
if rInspectJobInspectConfigCustomInfoTypesDetectionRulesHotwordRule, ok := objval["hotwordRule"].(map[string]interface{}); ok {
rInspectJobInspectConfigCustomInfoTypesDetectionRules.HotwordRule = &dclService.JobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRulesHotwordRule{}
if _, ok := rInspectJobInspectConfigCustomInfoTypesDetectionRulesHotwordRule["hotwordRegex"]; ok {
if rInspectJobInspectConfigCustomInfoTypesDetectionRulesHotwordRuleHotwordRegex, ok := rInspectJobInspectConfigCustomInfoTypesDetectionRulesHotwordRule["hotwordRegex"].(map[string]interface{}); ok {
rInspectJobInspectConfigCustomInfoTypesDetectionRules.HotwordRule.HotwordRegex = &dclService.JobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRulesHotwordRuleHotwordRegex{}
if _, ok := rInspectJobInspectConfigCustomInfoTypesDetectionRulesHotwordRuleHotwordRegex["groupIndexes"]; ok {
if s, ok := rInspectJobInspectConfigCustomInfoTypesDetectionRulesHotwordRuleHotwordRegex["groupIndexes"].([]interface{}); ok {
for _, ss := range s {
if intval, ok := ss.(int64); ok {
rInspectJobInspectConfigCustomInfoTypesDetectionRules.HotwordRule.HotwordRegex.GroupIndexes = append(rInspectJobInspectConfigCustomInfoTypesDetectionRules.HotwordRule.HotwordRegex.GroupIndexes, intval)
}
}
} else {
return nil, fmt.Errorf("rInspectJobInspectConfigCustomInfoTypesDetectionRules.HotwordRule.HotwordRegex.GroupIndexes: expected []interface{}")
}
}
if _, ok := rInspectJobInspectConfigCustomInfoTypesDetectionRulesHotwordRuleHotwordRegex["pattern"]; ok {
if s, ok := rInspectJobInspectConfigCustomInfoTypesDetectionRulesHotwordRuleHotwordRegex["pattern"].(string); ok {
rInspectJobInspectConfigCustomInfoTypesDetectionRules.HotwordRule.HotwordRegex.Pattern = dcl.String(s)
} else {
return nil, fmt.Errorf("rInspectJobInspectConfigCustomInfoTypesDetectionRules.HotwordRule.HotwordRegex.Pattern: expected string")
}
}
} else {
return nil, fmt.Errorf("rInspectJobInspectConfigCustomInfoTypesDetectionRules.HotwordRule.HotwordRegex: expected map[string]interface{}")
}
}
if _, ok := rInspectJobInspectConfigCustomInfoTypesDetectionRulesHotwordRule["likelihoodAdjustment"]; ok {
if rInspectJobInspectConfigCustomInfoTypesDetectionRulesHotwordRuleLikelihoodAdjustment, ok := rInspectJobInspectConfigCustomInfoTypesDetectionRulesHotwordRule["likelihoodAdjustment"].(map[string]interface{}); ok {
rInspectJobInspectConfigCustomInfoTypesDetectionRules.HotwordRule.LikelihoodAdjustment = &dclService.JobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRulesHotwordRuleLikelihoodAdjustment{}
if _, ok := rInspectJobInspectConfigCustomInfoTypesDetectionRulesHotwordRuleLikelihoodAdjustment["fixedLikelihood"]; ok {
if s, ok := rInspectJobInspectConfigCustomInfoTypesDetectionRulesHotwordRuleLikelihoodAdjustment["fixedLikelihood"].(string); ok {
rInspectJobInspectConfigCustomInfoTypesDetectionRules.HotwordRule.LikelihoodAdjustment.FixedLikelihood = dclService.JobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRulesHotwordRuleLikelihoodAdjustmentFixedLikelihoodEnumRef(s)
} else {
return nil, fmt.Errorf("rInspectJobInspectConfigCustomInfoTypesDetectionRules.HotwordRule.LikelihoodAdjustment.FixedLikelihood: expected string")
}
}
if _, ok := rInspectJobInspectConfigCustomInfoTypesDetectionRulesHotwordRuleLikelihoodAdjustment["relativeLikelihood"]; ok {
if i, ok := rInspectJobInspectConfigCustomInfoTypesDetectionRulesHotwordRuleLikelihoodAdjustment["relativeLikelihood"].(int64); ok {
rInspectJobInspectConfigCustomInfoTypesDetectionRules.HotwordRule.LikelihoodAdjustment.RelativeLikelihood = dcl.Int64(i)
} else {
return nil, fmt.Errorf("rInspectJobInspectConfigCustomInfoTypesDetectionRules.HotwordRule.LikelihoodAdjustment.RelativeLikelihood: expected int64")
}
}
} else {
return nil, fmt.Errorf("rInspectJobInspectConfigCustomInfoTypesDetectionRules.HotwordRule.LikelihoodAdjustment: expected map[string]interface{}")
}
}
if _, ok := rInspectJobInspectConfigCustomInfoTypesDetectionRulesHotwordRule["proximity"]; ok {
if rInspectJobInspectConfigCustomInfoTypesDetectionRulesHotwordRuleProximity, ok := rInspectJobInspectConfigCustomInfoTypesDetectionRulesHotwordRule["proximity"].(map[string]interface{}); ok {
rInspectJobInspectConfigCustomInfoTypesDetectionRules.HotwordRule.Proximity = &dclService.JobTriggerInspectJobInspectConfigCustomInfoTypesDetectionRulesHotwordRuleProximity{}
if _, ok := rInspectJobInspectConfigCustomInfoTypesDetectionRulesHotwordRuleProximity["windowAfter"]; ok {
if i, ok := rInspectJobInspectConfigCustomInfoTypesDetectionRulesHotwordRuleProximity["windowAfter"].(int64); ok {
rInspectJobInspectConfigCustomInfoTypesDetectionRules.HotwordRule.Proximity.WindowAfter = dcl.Int64(i)
} else {
return nil, fmt.Errorf("rInspectJobInspectConfigCustomInfoTypesDetectionRules.HotwordRule.Proximity.WindowAfter: expected int64")
}
}
if _, ok := rInspectJobInspectConfigCustomInfoTypesDetectionRulesHotwordRuleProximity["windowBefore"]; ok {
if i, ok := rInspectJobInspectConfigCustomInfoTypesDetectionRulesHotwordRuleProximity["windowBefore"].(int64); ok {
rInspectJobInspectConfigCustomInfoTypesDetectionRules.HotwordRule.Proximity.WindowBefore = dcl.Int64(i)
} else {
return nil, fmt.Errorf("rInspectJobInspectConfigCustomInfoTypesDetectionRules.HotwordRule.Proximity.WindowBefore: expected int64")
}
}
} else {
return nil, fmt.Errorf("rInspectJobInspectConfigCustomInfoTypesDetectionRules.HotwordRule.Proximity: expected map[string]interface{}")
}
}
} else {
return nil, fmt.Errorf("rInspectJobInspectConfigCustomInfoTypesDetectionRules.HotwordRule: expected map[string]interface{}")
}
}
rInspectJobInspectConfigCustomInfoTypes.DetectionRules = append(rInspectJobInspectConfigCustomInfoTypes.DetectionRules, rInspectJobInspectConfigCustomInfoTypesDetectionRules)
}
}
} else {
return nil, fmt.Errorf("rInspectJobInspectConfigCustomInfoTypes.DetectionRules: expected []interface{}")
}
}
if _, ok := objval["dictionary"]; ok {
if rInspectJobInspectConfigCustomInfoTypesDictionary, ok := objval["dictionary"].(map[string]interface{}); ok {
rInspectJobInspectConfigCustomInfoTypes.Dictionary = &dclService.JobTriggerInspectJobInspectConfigCustomInfoTypesDictionary{}
if _, ok := rInspectJobInspectConfigCustomInfoTypesDictionary["cloudStoragePath"]; ok {
if rInspectJobInspectConfigCustomInfoTypesDictionaryCloudStoragePath, ok := rInspectJobInspectConfigCustomInfoTypesDictionary["cloudStoragePath"].(map[string]interface{}); ok {
rInspectJobInspectConfigCustomInfoTypes.Dictionary.CloudStoragePath = &dclService.JobTriggerInspectJobInspectConfigCustomInfoTypesDictionaryCloudStoragePath{}
if _, ok := rInspectJobInspectConfigCustomInfoTypesDictionaryCloudStoragePath["path"]; ok {
if s, ok := rInspectJobInspectConfigCustomInfoTypesDictionaryCloudStoragePath["path"].(string); ok {
rInspectJobInspectConfigCustomInfoTypes.Dictionary.CloudStoragePath.Path = dcl.String(s)
} else {
return nil, fmt.Errorf("rInspectJobInspectConfigCustomInfoTypes.Dictionary.CloudStoragePath.Path: expected string")
}
}
} else {
return nil, fmt.Errorf("rInspectJobInspectConfigCustomInfoTypes.Dictionary.CloudStoragePath: expected map[string]interface{}")
}
}
if _, ok := rInspectJobInspectConfigCustomInfoTypesDictionary["wordList"]; ok {
if rInspectJobInspectConfigCustomInfoTypesDictionaryWordList, ok := rInspectJobInspectConfigCustomInfoTypesDictionary["wordList"].(map[string]interface{}); ok {
rInspectJobInspectConfigCustomInfoTypes.Dictionary.WordList = &dclService.JobTriggerInspectJobInspectConfigCustomInfoTypesDictionaryWordList{}
if _, ok := rInspectJobInspectConfigCustomInfoTypesDictionaryWordList["words"]; ok {
if s, ok := rInspectJobInspectConfigCustomInfoTypesDictionaryWordList["words"].([]interface{}); ok {
for _, ss := range s {
if strval, ok := ss.(string); ok {
rInspectJobInspectConfigCustomInfoTypes.Dictionary.WordList.Words = append(rInspectJobInspectConfigCustomInfoTypes.Dictionary.WordList.Words, strval)
}
}
} else {
return nil, fmt.Errorf("rInspectJobInspectConfigCustomInfoTypes.Dictionary.WordList.Words: expected []interface{}")
}
}
} else {
return nil, fmt.Errorf("rInspectJobInspectConfigCustomInfoTypes.Dictionary.WordList: expected map[string]interface{}")
}
}
} else {
return nil, fmt.Errorf("rInspectJobInspectConfigCustomInfoTypes.Dictionary: expected map[string]interface{}")
}
}
if _, ok := objval["exclusionType"]; ok {
if s, ok := objval["exclusionType"].(string); ok {
rInspectJobInspectConfigCustomInfoTypes.ExclusionType = dclService.JobTriggerInspectJobInspectConfigCustomInfoTypesExclusionTypeEnumRef(s)
} else {
return nil, fmt.Errorf("rInspectJobInspectConfigCustomInfoTypes.ExclusionType: expected string")
}
}
if _, ok := objval["infoType"]; ok {
if rInspectJobInspectConfigCustomInfoTypesInfoType, ok := objval["infoType"].(map[string]interface{}); ok {
rInspectJobInspectConfigCustomInfoTypes.InfoType = &dclService.JobTriggerInspectJobInspectConfigCustomInfoTypesInfoType{}
if _, ok := rInspectJobInspectConfigCustomInfoTypesInfoType["name"]; ok {
if s, ok := rInspectJobInspectConfigCustomInfoTypesInfoType["name"].(string); ok {
rInspectJobInspectConfigCustomInfoTypes.InfoType.Name = dcl.String(s)
} else {
return nil, fmt.Errorf("rInspectJobInspectConfigCustomInfoTypes.InfoType.Name: expected string")
}
}
if _, ok := rInspectJobInspectConfigCustomInfoTypesInfoType["version"]; ok {
if s, ok := rInspectJobInspectConfigCustomInfoTypesInfoType["version"].(string); ok {
rInspectJobInspectConfigCustomInfoTypes.InfoType.Version = dcl.String(s)
} else {
return nil, fmt.Errorf("rInspectJobInspectConfigCustomInfoTypes.InfoType.Version: expected string")
}
}
} else {
return nil, fmt.Errorf("rInspectJobInspectConfigCustomInfoTypes.InfoType: expected map[string]interface{}")
}
}
if _, ok := objval["likelihood"]; ok {
if s, ok := objval["likelihood"].(string); ok {
rInspectJobInspectConfigCustomInfoTypes.Likelihood = dclService.JobTriggerInspectJobInspectConfigCustomInfoTypesLikelihoodEnumRef(s)
} else {
return nil, fmt.Errorf("rInspectJobInspectConfigCustomInfoTypes.Likelihood: expected string")
}
}
if _, ok := objval["regex"]; ok {
if rInspectJobInspectConfigCustomInfoTypesRegex, ok := objval["regex"].(map[string]interface{}); ok {
rInspectJobInspectConfigCustomInfoTypes.Regex = &dclService.JobTriggerInspectJobInspectConfigCustomInfoTypesRegex{}
if _, ok := rInspectJobInspectConfigCustomInfoTypesRegex["groupIndexes"]; ok {
if s, ok := rInspectJobInspectConfigCustomInfoTypesRegex["groupIndexes"].([]interface{}); ok {
for _, ss := range s {
if intval, ok := ss.(int64); ok {
rInspectJobInspectConfigCustomInfoTypes.Regex.GroupIndexes = append(rInspectJobInspectConfigCustomInfoTypes.Regex.GroupIndexes, intval)
}
}
} else {
return nil, fmt.Errorf("rInspectJobInspectConfigCustomInfoTypes.Regex.GroupIndexes: expected []interface{}")
}
}
if _, ok := rInspectJobInspectConfigCustomInfoTypesRegex["pattern"]; ok {
if s, ok := rInspectJobInspectConfigCustomInfoTypesRegex["pattern"].(string); ok {
rInspectJobInspectConfigCustomInfoTypes.Regex.Pattern = dcl.String(s)
} else {
return nil, fmt.Errorf("rInspectJobInspectConfigCustomInfoTypes.Regex.Pattern: expected string")
}
}
} else {
return nil, fmt.Errorf("rInspectJobInspectConfigCustomInfoTypes.Regex: expected map[string]interface{}")
}
}
if _, ok := objval["storedType"]; ok {
if rInspectJobInspectConfigCustomInfoTypesStoredType, ok := objval["storedType"].(map[string]interface{}); ok {
rInspectJobInspectConfigCustomInfoTypes.StoredType = &dclService.JobTriggerInspectJobInspectConfigCustomInfoTypesStoredType{}
if _, ok := rInspectJobInspectConfigCustomInfoTypesStoredType["createTime"]; ok {
if s, ok := rInspectJobInspectConfigCustomInfoTypesStoredType["createTime"].(string); ok {
rInspectJobInspectConfigCustomInfoTypes.StoredType.CreateTime = dcl.String(s)
} else {
return nil, fmt.Errorf("rInspectJobInspectConfigCustomInfoTypes.StoredType.CreateTime: expected string")
}
}
if _, ok := rInspectJobInspectConfigCustomInfoTypesStoredType["name"]; ok {
if s, ok := rInspectJobInspectConfigCustomInfoTypesStoredType["name"].(string); ok {
rInspectJobInspectConfigCustomInfoTypes.StoredType.Name = dcl.String(s)
} else {
return nil, fmt.Errorf("rInspectJobInspectConfigCustomInfoTypes.StoredType.Name: expected string")
}
}
} else {
return nil, fmt.Errorf("rInspectJobInspectConfigCustomInfoTypes.StoredType: expected map[string]interface{}")
}
}
if _, ok := objval["surrogateType"]; ok {
if _, ok := objval["surrogateType"].(map[string]interface{}); ok {
rInspectJobInspectConfigCustomInfoTypes.SurrogateType = &dclService.JobTriggerInspectJobInspectConfigCustomInfoTypesSurrogateType{}
} else {
return nil, fmt.Errorf("rInspectJobInspectConfigCustomInfoTypes.SurrogateType: expected map[string]interface{}")
}
}
r.InspectJob.InspectConfig.CustomInfoTypes = append(r.InspectJob.InspectConfig.CustomInfoTypes, rInspectJobInspectConfigCustomInfoTypes)
}
}
} else {
return nil, fmt.Errorf("r.InspectJob.InspectConfig.CustomInfoTypes: expected []interface{}")
}
}
if _, ok := rInspectJobInspectConfig["excludeInfoTypes"]; ok {
if b, ok := rInspectJobInspectConfig["excludeInfoTypes"].(bool); ok {
r.InspectJob.InspectConfig.ExcludeInfoTypes = dcl.Bool(b)
} else {
return nil, fmt.Errorf("r.InspectJob.InspectConfig.ExcludeInfoTypes: expected bool")
}
}
if _, ok := rInspectJobInspectConfig["includeQuote"]; ok {
if b, ok := rInspectJobInspectConfig["includeQuote"].(bool); ok {
r.InspectJob.InspectConfig.IncludeQuote = dcl.Bool(b)
} else {
return nil, fmt.Errorf("r.InspectJob.InspectConfig.IncludeQuote: expected bool")
}
}
if _, ok := rInspectJobInspectConfig["infoTypes"]; ok {
if s, ok := rInspectJobInspectConfig["infoTypes"].([]interface{}); ok {
for _, o := range s {
if objval, ok := o.(map[string]interface{}); ok {
var rInspectJobInspectConfigInfoTypes dclService.JobTriggerInspectJobInspectConfigInfoTypes
if _, ok := objval["name"]; ok {
if s, ok := objval["name"].(string); ok {
rInspectJobInspectConfigInfoTypes.Name = dcl.String(s)
} else {
return nil, fmt.Errorf("rInspectJobInspectConfigInfoTypes.Name: expected string")
}
}
r.InspectJob.InspectConfig.InfoTypes = append(r.InspectJob.InspectConfig.InfoTypes, rInspectJobInspectConfigInfoTypes)
}
}
} else {
return nil, fmt.Errorf("r.InspectJob.InspectConfig.InfoTypes: expected []interface{}")
}
}
if _, ok := rInspectJobInspectConfig["limits"]; ok {
if rInspectJobInspectConfigLimits, ok := rInspectJobInspectConfig["limits"].(map[string]interface{}); ok {
r.InspectJob.InspectConfig.Limits = &dclService.JobTriggerInspectJobInspectConfigLimits{}
if _, ok := rInspectJobInspectConfigLimits["maxFindingsPerInfoType"]; ok {
if s, ok := rInspectJobInspectConfigLimits["maxFindingsPerInfoType"].([]interface{}); ok {
for _, o := range s {
if objval, ok := o.(map[string]interface{}); ok {
var rInspectJobInspectConfigLimitsMaxFindingsPerInfoType dclService.JobTriggerInspectJobInspectConfigLimitsMaxFindingsPerInfoType
if _, ok := objval["infoType"]; ok {
if rInspectJobInspectConfigLimitsMaxFindingsPerInfoTypeInfoType, ok := objval["infoType"].(map[string]interface{}); ok {
rInspectJobInspectConfigLimitsMaxFindingsPerInfoType.InfoType = &dclService.JobTriggerInspectJobInspectConfigLimitsMaxFindingsPerInfoTypeInfoType{}
if _, ok := rInspectJobInspectConfigLimitsMaxFindingsPerInfoTypeInfoType["name"]; ok {
if s, ok := rInspectJobInspectConfigLimitsMaxFindingsPerInfoTypeInfoType["name"].(string); ok {
rInspectJobInspectConfigLimitsMaxFindingsPerInfoType.InfoType.Name = dcl.String(s)
} else {
return nil, fmt.Errorf("rInspectJobInspectConfigLimitsMaxFindingsPerInfoType.InfoType.Name: expected string")
}
}
if _, ok := rInspectJobInspectConfigLimitsMaxFindingsPerInfoTypeInfoType["version"]; ok {
if s, ok := rInspectJobInspectConfigLimitsMaxFindingsPerInfoTypeInfoType["version"].(string); ok {
rInspectJobInspectConfigLimitsMaxFindingsPerInfoType.InfoType.Version = dcl.String(s)
} else {
return nil, fmt.Errorf("rInspectJobInspectConfigLimitsMaxFindingsPerInfoType.InfoType.Version: expected string")
}
}
} else {
return nil, fmt.Errorf("rInspectJobInspectConfigLimitsMaxFindingsPerInfoType.InfoType: expected map[string]interface{}")
}
}
if _, ok := objval["maxFindings"]; ok {
if i, ok := objval["maxFindings"].(int64); ok {
rInspectJobInspectConfigLimitsMaxFindingsPerInfoType.MaxFindings = dcl.Int64(i)
} else {
return nil, fmt.Errorf("rInspectJobInspectConfigLimitsMaxFindingsPerInfoType.MaxFindings: expected int64")
}
}
r.InspectJob.InspectConfig.Limits.MaxFindingsPerInfoType = append(r.InspectJob.InspectConfig.Limits.MaxFindingsPerInfoType, rInspectJobInspectConfigLimitsMaxFindingsPerInfoType)
}
}
} else {
return nil, fmt.Errorf("r.InspectJob.InspectConfig.Limits.MaxFindingsPerInfoType: expected []interface{}")
}
}
if _, ok := rInspectJobInspectConfigLimits["maxFindingsPerItem"]; ok {
if i, ok := rInspectJobInspectConfigLimits["maxFindingsPerItem"].(int64); ok {
r.InspectJob.InspectConfig.Limits.MaxFindingsPerItem = dcl.Int64(i)
} else {
return nil, fmt.Errorf("r.InspectJob.InspectConfig.Limits.MaxFindingsPerItem: expected int64")
}
}
if _, ok := rInspectJobInspectConfigLimits["maxFindingsPerRequest"]; ok {
if i, ok := rInspectJobInspectConfigLimits["maxFindingsPerRequest"].(int64); ok {
r.InspectJob.InspectConfig.Limits.MaxFindingsPerRequest = dcl.Int64(i)
} else {
return nil, fmt.Errorf("r.InspectJob.InspectConfig.Limits.MaxFindingsPerRequest: expected int64")
}
}
} else {
return nil, fmt.Errorf("r.InspectJob.InspectConfig.Limits: expected map[string]interface{}")
}
}
if _, ok := rInspectJobInspectConfig["minLikelihood"]; ok {
if s, ok := rInspectJobInspectConfig["minLikelihood"].(string); ok {
r.InspectJob.InspectConfig.MinLikelihood = dclService.JobTriggerInspectJobInspectConfigMinLikelihoodEnumRef(s)
} else {
return nil, fmt.Errorf("r.InspectJob.InspectConfig.MinLikelihood: expected string")
}
}
if _, ok := rInspectJobInspectConfig["ruleSet"]; ok {
if s, ok := rInspectJobInspectConfig["ruleSet"].([]interface{}); ok {
for _, o := range s {
if objval, ok := o.(map[string]interface{}); ok {
var rInspectJobInspectConfigRuleSet dclService.JobTriggerInspectJobInspectConfigRuleSet
if _, ok := objval["infoTypes"]; ok {
if s, ok := objval["infoTypes"].([]interface{}); ok {
for _, o := range s {
if objval, ok := o.(map[string]interface{}); ok {
var rInspectJobInspectConfigRuleSetInfoTypes dclService.JobTriggerInspectJobInspectConfigRuleSetInfoTypes
if _, ok := objval["name"]; ok {
if s, ok := objval["name"].(string); ok {
rInspectJobInspectConfigRuleSetInfoTypes.Name = dcl.String(s)
} else {
return nil, fmt.Errorf("rInspectJobInspectConfigRuleSetInfoTypes.Name: expected string")
}
}
if _, ok := objval["version"]; ok {
if s, ok := objval["version"].(string); ok {
rInspectJobInspectConfigRuleSetInfoTypes.Version = dcl.String(s)
} else {
return nil, fmt.Errorf("rInspectJobInspectConfigRuleSetInfoTypes.Version: expected string")
}
}
rInspectJobInspectConfigRuleSet.InfoTypes = append(rInspectJobInspectConfigRuleSet.InfoTypes, rInspectJobInspectConfigRuleSetInfoTypes)
}
}
} else {
return nil, fmt.Errorf("rInspectJobInspectConfigRuleSet.InfoTypes: expected []interface{}")
}
}
if _, ok := objval["rules"]; ok {
if s, ok := objval["rules"].([]interface{}); ok {
for _, o := range s {
if objval, ok := o.(map[string]interface{}); ok {
var rInspectJobInspectConfigRuleSetRules dclService.JobTriggerInspectJobInspectConfigRuleSetRules
if _, ok := objval["exclusionRule"]; ok {
if rInspectJobInspectConfigRuleSetRulesExclusionRule, ok := objval["exclusionRule"].(map[string]interface{}); ok {
rInspectJobInspectConfigRuleSetRules.ExclusionRule = &dclService.JobTriggerInspectJobInspectConfigRuleSetRulesExclusionRule{}
if _, ok := rInspectJobInspectConfigRuleSetRulesExclusionRule["dictionary"]; ok {
if rInspectJobInspectConfigRuleSetRulesExclusionRuleDictionary, ok := rInspectJobInspectConfigRuleSetRulesExclusionRule["dictionary"].(map[string]interface{}); ok {
rInspectJobInspectConfigRuleSetRules.ExclusionRule.Dictionary = &dclService.JobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleDictionary{}
if _, ok := rInspectJobInspectConfigRuleSetRulesExclusionRuleDictionary["cloudStoragePath"]; ok {
if rInspectJobInspectConfigRuleSetRulesExclusionRuleDictionaryCloudStoragePath, ok := rInspectJobInspectConfigRuleSetRulesExclusionRuleDictionary["cloudStoragePath"].(map[string]interface{}); ok {
rInspectJobInspectConfigRuleSetRules.ExclusionRule.Dictionary.CloudStoragePath = &dclService.JobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleDictionaryCloudStoragePath{}
if _, ok := rInspectJobInspectConfigRuleSetRulesExclusionRuleDictionaryCloudStoragePath["path"]; ok {
if s, ok := rInspectJobInspectConfigRuleSetRulesExclusionRuleDictionaryCloudStoragePath["path"].(string); ok {
rInspectJobInspectConfigRuleSetRules.ExclusionRule.Dictionary.CloudStoragePath.Path = dcl.String(s)
} else {
return nil, fmt.Errorf("rInspectJobInspectConfigRuleSetRules.ExclusionRule.Dictionary.CloudStoragePath.Path: expected string")
}
}
} else {
return nil, fmt.Errorf("rInspectJobInspectConfigRuleSetRules.ExclusionRule.Dictionary.CloudStoragePath: expected map[string]interface{}")
}
}
if _, ok := rInspectJobInspectConfigRuleSetRulesExclusionRuleDictionary["wordList"]; ok {
if rInspectJobInspectConfigRuleSetRulesExclusionRuleDictionaryWordList, ok := rInspectJobInspectConfigRuleSetRulesExclusionRuleDictionary["wordList"].(map[string]interface{}); ok {
rInspectJobInspectConfigRuleSetRules.ExclusionRule.Dictionary.WordList = &dclService.JobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleDictionaryWordList{}
if _, ok := rInspectJobInspectConfigRuleSetRulesExclusionRuleDictionaryWordList["words"]; ok {
if s, ok := rInspectJobInspectConfigRuleSetRulesExclusionRuleDictionaryWordList["words"].([]interface{}); ok {
for _, ss := range s {
if strval, ok := ss.(string); ok {
rInspectJobInspectConfigRuleSetRules.ExclusionRule.Dictionary.WordList.Words = append(rInspectJobInspectConfigRuleSetRules.ExclusionRule.Dictionary.WordList.Words, strval)
}
}
} else {
return nil, fmt.Errorf("rInspectJobInspectConfigRuleSetRules.ExclusionRule.Dictionary.WordList.Words: expected []interface{}")
}
}
} else {
return nil, fmt.Errorf("rInspectJobInspectConfigRuleSetRules.ExclusionRule.Dictionary.WordList: expected map[string]interface{}")
}
}
} else {
return nil, fmt.Errorf("rInspectJobInspectConfigRuleSetRules.ExclusionRule.Dictionary: expected map[string]interface{}")
}
}
if _, ok := rInspectJobInspectConfigRuleSetRulesExclusionRule["excludeInfoTypes"]; ok {
if rInspectJobInspectConfigRuleSetRulesExclusionRuleExcludeInfoTypes, ok := rInspectJobInspectConfigRuleSetRulesExclusionRule["excludeInfoTypes"].(map[string]interface{}); ok {
rInspectJobInspectConfigRuleSetRules.ExclusionRule.ExcludeInfoTypes = &dclService.JobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleExcludeInfoTypes{}
if _, ok := rInspectJobInspectConfigRuleSetRulesExclusionRuleExcludeInfoTypes["infoTypes"]; ok {
if s, ok := rInspectJobInspectConfigRuleSetRulesExclusionRuleExcludeInfoTypes["infoTypes"].([]interface{}); ok {
for _, o := range s {
if objval, ok := o.(map[string]interface{}); ok {
var rInspectJobInspectConfigRuleSetRulesExclusionRuleExcludeInfoTypesInfoTypes dclService.JobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleExcludeInfoTypesInfoTypes
if _, ok := objval["name"]; ok {
if s, ok := objval["name"].(string); ok {
rInspectJobInspectConfigRuleSetRulesExclusionRuleExcludeInfoTypesInfoTypes.Name = dcl.String(s)
} else {
return nil, fmt.Errorf("rInspectJobInspectConfigRuleSetRulesExclusionRuleExcludeInfoTypesInfoTypes.Name: expected string")
}
}
if _, ok := objval["version"]; ok {
if s, ok := objval["version"].(string); ok {
rInspectJobInspectConfigRuleSetRulesExclusionRuleExcludeInfoTypesInfoTypes.Version = dcl.String(s)
} else {
return nil, fmt.Errorf("rInspectJobInspectConfigRuleSetRulesExclusionRuleExcludeInfoTypesInfoTypes.Version: expected string")
}
}
rInspectJobInspectConfigRuleSetRules.ExclusionRule.ExcludeInfoTypes.InfoTypes = append(rInspectJobInspectConfigRuleSetRules.ExclusionRule.ExcludeInfoTypes.InfoTypes, rInspectJobInspectConfigRuleSetRulesExclusionRuleExcludeInfoTypesInfoTypes)
}
}
} else {
return nil, fmt.Errorf("rInspectJobInspectConfigRuleSetRules.ExclusionRule.ExcludeInfoTypes.InfoTypes: expected []interface{}")
}
}
} else {
return nil, fmt.Errorf("rInspectJobInspectConfigRuleSetRules.ExclusionRule.ExcludeInfoTypes: expected map[string]interface{}")
}
}
if _, ok := rInspectJobInspectConfigRuleSetRulesExclusionRule["matchingType"]; ok {
if s, ok := rInspectJobInspectConfigRuleSetRulesExclusionRule["matchingType"].(string); ok {
rInspectJobInspectConfigRuleSetRules.ExclusionRule.MatchingType = dclService.JobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleMatchingTypeEnumRef(s)
} else {
return nil, fmt.Errorf("rInspectJobInspectConfigRuleSetRules.ExclusionRule.MatchingType: expected string")
}
}
if _, ok := rInspectJobInspectConfigRuleSetRulesExclusionRule["regex"]; ok {
if rInspectJobInspectConfigRuleSetRulesExclusionRuleRegex, ok := rInspectJobInspectConfigRuleSetRulesExclusionRule["regex"].(map[string]interface{}); ok {
rInspectJobInspectConfigRuleSetRules.ExclusionRule.Regex = &dclService.JobTriggerInspectJobInspectConfigRuleSetRulesExclusionRuleRegex{}
if _, ok := rInspectJobInspectConfigRuleSetRulesExclusionRuleRegex["groupIndexes"]; ok {
if s, ok := rInspectJobInspectConfigRuleSetRulesExclusionRuleRegex["groupIndexes"].([]interface{}); ok {
for _, ss := range s {
if intval, ok := ss.(int64); ok {
rInspectJobInspectConfigRuleSetRules.ExclusionRule.Regex.GroupIndexes = append(rInspectJobInspectConfigRuleSetRules.ExclusionRule.Regex.GroupIndexes, intval)
}
}
} else {
return nil, fmt.Errorf("rInspectJobInspectConfigRuleSetRules.ExclusionRule.Regex.GroupIndexes: expected []interface{}")
}
}
if _, ok := rInspectJobInspectConfigRuleSetRulesExclusionRuleRegex["pattern"]; ok {
if s, ok := rInspectJobInspectConfigRuleSetRulesExclusionRuleRegex["pattern"].(string); ok {
rInspectJobInspectConfigRuleSetRules.ExclusionRule.Regex.Pattern = dcl.String(s)
} else {
return nil, fmt.Errorf("rInspectJobInspectConfigRuleSetRules.ExclusionRule.Regex.Pattern: expected string")
}
}
} else {
return nil, fmt.Errorf("rInspectJobInspectConfigRuleSetRules.ExclusionRule.Regex: expected map[string]interface{}")
}
}
} else {
return nil, fmt.Errorf("rInspectJobInspectConfigRuleSetRules.ExclusionRule: expected map[string]interface{}")
}
}
if _, ok := objval["hotwordRule"]; ok {
if rInspectJobInspectConfigRuleSetRulesHotwordRule, ok := objval["hotwordRule"].(map[string]interface{}); ok {
rInspectJobInspectConfigRuleSetRules.HotwordRule = &dclService.JobTriggerInspectJobInspectConfigRuleSetRulesHotwordRule{}
if _, ok := rInspectJobInspectConfigRuleSetRulesHotwordRule["hotwordRegex"]; ok {
if rInspectJobInspectConfigRuleSetRulesHotwordRuleHotwordRegex, ok := rInspectJobInspectConfigRuleSetRulesHotwordRule["hotwordRegex"].(map[string]interface{}); ok {
rInspectJobInspectConfigRuleSetRules.HotwordRule.HotwordRegex = &dclService.JobTriggerInspectJobInspectConfigRuleSetRulesHotwordRuleHotwordRegex{}
if _, ok := rInspectJobInspectConfigRuleSetRulesHotwordRuleHotwordRegex["groupIndexes"]; ok {
if s, ok := rInspectJobInspectConfigRuleSetRulesHotwordRuleHotwordRegex["groupIndexes"].([]interface{}); ok {
for _, ss := range s {
if intval, ok := ss.(int64); ok {
rInspectJobInspectConfigRuleSetRules.HotwordRule.HotwordRegex.GroupIndexes = append(rInspectJobInspectConfigRuleSetRules.HotwordRule.HotwordRegex.GroupIndexes, intval)
}
}
} else {
return nil, fmt.Errorf("rInspectJobInspectConfigRuleSetRules.HotwordRule.HotwordRegex.GroupIndexes: expected []interface{}")
}
}
if _, ok := rInspectJobInspectConfigRuleSetRulesHotwordRuleHotwordRegex["pattern"]; ok {
if s, ok := rInspectJobInspectConfigRuleSetRulesHotwordRuleHotwordRegex["pattern"].(string); ok {
rInspectJobInspectConfigRuleSetRules.HotwordRule.HotwordRegex.Pattern = dcl.String(s)
} else {
return nil, fmt.Errorf("rInspectJobInspectConfigRuleSetRules.HotwordRule.HotwordRegex.Pattern: expected string")
}
}
} else {
return nil, fmt.Errorf("rInspectJobInspectConfigRuleSetRules.HotwordRule.HotwordRegex: expected map[string]interface{}")
}
}
if _, ok := rInspectJobInspectConfigRuleSetRulesHotwordRule["likelihoodAdjustment"]; ok {
if rInspectJobInspectConfigRuleSetRulesHotwordRuleLikelihoodAdjustment, ok := rInspectJobInspectConfigRuleSetRulesHotwordRule["likelihoodAdjustment"].(map[string]interface{}); ok {
rInspectJobInspectConfigRuleSetRules.HotwordRule.LikelihoodAdjustment = &dclService.JobTriggerInspectJobInspectConfigRuleSetRulesHotwordRuleLikelihoodAdjustment{}
if _, ok := rInspectJobInspectConfigRuleSetRulesHotwordRuleLikelihoodAdjustment["fixedLikelihood"]; ok {
if s, ok := rInspectJobInspectConfigRuleSetRulesHotwordRuleLikelihoodAdjustment["fixedLikelihood"].(string); ok {
rInspectJobInspectConfigRuleSetRules.HotwordRule.LikelihoodAdjustment.FixedLikelihood = dclService.JobTriggerInspectJobInspectConfigRuleSetRulesHotwordRuleLikelihoodAdjustmentFixedLikelihoodEnumRef(s)
} else {
return nil, fmt.Errorf("rInspectJobInspectConfigRuleSetRules.HotwordRule.LikelihoodAdjustment.FixedLikelihood: expected string")
}
}
if _, ok := rInspectJobInspectConfigRuleSetRulesHotwordRuleLikelihoodAdjustment["relativeLikelihood"]; ok {
if i, ok := rInspectJobInspectConfigRuleSetRulesHotwordRuleLikelihoodAdjustment["relativeLikelihood"].(int64); ok {
rInspectJobInspectConfigRuleSetRules.HotwordRule.LikelihoodAdjustment.RelativeLikelihood = dcl.Int64(i)
} else {
return nil, fmt.Errorf("rInspectJobInspectConfigRuleSetRules.HotwordRule.LikelihoodAdjustment.RelativeLikelihood: expected int64")
}
}
} else {
return nil, fmt.Errorf("rInspectJobInspectConfigRuleSetRules.HotwordRule.LikelihoodAdjustment: expected map[string]interface{}")
}
}
if _, ok := rInspectJobInspectConfigRuleSetRulesHotwordRule["proximity"]; ok {
if rInspectJobInspectConfigRuleSetRulesHotwordRuleProximity, ok := rInspectJobInspectConfigRuleSetRulesHotwordRule["proximity"].(map[string]interface{}); ok {
rInspectJobInspectConfigRuleSetRules.HotwordRule.Proximity = &dclService.JobTriggerInspectJobInspectConfigRuleSetRulesHotwordRuleProximity{}
if _, ok := rInspectJobInspectConfigRuleSetRulesHotwordRuleProximity["windowAfter"]; ok {
if i, ok := rInspectJobInspectConfigRuleSetRulesHotwordRuleProximity["windowAfter"].(int64); ok {
rInspectJobInspectConfigRuleSetRules.HotwordRule.Proximity.WindowAfter = dcl.Int64(i)
} else {
return nil, fmt.Errorf("rInspectJobInspectConfigRuleSetRules.HotwordRule.Proximity.WindowAfter: expected int64")
}
}
if _, ok := rInspectJobInspectConfigRuleSetRulesHotwordRuleProximity["windowBefore"]; ok {
if i, ok := rInspectJobInspectConfigRuleSetRulesHotwordRuleProximity["windowBefore"].(int64); ok {
rInspectJobInspectConfigRuleSetRules.HotwordRule.Proximity.WindowBefore = dcl.Int64(i)
} else {
return nil, fmt.Errorf("rInspectJobInspectConfigRuleSetRules.HotwordRule.Proximity.WindowBefore: expected int64")
}
}
} else {
return nil, fmt.Errorf("rInspectJobInspectConfigRuleSetRules.HotwordRule.Proximity: expected map[string]interface{}")
}
}
} else {
return nil, fmt.Errorf("rInspectJobInspectConfigRuleSetRules.HotwordRule: expected map[string]interface{}")
}
}
rInspectJobInspectConfigRuleSet.Rules = append(rInspectJobInspectConfigRuleSet.Rules, rInspectJobInspectConfigRuleSetRules)
}
}
} else {
return nil, fmt.Errorf("rInspectJobInspectConfigRuleSet.Rules: expected []interface{}")
}
}
r.InspectJob.InspectConfig.RuleSet = append(r.InspectJob.InspectConfig.RuleSet, rInspectJobInspectConfigRuleSet)
}
}
} else {
return nil, fmt.Errorf("r.InspectJob.InspectConfig.RuleSet: expected []interface{}")
}
}
} else {
return nil, fmt.Errorf("r.InspectJob.InspectConfig: expected map[string]interface{}")
}
}
if _, ok := rInspectJob["inspectTemplateName"]; ok {
if s, ok := rInspectJob["inspectTemplateName"].(string); ok {
r.InspectJob.InspectTemplateName = dcl.String(s)
} else {
return nil, fmt.Errorf("r.InspectJob.InspectTemplateName: expected string")
}
}
if _, ok := rInspectJob["storageConfig"]; ok {
if rInspectJobStorageConfig, ok := rInspectJob["storageConfig"].(map[string]interface{}); ok {
r.InspectJob.StorageConfig = &dclService.JobTriggerInspectJobStorageConfig{}
if _, ok := rInspectJobStorageConfig["bigQueryOptions"]; ok {
if rInspectJobStorageConfigBigQueryOptions, ok := rInspectJobStorageConfig["bigQueryOptions"].(map[string]interface{}); ok {
r.InspectJob.StorageConfig.BigQueryOptions = &dclService.JobTriggerInspectJobStorageConfigBigQueryOptions{}
if _, ok := rInspectJobStorageConfigBigQueryOptions["excludedFields"]; ok {
if s, ok := rInspectJobStorageConfigBigQueryOptions["excludedFields"].([]interface{}); ok {
for _, o := range s {
if objval, ok := o.(map[string]interface{}); ok {
var rInspectJobStorageConfigBigQueryOptionsExcludedFields dclService.JobTriggerInspectJobStorageConfigBigQueryOptionsExcludedFields
if _, ok := objval["name"]; ok {
if s, ok := objval["name"].(string); ok {
rInspectJobStorageConfigBigQueryOptionsExcludedFields.Name = dcl.String(s)
} else {
return nil, fmt.Errorf("rInspectJobStorageConfigBigQueryOptionsExcludedFields.Name: expected string")
}
}
r.InspectJob.StorageConfig.BigQueryOptions.ExcludedFields = append(r.InspectJob.StorageConfig.BigQueryOptions.ExcludedFields, rInspectJobStorageConfigBigQueryOptionsExcludedFields)
}
}
} else {
return nil, fmt.Errorf("r.InspectJob.StorageConfig.BigQueryOptions.ExcludedFields: expected []interface{}")
}
}
if _, ok := rInspectJobStorageConfigBigQueryOptions["identifyingFields"]; ok {
if s, ok := rInspectJobStorageConfigBigQueryOptions["identifyingFields"].([]interface{}); ok {
for _, o := range s {
if objval, ok := o.(map[string]interface{}); ok {
var rInspectJobStorageConfigBigQueryOptionsIdentifyingFields dclService.JobTriggerInspectJobStorageConfigBigQueryOptionsIdentifyingFields
if _, ok := objval["name"]; ok {
if s, ok := objval["name"].(string); ok {
rInspectJobStorageConfigBigQueryOptionsIdentifyingFields.Name = dcl.String(s)
} else {
return nil, fmt.Errorf("rInspectJobStorageConfigBigQueryOptionsIdentifyingFields.Name: expected string")
}
}
r.InspectJob.StorageConfig.BigQueryOptions.IdentifyingFields = append(r.InspectJob.StorageConfig.BigQueryOptions.IdentifyingFields, rInspectJobStorageConfigBigQueryOptionsIdentifyingFields)
}
}
} else {
return nil, fmt.Errorf("r.InspectJob.StorageConfig.BigQueryOptions.IdentifyingFields: expected []interface{}")
}
}
if _, ok := rInspectJobStorageConfigBigQueryOptions["includedFields"]; ok {
if s, ok := rInspectJobStorageConfigBigQueryOptions["includedFields"].([]interface{}); ok {
for _, o := range s {
if objval, ok := o.(map[string]interface{}); ok {
var rInspectJobStorageConfigBigQueryOptionsIncludedFields dclService.JobTriggerInspectJobStorageConfigBigQueryOptionsIncludedFields
if _, ok := objval["name"]; ok {
if s, ok := objval["name"].(string); ok {
rInspectJobStorageConfigBigQueryOptionsIncludedFields.Name = dcl.String(s)
} else {
return nil, fmt.Errorf("rInspectJobStorageConfigBigQueryOptionsIncludedFields.Name: expected string")
}
}
r.InspectJob.StorageConfig.BigQueryOptions.IncludedFields = append(r.InspectJob.StorageConfig.BigQueryOptions.IncludedFields, rInspectJobStorageConfigBigQueryOptionsIncludedFields)
}
}
} else {
return nil, fmt.Errorf("r.InspectJob.StorageConfig.BigQueryOptions.IncludedFields: expected []interface{}")
}
}
if _, ok := rInspectJobStorageConfigBigQueryOptions["rowsLimit"]; ok {
if i, ok := rInspectJobStorageConfigBigQueryOptions["rowsLimit"].(int64); ok {
r.InspectJob.StorageConfig.BigQueryOptions.RowsLimit = dcl.Int64(i)
} else {
return nil, fmt.Errorf("r.InspectJob.StorageConfig.BigQueryOptions.RowsLimit: expected int64")
}
}
if _, ok := rInspectJobStorageConfigBigQueryOptions["rowsLimitPercent"]; ok {
if i, ok := rInspectJobStorageConfigBigQueryOptions["rowsLimitPercent"].(int64); ok {
r.InspectJob.StorageConfig.BigQueryOptions.RowsLimitPercent = dcl.Int64(i)
} else {
return nil, fmt.Errorf("r.InspectJob.StorageConfig.BigQueryOptions.RowsLimitPercent: expected int64")
}
}
if _, ok := rInspectJobStorageConfigBigQueryOptions["sampleMethod"]; ok {
if s, ok := rInspectJobStorageConfigBigQueryOptions["sampleMethod"].(string); ok {
r.InspectJob.StorageConfig.BigQueryOptions.SampleMethod = dclService.JobTriggerInspectJobStorageConfigBigQueryOptionsSampleMethodEnumRef(s)
} else {
return nil, fmt.Errorf("r.InspectJob.StorageConfig.BigQueryOptions.SampleMethod: expected string")
}
}
if _, ok := rInspectJobStorageConfigBigQueryOptions["tableReference"]; ok {
if rInspectJobStorageConfigBigQueryOptionsTableReference, ok := rInspectJobStorageConfigBigQueryOptions["tableReference"].(map[string]interface{}); ok {
r.InspectJob.StorageConfig.BigQueryOptions.TableReference = &dclService.JobTriggerInspectJobStorageConfigBigQueryOptionsTableReference{}
if _, ok := rInspectJobStorageConfigBigQueryOptionsTableReference["datasetId"]; ok {
if s, ok := rInspectJobStorageConfigBigQueryOptionsTableReference["datasetId"].(string); ok {
r.InspectJob.StorageConfig.BigQueryOptions.TableReference.DatasetId = dcl.String(s)
} else {
return nil, fmt.Errorf("r.InspectJob.StorageConfig.BigQueryOptions.TableReference.DatasetId: expected string")
}
}
if _, ok := rInspectJobStorageConfigBigQueryOptionsTableReference["projectId"]; ok {
if s, ok := rInspectJobStorageConfigBigQueryOptionsTableReference["projectId"].(string); ok {
r.InspectJob.StorageConfig.BigQueryOptions.TableReference.ProjectId = dcl.String(s)
} else {
return nil, fmt.Errorf("r.InspectJob.StorageConfig.BigQueryOptions.TableReference.ProjectId: expected string")
}
}
if _, ok := rInspectJobStorageConfigBigQueryOptionsTableReference["tableId"]; ok {
if s, ok := rInspectJobStorageConfigBigQueryOptionsTableReference["tableId"].(string); ok {
r.InspectJob.StorageConfig.BigQueryOptions.TableReference.TableId = dcl.String(s)
} else {
return nil, fmt.Errorf("r.InspectJob.StorageConfig.BigQueryOptions.TableReference.TableId: expected string")
}
}
} else {
return nil, fmt.Errorf("r.InspectJob.StorageConfig.BigQueryOptions.TableReference: expected map[string]interface{}")
}
}
} else {
return nil, fmt.Errorf("r.InspectJob.StorageConfig.BigQueryOptions: expected map[string]interface{}")
}
}
if _, ok := rInspectJobStorageConfig["cloudStorageOptions"]; ok {
if rInspectJobStorageConfigCloudStorageOptions, ok := rInspectJobStorageConfig["cloudStorageOptions"].(map[string]interface{}); ok {
r.InspectJob.StorageConfig.CloudStorageOptions = &dclService.JobTriggerInspectJobStorageConfigCloudStorageOptions{}
if _, ok := rInspectJobStorageConfigCloudStorageOptions["bytesLimitPerFile"]; ok {
if i, ok := rInspectJobStorageConfigCloudStorageOptions["bytesLimitPerFile"].(int64); ok {
r.InspectJob.StorageConfig.CloudStorageOptions.BytesLimitPerFile = dcl.Int64(i)
} else {
return nil, fmt.Errorf("r.InspectJob.StorageConfig.CloudStorageOptions.BytesLimitPerFile: expected int64")
}
}
if _, ok := rInspectJobStorageConfigCloudStorageOptions["bytesLimitPerFilePercent"]; ok {
if i, ok := rInspectJobStorageConfigCloudStorageOptions["bytesLimitPerFilePercent"].(int64); ok {
r.InspectJob.StorageConfig.CloudStorageOptions.BytesLimitPerFilePercent = dcl.Int64(i)
} else {
return nil, fmt.Errorf("r.InspectJob.StorageConfig.CloudStorageOptions.BytesLimitPerFilePercent: expected int64")
}
}
if _, ok := rInspectJobStorageConfigCloudStorageOptions["fileSet"]; ok {
if rInspectJobStorageConfigCloudStorageOptionsFileSet, ok := rInspectJobStorageConfigCloudStorageOptions["fileSet"].(map[string]interface{}); ok {
r.InspectJob.StorageConfig.CloudStorageOptions.FileSet = &dclService.JobTriggerInspectJobStorageConfigCloudStorageOptionsFileSet{}
if _, ok := rInspectJobStorageConfigCloudStorageOptionsFileSet["regexFileSet"]; ok {
if rInspectJobStorageConfigCloudStorageOptionsFileSetRegexFileSet, ok := rInspectJobStorageConfigCloudStorageOptionsFileSet["regexFileSet"].(map[string]interface{}); ok {
r.InspectJob.StorageConfig.CloudStorageOptions.FileSet.RegexFileSet = &dclService.JobTriggerInspectJobStorageConfigCloudStorageOptionsFileSetRegexFileSet{}
if _, ok := rInspectJobStorageConfigCloudStorageOptionsFileSetRegexFileSet["bucketName"]; ok {
if s, ok := rInspectJobStorageConfigCloudStorageOptionsFileSetRegexFileSet["bucketName"].(string); ok {
r.InspectJob.StorageConfig.CloudStorageOptions.FileSet.RegexFileSet.BucketName = dcl.String(s)
} else {
return nil, fmt.Errorf("r.InspectJob.StorageConfig.CloudStorageOptions.FileSet.RegexFileSet.BucketName: expected string")
}
}
if _, ok := rInspectJobStorageConfigCloudStorageOptionsFileSetRegexFileSet["excludeRegex"]; ok {
if s, ok := rInspectJobStorageConfigCloudStorageOptionsFileSetRegexFileSet["excludeRegex"].([]interface{}); ok {
for _, ss := range s {
if strval, ok := ss.(string); ok {
r.InspectJob.StorageConfig.CloudStorageOptions.FileSet.RegexFileSet.ExcludeRegex = append(r.InspectJob.StorageConfig.CloudStorageOptions.FileSet.RegexFileSet.ExcludeRegex, strval)
}
}
} else {
return nil, fmt.Errorf("r.InspectJob.StorageConfig.CloudStorageOptions.FileSet.RegexFileSet.ExcludeRegex: expected []interface{}")
}
}
if _, ok := rInspectJobStorageConfigCloudStorageOptionsFileSetRegexFileSet["includeRegex"]; ok {
if s, ok := rInspectJobStorageConfigCloudStorageOptionsFileSetRegexFileSet["includeRegex"].([]interface{}); ok {
for _, ss := range s {
if strval, ok := ss.(string); ok {
r.InspectJob.StorageConfig.CloudStorageOptions.FileSet.RegexFileSet.IncludeRegex = append(r.InspectJob.StorageConfig.CloudStorageOptions.FileSet.RegexFileSet.IncludeRegex, strval)
}
}
} else {
return nil, fmt.Errorf("r.InspectJob.StorageConfig.CloudStorageOptions.FileSet.RegexFileSet.IncludeRegex: expected []interface{}")
}
}
} else {
return nil, fmt.Errorf("r.InspectJob.StorageConfig.CloudStorageOptions.FileSet.RegexFileSet: expected map[string]interface{}")
}
}
if _, ok := rInspectJobStorageConfigCloudStorageOptionsFileSet["url"]; ok {
if s, ok := rInspectJobStorageConfigCloudStorageOptionsFileSet["url"].(string); ok {
r.InspectJob.StorageConfig.CloudStorageOptions.FileSet.Url = dcl.String(s)
} else {
return nil, fmt.Errorf("r.InspectJob.StorageConfig.CloudStorageOptions.FileSet.Url: expected string")
}
}
} else {
return nil, fmt.Errorf("r.InspectJob.StorageConfig.CloudStorageOptions.FileSet: expected map[string]interface{}")
}
}
if _, ok := rInspectJobStorageConfigCloudStorageOptions["fileTypes"]; ok {
if s, ok := rInspectJobStorageConfigCloudStorageOptions["fileTypes"].([]interface{}); ok {
for _, ss := range s {
if strval, ok := ss.(string); ok {
r.InspectJob.StorageConfig.CloudStorageOptions.FileTypes = append(r.InspectJob.StorageConfig.CloudStorageOptions.FileTypes, dclService.JobTriggerInspectJobStorageConfigCloudStorageOptionsFileTypesEnum(strval))
}
}
} else {
return nil, fmt.Errorf("r.InspectJob.StorageConfig.CloudStorageOptions.FileTypes: expected []interface{}")
}
}
if _, ok := rInspectJobStorageConfigCloudStorageOptions["filesLimitPercent"]; ok {
if i, ok := rInspectJobStorageConfigCloudStorageOptions["filesLimitPercent"].(int64); ok {
r.InspectJob.StorageConfig.CloudStorageOptions.FilesLimitPercent = dcl.Int64(i)
} else {
return nil, fmt.Errorf("r.InspectJob.StorageConfig.CloudStorageOptions.FilesLimitPercent: expected int64")
}
}
if _, ok := rInspectJobStorageConfigCloudStorageOptions["sampleMethod"]; ok {
if s, ok := rInspectJobStorageConfigCloudStorageOptions["sampleMethod"].(string); ok {
r.InspectJob.StorageConfig.CloudStorageOptions.SampleMethod = dclService.JobTriggerInspectJobStorageConfigCloudStorageOptionsSampleMethodEnumRef(s)
} else {
return nil, fmt.Errorf("r.InspectJob.StorageConfig.CloudStorageOptions.SampleMethod: expected string")
}
}
} else {
return nil, fmt.Errorf("r.InspectJob.StorageConfig.CloudStorageOptions: expected map[string]interface{}")
}
}
if _, ok := rInspectJobStorageConfig["datastoreOptions"]; ok {
if rInspectJobStorageConfigDatastoreOptions, ok := rInspectJobStorageConfig["datastoreOptions"].(map[string]interface{}); ok {
r.InspectJob.StorageConfig.DatastoreOptions = &dclService.JobTriggerInspectJobStorageConfigDatastoreOptions{}
if _, ok := rInspectJobStorageConfigDatastoreOptions["kind"]; ok {
if rInspectJobStorageConfigDatastoreOptionsKind, ok := rInspectJobStorageConfigDatastoreOptions["kind"].(map[string]interface{}); ok {
r.InspectJob.StorageConfig.DatastoreOptions.Kind = &dclService.JobTriggerInspectJobStorageConfigDatastoreOptionsKind{}
if _, ok := rInspectJobStorageConfigDatastoreOptionsKind["name"]; ok {
if s, ok := rInspectJobStorageConfigDatastoreOptionsKind["name"].(string); ok {
r.InspectJob.StorageConfig.DatastoreOptions.Kind.Name = dcl.String(s)
} else {
return nil, fmt.Errorf("r.InspectJob.StorageConfig.DatastoreOptions.Kind.Name: expected string")
}
}
} else {
return nil, fmt.Errorf("r.InspectJob.StorageConfig.DatastoreOptions.Kind: expected map[string]interface{}")
}
}
if _, ok := rInspectJobStorageConfigDatastoreOptions["partitionId"]; ok {
if rInspectJobStorageConfigDatastoreOptionsPartitionId, ok := rInspectJobStorageConfigDatastoreOptions["partitionId"].(map[string]interface{}); ok {
r.InspectJob.StorageConfig.DatastoreOptions.PartitionId = &dclService.JobTriggerInspectJobStorageConfigDatastoreOptionsPartitionId{}
if _, ok := rInspectJobStorageConfigDatastoreOptionsPartitionId["namespaceId"]; ok {
if s, ok := rInspectJobStorageConfigDatastoreOptionsPartitionId["namespaceId"].(string); ok {
r.InspectJob.StorageConfig.DatastoreOptions.PartitionId.NamespaceId = dcl.String(s)
} else {
return nil, fmt.Errorf("r.InspectJob.StorageConfig.DatastoreOptions.PartitionId.NamespaceId: expected string")
}
}
if _, ok := rInspectJobStorageConfigDatastoreOptionsPartitionId["projectId"]; ok {
if s, ok := rInspectJobStorageConfigDatastoreOptionsPartitionId["projectId"].(string); ok {
r.InspectJob.StorageConfig.DatastoreOptions.PartitionId.ProjectId = dcl.String(s)
} else {
return nil, fmt.Errorf("r.InspectJob.StorageConfig.DatastoreOptions.PartitionId.ProjectId: expected string")
}
}
} else {
return nil, fmt.Errorf("r.InspectJob.StorageConfig.DatastoreOptions.PartitionId: expected map[string]interface{}")
}
}
} else {
return nil, fmt.Errorf("r.InspectJob.StorageConfig.DatastoreOptions: expected map[string]interface{}")
}
}
if _, ok := rInspectJobStorageConfig["hybridOptions"]; ok {
if rInspectJobStorageConfigHybridOptions, ok := rInspectJobStorageConfig["hybridOptions"].(map[string]interface{}); ok {
r.InspectJob.StorageConfig.HybridOptions = &dclService.JobTriggerInspectJobStorageConfigHybridOptions{}
if _, ok := rInspectJobStorageConfigHybridOptions["description"]; ok {
if s, ok := rInspectJobStorageConfigHybridOptions["description"].(string); ok {
r.InspectJob.StorageConfig.HybridOptions.Description = dcl.String(s)
} else {
return nil, fmt.Errorf("r.InspectJob.StorageConfig.HybridOptions.Description: expected string")
}
}
if _, ok := rInspectJobStorageConfigHybridOptions["labels"]; ok {
if rInspectJobStorageConfigHybridOptionsLabels, ok := rInspectJobStorageConfigHybridOptions["labels"].(map[string]interface{}); ok {
m := make(map[string]string)
for k, v := range rInspectJobStorageConfigHybridOptionsLabels {
if s, ok := v.(string); ok {
m[k] = s
}
}
r.InspectJob.StorageConfig.HybridOptions.Labels = m
} else {
return nil, fmt.Errorf("r.InspectJob.StorageConfig.HybridOptions.Labels: expected map[string]interface{}")
}
}
if _, ok := rInspectJobStorageConfigHybridOptions["requiredFindingLabelKeys"]; ok {
if s, ok := rInspectJobStorageConfigHybridOptions["requiredFindingLabelKeys"].([]interface{}); ok {
for _, ss := range s {
if strval, ok := ss.(string); ok {
r.InspectJob.StorageConfig.HybridOptions.RequiredFindingLabelKeys = append(r.InspectJob.StorageConfig.HybridOptions.RequiredFindingLabelKeys, strval)
}
}
} else {
return nil, fmt.Errorf("r.InspectJob.StorageConfig.HybridOptions.RequiredFindingLabelKeys: expected []interface{}")
}
}
if _, ok := rInspectJobStorageConfigHybridOptions["tableOptions"]; ok {
if rInspectJobStorageConfigHybridOptionsTableOptions, ok := rInspectJobStorageConfigHybridOptions["tableOptions"].(map[string]interface{}); ok {
r.InspectJob.StorageConfig.HybridOptions.TableOptions = &dclService.JobTriggerInspectJobStorageConfigHybridOptionsTableOptions{}
if _, ok := rInspectJobStorageConfigHybridOptionsTableOptions["identifyingFields"]; ok {
if s, ok := rInspectJobStorageConfigHybridOptionsTableOptions["identifyingFields"].([]interface{}); ok {
for _, o := range s {
if objval, ok := o.(map[string]interface{}); ok {
var rInspectJobStorageConfigHybridOptionsTableOptionsIdentifyingFields dclService.JobTriggerInspectJobStorageConfigHybridOptionsTableOptionsIdentifyingFields
if _, ok := objval["name"]; ok {
if s, ok := objval["name"].(string); ok {
rInspectJobStorageConfigHybridOptionsTableOptionsIdentifyingFields.Name = dcl.String(s)
} else {
return nil, fmt.Errorf("rInspectJobStorageConfigHybridOptionsTableOptionsIdentifyingFields.Name: expected string")
}
}
r.InspectJob.StorageConfig.HybridOptions.TableOptions.IdentifyingFields = append(r.InspectJob.StorageConfig.HybridOptions.TableOptions.IdentifyingFields, rInspectJobStorageConfigHybridOptionsTableOptionsIdentifyingFields)
}
}
} else {
return nil, fmt.Errorf("r.InspectJob.StorageConfig.HybridOptions.TableOptions.IdentifyingFields: expected []interface{}")
}
}
} else {
return nil, fmt.Errorf("r.InspectJob.StorageConfig.HybridOptions.TableOptions: expected map[string]interface{}")
}
}
} else {
return nil, fmt.Errorf("r.InspectJob.StorageConfig.HybridOptions: expected map[string]interface{}")
}
}
if _, ok := rInspectJobStorageConfig["timespanConfig"]; ok {
if rInspectJobStorageConfigTimespanConfig, ok := rInspectJobStorageConfig["timespanConfig"].(map[string]interface{}); ok {
r.InspectJob.StorageConfig.TimespanConfig = &dclService.JobTriggerInspectJobStorageConfigTimespanConfig{}
if _, ok := rInspectJobStorageConfigTimespanConfig["enableAutoPopulationOfTimespanConfig"]; ok {
if b, ok := rInspectJobStorageConfigTimespanConfig["enableAutoPopulationOfTimespanConfig"].(bool); ok {
r.InspectJob.StorageConfig.TimespanConfig.EnableAutoPopulationOfTimespanConfig = dcl.Bool(b)
} else {
return nil, fmt.Errorf("r.InspectJob.StorageConfig.TimespanConfig.EnableAutoPopulationOfTimespanConfig: expected bool")
}
}
if _, ok := rInspectJobStorageConfigTimespanConfig["endTime"]; ok {
if s, ok := rInspectJobStorageConfigTimespanConfig["endTime"].(string); ok {
r.InspectJob.StorageConfig.TimespanConfig.EndTime = dcl.String(s)
} else {
return nil, fmt.Errorf("r.InspectJob.StorageConfig.TimespanConfig.EndTime: expected string")
}
}
if _, ok := rInspectJobStorageConfigTimespanConfig["startTime"]; ok {
if s, ok := rInspectJobStorageConfigTimespanConfig["startTime"].(string); ok {
r.InspectJob.StorageConfig.TimespanConfig.StartTime = dcl.String(s)
} else {
return nil, fmt.Errorf("r.InspectJob.StorageConfig.TimespanConfig.StartTime: expected string")
}
}
if _, ok := rInspectJobStorageConfigTimespanConfig["timestampField"]; ok {
if rInspectJobStorageConfigTimespanConfigTimestampField, ok := rInspectJobStorageConfigTimespanConfig["timestampField"].(map[string]interface{}); ok {
r.InspectJob.StorageConfig.TimespanConfig.TimestampField = &dclService.JobTriggerInspectJobStorageConfigTimespanConfigTimestampField{}
if _, ok := rInspectJobStorageConfigTimespanConfigTimestampField["name"]; ok {
if s, ok := rInspectJobStorageConfigTimespanConfigTimestampField["name"].(string); ok {
r.InspectJob.StorageConfig.TimespanConfig.TimestampField.Name = dcl.String(s)
} else {
return nil, fmt.Errorf("r.InspectJob.StorageConfig.TimespanConfig.TimestampField.Name: expected string")
}
}
} else {
return nil, fmt.Errorf("r.InspectJob.StorageConfig.TimespanConfig.TimestampField: expected map[string]interface{}")
}
}
} else {
return nil, fmt.Errorf("r.InspectJob.StorageConfig.TimespanConfig: expected map[string]interface{}")
}
}
} else {
return nil, fmt.Errorf("r.InspectJob.StorageConfig: expected map[string]interface{}")
}
}
} else {
return nil, fmt.Errorf("r.InspectJob: expected map[string]interface{}")
}
}
if _, ok := u.Object["lastRunTime"]; ok {
if s, ok := u.Object["lastRunTime"].(string); ok {
r.LastRunTime = dcl.String(s)
} else {
return nil, fmt.Errorf("r.LastRunTime: expected string")
}
}
if _, ok := u.Object["location"]; ok {
if s, ok := u.Object["location"].(string); ok {
r.Location = dcl.String(s)
} else {
return nil, fmt.Errorf("r.Location: expected string")
}
}
if _, ok := u.Object["locationId"]; ok {
if s, ok := u.Object["locationId"].(string); ok {
r.LocationId = dcl.String(s)
} else {
return nil, fmt.Errorf("r.LocationId: expected string")
}
}
if _, ok := u.Object["name"]; ok {
if s, ok := u.Object["name"].(string); ok {
r.Name = dcl.String(s)
} else {
return nil, fmt.Errorf("r.Name: expected string")
}
}
if _, ok := u.Object["parent"]; ok {
if s, ok := u.Object["parent"].(string); ok {
r.Parent = dcl.String(s)
} else {
return nil, fmt.Errorf("r.Parent: expected string")
}
}
if _, ok := u.Object["status"]; ok {
if s, ok := u.Object["status"].(string); ok {
r.Status = dclService.JobTriggerStatusEnumRef(s)
} else {
return nil, fmt.Errorf("r.Status: expected string")
}
}
if _, ok := u.Object["triggers"]; ok {
if s, ok := u.Object["triggers"].([]interface{}); ok {
for _, o := range s {
if objval, ok := o.(map[string]interface{}); ok {
var rTriggers dclService.JobTriggerTriggers
if _, ok := objval["manual"]; ok {
if _, ok := objval["manual"].(map[string]interface{}); ok {
rTriggers.Manual = &dclService.JobTriggerTriggersManual{}
} else {
return nil, fmt.Errorf("rTriggers.Manual: expected map[string]interface{}")
}
}
if _, ok := objval["schedule"]; ok {
if rTriggersSchedule, ok := objval["schedule"].(map[string]interface{}); ok {
rTriggers.Schedule = &dclService.JobTriggerTriggersSchedule{}
if _, ok := rTriggersSchedule["recurrencePeriodDuration"]; ok {
if s, ok := rTriggersSchedule["recurrencePeriodDuration"].(string); ok {
rTriggers.Schedule.RecurrencePeriodDuration = dcl.String(s)
} else {
return nil, fmt.Errorf("rTriggers.Schedule.RecurrencePeriodDuration: expected string")
}
}
} else {
return nil, fmt.Errorf("rTriggers.Schedule: expected map[string]interface{}")
}
}
r.Triggers = append(r.Triggers, rTriggers)
}
}
} else {
return nil, fmt.Errorf("r.Triggers: expected []interface{}")
}
}
if _, ok := u.Object["updateTime"]; ok {
if s, ok := u.Object["updateTime"].(string); ok {
r.UpdateTime = dcl.String(s)
} else {
return nil, fmt.Errorf("r.UpdateTime: expected string")
}
}
return r, nil
}