query
stringlengths 8
6.75k
| document
stringlengths 9
1.89M
| negatives
listlengths 19
19
| metadata
dict |
---|---|---|---|
NewConfigurationManager_updateConfiguration_Results creates a new list of ConfigurationManager_updateConfiguration_Results.
|
func NewConfigurationManager_updateConfiguration_Results_List(s *capnp.Segment, sz int32) (ConfigurationManager_updateConfiguration_Results_List, error) {
l, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}, sz)
return ConfigurationManager_updateConfiguration_Results_List{l}, err
}
|
[
"func (s ConfigurationManager_updateConfiguration_Results) NewResult() (UpdateConfigurationResponse, error) {\n\tss, err := NewUpdateConfigurationResponse(s.Struct.Segment())\n\tif err != nil {\n\t\treturn UpdateConfigurationResponse{}, err\n\t}\n\terr = s.Struct.SetPtr(0, ss.Struct.ToPtr())\n\treturn ss, err\n}",
"func NewApp_configs_Results_List(s *capnp.Segment, sz int32) (App_configs_Results_List, error) {\n\tl, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}, sz)\n\treturn App_configs_Results_List{l}, err\n}",
"func NewRegistrationServer_updateLocalConfiguration_Results_List(s *capnp.Segment, sz int32) (RegistrationServer_updateLocalConfiguration_Results_List, error) {\n\tl, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 0, PointerCount: 0}, sz)\n\treturn RegistrationServer_updateLocalConfiguration_Results_List{l}, err\n}",
"func NewConfigurationManager_updateConfiguration_Params_List(s *capnp.Segment, sz int32) (ConfigurationManager_updateConfiguration_Params_List, error) {\n\tl, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 8, PointerCount: 1}, sz)\n\treturn ConfigurationManager_updateConfiguration_Params_List{l}, err\n}",
"func NewUpdateConfigurationResponse_List(s *capnp.Segment, sz int32) (UpdateConfigurationResponse_List, error) {\n\tl, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 8, PointerCount: 1}, sz)\n\treturn UpdateConfigurationResponse_List{l}, err\n}",
"func NewConfigurationUpdate(value []string) *ConfigurationUpdate {\n\tthis := ConfigurationUpdate{}\n\tthis.Value = value\n\treturn &this\n}",
"func NewConfigs_configDir_Results_List(s *capnp.Segment, sz int32) (Configs_configDir_Results_List, error) {\n\tl, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}, sz)\n\treturn Configs_configDir_Results_List{l}, err\n}",
"func (r *Repository) applyUpdateResult(update Update, result updateResult) {\n\t// 4.b Save all the updated and new config files\n\tfor product, configs := range result.changed {\n\t\tfor path, config := range configs {\n\t\t\tm := r.configs[product]\n\t\t\tm[path] = config\n\t\t}\n\t}\n\tfor path, metadata := range result.metadata {\n\t\tr.metadata[path] = metadata\n\t}\n\n\t// 5.b Clean up the cache of any removed configs\n\tfor _, path := range result.removed {\n\t\tdelete(r.metadata, path)\n\t\tfor _, configs := range r.configs {\n\t\t\tdelete(configs, path)\n\t\t}\n\t}\n}",
"func NewConfigs_serviceIds_Results_List(s *capnp.Segment, sz int32) (Configs_serviceIds_Results_List, error) {\n\tl, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}, sz)\n\treturn Configs_serviceIds_Results_List{l}, err\n}",
"func NewUpdateConfigurationsParams() *UpdateConfigurationsParams {\n\treturn &UpdateConfigurationsParams{\n\t\ttimeout: cr.DefaultTimeout,\n\t}\n}",
"func UA_MonitoredItemModifyResult_new() []UA_MonitoredItemModifyResult {\n\treturn UA_new((*[100000000]UA_DataType)(unsafe.Pointer(&UA_TYPES[31]))[:]).([]UA_MonitoredItemModifyResult)\n}",
"func (r *RegexpManager) UpdateFromConf(res []tomlconf.Regexp, root *template.Template) error {\n\tvar reList RegexpList\n\n\tr.game.Debug(\"regex manager reloading\")\n\n\tfor _, reConf := range res {\n\t\tre, err := NewRegexp(reConf, r, root)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tr.game.Debugf(\"adding regexp %s\", re)\n\t\treList = append(reList, re)\n\t}\n\n\tsort.Sort(reList)\n\tr.Lock()\n\tr.regexps = reList\n\tr.Unlock()\n\tr.game.Debug(\"regexp manager reload complete\")\n\n\treturn nil\n}",
"func ListOfConfigurations(api restapi.API, filter string) {\n\t// TODO: filter in query?\n\t// try to read list of configurations and display error if something\n\t// wrong happens\n\tconfigurations, err := api.ReadListOfConfigurations()\n\tif err != nil {\n\t\tfmt.Println(colorizer.Red(ErrorReadingListOfConfigurations))\n\t\tfmt.Println(err)\n\t\treturn\n\t}\n\n\t// list all configurations returned in HTTP response\n\tfmt.Println(colorizer.Magenta(\"List of configurations for all clusters\"))\n\tfmt.Printf(\"%4s %4s %4s %-20s %-20s %-10s %-12s %s\\n\", \"#\", \"ID\", \"Profile\", clusterUUID, changedAt, changedBy, activeTrigger, \"Reason\")\n\tfor i, configuration := range configurations {\n\t\t// perform poor man's filtering on client side\n\t\tif strings.Contains(configuration.Cluster, filter) {\n\t\t\tvar active aurora.Value\n\t\t\tif configuration.Active == \"1\" {\n\t\t\t\tactive = colorizer.Green(conditionSet)\n\t\t\t} else {\n\t\t\t\tactive = colorizer.Red(\"no\")\n\t\t\t}\n\t\t\tchangedAt := configuration.ChangedAt[0:19]\n\t\t\tfmt.Printf(\"%4d %4d %4s %-20s %-20s %-10s %-12s %s\\n\", i, configuration.ID, configuration.Configuration, configuration.Cluster, changedAt, configuration.ChangedBy, active, configuration.Reason)\n\t\t}\n\t}\n}",
"func updateListPoolsResponse(finalResp *control.ListPoolsResp, resp *control.ListPoolsResp, rebuildOnly bool) error {\n\tfor _, pool := range resp.Pools {\n\t\tif !rebuildOnly || pool.RebuildState != \"idle\" {\n\t\t\tfinalResp.Pools = append(finalResp.Pools, pool)\n\t\t}\n\t}\n\n\treturn nil\n}",
"func (this *AP) __updateConfigurationResponse() {\n\t// AP 给AC发送响应请求\n\tsMsg := this.tlv.packDisc(this.updateHeaderMsg(), this.updateDataMsg())\n\tthis.sendMsg(sMsg)\n\t// 设置下个code 和Action\n\tthis.APStatusCode = 7\n\t// AP 动作 Action 1 请求配置\n\tthis.Action = \"00000001\"\n}",
"func NewBackend_installPackage_Results_List(s *capnp.Segment, sz int32) (Backend_installPackage_Results_List, error) {\n\tl, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}, sz)\n\treturn capnp.StructList[Backend_installPackage_Results](l), err\n}",
"func NewConfigs_configDirExists_Results_List(s *capnp.Segment, sz int32) (Configs_configDirExists_Results_List, error) {\n\tl, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 8, PointerCount: 0}, sz)\n\treturn Configs_configDirExists_Results_List{l}, err\n}",
"func NewApp_releaseId_Results_List(s *capnp.Segment, sz int32) (App_releaseId_Results_List, error) {\n\tl, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 8, PointerCount: 0}, sz)\n\treturn App_releaseId_Results_List{l}, err\n}",
"func NewApp_instance_Results_List(s *capnp.Segment, sz int32) (App_instance_Results_List, error) {\n\tl, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 0, PointerCount: 1}, sz)\n\treturn App_instance_Results_List{l}, err\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
NewType registers a new type in a Registry
|
func (r *Registry) NewType(structure interface{}, cue StorageCue) (*Type, error) {
t := &Type{
name: reflect.TypeOf(structure).String(),
structure: structure,
registry: r,
storageCue: cue,
fieldTag: map[string]string{},
tagField: map[string]string{},
}
st := reflect.Indirect(reflect.ValueOf(structure)).Type()
for i := 0; i < st.NumField(); i++ {
f := st.Field(i)
if tag, ok := f.Tag.Lookup("registry"); ok {
t.fieldTag[f.Name] = tag
t.tagField[tag] = f.Name
}
}
if err := r.storage.NewType(t); err != nil {
return nil, err
}
r.types[t.name] = t
return t, nil
}
|
[
"func RegisterType(t reflect.Type) string {\n\tif initialized {\n\t\tpanic(\"Init hooks have already run. Register type during init() instead.\")\n\t}\n\n\tt = reflectx.SkipPtr(t)\n\n\tk, ok := TypeKey(t)\n\tif !ok {\n\t\tpanic(fmt.Sprintf(\"invalid registration type: %v\", t))\n\t}\n\n\tif v, exists := types[k]; exists && v != t {\n\t\tpanic(fmt.Sprintf(\"type already registered for %v, and new type %v != %v (existing type)\", k, t, v))\n\t}\n\ttypes[k] = t\n\treturn k\n}",
"func NewTypeRegistry() TypeRegistry {\n\treturn newTypeRegistry()\n}",
"func RegisterType(name string, f Factory) {\n\tif queueReg[name] != nil {\n\t\tpanic(fmt.Errorf(\"queue type '%v' exists already\", name))\n\t}\n\tqueueReg[name] = f\n}",
"func RegisterType(L *lua.LState) {\n\tmt := L.NewTypeMetatable(MetaTableName)\n\n\tL.SetGlobal(\"RSA\", mt)\n\tL.SetField(mt, \"new\", L.NewFunction(lCreate))\n\tL.SetField(mt, \"__index\", L.SetFuncs(L.NewTable(), map[string]lua.LGFunction{\n\t\t\"exportCertificate\": lExportCertificate,\n\t\t\"certificateExport\": lExportCertificate,\n\t\t\"exportCertificate64\": lExportCertificateB64,\n\t\t\"certificateExport64\": lExportCertificateB64,\n\t\t\"signSHA256String64\": lSign256StringB64,\n\t\t\"signSHA256Int64\": lSign256BLongSliceB64,\n\t\t\"signSHA256Long64\": lSign256BLongSliceB64,\n\t}))\n}",
"func (br BindnodeRegistry) RegisterType(ptrType interface{}, schema string, typeName string, options ...bindnode.Option) (err error) {\n\ttyp := typeOf(ptrType)\n\tif _, ok := br[typ]; ok {\n\t\treturn fmt.Errorf(\"bindnode utils: type already registered: %s\", typ.Name())\n\t}\n\ttypeSystem, err := ipld.LoadSchemaBytes([]byte(schema))\n\tif err != nil {\n\t\treturn fmt.Errorf(\"bindnode utils: failed to load schema: %s\", err.Error())\n\t}\n\tschemaType := typeSystem.TypeByName(typeName)\n\tif schemaType == nil {\n\t\treturn fmt.Errorf(\"bindnode utils: schema for [%T] does not contain that named type [%s]\", ptrType, typ.Name())\n\t}\n\n\t// focusing on bindnode setup panics\n\tdefer func() {\n\t\tif rec := recover(); rec != nil {\n\t\t\tswitch v := rec.(type) {\n\t\t\tcase string:\n\t\t\t\terr = fmt.Errorf(v)\n\t\t\tcase error:\n\t\t\t\terr = v\n\t\t\tdefault:\n\t\t\t\tpanic(rec)\n\t\t\t}\n\t\t}\n\t}()\n\n\tproto := bindnode.Prototype(ptrType, schemaType, options...)\n\tbr[typ] = prototypeData{\n\t\tproto,\n\t\toptions,\n\t}\n\n\treturn err\n}",
"func newType(rt reflect.Type) (Type, error) {\n\tvar err error\n\tvar type0, type1 Type\n\tdefer func() {\n\t\tif err != nil {\n\t\t\tdelete(types, rt)\n\t\t}\n\t}()\n\n\tname := nameFromType(rt)\n\tid := ID(adler32.Checksum([]byte(name)))\n\n\t// Install the top-level type before the subtypes (e.g. struct before\n\t// fields) so recursive types can be constructed safely.\n\tswitch rt.Kind() {\n\t// All basic types are easy: they are predefined.\n\tcase reflect.Bool:\n\t\treturn tBool.Type(), nil\n\n\tcase reflect.Int:\n\t\treturn tInt.Type(), nil\n\n\tcase reflect.Int8:\n\t\treturn tInt8.Type(), nil\n\n\tcase reflect.Int16:\n\t\treturn tInt16.Type(), nil\n\n\tcase reflect.Int32:\n\t\treturn tInt32.Type(), nil\n\n\tcase reflect.Int64:\n\t\treturn tInt64.Type(), nil\n\n\tcase reflect.Uint:\n\t\treturn tUint.Type(), nil\n\n\tcase reflect.Uint8:\n\t\treturn tUint8.Type(), nil\n\n\tcase reflect.Uint16:\n\t\treturn tUint16.Type(), nil\n\n\tcase reflect.Uint32:\n\t\treturn tUint32.Type(), nil\n\n\tcase reflect.Uint64:\n\t\treturn tUint64.Type(), nil\n\n\tcase reflect.Uintptr:\n\t\treturn tUintptr.Type(), nil\n\n\tcase reflect.Float32:\n\t\treturn tFloat32.Type(), nil\n\n\tcase reflect.Float64:\n\t\treturn tFloat64.Type(), nil\n\n\tcase reflect.Complex64:\n\t\treturn tComplex64.Type(), nil\n\n\tcase reflect.Complex128:\n\t\treturn tComplex128.Type(), nil\n\n\tcase reflect.String:\n\t\treturn tString.Type(), nil\n\n\tcase reflect.Interface:\n\t\treturn tInterface.Type(), nil\n\n\tcase reflect.Array:\n\t\tat := newArrayType(name, id, rt)\n\t\ttypes[rt] = at\n\t\ttype0, err = newType(rt.Elem())\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tat.init(type0, rt.Len())\n\t\treturn at, err\n\n\tcase reflect.Map:\n\t\tmt := newMapType(name, id, rt)\n\t\ttypes[rt] = mt\n\t\ttype0, err = newType(rt.Key())\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\ttype1, err = newType(rt.Elem())\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tmt.init(type0, type1)\n\t\treturn mt, nil\n\n\tcase reflect.Slice:\n\t\t// []byte == []uint8 is a special case\n\t\tif rt.Elem().Kind() == reflect.Uint8 {\n\t\t\treturn tBytes.Type(), nil\n\t\t}\n\t\tst := newSliceType(name, id, rt)\n\t\ttypes[rt] = st\n\t\ttype0, err = newType(rt.Elem())\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tst.init(type0)\n\t\treturn st, nil\n\n\tcase reflect.Struct:\n\t\tst := newStructType(name, id, rt)\n\t\ttypes[rt] = st\n\t\tsetTypeID(st)\n\t\tfor i := 0; i < rt.NumField(); i++ {\n\t\t\tf := rt.Field(i)\n\t\t\tif !isStorable(&f) {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tft, err := newType(f.Type)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\t// Some mutually recursive types can cause us to be here while\n\t\t\t// still defining the element. Fix the element type id here.\n\t\t\t// We could do this more neatly by setting the id at the start of\n\t\t\t// building every type, but that would break binary compatibility.\n\t\t\tif ft.ID() == 0 {\n\t\t\t\tsetTypeID(ft)\n\t\t\t}\n\t\t\tst.Fields = append(st.Fields, Descr{f.Name, ft.ID()})\n\t\t}\n\t\treturn st, nil\n\n\tdefault:\n\t\treturn nil, errors.New(\"dtypes: newType can't handle type: \" + name)\n\t}\n\n}",
"func RegisterType(id int8, v interface{}) {\n\tmsgpack.RegisterExt(id, v)\n}",
"func NewOfType(typ reflect.Type) Ki {\n\tinst := kit.Types.Inst(typ)\n\tif inst == nil {\n\t\tlog.Printf(\"ki.NewOfType: type %v was not found in kit.Types type registry -- all Ki types must be registered there!\\n\", typ.String())\n\t\treturn nil // almost certainly will crash now..\n\t} else {\n\t\tnkid := inst.(Ki).New()\n\t\tkid, _ := nkid.(Ki)\n\t\treturn kid\n\t}\n}",
"func (m *Module) NewType(name string, typ types.Type) types.Type {\n\ttyp.SetName(name)\n\tm.Types = append(m.Types, typ)\n\treturn typ\n}",
"func NewType(name, application string) *sysl.Type {\n\tif fieldType, ok := TypeMapping[name]; ok {\n\t\treturn SyslPrimitive(fieldType)\n\t}\n\treturn SyslStruct(name, application)\n}",
"func RegisterType(t interface{}, options RegisterTypeOptions) (Atom, error) {\n\tswitch t.(type) {\n\tcase Pid, Ref, Alias:\n\t\treturn \"\", fmt.Errorf(\"types Pid, Ref, Alias can not be registered\")\n\t}\n\ttt := reflect.TypeOf(t)\n\tttk := tt.Kind()\n\n\tname := options.Name\n\torigin := regTypeName(tt)\n\tif name == \"\" {\n\t\tname = origin\n\t}\n\tlname := len([]rune(name))\n\tif lname > 255 {\n\t\treturn name, fmt.Errorf(\"type name %q is too long. characters number %d (limit: 255)\", name, lname)\n\t}\n\n\tswitch ttk {\n\tcase reflect.Struct, reflect.Slice, reflect.Array:\n\tcase reflect.Map:\n\t\t// Using pointers for the network messaging is meaningless.\n\t\t// Supporting this feature in the maps is getting the decoding process a bit overloaded.\n\t\t// But they still can be used for the other types, even being meaningless.\n\t\tif tt.Key().Kind() == reflect.Ptr {\n\t\t\treturn name, fmt.Errorf(\"pointer as a key for the map is not supported\")\n\t\t}\n\t\tif tt.Elem().Kind() == reflect.Ptr {\n\t\t\treturn name, fmt.Errorf(\"pointer as a value for the map is not supported\")\n\t\t}\n\t\t// supported types\n\tdefault:\n\t\treturn name, fmt.Errorf(\"type %q is not supported\", regTypeName(tt))\n\t}\n\n\tregistered.Lock()\n\tdefer registered.Unlock()\n\n\t_, taken := registered.typesDec[name]\n\tif taken {\n\t\treturn name, lib.ErrTaken\n\t}\n\n\tr, taken := registered.typesEnc[origin]\n\tif taken {\n\t\treturn name, fmt.Errorf(\"type is already registered as %q\", r.name)\n\t}\n\n\tcheckIsRegistered := func(name Atom, rt reflect.Kind) error {\n\t\tswitch rt {\n\t\tcase reflect.Struct, reflect.Array, reflect.Slice, reflect.Map:\n\t\t\t// check if this type is registered\n\t\t\t_, taken := registered.typesEnc[name]\n\t\t\tif taken == false {\n\t\t\t\treturn fmt.Errorf(\"type %q must be registered first\", name)\n\t\t\t}\n\t\tcase reflect.Chan, reflect.Func, reflect.UnsafePointer, reflect.Complex64, reflect.Complex128:\n\t\t\treturn fmt.Errorf(\"type %q is not supported\", rt)\n\t\t}\n\t\treturn nil\n\t}\n\n\tswitch ttk {\n\tcase reflect.Struct:\n\t\t// check for unexported fields\n\t\ttv := reflect.ValueOf(t)\n\t\tfor i := 0; i < tv.NumField(); i++ {\n\t\t\tf := tv.Field(i)\n\t\t\tif f.CanInterface() == false {\n\t\t\t\treturn name, fmt.Errorf(\"struct has unexported field(s)\")\n\t\t\t}\n\n\t\t\tswitch f.Interface().(type) {\n\t\t\tcase Pid, Ref, Alias:\n\t\t\t\t// ignore this types\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tif f.Type().Kind() == reflect.Slice && f.Type().Elem().Kind() == reflect.Uint8 {\n\t\t\t\t// []byte\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\torig := regTypeName(f.Type())\n\t\t\tif err := checkIsRegistered(orig, f.Kind()); err != nil {\n\t\t\t\treturn name, err\n\t\t\t}\n\t\t}\n\tcase reflect.Array, reflect.Slice, reflect.Map:\n\t\telem := tt.Elem()\n\t\torig := regTypeName(elem)\n\t\tif err := checkIsRegistered(orig, elem.Kind()); err != nil {\n\t\t\treturn name, err\n\t\t}\n\t}\n\n\trt := ®isterType{\n\t\trtype: reflect.TypeOf(t),\n\t\tname: name,\n\t\torigin: origin,\n\t\tstrict: options.Strict,\n\t}\n\tregistered.typesEnc[origin] = rt\n\tregistered.typesDec[name] = rt\n\treturn name, nil\n}",
"func (e *ExtensionIDRegistry) RegisterType(id extensions.ID, dt arrow.DataType) error {\n\tif _, ok := e.substraitToIdx[id]; ok {\n\t\treturn fmt.Errorf(\"%w: type id already registered\", arrow.ErrInvalid)\n\t}\n\n\tdthash := arrow.HashType(hashSeed, dt)\n\tif _, ok := e.arrowToIdx[dthash]; ok {\n\t\treturn fmt.Errorf(\"%w: type already registered\", arrow.ErrInvalid)\n\t}\n\n\tidx := len(e.ids)\n\te.typeList = append(e.typeList, dt)\n\te.ids = append(e.ids, id)\n\te.substraitToIdx[id] = idx\n\te.arrowToIdx[dthash] = idx\n\treturn nil\n}",
"func NewTypeName(pos token.Pos, pkg *Package, name string, typ Type) *TypeName {}",
"func (system *ModuleSystem) RegisterClassType(\n\tclassName string,\n\tclassType string,\n\tgenerator BuildGenerator,\n) error {\n\tmoduleClass := system.classes[className]\n\n\tif moduleClass == nil {\n\t\treturn errors.Errorf(\n\t\t\t\"Cannot set class type %q for undefined class %q\",\n\t\t\tclassType,\n\t\t\tclassName,\n\t\t)\n\t}\n\n\tif moduleClass.types[classType] != nil {\n\t\treturn errors.Errorf(\n\t\t\t\"The class type %q is already defined for class %q\",\n\t\t\tclassType,\n\t\t\tclassName,\n\t\t)\n\t}\n\n\tmoduleClass.types[classType] = generator\n\n\treturn nil\n}",
"func NewModType(L *glua.LState, mod *glua.LTable, typename string, instance interface{}) {\n\tmod.RawSetString(typename, luar.NewType(L, instance))\n}",
"func RegisterRegistrarType(name string, init RegistrarInitializer, pm ...ProviderMetadata) {\n\tif _, ok := RegistrarTypes[name]; ok {\n\t\tlog.Fatalf(\"Cannot register registrar type %q multiple times\", name)\n\t}\n\tRegistrarTypes[name] = init\n\tunwrapProviderCapabilities(name, pm)\n}",
"func (r *Registry) Register(kind Kind, a Actions) error {\n\tif kind == \"\" {\n\t\treturn errors.New(\"kind cannot be empty\")\n\t}\n\tm := r.typesMap()\n\tif _, ok := m[kind]; ok {\n\t\treturn errors.New(\"kind '\" + string(kind) + \"' already registered\")\n\t}\n\tm[kind] = a\n\treturn nil\n}",
"func (kt *KnownTypes) Register(ttype string, codec TypedObjectCodec) (overwritten bool) {\n\tif _, ok := (*kt)[ttype]; ok {\n\t\toverwritten = true\n\t}\n\t(*kt)[ttype] = codec\n\treturn\n}",
"func (recv *Registry) SetFactoryType(type_ gobject.Type, factoryType gobject.Type) {\n\tc_type := (C.GType)(type_)\n\n\tc_factory_type := (C.GType)(factoryType)\n\n\tC.atk_registry_set_factory_type((*C.AtkRegistry)(recv.native), c_type, c_factory_type)\n\n\treturn\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
ReportFailureAndExit logs and reports an error to kuberhealthy and then exits the program. If a error occurs when reporting to kuberhealthy, the program fatals.
|
func ReportFailureAndExit(err error) {
log.Errorln(err)
err2 := kh.ReportFailure([]string{err.Error()})
if err2 != nil {
log.Fatalln("error when reporting to kuberhealthy:", err.Error())
}
os.Exit(0)
}
|
[
"func exit(msg string, err error) {\n\tfmt.Printf(\"WithError(%s)=%v called from:\\n%s\", msg, err, debug.Stack())\n\tif err := deleteMinikube(); err != nil {\n\t\tfmt.Printf(\"error cleaning up minikube at start up: %v\\n\", err)\n\t}\n\tos.Exit(60)\n}",
"func handleExit() {\n\tif e := recover(); e != nil {\n\t\tif exit, ok := e.(Exit); ok == true {\n\t\t\tfmt.Fprintln(os.Stderr, Red(\"Program exited\"))\n\t\t\tos.Exit(exit.Code)\n\t\t}\n\t\tpanic(e) // not an Exit, bubble up\n\t}\n}",
"func failExit(message string) {\n\tlog.Println(\"Failed to execute goenvdir\")\n\tlog.Println(message)\n\tos.Exit(111)\n}",
"func (pipestanceBox *pipestanceHolder) reportAndDieIf(err error) {\n\tif err == nil {\n\t\treturn\n\t}\n\tpipestanceBox.reportConfigFailure(err)\n\tutil.DieIf(err)\n}",
"func (hc *HealthCheck) Run(key HealthStatusKey) (stat HealthStatus) {\n\tlogger := plog.WithFields(log.Fields{\n\t\t\"service\": key.ServiceID,\n\t\t\"instance\": key.InstanceID,\n\t\t\"healthcheck\": key.HealthCheckName,\n\t})\n\tstat.StartedAt = time.Now()\n\tcmd := exec.Command(\"sh\", \"-c\", hc.Script)\n\tcmd.Start()\n\ttimer := time.NewTimer(hc.GetTimeout())\n\terrC := make(chan error)\n\tgo func() { errC <- cmd.Wait() }()\n\tselect {\n\tcase err := <-errC:\n\t\ttimer.Stop()\n\t\tif err != nil {\n\t\t\t// If the command gives an error, the healthcheck status is Failed (curl command failed, connection\n\t\t\t// refused, or any other error message including one that might contribute to the kill count)\n\t\t\tstat.Status = Failed\n\t\t\tif hc.KillCountLimit > 0 {\n\t\t\t\tlogger.Debug(\"Healthcheck has a KillCount.. checking the exit code\")\n\n\t\t\t\tif len(hc.KillExitCodes) == 0 {\n\t\t\t\t\t// No error codes listed means any error code will count toward the health check kill count.\n\t\t\t\t\thc.KillCounter++\n\t\t\t\t\tlogger.Debugf(\"No KillExitCodes provided; KillCounter is now %d\", hc.KillCounter)\n\t\t\t\t} else if exitError, ok := err.(*exec.ExitError); ok {\n\t\t\t\t\t// Get the exit code and compare to our kill code list.\n\t\t\t\t\tws := exitError.Sys().(syscall.WaitStatus)\n\t\t\t\t\texitcode := ws.ExitStatus()\n\t\t\t\t\tlogger.Debugf(\"Got exit code: %d\", exitcode)\n\t\t\t\t\tfound := false\n\t\t\t\t\tfor i := range hc.KillExitCodes {\n\t\t\t\t\t\tif hc.KillExitCodes[i] == exitcode {\n\t\t\t\t\t\t\thc.KillCounter++\n\t\t\t\t\t\t\tlogger.Infof(\"found matching exit code %d.. KillCounter is now %d\", exitcode, hc.KillCounter)\n\t\t\t\t\t\t\tfound = true\n\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif !found {\n\t\t\t\t\t\t// This isn't in our list of kill codes; we don't care about any of the others. Reset the count\n\t\t\t\t\t\tlogger.Debug(\"No matching exit code was found\")\n\t\t\t\t\t\tif hc.KillCounter > 0 {\n\t\t\t\t\t\t\tlogger.Infof(\"Resetting KillCounter. KillCounter was %d\", hc.KillCounter)\n\t\t\t\t\t\t\thc.KillCounter = 0\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tlogger.WithError(err).Warn(\"Unable to read the health check exit code\")\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tif hc.KillCounter > 0 {\n\t\t\t\tlogger.Infof(\"Resetting KillCounter. KillCounter was %d\", hc.KillCounter)\n\t\t\t\thc.KillCounter = 0\n\t\t\t}\n\t\t\tstat.Status = OK\n\t\t}\n\tcase <-timer.C:\n\t\tcmd.Process.Kill()\n\t\t<-errC\n\t\tstat.Status = Timeout\n\t}\n\tstat.Duration = time.Since(stat.StartedAt)\n\treturn\n}",
"func bail(ctx worker.Context, args ...interface{}) error {\n\n\t//This could be greatly improved if we can preserve the original structs passed to the worker...\n\t//For now we need to parse the values from the args (a slice of interface{}), and use type assertion\n\n\t//Get map of interfaces containing the alert labels\n\talert := args[0].(map[string]interface{})\n\talertLabels := alert[\"labels\"].(map[string]interface{})\n\n\t//Get main bailer map of interfaces from the worker args\n\tbailer := args[1].(map[string]interface{})\n\n\t//Get map of interfaces containing the container image and tag\n\tbailerContainer := bailer[\"Container\"].(map[string]interface{})\n\n\t//Get kubeconfig and cluster auth from the worker args\n\tkubeConfig := args[2].(string)\n\tclusterAuth := args[3].(bool)\n\tkubeClient := kubeClient(kubeConfig, clusterAuth)\n\n\t//stringified timestamp for unique naming\n\tts := time.Now().Unix()\n\tvar stamp string = fmt.Sprint(ts)\n\n\t//Get alert name from bailer map of interfaces and use it to create the jobName string\n\talertName := strings.ToLower(bailer[\"Alert\"].(string))\n\tjobName := \"bailer-\" + alertName + \"-\" + stamp\n\tjobNamespace := namespace\n\n\t//Get service account to run bailer job with from map of interfaces\n\tserviceAccountName := bailer[\"ServiceAccountName\"].(string)\n\t//Get the TTL for the bailer job from map of interfaces\n\tttlSecondsAfterFinished := bailer[\"TTLSecondsAfterFinished\"].(*int32)\n\n\t//The image and tag cmd for the bailer job need to be cast to strings\n\timage := bailerContainer[\"Image\"].(string) + \":\" + bailerContainer[\"Tag\"].(string)\n\t//cmd needs to be cast as a slice of strings\n\tvar cmd []string\n\tfor _, s := range bailer[\"Command\"].([]interface{}) {\n\t\tcmd = append(cmd, s.(string))\n\t}\n\n\t//EnvVars from the labels on the alert, these can be used in bailer scripts\n\tvar envVars []apiv1.EnvVar\n\tfor key, value := range alertLabels {\n\t\tenvVarKey := strings.ToUpper(\"ALERT_\" + strings.Replace(key, \"-\", \"_\", -1))\n\t\tenvVar := apiv1.EnvVar{Name: envVarKey, Value: value.(string)}\n\t\tenvVars = append(envVars, envVar)\n\n\t}\n\n\tbackoffLimit := int32(0)\n\n\t//Bailer job\n\tjob := &batchv1.Job{\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tName: jobName,\n\t\t\tNamespace: jobNamespace,\n\t\t},\n\n\t\tSpec: batchv1.JobSpec{\n\t\t\tTemplate: apiv1.PodTemplateSpec{\n\t\t\t\tSpec: apiv1.PodSpec{\n\t\t\t\t\tContainers: []apiv1.Container{\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tName: alertName,\n\t\t\t\t\t\t\tImage: image,\n\t\t\t\t\t\t\tCommand: cmd,\n\t\t\t\t\t\t\tEnv: envVars,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t\tRestartPolicy: \"Never\",\n\t\t\t\t\tServiceAccountName: serviceAccountName,\n\t\t\t\t},\n\t\t\t},\n\t\t\tBackoffLimit: &backoffLimit,\n\t\t\tTTLSecondsAfterFinished: ttlSecondsAfterFinished,\n\t\t},\n\t}\n\t//Run the bailer job\n\tfmt.Println(\"Creating job... \")\n\n\tjobsClient := kubeClient.BatchV1().Jobs(jobNamespace)\n\tresult, err := jobsClient.Create(job)\n\tif err != nil {\n\t\tpanic(fmt.Errorf(\"Unable to create job: %s \\n\", err))\n\t}\n\tfmt.Printf(\"Created job %q.\\n\", jobName)\n\tfmt.Printf(\"In Namespace %q.\\n\", jobNamespace)\n\tfmt.Printf(\"Job: %q \\n\", result)\n\treturn nil\n}",
"func CatchExit() {\n\tif p := recover(); p != nil {\n\t\tif ec, ok := p.(exitCode); ok {\n\t\t\tos.Exit(int(ec))\n\t\t}\n\t\tpanic(p)\n\t}\n}",
"func (app *Application) runAndWaitForShutdownEvent() {\n\t// Plug SIGTERM signal into a channel.\n\tsignalsChannel := make(chan os.Signal, 1)\n\tsignal.Notify(signalsChannel, os.Interrupt, syscall.SIGTERM)\n\n\t// mark service as ready to receive traffic.\n\tapp.healthCheck.Ready()\n\n\t// set the channel to stop testing.\n\tapp.stopTestChan = make(chan struct{})\n\t// notify tests that it is ready.\n\tclose(app.readyChan)\n\n\tselect {\n\tcase err := <-app.asyncErrorChannel:\n\t\tapp.logger.Error(\"Asynchronous error received, terminating process\", zap.Error(err))\n\tcase s := <-signalsChannel:\n\t\tapp.logger.Info(\"Received signal from OS\", zap.String(\"signal\", s.String()))\n\tcase <-app.stopTestChan:\n\t\tapp.logger.Info(\"Received stop test request\")\n\t}\n}",
"func Exit(code int) {\n\tcode = runHandlers(code)\n\tos.Exit(code)\n}",
"func printExitStatus(b *work.Builder, ctx context.Context, a *work.Action) error {\n\tif !testJSON && testFuzz == \"\" && len(pkgArgs) != 0 {\n\t\tif base.GetExitStatus() != 0 {\n\t\t\tfmt.Println(\"FAIL\")\n\t\t\treturn nil\n\t\t}\n\t}\n\treturn nil\n}",
"func Exitf(format string, args ...interface{}) {\n\tgolog.ExitDepth(1, fmt.Sprintf(format, args...))\n\tnotifyAirbrake(2, fatalLog, format, args...)\n}",
"func (h *Helper) runFail(args ...string) {\n\tif status := h.DoRun(args); status == nil {\n\t\th.t.Fatalf(\"%+v\", errors.New(\"testgo succeeded unexpectedly\"))\n\t} else {\n\t\th.t.Log(\"testgo failed as expected:\", status)\n\t}\n}",
"func Exit(code int) {\n\tfor i := len(atExitFuncs) - 1; i >= 0; i-- {\n\t\tf := atExitFuncs[i]\n\t\tatExitFuncs = atExitFuncs[:i]\n\t\tf()\n\t}\n\tos.Exit(code)\n}",
"func (s *BasetinyListener) ExitProgram(ctx *ProgramContext) {}",
"func Failed(err error) {\n\tvar message string\n\tcode, s := error2exit(err)\n\tlog.Printf(\"INFO: %s (considered %s for monitoring)\\n\", s, code)\n\tif firstbytes == nil {\n\t\tmessage = s\n\t} else {\n\t\tmessage = string(firstbytes.Bytes())\n\t}\n\tmonitor(code, message)\n}",
"func recoverFromFailure() {\n\tlog.Println(\"Starting Recovery Process.\")\n\n\tfiles, err := ioutil.ReadDir(WORKER_PROGRESS_DIR)\n\tif err != nil {\n\t\tfatal(\"Error reading worker_progress directory: \", err)\n\t}\n\n\tvar wg sync.WaitGroup\n\twg.Add(len(files))\n\n\tworkers := make(chan struct{}, N_WORKERS)\n\tfor i := 0; i < N_WORKERS; i++ { // Signal that there are available workers.\n\t\tworkers <- struct{}{}\n\t}\n\n\tprogressFiles := make([]os.FileInfo, len(files))\n\tfor i := 0; i < len(files); i++ {\n\t\tprogressFiles[i] = files[i]\n\t}\n\n\ti := 0 // index into files, incremented at bottom of loop.\n\tfor i < len(files) {\n\t\t// Check if any workers are free.\n\t\tselect {\n\t\tcase <-workers:\n\t\tdefault:\n\t\t\t// If all workers are busy, wait and continue.\n\t\t\ttime.Sleep(1000 * time.Millisecond)\n\t\t\tcontinue\n\t\t}\n\n\t\tfile := progressFiles[i]\n\t\tcontentsBytes, err := ioutil.ReadFile(WORKER_PROGRESS_DIR + \"/\" + file.Name())\n\t\tif err != nil {\n\t\t\tfatal(\"Error reading wp file: \", err)\n\t\t}\n\t\tcontents := string(contentsBytes)\n\t\tprogress := parseProgress(contents)\n\t\tlog.Printf(\"Starting recovery worker %v on range [%v, %v) at height %v\\n\", i, progress[0], progress[2], progress[1])\n\t\tgo func(i int) {\n\t\t\tanalyzeBlockRange(time.Now().Format(\"01-02:15:04\"), i, progress[1], progress[2])\n\t\t\tworkers <- struct{}{}\n\t\t\twg.Done()\n\t\t}(i)\n\n\t\terr = os.Remove(WORKER_PROGRESS_DIR + \"/\" + file.Name())\n\t\tif err != nil {\n\t\t\tfatal(\"Error removing file: \", err)\n\t\t}\n\n\t\ti++\n\t}\n\twg.Wait()\n\n\tlog.Println(\"Finished with Recovery.\")\n}",
"func (r *application) DieWithStatusCode(status int) {\n\tos.Exit(status)\n}",
"func Trap(cleanup func()) {\n\tc := make(chan os.Signal, 1)\n\tsignals := []os.Signal{os.Interrupt, syscall.SIGTERM}\n\tif os.Getenv(\"DEBUG\") == \"\" {\n\t\tsignals = append(signals, syscall.SIGQUIT)\n\t}\n\tgosignal.Notify(c, signals...)\n\tgo func() {\n\t\tinterruptCount := uint32(0)\n\t\tfor sig := range c {\n\t\t\tgo func(sig os.Signal) {\n\t\t\t\tlog.Infof(\"Received signal '%v', starting shutdown of docker...\", sig)\n\t\t\t\tswitch sig {\n\t\t\t\tcase os.Interrupt, syscall.SIGTERM:\n\t\t\t\t\t// If the user really wants to interrupt, let him do so.\n\t\t\t\t\tif atomic.LoadUint32(&interruptCount) < 3 {\n\t\t\t\t\t\t// Initiate the cleanup only once\n\t\t\t\t\t\tif atomic.AddUint32(&interruptCount, 1) == 1 {\n\t\t\t\t\t\t\t// Call cleanup handler\n\t\t\t\t\t\t\tcleanup()\n\t\t\t\t\t\t\tos.Exit(0)\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treturn\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlog.Infof(\"Force shutdown of docker, interrupting cleanup\")\n\t\t\t\t\t}\n\t\t\t\tcase syscall.SIGQUIT:\n\t\t\t\t}\n\t\t\t\tos.Exit(128 + int(sig.(syscall.Signal)))\n\t\t\t}(sig)\n\t\t}\n\t}()\n}",
"func (s *BaseFGListener) ExitSpecs(ctx *SpecsContext) {}",
"func fail(i int) {\n\tfmt.Printf(\"{\\\"status\\\":\\\"fail\\\",\\\"message\\\":\\\"error %d\\\"}\", i)\n\tos.Exit(i)\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
URI: /api/v1/recovery Method: POST Args: JSON Body
|
func recovery(gateway Gatewayer) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
if r.Method != http.MethodPost {
resp := NewHTTPErrorResponse(http.StatusMethodNotAllowed, "")
writeHTTPResponse(w, resp)
return
}
if r.Header.Get("Content-Type") != ContentTypeJSON {
resp := NewHTTPErrorResponse(http.StatusUnsupportedMediaType, "")
writeHTTPResponse(w, resp)
return
}
var req RecoveryRequest
if err := json.NewDecoder(r.Body).Decode(&req); err != nil {
resp := NewHTTPErrorResponse(http.StatusBadRequest, err.Error())
writeHTTPResponse(w, resp)
return
}
defer r.Body.Close()
// for integration tests
if autoPressEmulatorButtons {
err := gateway.SetAutoPressButton(true, skyWallet.ButtonRight)
if err != nil {
logger.Error("recovery failed: %s", err.Error())
resp := NewHTTPErrorResponse(http.StatusInternalServerError, err.Error())
writeHTTPResponse(w, resp)
return
}
}
var msg wire.Message
var err error
retCH := make(chan int)
errCH := make(chan int)
ctx := r.Context()
go func() {
msg, err = gateway.Recovery(req.WordCount, req.UsePassphrase, req.DryRun)
if err != nil {
errCH <- 1
return
}
retCH <- 1
}()
select {
case <-retCH:
HandleFirmwareResponseMessages(w, msg)
case <-errCH:
logger.Errorf("recovery failed: %s", err.Error())
resp := NewHTTPErrorResponse(http.StatusInternalServerError, err.Error())
writeHTTPResponse(w, resp)
case <-ctx.Done():
disConnErr := gateway.Disconnect()
if disConnErr != nil {
resp := NewHTTPErrorResponse(http.StatusInternalServerError, err.Error())
writeHTTPResponse(w, resp)
} else {
resp := NewHTTPErrorResponse(499, "Client Closed Request")
writeHTTPResponse(w, resp)
}
}
}
}
|
[
"func PostLegderAPI(w http.ResponseWriter, req *http.Request) {\n\t//log\n\tnow, userIP := globalPkg.SetLogObj(req)\n\tlogobj := logpkg.LogStruct{\"_\", now, userIP, \"macAdress\", \"PostLegderAPI\", \"Ledger\", \"_\", \"_\", \"_\", 0}\n\n\trecievedObj := MixedObjStruct{}\n\tadminReqObj := admin.Admin1{}\n\tledgerReqObj := Ledger{}\n\n\tdecoder := json.NewDecoder(req.Body)\n\tdecoder.DisallowUnknownFields()\n\terr := decoder.Decode(&recievedObj)\n\tif err != nil {\n\t\tresponseObj := responses.FindResponseByID(\"1\")\n\t\tglobalPkg.SendError(w, responseObj.EngResponse)\n\t\tglobalPkg.WriteLog(logobj, responseObj.EngResponse, \"failed\")\n\t\treturn\n\t}\n\tadminReqObj = recievedObj.AdminObject\n\tledgerReqObj = recievedObj.LedgerObject\n\n\tif adminReqObj == AdminObjec {\n\t\tfmt.Println(\"nice\")\n\t}\n\n\tRemoveDatabase()\n\tfor _, accountObj := range ledgerReqObj.AccountsLstObj {\n\t\taccountObj.BlocksLst = nil\n\t\taccount.AddAccount(accountObj)\n\t}\n\n\t// encryptedValidators := validator.GetAllValidators()\n\tfor index := range ledgerReqObj.ValidatorsLstObj {\n\t\tif validator.CurrentValidator.ValidatorIP == ledgerReqObj.ValidatorsLstObj[index].ValidatorIP {\n\t\t\tledgerReqObj.ValidatorsLstObj[index].ECCPrivateKey = validator.CurrentValidator.ECCPrivateKey\n\t\t\tledgerReqObj.ValidatorsLstObj[index].ECCPublicKey = validator.CurrentValidator.ECCPublicKey\n\t\t} else {\n\t\t\tledgerReqObj.ValidatorsLstObj[index].ECCPublicKey = validator.CurrentValidator.ECCPublicKey\n\t\t}\n\t\tvalidator.CreateValidator(&(ledgerReqObj.ValidatorsLstObj[index]))\n\t}\n\tvalidator.ValidatorsLstObj = validator.GetAllValidatorsDecrypted()\n\t// validator.ValidatorsLstObj = ledgerReqObj.ValidatorsLstObj\n\t// for _, transactionObj := range ledgerReqObj.TransactionLstObj {\n\t// \ttransaction.AddTransaction(transactionObj)\n\t// }\n\tfor _, transactionObj := range ledgerReqObj.TransactionLstObj {\n\t\ttransactionObj.AddTransaction()\n\t}\n\tfor _, transactionObj := range ledgerReqObj.TransactionLstDb {\n\t\ttransactionObj.AddTransactiondb()\n\t}\n\tfor _, validatorObject := range ledgerReqObj.UnconfirmedValidators {\n\t\tvalidator.TempValidatorlst = append(validator.TempValidatorlst, validatorObject)\n\t}\n\tfor _, blockObj := range ledgerReqObj.BlockchainObj {\n\t\t(&blockObj).AddBlock(true)\n\t}\n\n\taccount.SetResetPasswordData(ledgerReqObj.ResetPassArray)\n\taccount.SetUserObjLst(ledgerReqObj.UserObjects)\n\n\tfor _, adminObj := range ledgerReqObj.AdminObj {\n\t\tadmin.CreateAdmin(adminObj)\n\t}\n\n\tfor _, tokenobj := range ledgerReqObj.TokenObj {\n\t\ttokenModule.AddToken(tokenobj)\n\t}\n\tfor _, serviceObj := range ledgerReqObj.PurchasedService {\n\t\t(&serviceObj).AddAndUpdateServiceObj()\n\t}\n\tservice.SetserviceTemp(ledgerReqObj.ServiceTmp)\n\n\t//alaa\n\tglobalfinctiontransaction.SetTransactionIndexTemMap(ledgerReqObj.ValidatorMap) //globalfinctiontransaction.GetTransactionIndexTemMap()\n\tservice.SetserviceTemp(ledgerReqObj.ServiceTmp)\n\tfor _, UserPKObj := range ledgerReqObj.UserPK {\n\t\taccount.SavePKAddress(UserPKObj)\n\t}\n\n\tfor _, logdb := range ledgerReqObj.LogDB {\n\t\tlogpkg.RecordLog(logdb)\n\t}\n\n\tfor _, shareFileObj := range ledgerReqObj.Sharedfiles {\n\t\tfile.AddSharedFile(shareFileObj)\n\t}\n\t//get permission list to append in owner pk\n\tGetPermissionByOwnerpk()\n\n\tresponseObj := responses.FindResponseByID(\"49\")\n\tglobalPkg.SendResponseMessage(w, responseObj.EngResponse)\n\tglobalPkg.WriteLog(logobj, responseObj.EngResponse, \"success\")\n\n}",
"func (r *Recover) EndPost(w http.ResponseWriter, req *http.Request) error {\n\tlogger := r.RequestLogger(req)\n\n\tvalidatable, err := r.Authboss.Core.BodyReader.Read(PageRecoverEnd, req)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tvalues := authboss.MustHaveRecoverEndValues(validatable)\n\tpassword := values.GetPassword()\n\ttoken := values.GetToken()\n\n\tif errs := validatable.Validate(); errs != nil {\n\t\tlogger.Info(\"recovery validation failed\")\n\t\tdata := authboss.HTMLData{\n\t\t\tauthboss.DataValidation: authboss.ErrorMap(errs),\n\t\t\tDataRecoverToken: token,\n\t\t}\n\t\treturn r.Config.Core.Responder.Respond(w, req, http.StatusOK, PageRecoverEnd, data)\n\t}\n\n\trawToken, err := base64.URLEncoding.DecodeString(token)\n\tif err != nil {\n\t\tlogger.Infof(\"invalid recover token submitted, base64 decode failed: %+v\", err)\n\t\treturn r.invalidToken(PageRecoverEnd, w, req)\n\t}\n\n\tif len(rawToken) != recoverTokenSize {\n\t\tlogger.Infof(\"invalid recover token submitted, size was wrong: %d\", len(rawToken))\n\t\treturn r.invalidToken(PageRecoverEnd, w, req)\n\t}\n\n\tselectorBytes := sha512.Sum512(rawToken[:recoverTokenSplit])\n\tverifierBytes := sha512.Sum512(rawToken[recoverTokenSplit:])\n\tselector := base64.StdEncoding.EncodeToString(selectorBytes[:])\n\n\tstorer := authboss.EnsureCanRecover(r.Authboss.Config.Storage.Server)\n\tuser, err := storer.LoadByRecoverSelector(req.Context(), selector)\n\tif err == authboss.ErrUserNotFound {\n\t\tlogger.Info(\"invalid recover token submitted, user not found\")\n\t\treturn r.invalidToken(PageRecoverEnd, w, req)\n\t} else if err != nil {\n\t\treturn err\n\t}\n\n\tif time.Now().UTC().After(user.GetRecoverExpiry()) {\n\t\tlogger.Infof(\"invalid recover token submitted, already expired: %+v\", err)\n\t\treturn r.invalidToken(PageRecoverEnd, w, req)\n\t}\n\n\tdbVerifierBytes, err := base64.StdEncoding.DecodeString(user.GetRecoverVerifier())\n\tif err != nil {\n\t\tlogger.Infof(\"invalid recover verifier stored in database: %s\", user.GetRecoverVerifier())\n\t\treturn r.invalidToken(PageRecoverEnd, w, req)\n\t}\n\n\tif subtle.ConstantTimeEq(int32(len(verifierBytes)), int32(len(dbVerifierBytes))) != 1 ||\n\t\tsubtle.ConstantTimeCompare(verifierBytes[:], dbVerifierBytes) != 1 {\n\t\tlogger.Info(\"stored recover verifier does not match provided one\")\n\t\treturn r.invalidToken(PageRecoverEnd, w, req)\n\t}\n\n\treq = req.WithContext(context.WithValue(req.Context(), authboss.CTXKeyUser, user))\n\thandled, err := r.Authboss.Events.FireBefore(authboss.EventRecoverEnd, w, req)\n\tif err != nil {\n\t\treturn err\n\t} else if handled {\n\t\treturn nil\n\t}\n\n\tpass, err := bcrypt.GenerateFromPassword([]byte(password), r.Authboss.Config.Modules.BCryptCost)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tuser.PutPassword(string(pass))\n\tuser.PutRecoverSelector(\"\") // Don't allow another recovery\n\tuser.PutRecoverVerifier(\"\") // Don't allow another recovery\n\tuser.PutRecoverExpiry(time.Now().UTC()) // Put current time for those DBs that can't handle 0 time\n\n\tif err := storer.Save(req.Context(), user); err != nil {\n\t\treturn err\n\t}\n\n\tsuccessMsg := \"Successfully updated password\"\n\t_, err = r.Authboss.Events.FireAfter(authboss.EventRecoverEnd, w, req)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif r.Authboss.Config.Modules.RecoverLoginAfterRecovery {\n\t\thandled, err = r.Events.FireBefore(authboss.EventAuth, w, req)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t} else if handled {\n\t\t\treturn nil\n\t\t}\n\n\t\thandled, err = r.Events.FireBefore(authboss.EventAuthHijack, w, req)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t} else if handled {\n\t\t\treturn nil\n\t\t}\n\n\t\tauthboss.PutSession(w, authboss.SessionKey, user.GetPID())\n\t\tsuccessMsg += \" and logged in\"\n\n\t\thandled, err = r.Authboss.Events.FireAfter(authboss.EventAuth, w, req)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t} else if handled {\n\t\t\treturn nil\n\t\t}\n\t}\n\n\tro := authboss.RedirectOptions{\n\t\tCode: http.StatusTemporaryRedirect,\n\t\tRedirectPath: r.Authboss.Config.Paths.RecoverOK,\n\t\tSuccess: successMsg,\n\t}\n\treturn r.Authboss.Config.Core.Redirector.Redirect(w, req, ro)\n}",
"func (a TelephonyProvidersEdgeApi) PostTelephonyProvidersEdgesPhonesReboot(body Phonesreboot) (*APIResponse, error) {\n\tvar httpMethod = \"POST\"\n\t// create path and map variables\n\tpath := a.Configuration.BasePath + \"/api/v2/telephony/providers/edges/phones/reboot\"\n\tif true == false {\n\t\treturn nil, errors.New(\"This message brought to you by the laws of physics being broken\")\n\t}\n\n\t// verify the required parameter 'body' is set\n\tif &body == nil {\n\t\t// false\n\t\treturn nil, errors.New(\"Missing required parameter 'body' when calling TelephonyProvidersEdgeApi->PostTelephonyProvidersEdgesPhonesReboot\")\n\t}\n\n\theaderParams := make(map[string]string)\n\tqueryParams := make(map[string]string)\n\tformParams := url.Values{}\n\tvar postBody interface{}\n\tvar postFileName string\n\tvar fileBytes []byte\n\t// authentication (PureCloud OAuth) required\n\n\t// oauth required\n\tif a.Configuration.AccessToken != \"\"{\n\t\theaderParams[\"Authorization\"] = \"Bearer \" + a.Configuration.AccessToken\n\t}\n\t// add default headers if any\n\tfor key := range a.Configuration.DefaultHeader {\n\t\theaderParams[key] = a.Configuration.DefaultHeader[key]\n\t}\n\t\n\n\t// Find an replace keys that were altered to avoid clashes with go keywords \n\tcorrectedQueryParams := make(map[string]string)\n\tfor k, v := range queryParams {\n\t\tif k == \"varType\" {\n\t\t\tcorrectedQueryParams[\"type\"] = v\n\t\t\tcontinue\n\t\t}\n\t\tcorrectedQueryParams[k] = v\n\t}\n\tqueryParams = correctedQueryParams\n\n\t// to determine the Content-Type header\n\tlocalVarHttpContentTypes := []string{ \"application/json\", }\n\n\t// set Content-Type header\n\tlocalVarHttpContentType := a.Configuration.APIClient.SelectHeaderContentType(localVarHttpContentTypes)\n\tif localVarHttpContentType != \"\" {\n\t\theaderParams[\"Content-Type\"] = localVarHttpContentType\n\t}\n\t// to determine the Accept header\n\tlocalVarHttpHeaderAccepts := []string{\n\t\t\"application/json\",\n\t}\n\n\t// set Accept header\n\tlocalVarHttpHeaderAccept := a.Configuration.APIClient.SelectHeaderAccept(localVarHttpHeaderAccepts)\n\tif localVarHttpHeaderAccept != \"\" {\n\t\theaderParams[\"Accept\"] = localVarHttpHeaderAccept\n\t}\n\t// body params\n\tpostBody = &body\n\n\n\tresponse, err := a.Configuration.APIClient.CallAPI(path, httpMethod, postBody, headerParams, queryParams, formParams, postFileName, fileBytes)\n\tif err != nil {\n\t\t// Nothing special to do here, but do avoid processing the response\n\t} else if err == nil && response.Error != nil {\n\t\terr = errors.New(response.ErrorMessage)\n\t}\n\treturn response, err\n}",
"func RecoveryVolume(PathData, deploymentName, volumeName string) {\n\n\t//Create Restic To\n\tauxPath := PathData + \"/pairs/\" + deploymentName + \"/\" + volumeName + \"/\"\n\n\tutils.CreateObject(auxPath + \"resticTo.json\")\n\t// TODO Wait a minut\n\tfmt.Println(\"sleeping\")\n\ttime.Sleep(20*time.Second)\n\tfmt.Println(\"wake up\")\n\n\t//Check if it is done\n\t// TODO\n\t// Deployment available\n\t// Restic re\n\t//Create Recovery To\n\tutils.CreateObject(auxPath + \"recoveryTo.json\")\n\n}",
"func (a *Client) PostRemoteAPIJPasswordRecoveryResendVerification(params *PostRemoteAPIJPasswordRecoveryResendVerificationParams) (*PostRemoteAPIJPasswordRecoveryResendVerificationOK, error) {\n\t// TODO: Validate the params before sending\n\tif params == nil {\n\t\tparams = NewPostRemoteAPIJPasswordRecoveryResendVerificationParams()\n\t}\n\n\tresult, err := a.transport.Submit(&runtime.ClientOperation{\n\t\tID: \"PostRemoteAPIJPasswordRecoveryResendVerification\",\n\t\tMethod: \"POST\",\n\t\tPathPattern: \"/remote.api/JPasswordRecovery.resendVerification\",\n\t\tProducesMediaTypes: []string{\"\"},\n\t\tConsumesMediaTypes: []string{\"application/json\"},\n\t\tSchemes: []string{\"http\", \"https\"},\n\t\tParams: params,\n\t\tReader: &PostRemoteAPIJPasswordRecoveryResendVerificationReader{formats: a.formats},\n\t\tContext: params.Context,\n\t\tClient: params.HTTPClient,\n\t})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn result.(*PostRemoteAPIJPasswordRecoveryResendVerificationOK), nil\n\n}",
"func TriggerRepair(t *testing.T, namespace, keyspace string) string {\n\trestClient := resty.New()\n\n\t// Create the repair run\n\tresponse, err := restClient.R().\n\t\tSetHeader(\"Content-Type\", \"application/json\").\n\t\tSetQueryParams(map[string]string{\n\t\t\t\"clusterName\": \"k8ssandra\",\n\t\t\t\"keyspace\": keyspace,\n\t\t\t\"owner\": \"k8ssandra\",\n\t\t\t\"segmentCount\": \"5\",\n\t\t}).\n\t\tPost(\"http://repair.127.0.0.1.nip.io:8080/repair_run\")\n\n\tdata := response.Body()\n\tlog.Println(fmt.Sprintf(\"Reaper response: %s\", data))\n\tvar reaperResponse interface{}\n\terr2 := json.Unmarshal(data, &reaperResponse)\n\n\terrMessageCreateRepair := fmt.Sprintf(\"The REST request or response parsing failed with error %s %s: %s\", err, err2, data)\n\tg(t).Expect(err).To(BeNil(), errMessageCreateRepair)\n\tg(t).Expect(err2).To(BeNil(), errMessageCreateRepair)\n\n\treaperResponseMap := reaperResponse.(map[string]interface{})\n\trepairId := fmt.Sprintf(\"%s\", reaperResponseMap[\"id\"])\n\t// Start the previously created repair run\n\tresponse, err = restClient.R().\n\t\tSetHeader(\"Content-Type\", \"application/json\").\n\t\tPut(fmt.Sprintf(\"http://repair.127.0.0.1.nip.io:8080/repair_run/%s/state/RUNNING\", repairId))\n\n\tlog.Println(fmt.Sprintf(\"Reaper response: %s\", response.Body()))\n\tlog.Println(fmt.Sprintf(\"Reaper status code: %d\", response.StatusCode()))\n\n\terrMessageStart := fmt.Sprintf(\"Failed starting repair %s: %s / %s\", repairId, err, response.Body())\n\tg(t).Expect(err).To(BeNil(), errMessageStart)\n\tg(t).Expect(response.StatusCode()).Should(Equal(200), errMessageStart)\n\n\treturn repairId\n}",
"func (r *Recover) StartPost(w http.ResponseWriter, req *http.Request) error {\n\tlogger := r.RequestLogger(req)\n\n\tvalidatable, err := r.Authboss.Core.BodyReader.Read(PageRecoverStart, req)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif errs := validatable.Validate(); errs != nil {\n\t\tlogger.Info(\"recover validation failed\")\n\t\tdata := authboss.HTMLData{authboss.DataValidation: authboss.ErrorMap(errs)}\n\t\treturn r.Authboss.Core.Responder.Respond(w, req, http.StatusOK, PageRecoverStart, data)\n\t}\n\n\trecoverVals := authboss.MustHaveRecoverStartValues(validatable)\n\n\tuser, err := r.Authboss.Storage.Server.Load(req.Context(), recoverVals.GetPID())\n\tif err == authboss.ErrUserNotFound {\n\t\tlogger.Infof(\"user %s was attempted to be recovered, user does not exist, faking successful response\", recoverVals.GetPID())\n\t\tro := authboss.RedirectOptions{\n\t\t\tCode: http.StatusTemporaryRedirect,\n\t\t\tRedirectPath: r.Authboss.Config.Paths.RecoverOK,\n\t\t\tSuccess: recoverInitiateSuccessFlash,\n\t\t}\n\t\treturn r.Authboss.Core.Redirector.Redirect(w, req, ro)\n\t}\n\n\tru := authboss.MustBeRecoverable(user)\n\n\treq = req.WithContext(context.WithValue(req.Context(), authboss.CTXKeyUser, user))\n\thandled, err := r.Authboss.Events.FireBefore(authboss.EventRecoverStart, w, req)\n\tif err != nil {\n\t\treturn err\n\t} else if handled {\n\t\treturn nil\n\t}\n\n\tselector, verifier, token, err := GenerateRecoverCreds()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tru.PutRecoverSelector(selector)\n\tru.PutRecoverVerifier(verifier)\n\tru.PutRecoverExpiry(time.Now().UTC().Add(r.Config.Modules.RecoverTokenDuration))\n\n\tif err := r.Authboss.Storage.Server.Save(req.Context(), ru); err != nil {\n\t\treturn err\n\t}\n\n\tif r.Authboss.Modules.MailNoGoroutine {\n\t\tr.SendRecoverEmail(req.Context(), ru.GetEmail(), token)\n\t} else {\n\t\tgo r.SendRecoverEmail(req.Context(), ru.GetEmail(), token)\n\t}\n\n\t_, err = r.Authboss.Events.FireAfter(authboss.EventRecoverStart, w, req)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tlogger.Infof(\"user %s password recovery initiated\", ru.GetPID())\n\tro := authboss.RedirectOptions{\n\t\tCode: http.StatusTemporaryRedirect,\n\t\tRedirectPath: r.Authboss.Config.Paths.RecoverOK,\n\t\tSuccess: recoverInitiateSuccessFlash,\n\t}\n\treturn r.Authboss.Core.Redirector.Redirect(w, req, ro)\n}",
"func Recovery(PathData string) {\n\tvar pairs []map[string]interface{}\n\tpairs = utils.ReadJsonArray(PathData + \"/pairs/\", \"pairs\")\n\tfor _, v := range pairs {\n\t\tPrintVolumes(v)\n\t\t// TEST THAT\n\t\tgo RecoveryVolume(PathData, v[\"deploymentName\"].(string), v[\"volumeName\"].(string))\n\t}\n}",
"func (a *Client) PostRemoteAPIJPasswordRecoveryRecoverPassword(params *PostRemoteAPIJPasswordRecoveryRecoverPasswordParams) (*PostRemoteAPIJPasswordRecoveryRecoverPasswordOK, error) {\n\t// TODO: Validate the params before sending\n\tif params == nil {\n\t\tparams = NewPostRemoteAPIJPasswordRecoveryRecoverPasswordParams()\n\t}\n\n\tresult, err := a.transport.Submit(&runtime.ClientOperation{\n\t\tID: \"PostRemoteAPIJPasswordRecoveryRecoverPassword\",\n\t\tMethod: \"POST\",\n\t\tPathPattern: \"/remote.api/JPasswordRecovery.recoverPassword\",\n\t\tProducesMediaTypes: []string{\"\"},\n\t\tConsumesMediaTypes: []string{\"application/json\"},\n\t\tSchemes: []string{\"http\", \"https\"},\n\t\tParams: params,\n\t\tReader: &PostRemoteAPIJPasswordRecoveryRecoverPasswordReader{formats: a.formats},\n\t\tContext: params.Context,\n\t\tClient: params.HTTPClient,\n\t})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn result.(*PostRemoteAPIJPasswordRecoveryRecoverPasswordOK), nil\n\n}",
"func PostResident(w http.ResponseWriter, r *http.Request) {\n\n\t// Struct to unmarshal body of request into\n\tvar o boomyDB.Resident\n\n\t// Set content type returned to JSON\n\tw.Header().Set(\"Content-Type\", \"application/json; charset=UTF-8\")\n\n\tif err := apih.PostHelper(r, &o); err != nil {\n\t\thttp.Error(w, fmt.Sprintf(\"There was an error saving the %s. Please contact your administrator.\\n\", utils.GetType(o)), http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\t// Encode array returned into JSON and return\n\tif err := json.NewEncoder(w).Encode(o); err != nil {\n\t\tlogrus.WithFields(logrus.Fields{\n\t\t\t\"err\": err,\n\t\t}).Warn(\"Error encoding retStruct\")\n\t}\n}",
"func (r *recovery) RepostRecord() {\r\n\tr.recoveryMutex.Lock()\r\n\tdefer r.recoveryMutex.Unlock()\r\n\r\n\t// get position\r\n\tpos := r.getPosition()\r\n\r\n\t// set seeking-position\r\n\trf, err := os.OpenFile(r.recoveryFilePath, os.O_RDONLY|os.O_CREATE, 0666)\r\n\tdefer rf.Close()\r\n\tif err != nil {\r\n\t\tlogrus.Errorf(\"Failed to open recovery file, detail: %s\", err)\r\n\t\treturn\r\n\t}\r\n\t_, err = rf.Seek(pos, 0)\r\n\tif err != nil {\r\n\t\tlogrus.Errorf(\"Failed to seek recovery file, detail: %s\", err)\r\n\t\treturn\r\n\t}\r\n\t// read history records\r\n\tfailedRecords := make([]entity.TrafficRecord, 0, r.cacheSize)\r\n\tlineReader := bufio.NewScanner(rf)\r\n\tfor lineReader.Scan() {\r\n\t\tvar record entity.TrafficRecord\r\n\t\tline := lineReader.Text()\r\n\t\tpos += int64(len(line) + 1)\r\n\r\n\t\terr := json.Unmarshal([]byte(line), &record)\r\n\t\tif err != nil {\r\n\t\t\tcontinue\r\n\t\t}\r\n\r\n\t\terr = r.post(&record)\r\n\t\tif err != nil {\r\n\t\t\tlogrus.Warningf(\"Failed to post record, detail: %d\", err)\r\n\t\t\tfailedRecords = append(failedRecords, record)\r\n\t\t}\r\n\t}\r\n\r\n\t// check if current pos is out of PosLimit\r\n\tif pos > r.recoveryLengthLimit {\r\n\t\tpos = r.clearRecord(pos)\r\n\t}\r\n\r\n\tfor _, record := range failedRecords {\r\n\t\tstr, err := record.ToJSONString()\r\n\t\tif err != nil {\r\n\t\t\tlogrus.Warningf(\"Failed to parse to JSON string: %v\", record)\r\n\t\t\tcontinue\r\n\t\t}\r\n\t\t_, err = rf.WriteString(str + \"\\n\")\r\n\t\tif err != nil {\r\n\t\t\tlogrus.Errorf(\"Failed to write recovery file, with reocrd: %s\", str)\r\n\t\t\tcontinue\r\n\t\t}\r\n\t}\r\n\r\n\terr = r.writePosition(pos)\r\n\tif err != nil {\r\n\t\tlogrus.Errorf(\"Failed to write position file, detail: %s\", err)\r\n\t}\r\n\treturn\r\n}",
"func (t *transporter) SendSnapshotRecoveryRequest(server *raft.Server, peer *raft.Peer, req *raft.SnapshotRecoveryRequest) *raft.SnapshotRecoveryResponse {\n\tvar aersp *raft.SnapshotRecoveryResponse\n\tvar b bytes.Buffer\n\tjson.NewEncoder(&b).Encode(req)\n\n\tu, _ := nameToRaftURL(peer.Name)\n\tdebugf(\"Send SnapshotRecovery to %s [Last Term: %d, LastIndex %d]\", u,\n\t\treq.LastTerm, req.LastIndex)\n\n\tresp, _, err := t.Post(fmt.Sprintf(\"%s/snapshotRecovery\", u), &b)\n\n\tif err != nil {\n\t\tdebugf(\"Cannot send SendSnapshotRecoveryRequest to %s : %s\", u, err)\n\t}\n\n\tif resp != nil {\n\t\tdefer resp.Body.Close()\n\t\taersp = &raft.SnapshotRecoveryResponse{}\n\n\t\tif err = json.NewDecoder(resp.Body).Decode(&aersp); err == nil || err == io.EOF {\n\t\t\treturn aersp\n\t\t}\n\t}\n\n\treturn aersp\n}",
"func NewRecovery(dsn string) *recovery {\n\tlogger := log.New(os.Stdout, \"[sentroni] \", 0)\n\n\tclient, err := raven.NewClient(dsn, nil)\n\tif err != nil {\n\t\tlogger.Fatal(\"FATAL: \", err)\n\t}\n\n\treturn &recovery{\n\t\tLogger: logger,\n\t\tClient: client,\n\t}\n}",
"func (dao RecoverDAO) CreateRecovery(account *types.Account, db *db.MySQL) (*types.Recovery, error) {\n\n\trecovery := types.Recovery{ID: uuid.New().String(), AccountID: account.ID, Created: time.Now(), Email: account.Email}\n\n\tstmt, err := db.PreparedQuery(\"INSERT INTO recover (id, accountId, created, email) VALUES(?,?,?,?)\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\trows, err := stmt.Query(recovery.ID, recovery.AccountID, recovery.Created, recovery.Email)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tstmt.Close()\n\tdefer rows.Close()\n\treturn &recovery, nil\n\n}",
"func PanicRecovery(h http.Handler) http.Handler {\n\treturn http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n\t\tvar err error\n\t\tdefer func() {\n\t\t\tr := recover()\n\t\t\tif r != nil {\n\t\t\t\tswitch t := r.(type) {\n\t\t\t\tcase string:\n\t\t\t\t\terr = errors.New(t)\n\t\t\t\tcase error:\n\t\t\t\t\terr = t\n\t\t\t\tdefault:\n\t\t\t\t\terr = errors.New(\"Unknown error\")\n\t\t\t\t}\n\n\t\t\t\thttp.Error(w, err.Error(), http.StatusInternalServerError)\n\t\t\t}\n\t\t}()\n\n\t\th.ServeHTTP(w, r)\n\t})\n}",
"func TheRecovery() {\n\tif err := recover(); err != nil {\n\t\tLogger.Println(err)\n\t}\n}",
"func (client *Client) RequestPasswordRecovery() (*EmailAddressAuthenticationCodeInfo, error) {\n\t// Unlock receive function at the end of this function to mark received event as processed\n\tdefer client.Unlock(\"RequestPasswordRecovery\")\n\tresult, err := client.Send(Request{\n\t\tmeta: meta{\n\t\t\tType: \"requestPasswordRecovery\",\n\t\t},\n\t\tData: map[string]interface{}{},\n\t})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif result.Type == \"error\" {\n\t\treturn nil, buildResponseError(result.Data)\n\t}\n\n\treturn UnmarshalEmailAddressAuthenticationCodeInfo(result.Data)\n}",
"func Payment_register_excute(w http.ResponseWriter, r *http.Request) {\n\n// IN w : response-writer\n// IN r : request-parameter\n\n// fmt.Fprintf( w, \"payment_register_excute start \\n\" )\n\n\tvar guest_payment type6.Guest_Payment\n\n/// get guest no and guest name in guest temp inf.\n\n// flexible_out := datastore2.Datastore_sgh( \"D_District_Temp\" ,\"check\" ,idmy , w , r )\n\n general_work := check5.Guest_temp (w , r )\n\n// value2, _ := flexible_out.([]type5.General_Work)\n\n guest_payment.Guest_No = general_work[0].Int64_Work\n guest_payment.Guest_Name = general_work[0].String_Work\n\n//\tfmt.Fprintf( w, \"payment_register_excute : guest_payment.Guest_No %v\\n\", guest_payment.Guest_No )\n//\tfmt.Fprintf( w, \"payment_register_excute : guest_payment.Guest_Name %v\\n\", guest_payment.Guest_Name )\n\n// value, _ := count.(int64)\n\n//\tfmt.Fprintf( w, \"payment_register_excute count %v \\n\" , count )\n//\tfmt.Fprintf( w, \"payment_register_excute district_no %v \\n\" , district_no )\n\n guest_payment.Date = r.FormValue(\"date\")\n\n guest_payment.Item = r.FormValue(\"item\")\n\n\tamount := r.FormValue(\"amount\")\n\tamountw ,err := strconv.Atoi(amount) // make an integer\n\tif err != nil {\n\t\thttp.Error(w,err.Error(), http.StatusInternalServerError)\n\n\t\treturn\n\t}\n\n\tguest_payment.Amount = int64(amountw) // make an integer64\n\n//\tfmt.Fprintf( w, \"payment_register_excute : guest_payment.Item %v\\n\", guest_payment.Item )\n//\tfmt.Fprintf( w, \"payment_register_excute : guest_payment.Amount %v\\n\", guest_payment.Amount )\n\n projectID := os.Getenv(\"GOOGLE_CLOUD_PROJECT\")\n\n if projectID == \"\" {\n\n projectID = \"sample-7777\"\n\n\t}\n\n ctx := context.Background()\n\n client, err := datastore.NewClient(ctx, projectID)\n if err != nil {\n\t\thttp.Error(w, err.Error(), http.StatusInternalServerError)\n\t\treturn\n\t}\n\n new_key := datastore.IncompleteKey(\"Guest_Payment\", nil)\n\n if _, err = client.Put(ctx, new_key, &guest_payment ); err != nil {\n\n\t\thttp.Error(w,err.Error(), http.StatusInternalServerError)\n\t\treturn\n\t}\n\n\n///\n/// show payment inf. on web\n///\n\n\tprocess4.Payment_register(w , r ,guest_payment.Guest_No)\n\n//\tfmt.Fprintf( w, \"payment_register_excute : normal end \\n\" )\n\n}",
"func (e *Endpoint) startRegenerationFailureHandler() {\n\te.controllers.UpdateController(fmt.Sprintf(\"endpoint-%s-regeneration-recovery\", e.StringID()), controller.ControllerParams{\n\t\tGroup: endpointRegenerationRecoveryControllerGroup,\n\t\tDoFunc: func(ctx context.Context) error {\n\t\t\tselect {\n\t\t\tcase <-e.regenFailedChan:\n\t\t\t\te.getLogger().Debug(\"received signal that regeneration failed\")\n\t\t\tcase <-ctx.Done():\n\t\t\t\te.getLogger().Debug(\"exiting retrying regeneration goroutine due to endpoint being deleted\")\n\t\t\t\treturn nil\n\t\t\t}\n\n\t\t\tregenMetadata := ®eneration.ExternalRegenerationMetadata{\n\t\t\t\t// TODO (ianvernon) - is there a way we can plumb a parent\n\t\t\t\t// context to a controller (e.g., endpoint.aliveCtx)?\n\t\t\t\tParentContext: ctx,\n\t\t\t\tReason: reasonRegenRetry,\n\t\t\t\t// Completely rewrite the endpoint - we don't know the nature\n\t\t\t\t// of the failure, simply that something failed.\n\t\t\t\tRegenerationLevel: regeneration.RegenerateWithDatapathRewrite,\n\t\t\t}\n\t\t\tregen, _ := e.SetRegenerateStateIfAlive(regenMetadata)\n\t\t\tif !regen {\n\t\t\t\t// We don't need to regenerate because the endpoint is d\n\t\t\t\t// disconnecting / is disconnected, or another regeneration has\n\t\t\t\t// already been enqueued. Exit gracefully.\n\t\t\t\treturn nil\n\t\t\t}\n\n\t\t\tif success := <-e.Regenerate(regenMetadata); success {\n\t\t\t\treturn nil\n\t\t\t}\n\t\t\treturn fmt.Errorf(\"regeneration recovery failed\")\n\t\t},\n\t\tErrorRetryBaseDuration: 2 * time.Second,\n\t\tContext: e.aliveCtx,\n\t})\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
GetPvNameFormMntPoint get pv name
|
func GetPvNameFormMntPoint(mntPath string) string {
if mntPath == "" {
return ""
}
if strings.HasSuffix(mntPath, "/mount") {
tmpPath := mntPath[0 : len(mntPath)-6]
pvName := filepath.Base(tmpPath)
return pvName
}
return ""
}
|
[
"func GetPVNameFromPVCName(ctx context.Context, clientset *kubernetes.Clientset, namespace string, pvcName string) (string, error) {\n\tvar pvName string\n\tpvc, err := clientset.CoreV1().PersistentVolumeClaims(namespace).Get(ctx, pvcName, metav1.GetOptions{})\n\tif err != nil {\n\t\treturn pvName, err\n\t}\n\tpvName = pvc.Spec.VolumeName\n\treturn pvName, err\n}",
"func (tp *timePoint) Name() TimePointName { return tp.name }",
"func (o GetEndpointsEndpointOutput) VpcName() pulumi.StringOutput {\n\treturn o.ApplyT(func(v GetEndpointsEndpoint) string { return v.VpcName }).(pulumi.StringOutput)\n}",
"func (o GetRulesRuleBindVpcOutput) VpcName() pulumi.StringOutput {\n\treturn o.ApplyT(func(v GetRulesRuleBindVpc) string { return v.VpcName }).(pulumi.StringOutput)\n}",
"func generatePVCName(volName, componentName, appName string) (string, error) {\n\n\tpvcName, err := util.NamespaceKubernetesObject(volName, componentName)\n\tif err != nil {\n\t\treturn \"\", errors.Wrapf(err, \"unable to create namespaced name\")\n\t}\n\n\tpvcName, err = util.NamespaceKubernetesObject(pvcName, appName)\n\tif err != nil {\n\t\treturn \"\", errors.Wrapf(err, \"unable to create namespaced name\")\n\t}\n\n\treturn pvcName, nil\n}",
"func PVCName(backupName string) string {\n\treturn backupName\n}",
"func (pkt *Packet) PName() *PName {\n\treturn (*PName)(C.Packet_GetName(pkt.ptr()))\n}",
"func getVMName(client *govmomi.Client, cfg *VSphereConfig) (string, error) {\n\n\tvar vmUUID string\n\n\tif cfg.Global.VMUUID != \"\" {\n\t\tvmUUID = cfg.Global.VMUUID\n\t} else {\n\t\t// This needs root privileges on the host, and will fail otherwise.\n\t\tvmUUIDbytes, err := ioutil.ReadFile(\"/sys/devices/virtual/dmi/id/product_uuid\")\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\n\t\tvmUUID = string(vmUUIDbytes)\n\t\tcfg.Global.VMUUID = vmUUID\n\t}\n\n\tif vmUUID == \"\" {\n\t\treturn \"\", fmt.Errorf(\"unable to determine machine ID from cloud configuration or sysfs\")\n\t}\n\n\t// Create context\n\tctx, cancel := context.WithCancel(context.Background())\n\tdefer cancel()\n\n\t// Create a new finder\n\tf := find.NewFinder(client.Client, true)\n\n\t// Fetch and set data center\n\tdc, err := f.Datacenter(ctx, cfg.Global.Datacenter)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tf.SetDatacenter(dc)\n\n\ts := object.NewSearchIndex(client.Client)\n\n\tsvm, err := s.FindByUuid(ctx, dc, strings.ToLower(strings.TrimSpace(vmUUID)), true, nil)\n\tif err != nil {\n\t\treturn \"\", err\n\t} else if svm == nil {\n\t\treturn \"\", fmt.Errorf(\"Failed to identify current vm by UUID\")\n\t}\n\n\tvar vm mo.VirtualMachine\n\terr = s.Properties(ctx, svm.Reference(), []string{\"name\"}, &vm)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tif log.GetLevel() >= log.DebugLevel {\n\t\tlog.Debugf(\"getVMName: vm.Name=%s\", vm.Name)\n\t}\n\treturn vm.Name, nil\n}",
"func pOpcodeName(opcode uint16) string {\n\tindex := pOpcodeTableIndex(opcode, true)\n\tif index == badOpcode {\n\t\treturn \"unknown\"\n\t}\n\n\treturn pOpcodeTable[index].opName\n}",
"func (_class VMPPClass) GetNameLabel(sessionID SessionRef, self VMPPRef) (_retval string, _err error) {\n\t_method := \"VMPP.get_name_label\"\n\t_sessionIDArg, _err := convertSessionRefToXen(fmt.Sprintf(\"%s(%s)\", _method, \"session_id\"), sessionID)\n\tif _err != nil {\n\t\treturn\n\t}\n\t_selfArg, _err := convertVMPPRefToXen(fmt.Sprintf(\"%s(%s)\", _method, \"self\"), self)\n\tif _err != nil {\n\t\treturn\n\t}\n\t_result, _err := _class.client.APICall(_method, _sessionIDArg, _selfArg)\n\tif _err != nil {\n\t\treturn\n\t}\n\t_retval, _err = convertStringToGo(_method + \" -> \", _result.Value)\n\treturn\n}",
"func (o NetappVolumeAttachmentOutput) Name() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *NetappVolumeAttachment) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)\n}",
"func (p *PetResolver) Name(ctx context.Context) *string {\n\treturn &p.m.Name\n}",
"func (pnj Npc) GetPv() int{\n\treturn pnj.pv\n}",
"func VolumeProvisionerName(profileMap map[string]string) string {\n\tval := \"\"\n\tif profileMap != nil {\n\t\tval = strings.TrimSpace(profileMap[string(VolumeProvisionerNameLbl)])\n\t}\n\n\tif val != \"\" {\n\t\treturn val\n\t}\n\n\t// else get from environment variable\n\treturn OSGetEnv(string(PVPNameEnvVarKey), profileMap)\n}",
"func (p *SinglePart) FormName() string {\n\t// See http://tools.ietf.org/html/rfc2183 section 2 for EBNF\n\t// of Content-Disposition value format.\n\tif p.dispositionParams == nil {\n\t\tp.parseContentDisposition()\n\t}\n\tif p.disposition != \"form-data\" {\n\t\treturn \"\"\n\t}\n\treturn p.dispositionParams[\"name\"]\n}",
"func (o VMwareNodePoolOutput) Name() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *VMwareNodePool) pulumi.StringOutput { return v.Name }).(pulumi.StringOutput)\n}",
"func (m *ControlScore) GetControlName()(*string) {\n return m.controlName\n}",
"func podNameWithCheckpoint(pvc *corev1.PersistentVolumeClaim) string {\n\tif checkpoint := pvc.Annotations[cc.AnnCurrentCheckpoint]; checkpoint != \"\" {\n\t\treturn pvc.Name + \"-checkpoint-\" + checkpoint\n\t}\n\treturn pvc.Name\n}",
"func (v *View) Name() string { return v.name }",
"func FuncNameP() string {\n\treturn funcName(1, true)\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
AppDataDir returns an operating system specific directory to be used for storing application data for an application. The appName parameter is the name of the application the data directory is being requested for. This function will prepend a period to the appName for POSIX style operating systems since that is standard practice. An empty appName or one with a single dot is treated as requesting the current directory so only "." will be returned. Further, the first character of appName will be made lowercase for POSIX style operating systems and uppercase for Mac and Windows since that is standard practice. The roaming parameter only applies to Windows where it specifies the roaming application data profile (%APPDATA%) should be used instead of the local one (%LOCALAPPDATA%) that is used by default. Example results: dir := AppDataDir("myapp", false) POSIX (Linux/BSD): ~/.myapp Mac OS: $HOME/Library/Application Support/Myapp Windows: %LOCALAPPDATA%\Myapp Plan 9: $home/myapp
|
func AppDataDir(appName string, roaming bool) string {
return appDataDir(runtime.GOOS, appName, roaming)
}
|
[
"func TestAppDataDir(t *testing.T) {\n\t// App name plus upper and lowercase variants.\n\tappName := \"myapp\"\n\tappNameUpper := string(unicode.ToUpper(rune(appName[0]))) + appName[1:]\n\tappNameLower := string(unicode.ToLower(rune(appName[0]))) + appName[1:]\n\n\t// When we're on Windows, set the expected local and roaming directories\n\t// per the environment vars. When we aren't on Windows, the function\n\t// should return the current directory when forced to provide the\n\t// Windows path since the environment variables won't exist.\n\twinLocal := \".\"\n\twinRoaming := \".\"\n\tif runtime.GOOS == \"windows\" {\n\t\tlocalAppData := os.Getenv(\"LOCALAPPDATA\")\n\t\troamingAppData := os.Getenv(\"APPDATA\")\n\t\tif localAppData == \"\" {\n\t\t\tlocalAppData = roamingAppData\n\t\t}\n\t\twinLocal = filepath.Join(localAppData, appNameUpper)\n\t\twinRoaming = filepath.Join(roamingAppData, appNameUpper)\n\t}\n\n\t// Get the home directory to use for testing expected results.\n\tvar homeDir string\n\tusr, err := user.Current()\n\tif err != nil {\n\t\tt.Errorf(\"user.Current: %v\", err)\n\t\treturn\n\t}\n\thomeDir = usr.HomeDir\n\n\t// Mac app data directory.\n\tmacAppData := filepath.Join(homeDir, \"Library\", \"Application Support\")\n\n\ttests := []struct {\n\t\tgoos string\n\t\tappName string\n\t\troaming bool\n\t\twant string\n\t}{\n\t\t// Various combinations of application name casing, leading\n\t\t// period, operating system, and roaming flags.\n\t\t{\"windows\", appNameLower, false, winLocal},\n\t\t{\"windows\", appNameUpper, false, winLocal},\n\t\t{\"windows\", \".\" + appNameLower, false, winLocal},\n\t\t{\"windows\", \".\" + appNameUpper, false, winLocal},\n\t\t{\"windows\", appNameLower, true, winRoaming},\n\t\t{\"windows\", appNameUpper, true, winRoaming},\n\t\t{\"windows\", \".\" + appNameLower, true, winRoaming},\n\t\t{\"windows\", \".\" + appNameUpper, true, winRoaming},\n\t\t{\"linux\", appNameLower, false, filepath.Join(homeDir, \".\"+appNameLower)},\n\t\t{\"linux\", appNameUpper, false, filepath.Join(homeDir, \".\"+appNameLower)},\n\t\t{\"linux\", \".\" + appNameLower, false, filepath.Join(homeDir, \".\"+appNameLower)},\n\t\t{\"linux\", \".\" + appNameUpper, false, filepath.Join(homeDir, \".\"+appNameLower)},\n\t\t{\"darwin\", appNameLower, false, filepath.Join(macAppData, appNameUpper)},\n\t\t{\"darwin\", appNameUpper, false, filepath.Join(macAppData, appNameUpper)},\n\t\t{\"darwin\", \".\" + appNameLower, false, filepath.Join(macAppData, appNameUpper)},\n\t\t{\"darwin\", \".\" + appNameUpper, false, filepath.Join(macAppData, appNameUpper)},\n\t\t{\"openbsd\", appNameLower, false, filepath.Join(homeDir, \".\"+appNameLower)},\n\t\t{\"openbsd\", appNameUpper, false, filepath.Join(homeDir, \".\"+appNameLower)},\n\t\t{\"openbsd\", \".\" + appNameLower, false, filepath.Join(homeDir, \".\"+appNameLower)},\n\t\t{\"openbsd\", \".\" + appNameUpper, false, filepath.Join(homeDir, \".\"+appNameLower)},\n\t\t{\"freebsd\", appNameLower, false, filepath.Join(homeDir, \".\"+appNameLower)},\n\t\t{\"freebsd\", appNameUpper, false, filepath.Join(homeDir, \".\"+appNameLower)},\n\t\t{\"freebsd\", \".\" + appNameLower, false, filepath.Join(homeDir, \".\"+appNameLower)},\n\t\t{\"freebsd\", \".\" + appNameUpper, false, filepath.Join(homeDir, \".\"+appNameLower)},\n\t\t{\"netbsd\", appNameLower, false, filepath.Join(homeDir, \".\"+appNameLower)},\n\t\t{\"netbsd\", appNameUpper, false, filepath.Join(homeDir, \".\"+appNameLower)},\n\t\t{\"netbsd\", \".\" + appNameLower, false, filepath.Join(homeDir, \".\"+appNameLower)},\n\t\t{\"netbsd\", \".\" + appNameUpper, false, filepath.Join(homeDir, \".\"+appNameLower)},\n\t\t{\"plan9\", appNameLower, false, filepath.Join(homeDir, appNameLower)},\n\t\t{\"plan9\", appNameUpper, false, filepath.Join(homeDir, appNameLower)},\n\t\t{\"plan9\", \".\" + appNameLower, false, filepath.Join(homeDir, appNameLower)},\n\t\t{\"plan9\", \".\" + appNameUpper, false, filepath.Join(homeDir, appNameLower)},\n\t\t{\"unrecognized\", appNameLower, false, filepath.Join(homeDir, \".\"+appNameLower)},\n\t\t{\"unrecognized\", appNameUpper, false, filepath.Join(homeDir, \".\"+appNameLower)},\n\t\t{\"unrecognized\", \".\" + appNameLower, false, filepath.Join(homeDir, \".\"+appNameLower)},\n\t\t{\"unrecognized\", \".\" + appNameUpper, false, filepath.Join(homeDir, \".\"+appNameLower)},\n\n\t\t// No application name provided, so expect current directory.\n\t\t{\"windows\", \"\", false, \".\"},\n\t\t{\"windows\", \"\", true, \".\"},\n\t\t{\"linux\", \"\", false, \".\"},\n\t\t{\"darwin\", \"\", false, \".\"},\n\t\t{\"openbsd\", \"\", false, \".\"},\n\t\t{\"freebsd\", \"\", false, \".\"},\n\t\t{\"netbsd\", \"\", false, \".\"},\n\t\t{\"plan9\", \"\", false, \".\"},\n\t\t{\"unrecognized\", \"\", false, \".\"},\n\n\t\t// Single dot provided for application name, so expect current\n\t\t// directory.\n\t\t{\"windows\", \".\", false, \".\"},\n\t\t{\"windows\", \".\", true, \".\"},\n\t\t{\"linux\", \".\", false, \".\"},\n\t\t{\"darwin\", \".\", false, \".\"},\n\t\t{\"openbsd\", \".\", false, \".\"},\n\t\t{\"freebsd\", \".\", false, \".\"},\n\t\t{\"netbsd\", \".\", false, \".\"},\n\t\t{\"plan9\", \".\", false, \".\"},\n\t\t{\"unrecognized\", \".\", false, \".\"},\n\t}\n\n\tt.Logf(\"Running %d tests\", len(tests))\n\tfor i, test := range tests {\n\t\tret := btcutil.TstAppDataDir(test.goos, test.appName, test.roaming)\n\t\tif ret != test.want {\n\t\t\tt.Errorf(\"appDataDir #%d (%s) does not match - \"+\n\t\t\t\t\"expected got %s, want %s\", i, test.goos, ret,\n\t\t\t\ttest.want)\n\t\t\tcontinue\n\t\t}\n\t}\n}",
"func GetAppDataDir() (string, error) {\n\tif wlpprData != \"\" {\n\t\treturn wlpprData, nil\n\t}\n\tappdata := os.Getenv(\"APPDATA\")\n\twlpprData = filepath.Join(appdata, \"Wlppr\")\n\tif err := createNotExist(wlpprData); err != nil {\n\t\treturn \"\", fmt.Errorf(\"error creatin data folder : %v\", err)\n\t}\n\treturn wlpprData, nil\n}",
"func (app *App) DataDir() (string, error) {\n\tif os.Getenv(\"DATA_DIR\") != \"\" {\n\t\treturn os.Getenv(\"DATA_DIR\"), nil\n\t}\n\n\t// If a root data directory is defined ...\n\tdatadir := app.config.GetString(\"x-blackbox.data_dir\")\n\tif datadir != \"\" {\n\t\treturn datadir, nil\n\t}\n\n\t// The default datadir is at ~/.blackbox/data\n\thome, err := homedir.Dir()\n\treturn filepath.Join(home, userspace, \"data\"), err\n}",
"func dataDirPath(\n\tconfig Config,\n) (string, error) {\n\tif nil != config.DataDir {\n\t\treturn filepath.Abs(*config.DataDir)\n\t}\n\n\tif dataDirEnvVar, ok := os.LookupEnv(\"OPCTL_DATA_DIR\"); ok {\n\t\treturn filepath.Abs(dataDirEnvVar)\n\t}\n\n\tperUserAppDataPath, err := appdatapath.New().PerUser()\n\tif nil != err {\n\t\treturn \"\", err\n\t}\n\n\treturn path.Join(\n\t\tperUserAppDataPath,\n\t\t\"opctl\",\n\t), nil\n}",
"func getDataDir() string {\n\tu, err := user.Current()\n\tif err != nil {\n\t\treturn \".\"\n\t}\n\treturn path.Join(u.HomeDir, UserDataPath)\n}",
"func AppRoot(appName string) string {\n\tdokkuRoot := MustGetEnv(\"DOKKU_ROOT\")\n\treturn fmt.Sprintf(\"%v/%v\", dokkuRoot, appName)\n}",
"func DataDir() (d string) {\n\tosname := runtime.GOOS\n\tif slices.Contains(approvedOSes, osname) {\n\t\td = xdg.StateHome\n\t} else {\n\t\tfmt.Println(\"Operating system couldn't be recognized\")\n\t}\n\treturn d\n}",
"func DataDir() string {\n\treturn dataDir()\n}",
"func DataDirs() string {\n\tif env := os.Getenv(\"XDG_DATA_DIRS\"); env != \"\" {\n\t\treturn expandUser(env)\n\t}\n\treturn dataDirs()\n}",
"func(s *ShellFolders)AppData()(val string){\n\tif s.Context {\n\t\tval, _ = GetReg(\"HKLM\", `Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders`, \"Common AppData\")\n\t\treturn\n\t}\n\tval, _ = GetReg(\"HKCU\", `Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\User Shell Folders`, \"AppData\")\n\treturn\n}",
"func (cfg *Config) DataDir() string {\n\treturn filepath.Clean(cfg.DataDirParent)\n}",
"func Dir() string {\n\treturn filepath.Join(xdg.ConfigHome, AppName)\n}",
"func findAppDataConfig() (configDir string, configFile string) {\n\tif appDataDir := os.Getenv(\"APPDATA\"); appDataDir != \"\" {\n\t\tconfigDir = filepath.Join(appDataDir, \"rclone\")\n\t\tconfigFile = findFile(configDir, configFileName)\n\t} else {\n\t\tfs.Debugf(nil, \"Environment variable APPDATA is not defined and cannot be used as configuration location\")\n\t}\n\treturn\n}",
"func AppPath() string {\n\tpath, err := os.Executable()\n\tMust(err)\n\treturn filepath.Dir(path)\n}",
"func DefaultDataDir() string {\n\tif datadir != \"\" {\n\t\treturn datadir\n\t}\n\t// Try to place the data folder in the user's home dir\n\thome := homeDir()\n\tif home != \"\" {\n\t\tif runtime.GOOS == \"darwin\" {\n\t\t\treturn filepath.Join(home, \"Library\", \"dcrm-walletservice\")\n\t\t} else if runtime.GOOS == \"windows\" {\n\t\t\treturn filepath.Join(home, \"AppData\", \"Roaming\", \"dcrm-walletservice\")\n\t\t} else {\n\t\t\treturn filepath.Join(home, \".dcrm-walletservice\")\n\t\t}\n\t}\n\t// As we cannot guess a stable location, return empty and handle later\n\treturn \"\"\n}",
"func app_dir(pwd string) string {\n\tdir := pwd\n\tfor dir != path.Dir(dir) {\n\t\tif _, err := os.Stat(path.Join(dir, \".arasu_project_rc\")); err == nil {\n\t\t\treturn dir\n\t\t}\n\t\tdir = path.Dir(dir)\n\t}\n\treturn \"\"\n}",
"func GetAppDataPath(entry string) (string, error) {\n\tappdata, err := GetAppDataDir()\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tp := filepath.Join(appdata, entry)\n\tif err := createNotExist(p); err != nil {\n\t\treturn \"\", fmt.Errorf(\"error creatin new folder : %v\", err)\n\t}\n\treturn p, nil\n}",
"func DefaultDataDir() string {\n\t// Try to place the data folder in the user's home dir\n\thome := homeDir()\n\tif home != \"\" {\n\t\tif runtime.GOOS == \"darwin\" {\n\t\t\treturn filepath.Join(home, \"Library\", \"photonpfs\")\n\t\t} else if runtime.GOOS == \"windows\" {\n\t\t\treturn filepath.Join(home, \"AppData\", \"Roaming\", \"photonpfs\")\n\t\t} else {\n\t\t\treturn filepath.Join(home, \".photonpfs\")\n\t\t}\n\t}\n\t// As we cannot guess a stable location, return empty and handle later\n\treturn \"\"\n}",
"func AppBaseDir() string {\n\treturn defaultApp.BaseDir()\n}",
"func (e env) AppdHome(name, sdkVersion string) string {\n\tswitch sdkVersion {\n\tcase Stargate:\n\t\treturn filepath.Join(e.Home(), fmt.Sprintf(\".%s\", name))\n\tcase Launchpad:\n\t\treturn filepath.Join(e.Home(), fmt.Sprintf(\".%sd\", name))\n\t}\n\treturn \"\"\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
validateVertex returns error unless v > 0 and v < V
|
func (dg *Digraph) validateVertex(v int) (err error) {
if v < 0 || v >= dg.V {
err = errors.Wrap(err, "illegal argument")
return err
}
}
|
[
"func mustUseDifferentVertexBuffer(nextNumVertexFloats int) bool {\n\treturn nextNumVertexFloats > graphics.MaxVertexFloatsCount\n}",
"func (v Vertex) Abs() float64 {\n\tfmt.Println(\"Abs:\", v)\n\treturn math.Sqrt(v.X*v.X + v.Y*v.Y)\n}",
"func buildVertex(v0 string, v1 string, v2 string) (Vertex, error) {\n\t//Build a new vertex\n\n\t//Convert each one to float64\n\tv0Float, err := strconv.ParseFloat(v0, 32)\n\tif err != nil {\n\t\treturn Vertex{}, err\n\t}\n\tv1Float, err := strconv.ParseFloat(v1, 32)\n\tif err != nil {\n\t\treturn Vertex{}, err\n\t}\n\tv2Float, err := strconv.ParseFloat(v2, 32)\n\tif err != nil {\n\t\treturn Vertex{}, err\n\t}\n\treturn Vertex{float32(v0Float), float32(v1Float), float32(v2Float)}, nil\n}",
"func EqualVertex(a, b Vertex) bool {\n\treturn EqualFloat(a.X, b.X) &&\n\t\tEqualFloat(a.Y, b.Y)\n}",
"func (l *LWWSet) ContainsVertex(v Vertex) bool {\n\ttsAdd, ok := l.vertexAdded[v]\n\tif !ok {\n\t\treturn false\n\t}\n\n\ttsRem, ok := l.vertexRemoved[v]\n\tif !ok {\n\t\treturn true\n\t}\n\n\treturn tsAdd.After(tsRem)\n}",
"func (hsv HSV) Valid() bool {\n\treturn hsv.H <= 360 && hsv.S <= 100 && hsv.V <= 100\n}",
"func (he HistoryEventVertex) IsStrictOnNextVertex() bool {\n\n\treturn he.isStrictOnNextVertex\n}",
"func validateWeight(weight Weight) error {\n\tw := float32(weight)\n\tif w == 0 {\n\t\treturn nil\n\t}\n\n\tif w < 0 || w > 99 {\n\t\treturn fmt.Errorf(\"Insert a valid weight\")\n\t}\n\treturn nil\n}",
"func TestInvalidMinimum(t *testing.T) {\n\tassertionErrTest(\"x-10\", t)\n}",
"func (o *UIntEngine) validateParams(params *UIntEngineParams) (err error) {\n\terr = nil\n\tif params.MinValue > params.MaxValue {\n\t\terr = fmt.Errorf(\"Min value %v is bigger than max value %v.\\n\", params.MinValue, params.MaxValue)\n\t\to.mgr.counters.maxSmallerThanMin++\n\t}\n\tif params.InitValue != 0 && (params.InitValue < params.MinValue || params.InitValue > params.MaxValue) {\n\t\terr = fmt.Errorf(\"Init value %v must be between [%v - %v].\\n\", params.InitValue, params.MinValue, params.MaxValue)\n\t\to.mgr.counters.badInitValue++\n\t}\n\tsizes := []uint16{1, 2, 4, 8}\n\tmaxPossible := []uint64{math.MaxUint8, math.MaxUint16, math.MaxUint32, math.MaxUint64}\n\ti, ok := findValue(sizes, params.Size)\n\tif !ok {\n\t\terr = fmt.Errorf(\"Invalid size %v. Size should be {1, 2, 4, 8}.\\n\", params.Size)\n\t\to.mgr.counters.invalidSize++\n\t} else {\n\t\tif params.MaxValue > maxPossible[i] {\n\t\t\terr = fmt.Errorf(\"Max value %v cannot be represented with size %v.\\n\", params.MaxValue, params.Size)\n\t\t\to.mgr.counters.sizeTooSmall++\n\t\t}\n\t}\n\tif params.Op != \"inc\" && params.Op != \"dec\" && params.Op != \"rand\" {\n\t\terr = fmt.Errorf(\"Unsupported operation %v.\\n\", params.Op)\n\t\to.mgr.counters.badOperation++\n\t}\n\treturn err\n}",
"func quadraticValidate(t *testing.T, index *ShapeIndex) {\n\t// Iterate through a sequence of nonoverlapping cell ids that cover the\n\t// sphere and include as a subset all the cell ids used in the index. For\n\t// each cell id, verify that the expected set of edges is present.\n\t// \"minCellID\" is the first CellID that has not been validated yet.\n\tminCellID := CellIDFromFace(0).ChildBeginAtLevel(MaxLevel)\n\tfor it := index.Iterator(); ; it.Next() {\n\t\t// Generate a list of CellIDs (\"skipped cells\") that cover the gap\n\t\t// between the last cell we validated and the next cell in the index.\n\t\tvar skipped CellUnion\n\t\tif !it.Done() {\n\t\t\tcellID := it.CellID()\n\t\t\tif cellID < minCellID {\n\t\t\t\tt.Errorf(\"cell ID below min, got %v, want %v\", cellID, minCellID)\n\t\t\t}\n\t\t\tskipped = CellUnionFromRange(minCellID, cellID.RangeMin())\n\t\t\tminCellID = cellID.RangeMax().Next()\n\t\t} else {\n\t\t\t// Validate the empty cells beyond the last cell in the index.\n\t\t\tskipped = CellUnionFromRange(minCellID,\n\t\t\t\tCellIDFromFace(5).ChildEndAtLevel(MaxLevel))\n\t\t}\n\n\t\t// Iterate through all the shapes, simultaneously validating the current\n\t\t// index cell and all the skipped cells.\n\t\tshortEdges := 0 // number of edges counted toward subdivision\n\t\tfor id, shape := range index.shapes {\n\t\t\tfor j := 0; j < len(skipped); j++ {\n\t\t\t\tvalidateInterior(t, shape, skipped[j], false)\n\t\t\t}\n\n\t\t\t// First check that containsCenter() is set correctly.\n\t\t\tvar clipped *clippedShape\n\t\t\tif !it.Done() {\n\t\t\t\tclipped = it.IndexCell().findByShapeID(id)\n\t\t\t\tcontainsCenter := clipped != nil && clipped.containsCenter\n\t\t\t\tvalidateInterior(t, shape, it.CellID(), containsCenter)\n\t\t\t}\n\t\t\t// If this shape has been removed, it should not be present at all.\n\t\t\tif shape == nil {\n\t\t\t\tif clipped != nil {\n\t\t\t\t\tt.Errorf(\"clipped should be nil when shape is nil\")\n\t\t\t\t}\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\t// Otherwise check that the appropriate edges are present.\n\t\t\tfor e := 0; e < shape.NumEdges(); e++ {\n\t\t\t\tedge := shape.Edge(e)\n\t\t\t\tfor j := 0; j < len(skipped); j++ {\n\t\t\t\t\tvalidateEdge(t, edge.V0, edge.V1, skipped[j], false)\n\t\t\t\t}\n\t\t\t\tif !it.Done() {\n\t\t\t\t\thasEdge := clipped != nil && clipped.containsEdge(e)\n\t\t\t\t\tvalidateEdge(t, edge.V0, edge.V1, it.CellID(), hasEdge)\n\t\t\t\t\tif hasEdge && it.CellID().Level() < maxLevelForEdge(edge) {\n\t\t\t\t\t\tshortEdges++\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif shortEdges > index.maxEdgesPerCell {\n\t\t\tt.Errorf(\"too many edges\")\n\t\t}\n\n\t\tif it.Done() {\n\t\t\tbreak\n\t\t}\n\t}\n}",
"func (v Vertex) Len() float64 {\n\treturn math.Sqrt(v.x*v.x + v.y*v.y + v.z*v.z)\n}",
"func Vertex3iv(v []int32) {\n\tC.glVertex3iv((*C.GLint)(&v[0]))\n}",
"func (mesh Mesh) Validate() bool {\n\t// Iterate over all faces\n\tfor _, f := range mesh.Faces {\n\t\t// Check if all vertex ids are in bounds\n\t\tfor _, v := range f.Vertices {\n\t\t\tif v > len(mesh.Vertices)-1 || v < 0 {\n\t\t\t\t// Vertex ids are not in bounds\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t}\n\n\t// Everything okay\n\treturn true\n}",
"func (l *LWWSet) VertexInEdge(v Vertex) bool {\n\tfor e := range l.edgeAdded {\n\t\tif l.ContainsEdge(e) {\n\t\t\treturn e.V1 == v || e.V2 == v\n\t\t}\n\t}\n\treturn false\n}",
"func findMinimumDistance(distance [V]int, vertices [V]bool) int {\n\n\t// Initialize min value\n\tvar min int = math.MaxInt64\n\tvar minIndex int = -1\n\tfor i := 0; i < V; i++ {\n\t\tif vertices[i] == false && distance[i] <= min {\n\t\t\tmin = distance[i]\n\t\t\tminIndex = i\n\t\t}\n\n\t}\n\treturn minIndex\n}",
"func ValidVA(input string) bool {\n\tvals := make([]int, 0, len(input))\n\tfor _, el := range input {\n\t\tif unicode.IsNumber(el) {\n\t\t\tvals = append(vals, int(el-'0')) // int(el-'0') converts rune to int\n\t\t} else {\n\t\t\tif el != ' ' {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t}\n\tif len(vals) < 2 {\n\t\treturn false\n\t}\n\tdouble := len(vals)&1 == 0 // begin doubling if len(vals) is even\n\tsum := 0\n\tfor _, val := range vals {\n\t\tif double {\n\t\t\tif val > 4 { // if val > 4 then val * 2 > 9\n\t\t\t\tsum += (val << 1) - 9 // val * 2 - 9\n\t\t\t} else {\n\t\t\t\tsum += val << 1 // val * 2\n\t\t\t}\n\t\t} else {\n\t\t\tsum += val\n\t\t}\n\t\tdouble = !double\n\t}\n\treturn sum%10 == 0\n}",
"func (p Point) Valid() bool {\n\treturn p.X >= 1 && p.Y >= 1\n}",
"func (w *DL) VertexFormat(frac uint) {\n\tw.wr32(VERTEX_FORMAT | uint32(frac)&7)\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
SetupFixtureData creates a mock data set for the tests to operate on.
|
func SetupFixtureData(storageBackends database.StorageBackends) string {
// create a user
mockUser := models.NewUser()
mockUser.FullName = "John Doe"
mockUser.Username = "johndoe"
mockUser.ID, _ = storageBackends.User.Insert(*mockUser)
utils.DebugLog.Printf("Created Mock user with ID: %s and username: %s\n", mockUser.ID.Hex(), mockUser.Username)
// create a space
mockSpace := models.NewSpace()
mockSpace.Name = "Some Space Name"
mockSpace.Description = "Some Space Description"
mockSpace.OwnerID = mockUser.ID
mockSpace.ID, _ = storageBackends.Space.Insert(*mockSpace)
utils.DebugLog.Printf("Created Mock Space with ID: %s\n", mockSpace.ID.Hex())
// create schema for space
workItemTypeIDs, rootAreaID, rootIterationID, _ := createSchemaForSpaceInStorage(mockSpace.ID, storageBackends)
// create areas: root -> a -> b
mockAreaA := models.NewArea()
mockAreaA.Name = "Area A Name"
mockAreaA.Description = "Area A Description"
mockAreaA.ParentAreaID = *rootAreaID
mockAreaA.SpaceID = mockSpace.ID
mockAreaA.ID, _ = storageBackends.Area.Insert(*mockAreaA)
mockAreaB := models.NewArea()
mockAreaB.Name = "Area B Name"
mockAreaB.Description = "Area B Description"
mockAreaB.ParentAreaID = mockAreaA.ID
mockAreaB.SpaceID = mockSpace.ID
mockAreaB.ID, _ = storageBackends.Area.Insert(*mockAreaB)
// create iterations: root -> a -> b
mockIterationA := models.NewIteration()
mockIterationA.Name = "Iteration A Name"
mockIterationA.Description = "Iteration A Description"
mockIterationA.ParentIterationID = *rootIterationID
mockIterationA.SpaceID = mockSpace.ID
mockIterationA.ID, _ = storageBackends.Iteration.Insert(*mockIterationA)
mockIterationB := models.NewIteration()
mockIterationB.Name = "Iteration B Name"
mockIterationB.Description = "Iteration B Description"
mockIterationB.ParentIterationID = mockIterationA.ID
mockIterationB.SpaceID = mockSpace.ID
mockIterationB.ID, _ = storageBackends.Iteration.Insert(*mockIterationB)
// create some WorkItems
for i := 0; i < 10; i++ {
thisWorkItem := models.NewWorkItem()
thisWorkItem.SpaceID = mockSpace.ID
thisWorkItem.BaseTypeID = workItemTypeIDs[0]
thisWorkItem.Attributes["system.title"] = "Title 0-" + strconv.Itoa(i)
thisWorkItem.Attributes["system.description"] = "Description 0-" + strconv.Itoa(i)
thisWorkItem.Attributes["system.creator"] = mockUser.ID.Hex()
thisWorkItem.CreatorID = mockUser.ID
thisWorkItem.Attributes["system.created_at"] = thisWorkItem.CreatedAt.String()
thisWorkItem.Attributes["system.updated_at"] = thisWorkItem.UpdatedAt.String()
thisWorkItem.Attributes["system.area"] = rootAreaID.Hex()
thisWorkItem.AreaID = *rootAreaID
thisWorkItem.Attributes["system.iteration"] = rootIterationID.Hex()
thisWorkItem.IterationID = *rootIterationID
thisWorkItem.Attributes["system.state"] = "new"
thisWorkItem.ID, _ = storageBackends.WorkItem.Insert(*thisWorkItem)
}
for i := 0; i < 10; i++ {
thisWorkItem := models.NewWorkItem()
thisWorkItem.SpaceID = mockSpace.ID
thisWorkItem.BaseTypeID = workItemTypeIDs[0]
thisWorkItem.Attributes["system.title"] = "Title 1-" + strconv.Itoa(i)
thisWorkItem.Attributes["system.description"] = "Description 1-" + strconv.Itoa(i)
thisWorkItem.Attributes["system.creator"] = mockUser.ID.Hex()
thisWorkItem.CreatorID = mockUser.ID
thisWorkItem.Attributes["system.created_at"] = thisWorkItem.CreatedAt.String()
thisWorkItem.Attributes["system.updated_at"] = thisWorkItem.UpdatedAt.String()
thisWorkItem.Attributes["system.area"] = mockAreaA.ID.Hex()
thisWorkItem.AreaID = *rootAreaID
thisWorkItem.Attributes["system.iteration"] = mockIterationA.ID.Hex()
thisWorkItem.IterationID = *rootIterationID
thisWorkItem.Attributes["system.state"] = "new"
thisWorkItem.ID, _ = storageBackends.WorkItem.Insert(*thisWorkItem)
}
return mockSpace.ID.Hex()
}
|
[
"func SeedTestData(t *testing.T, ctx context.Context, d Data) (Clients, Informers) {\n\tc := Clients{\n\t\tKube: fakekubeclient.Get(ctx),\n\t\tPipeline: fakepipelineclient.Get(ctx),\n\t\tResource: fakeresourceclient.Get(ctx),\n\t}\n\n\ti := Informers{\n\t\tPipelineRun: fakepipelineruninformer.Get(ctx),\n\t\tPipeline: fakepipelineinformer.Get(ctx),\n\t\tTaskRun: faketaskruninformer.Get(ctx),\n\t\tTask: faketaskinformer.Get(ctx),\n\t\tClusterTask: fakeclustertaskinformer.Get(ctx),\n\t\tPipelineResource: fakeresourceinformer.Get(ctx),\n\t\tCondition: fakeconditioninformer.Get(ctx),\n\t\tPod: fakefilteredpodinformer.Get(ctx, v1alpha1.ManagedByLabelKey),\n\t}\n\n\tfor _, pr := range d.PipelineRuns {\n\t\tif err := i.PipelineRun.Informer().GetIndexer().Add(pr); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tif _, err := c.Pipeline.TektonV1alpha1().PipelineRuns(pr.Namespace).Create(ctx, pr, metav1.CreateOptions{}); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t}\n\tfor _, p := range d.Pipelines {\n\t\tif err := i.Pipeline.Informer().GetIndexer().Add(p); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tif _, err := c.Pipeline.TektonV1alpha1().Pipelines(p.Namespace).Create(ctx, p, metav1.CreateOptions{}); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t}\n\tfor _, tr := range d.TaskRuns {\n\t\tif err := i.TaskRun.Informer().GetIndexer().Add(tr); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tif _, err := c.Pipeline.TektonV1alpha1().TaskRuns(tr.Namespace).Create(ctx, tr, metav1.CreateOptions{}); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t}\n\tfor _, ta := range d.Tasks {\n\t\tif err := i.Task.Informer().GetIndexer().Add(ta); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tif _, err := c.Pipeline.TektonV1alpha1().Tasks(ta.Namespace).Create(ctx, ta, metav1.CreateOptions{}); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t}\n\tfor _, ct := range d.ClusterTasks {\n\t\tif err := i.ClusterTask.Informer().GetIndexer().Add(ct); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tif _, err := c.Pipeline.TektonV1alpha1().ClusterTasks().Create(ctx, ct, metav1.CreateOptions{}); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t}\n\tfor _, r := range d.PipelineResources {\n\t\tif err := i.PipelineResource.Informer().GetIndexer().Add(r); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tif _, err := c.Resource.TektonV1alpha1().PipelineResources(r.Namespace).Create(ctx, r, metav1.CreateOptions{}); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t}\n\tfor _, cond := range d.Conditions {\n\t\tif err := i.Condition.Informer().GetIndexer().Add(cond); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tif _, err := c.Pipeline.TektonV1alpha1().Conditions(cond.Namespace).Create(ctx, cond, metav1.CreateOptions{}); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t}\n\tfor _, p := range d.Pods {\n\t\tif err := i.Pod.Informer().GetIndexer().Add(p); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tif _, err := c.Kube.CoreV1().Pods(p.Namespace).Create(ctx, p, metav1.CreateOptions{}); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t}\n\tfor _, n := range d.Namespaces {\n\t\tif _, err := c.Kube.CoreV1().Namespaces().Create(ctx, n, metav1.CreateOptions{}); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t}\n\tc.Pipeline.ClearActions()\n\tc.Kube.ClearActions()\n\treturn c, i\n}",
"func (scenTest *MovieScenarioTest) SetupDataAndStubs() []testtools.Stub {\n\tscenTest.TableName = \"doc-example-test-movie-table\"\n\ttitle := \"Test movie\"\n\tyear := 2002\n\taddRating := 3.5\n\taddRatingS := \"3.5\"\n\taddPlot := \"Add test plot.\"\n\taddMovie := actions.Movie{\n\t\tTitle: title,\n\t\tYear: year,\n\t\tInfo: map[string]interface{}{\"rating\": addRating, \"plot\": addPlot},\n\t}\n\taddMovieItem, marshErr := attributevalue.MarshalMap(addMovie)\n\tif marshErr != nil {\n\t\tpanic(marshErr)\n\t}\n\tupdateRating := 6.6\n\tupdateRatingS := \"6.6\"\n\tupdatePlot := \"Update test plot.\"\n\tupdateMovie := actions.Movie{\n\t\tTitle: title,\n\t\tYear: year,\n\t\tInfo: map[string]interface{}{\"rating\": updateRating, \"plot\": updatePlot},\n\t}\n\tgetIndex := 2\n\tqueryYear := \"1985\"\n\tscanStart := \"2001\"\n\tscanEnd := \"2010\"\n\ttableNames := []string{\"Table 1\", \"Table 2\", \"Table 3\"}\n\tscenTest.Answers = []string{\n\t\taddMovie.Title,\n\t\tstrconv.Itoa(addMovie.Year),\n\t\taddRatingS,\n\t\taddPlot,\n\t\tupdateRatingS,\n\t\tupdatePlot,\n\t\tstrconv.Itoa(getIndex + 1),\n\t\tqueryYear,\n\t\tscanStart,\n\t\tscanEnd,\n\t\t\"y\",\n\t\t\"y\",\n\t\t\"y\",\n\t}\n\n\tscenTest.Sampler = MockSampler{}\n\tsampleMovies := scenTest.Sampler.GetSampleMovies()\n\tvar writeReqs []types.WriteRequest\n\tfor _, movie := range sampleMovies {\n\t\titem, marshErr := attributevalue.MarshalMap(movie)\n\t\tif marshErr != nil {\n\t\t\tpanic(marshErr)\n\t\t}\n\t\twriteReqs = append(\n\t\t\twriteReqs,\n\t\t\ttypes.WriteRequest{PutRequest: &types.PutRequest{Item: item}})\n\t}\n\n\tvar stubList []testtools.Stub\n\tstubList = append(stubList, stubs.StubDescribeTable(\n\t\tscenTest.TableName, &testtools.StubError{Err: &types.ResourceNotFoundException{}, ContinueAfter: true}))\n\tstubList = append(stubList, stubs.StubCreateTable(scenTest.TableName, nil))\n\tstubList = append(stubList, stubs.StubDescribeTable(scenTest.TableName, nil))\n\tstubList = append(stubList, stubs.StubAddMovie(scenTest.TableName, addMovieItem, nil))\n\tstubList = append(stubList, stubs.StubUpdateMovie(scenTest.TableName, updateMovie.GetKey(), updateRatingS, updatePlot, nil))\n\tstubList = append(stubList, stubs.StubAddMovieBatch(scenTest.TableName, writeReqs, nil))\n\tstubList = append(stubList, stubs.StubGetMovie(\n\t\tscenTest.TableName, sampleMovies[getIndex].GetKey(), sampleMovies[getIndex].Title, strconv.Itoa(sampleMovies[getIndex].Year),\n\t\tstrconv.FormatFloat(sampleMovies[getIndex].Info[\"rating\"].(float64), 'f', 1, 64),\n\t\tsampleMovies[getIndex].Info[\"plot\"].(string), nil))\n\tstubList = append(stubList, stubs.StubQuery(scenTest.TableName, title, queryYear, nil))\n\tstubList = append(stubList, stubs.StubScan(scenTest.TableName, title, scanStart, scanEnd, nil))\n\tstubList = append(stubList, stubs.StubListTables(tableNames, nil))\n\tstubList = append(stubList, stubs.StubDeleteItem(scenTest.TableName, addMovie.GetKey(), nil))\n\tstubList = append(stubList, stubs.StubDeleteTable(scenTest.TableName, nil))\n\n\treturn stubList\n}",
"func (runner *TestSuiteRunner) setupFixtureContext(fixture *Fixture) *fixtureContext {\n\tif fixture == nil {\n\t\treturn nil\n\t}\n\tvar cxt = fixtureContext{}\n\tif fixture.DesiredState != \"\" {\n\t\tcxt.desired = runner.loadAWSResource(fixture.DesiredState)\n\t}\n\tif fixture.LatestState != \"\" {\n\t\tcxt.latest = runner.loadAWSResource(fixture.LatestState)\n\t}\n\tmocksdkapi := &mocksvcsdkapi.SageMakerAPI{}\n\tfor _, serviceApi := range fixture.ServiceAPIs {\n\t\tif serviceApi.Operation != \"\" {\n\n\t\t\tif serviceApi.ServiceAPIError != nil {\n\t\t\t\tmockError := CreateAWSError(*serviceApi.ServiceAPIError)\n\t\t\t\tmocksdkapi.On(serviceApi.Operation, mock.Anything, mock.Anything).Return(nil, mockError)\n\t\t\t} else if serviceApi.Operation != \"\" && serviceApi.Output != \"\" {\n\t\t\t\tvar outputObj, err = runner.Delegate.EmptyServiceAPIOutput(serviceApi.Operation)\n\t\t\t\tapiOutputFixturePath := append([]string{\"testdata\"}, strings.Split(serviceApi.Output, \"/\")...)\n\t\t\t\tLoadFromFixture(filepath.Join(apiOutputFixturePath...), outputObj)\n\t\t\t\tmocksdkapi.On(serviceApi.Operation, mock.Anything, mock.Anything).Return(outputObj, nil)\n\t\t\t\tif err != nil {\n\t\t\t\t\tpanic(err)\n\t\t\t\t}\n\t\t\t} else if serviceApi.ServiceAPIError == nil && serviceApi.Output == \"\" {\n\t\t\t\t// Default case for no defined output fixture or error.\n\t\t\t\tmocksdkapi.On(serviceApi.Operation, mock.Anything, mock.Anything).Return(nil, nil)\n\t\t\t}\n\t\t}\n\t}\n\tcxt.mocksdkapi = mocksdkapi\n\tcxt.resourceManager = runner.Delegate.ResourceManager(mocksdkapi)\n\treturn &cxt\n}",
"func setupTestDataset(ctx context.Context, t *testing.T, bqc *bigquery.Client, location string) (ds *bigquery.Dataset, cleanup func(), err error) {\n\tdataset := bqc.Dataset(datasetIDs.New())\n\tif err := dataset.Create(ctx, &bigquery.DatasetMetadata{Location: location}); err != nil {\n\t\treturn nil, nil, err\n\t}\n\treturn dataset, func() {\n\t\tif err := dataset.DeleteWithContents(ctx); err != nil {\n\t\t\tt.Logf(\"could not cleanup dataset %q: %v\", dataset.DatasetID, err)\n\t\t}\n\t}, nil\n}",
"func LoadTestData(filename string, provider TestDataProvider) ([]byte, error) {\n\trefreshLocalData := func(path string, refresh TestDataProvider) ([]byte, error) {\n\t\tcontent, err := refresh()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\terr = ioutil.WriteFile(path, content, 0644)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn content, nil\n\t}\n\n\t// Get path to src/github.com/almighty/almighty-core/test/remote_test_data.go\n\t_, packagefilename, _, ok := runtime.Caller(0)\n\tif !ok {\n\t\tpanic(\"No caller information\")\n\t}\n\n\t// The target dir would be src/github.com/almighty/almighty-core/examples/test\n\ttargetDir := filepath.FromSlash(path.Dir(packagefilename) + \"/../test/data/\")\n\terr := os.MkdirAll(targetDir, 0777)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\ttargetPath := filepath.FromSlash(targetDir + filename)\n\tif _, err := os.Stat(targetPath); os.IsNotExist(err) {\n\t\t// Call refresher if data does not exist locally\n\t\treturn refreshLocalData(targetPath, provider)\n\t}\n\tif _, found := os.LookupEnv(\"REFRESH_DATA\"); found {\n\t\t// Call refresher if force update of test data set in env\n\t\treturn refreshLocalData(targetPath, provider)\n\t}\n\n\treturn ioutil.ReadFile(targetPath)\n}",
"func testDataFlat() testData {\n\treturn loadFixture(\"tdFlat.jsonnet\")\n}",
"func TestDataFiles(t *testing.T, module, metricSet string) {\n\tt.Helper()\n\tconfig := TestDataConfig(t)\n\tTestDataFilesWithConfig(t, module, metricSet, config)\n}",
"func GetTestData() *TestData {\n\tlocation, _ := time.LoadLocation(\"Europe/Athens\")\n\n\treturn &TestData{\n\t\tVersion: 1,\n\t\tName: \"Joe\",\n\t\tBalance: 12.99,\n\t\tBirthDate: time.Date(2015, 12, 13, 23, 59, 59, 0, location),\n\t}\n}",
"func testDataRegular() testData {\n\treturn loadFixture(\"tdRegular.jsonnet\")\n}",
"func (m *MockClaimRewardCaller) SetData(arg0 []byte) ClaimRewardCaller {\n\tm.ctrl.T.Helper()\n\tret := m.ctrl.Call(m, \"SetData\", arg0)\n\tret0, _ := ret[0].(ClaimRewardCaller)\n\treturn ret0\n}",
"func (fs *Fixtures) Setup(ctx context.Context, graphqlClient *graphqlclient.Client) error {\n\tif !fs.parsed {\n\t\tfs.Parse()\n\t}\n\tif fs.parsed && fs.parseErr != nil {\n\t\treturn fmt.Errorf(\"parse error: %w\", fs.parseErr)\n\t}\n\tif fs.setupUntilIdx != nil {\n\t\treturn fmt.Errorf(\"setup has already been attempted until fixture[%d]\", *fs.setupUntilIdx)\n\t}\n\n\t// reach here: can attempt setups\n\t// early exit on the first encountered error.\n\t// if the setup is aborted due to error:\n\t// - fs.setupUntilIdx records the last successful setupUntilIdx\n\tfs.captured = map[string]interface{}{}\n\n\tfor fIdx, f := range fs.Fixtures {\n\t\tfixtureName := fmt.Sprintf(\"fixture[%d]\", fIdx)\n\n\t\t// 1. execute setup\n\t\tjsonParsedResp, err := doGraphqlRequest(ctx, graphqlClient, f.Setup, f.setupVariables, fs.captured)\n\t\tif err != nil {\n\t\t\treturn fs.logAndReturnError(\"%s.setup failed: %w\", fixtureName, err)\n\t\t}\n\t\t// reach here: the setup is done (if the graphql is mutation, the data is already persisted)\n\t\t// then teardown needs to start at least from this fixture.\n\t\tfs.logs = append(fs.logs, fmt.Sprintf(\"%s.setup: completed\", fixtureName))\n\t\tsetupUntilIdx := fIdx // make a copy\n\t\tfs.setupUntilIdx = &setupUntilIdx\n\n\t\t// 2. captures from response\n\t\tif len(f.Captors) == 0 {\n\t\t\tfs.logs = append(fs.logs, fmt.Sprintf(\"%s.captors: not exist\", fixtureName))\n\t\t\treturn nil\n\t\t}\n\t\t// reach here: there are captures to handle\n\t\tfor captorName, captorPath := range f.Captors {\n\t\t\t// captorVal can be single value, or map, or array.\n\t\t\tcapturedGabsObj, err := jsonParsedResp.JSONPointer(captorPath)\n\t\t\tif err != nil {\n\t\t\t\treturn fs.logAndReturnError(\"%s.captors failed: %s (%s) not found: %w\", fixtureName, captorName, captorPath, err)\n\t\t\t}\n\t\t\tfs.captured[captorName] = capturedGabsObj.Data()\n\t\t}\n\t\t// reach here: captures are done\n\t\tfs.logs = append(fs.logs, fmt.Sprintf(\"%s.captors: completed with %d capture(s)\", fixtureName, len(f.Captors)))\n\t}\n\n\treturn nil\n}",
"func (t *TestData) initTestData() error {\n\tif err := validateData(t.Config, t.Separator); err != nil {\n\t\treturn err\n\t}\n\tfile, err := os.Open(t.Path)\n\tdefer file.Close()\n\tif err != nil {\n\t\treturn err\n\t}\n\tscanner := bufio.NewScanner(file)\n\tfor scanner.Scan() {\n\t\tlineStr := scanner.Text()\n\t\tdata := map[string]string{}\n\t\tif err := validateData(lineStr, t.Separator); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tlineStrSlice := strings.Split(lineStr, t.Separator)\n\t\tconfigSlice := strings.Split(t.Config, t.Separator)\n\t\tfor index, key := range configSlice {\n\t\t\tif index > len(lineStrSlice)-1 {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tdata[key] = lineStrSlice[index]\n\t\t}\n\t\tt.Data = append(t.Data, data)\n\t}\n\treturn nil\n}",
"func testDataArray() testData {\n\treturn loadFixture(\"tdArray.jsonnet\")\n}",
"func SetupAndRunTest(m *testing.M) {\n\terr := common.InitConfig()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tcommon.SetLogLevel()\n\tdbConfig := viper.GetStringMap(\"test_database\")\n\tfor _, iConfig := range dbConfig {\n\t\tconfig := common.InterfaceToInterfaceMap(iConfig)\n\t\tviper.Set(\"database.type\", config[\"type\"])\n\t\tviper.Set(\"database.connection\", config[\"connection\"])\n\t\tviper.Set(\"database.dialect\", config[\"dialect\"])\n\t\tRunTestForDB(m)\n\t}\n}",
"func testDataDeep() testData {\n\treturn loadFixture(\"tdDeep.jsonnet\")\n}",
"func Test02Datasets(t *testing.T) {\n\tdName := \"testout\"\n\tfName := path.Join(dName, \"settings.json\")\n\tif _, err := os.Stat(fName); os.IsNotExist(err) {\n\t\tt.Errorf(\"could not find %q, %s\", fName, err)\n\t\tt.FailNow()\n\t}\n\tif err := RunDatasets(fName, \"\", \"\", true); err != nil {\n\t\tt.Error(err)\n\t\tt.FailNow()\n\t}\n}",
"func (x Console) TestData() (result []settings.TestBundle) {\n\treturn\n}",
"func PrepareTestData(clearSqls []string, initSqls []string) {\n\to := GetOrmer()\n\n\tfor _, sql := range clearSqls {\n\t\tfmt.Printf(\"Exec sql:%v\\n\", sql)\n\t\t_, err := o.Raw(sql).Exec()\n\t\tif err != nil {\n\t\t\tfmt.Printf(\"failed to clear database, sql:%v, error: %v\", sql, err)\n\t\t}\n\t}\n\n\tfor _, sql := range initSqls {\n\t\t_, err := o.Raw(sql).Exec()\n\t\tif err != nil {\n\t\t\tfmt.Printf(\"failed to init database, sql:%v, error: %v\", sql, err)\n\t\t}\n\t}\n}",
"func (m *MockDataFlush) PrepareData(opts DataPrepareOptions) (PreparedDataPersist, error) {\n\tret := m.ctrl.Call(m, \"PrepareData\", opts)\n\tret0, _ := ret[0].(PreparedDataPersist)\n\tret1, _ := ret[1].(error)\n\treturn ret0, ret1\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
Format returns an FLV tag with the given arguments
|
func (me *Track) Format(timestamp uint32, data []byte) []byte {
typ := TYPE_AUDIO
if me.Kind() == av.KIND_VIDEO {
typ = TYPE_VIDEO
}
return Tag(typ, timestamp, data)
}
|
[
"func (p *Pattern) Format() (string, error) {\n\tx := *p\n\tvar formatedString string = \"Saved with HW Version: \" + x.version + \"\\n\"\n\n\tif int(x.tempo)*10 == int(x.tempo*10) {\n\t\tformatedString += \"Tempo: \" + strconv.FormatInt(int64(x.tempo), 10) + \"\\n\"\n\t} else {\n\t\tformatedString += \"Tempo: \" + strconv.FormatFloat(float64(x.tempo), 'f', 1, 32) + \"\\n\"\n\t}\n\n\tfor i := 0; i < len(x.instruments); i++ {\n\t\tformatedString += \"(\" + strconv.FormatInt(x.instruments[i].id, 10) + \") \" + x.instruments[i].name + \"\\t\"\n\t\tfor j := 0; j < 16; j++ {\n\t\t\tif j%4 == 0 {\n\t\t\t\tformatedString += \"|\"\n\t\t\t}\n\t\t\tif x.instruments[i].beats[j] {\n\t\t\t\tformatedString += \"x\"\n\t\t\t} else {\n\t\t\t\tformatedString += \"-\"\n\t\t\t}\n\t\t}\n\t\tformatedString += \"|\\n\"\n\t}\n\treturn formatedString, nil\n\n}",
"func (f Frame) Format(st fmt.State, verb rune) {\n\tswitch verb {\n\tcase 'v':\n\t\tf.Format(st, 's')\n\t\tio.WriteString(st, \":\")\n\t\tf.Format(st, 'd')\n\tcase 's':\n\t\tswitch {\n\t\tcase st.Flag('+'):\n\t\t\tpc := f.pc()\n\t\t\tfn := runtime.FuncForPC(pc)\n\t\t\tif fn == nil {\n\t\t\t\tio.WriteString(st, \"unknown\")\n\t\t\t} else {\n\t\t\t\tfile, _ := fn.FileLine(f.pc())\n\t\t\t\tfmt.Fprintf(st, \"%s\\n\\t%s\", fn.Name(), file)\n\t\t\t}\n\t\tdefault:\n\t\t\tio.WriteString(st, path.Base(f.file()))\n\t\t}\n\tcase 'd':\n\t\tfmt.Fprintf(st, \"%d\", f.line())\n\tcase 'n':\n\t\tname := runtime.FuncForPC(f.pc()).Name()\n\t\tio.WriteString(st, funcName(name))\n\t}\n}",
"func (fib *FIBeneficiary) Format(options FormatOptions) string {\n\tvar buf strings.Builder\n\tbuf.Grow(201)\n\tbuf.WriteString(fib.tag)\n\n\tbuf.WriteString(fib.FormatLineOne(options))\n\tbuf.WriteString(fib.FormatLineTwo(options))\n\tbuf.WriteString(fib.FormatLineThree(options))\n\tbuf.WriteString(fib.FormatLineFour(options))\n\tbuf.WriteString(fib.FormatLineFive(options))\n\tbuf.WriteString(fib.FormatLineSix(options))\n\n\tif options.VariableLengthFields {\n\t\treturn fib.stripDelimiters(buf.String())\n\t} else {\n\t\treturn buf.String()\n\t}\n}",
"func Format(v *version.Version) string {\n\treturn \"v\" + v.String()\n}",
"func (cfg *BaseConfig) Infovf(format string, vals ...interface{}) {\n\tif cfg.s_log != nil && cfg.Verbosity.Value != 0 && 3 <= cfg.Verbosity.Value {\n\t\tcfg.s_log.InfoStructured(fmt.Sprintf(format, vals...))\n\t}\n}",
"func (f *Text) Format(path string, data interface{}) error {\n\tif filepath.Ext(path) == \"\" {\n\t\tpath += \".gotmpl\"\n\t}\n\n\ttformat, err := f.assetLoaderFunc(filepath.Join(f.Name(), path))\n\tif err != nil {\n\t\ttformat = []byte(f.fallback)\n\t}\n\treturn f.format(string(tformat), data)\n}",
"func Textf(format string, args ...interface{}) *bar.Segment {\n\treturn Text(fmt.Sprintf(format, args...))\n}",
"func File(args string, buff *demodel.CharBuffer, v demodel.Viewport) {\n\tif args == \"\" {\n\t\tbuff.AppendTag(\"\\nFile:\" + buff.Filename)\n\t\treturn\n\t}\n\n\t// Update tagline if it starts with the current filename. Otherwise\n\t// people will get confused.\n\tif bytes.HasPrefix(buff.Tagline.Buffer, []byte(buff.Filename)) {\n\t\tnewTag := make(\n\t\t\t[]byte,\n\t\t\tlen(buff.Tagline.Buffer)-len(buff.Filename)+len(args),\n\t\t)\n\t\tcopy(newTag, []byte(args))\n\t\tcopy(newTag[len(args):], buff.Tagline.Buffer[len(buff.Filename):])\n\t\tbuff.Tagline.Buffer = newTag\n\t}\n\tbuff.Filename = args\n\n\t// assume that the new filename doesn't have the exact same contents\n\t// as the current buffer, and just mark it dirty.\n\tbuff.Dirty = true\n}",
"func (r Result) Format(f fmt.State, verb rune) {\n\tif len(r.Tags) > 0 {\n\t\tfmt.Fprintf(f, \"%v %v %v %v %v\", r.Query, TagsToString(r.Tags), r.Status, r.Duration, r.MayExonerate)\n\t} else {\n\t\tfmt.Fprintf(f, \"%v %v %v %v\", r.Query, r.Status, r.Duration, r.MayExonerate)\n\t}\n}",
"func (b BinaryVec) Format(f fmt.State, c rune) {\n\tvar buf bytes.Buffer\n\tvar format string\n\tvar leadFormat string\n\tswitch c {\n\tcase 'x':\n\t\tformat = \".%x\"\n\t\tleadFormat = \"%x\"\n\tcase 'X':\n\t\tformat = \".%X\"\n\t\tleadFormat = \"%X\"\n\tcase 'b':\n\t\tf.Write([]byte(b.String()))\n\t\treturn\n\tcase 's':\n\t\tf.Write([]byte(b.String()))\n\t\treturn\n\tdefault:\n\t\tpanic(fmt.Errorf(\"sparse: unsupported format verb '%c' for Binary vector\", c))\n\t}\n\tfmt.Fprintf(&buf, leadFormat, b.data[len(b.data)-1])\n\tfor i := len(b.data) - 2; i >= 0; i-- {\n\t\tfmt.Fprintf(&buf, format, b.data[i])\n\t}\n\tf.Write(buf.Bytes())\n}",
"func NewSWFParameterFormatter(runUUID string, scheduledEpoch int64, nowEpoch int64,\n\tindex int64,\n) *ParameterFormatter {\n\treturn &ParameterFormatter{\n\t\trunUUID: runUUID,\n\t\tscheduledEpoch: scheduledEpoch,\n\t\tnowEpoch: nowEpoch,\n\t\tindex: index,\n\t}\n}",
"func (v Value) Format(w fmt.State, r rune) {\n\tswitch r {\n\tcase 'c':\n\t\tif w.Flag('+') {\n\t\t\tio.WriteString(w, \"C:\")\n\t\t}\n\t\tfmt.Fprint(w, v.Column())\n\n\tcase 'd':\n\t\tif w.Flag('+') {\n\t\t\tio.WriteString(w, \"D:\")\n\t\t}\n\t\tfmt.Fprint(w, v.DefinitionLevel())\n\n\tcase 'r':\n\t\tif w.Flag('+') {\n\t\t\tio.WriteString(w, \"R:\")\n\t\t}\n\t\tfmt.Fprint(w, v.RepetitionLevel())\n\n\tcase 'q':\n\t\tif w.Flag('+') {\n\t\t\tio.WriteString(w, \"V:\")\n\t\t}\n\t\tswitch v.Kind() {\n\t\tcase ByteArray, FixedLenByteArray:\n\t\t\tfmt.Fprintf(w, \"%q\", v.ByteArray())\n\t\tdefault:\n\t\t\tfmt.Fprintf(w, `\"%s\"`, v)\n\t\t}\n\n\tcase 's':\n\t\tif w.Flag('+') {\n\t\t\tio.WriteString(w, \"V:\")\n\t\t}\n\t\tswitch v.Kind() {\n\t\tcase Boolean:\n\t\t\tfmt.Fprint(w, v.Boolean())\n\t\tcase Int32:\n\t\t\tfmt.Fprint(w, v.Int32())\n\t\tcase Int64:\n\t\t\tfmt.Fprint(w, v.Int64())\n\t\tcase Int96:\n\t\t\tfmt.Fprint(w, v.Int96())\n\t\tcase Float:\n\t\t\tfmt.Fprint(w, v.Float())\n\t\tcase Double:\n\t\t\tfmt.Fprint(w, v.Double())\n\t\tcase ByteArray, FixedLenByteArray:\n\t\t\tw.Write(v.ByteArray())\n\t\tdefault:\n\t\t\tio.WriteString(w, \"<null>\")\n\t\t}\n\n\tcase 'v':\n\t\tswitch {\n\t\tcase w.Flag('+'):\n\t\t\tfmt.Fprintf(w, \"%+[1]c %+[1]d %+[1]r %+[1]s\", v)\n\t\tcase w.Flag('#'):\n\t\t\tfmt.Fprintf(w, \"parquet.Value{%+[1]c, %+[1]d, %+[1]r, %+[1]s}\", v)\n\t\tdefault:\n\t\t\tv.Format(w, 's')\n\t\t}\n\t}\n}",
"func (l *Logger) TagPrintf(tags []string, fmt string, args ...interface{}) error {\n\tif l == nil {\n\t\treturn nil\n\t}\n\tl.RLock()\n\tif l.appender == nil {\n\t\tl.RUnlock()\n\t\treturn nil\n\t}\n\tentry := l.format(false, tags, time.Now(), fmt, args...)\n\tapp := l.appender\n\tl.RUnlock()\n\treturn app(entry)\n}",
"func FmtWithv1(input string) string {\n\treturn formatv1.Format(input)\n}",
"func (fibfia *FIBeneficiaryFIAdvice) Format(options FormatOptions) string {\n\tvar buf strings.Builder\n\tbuf.Grow(200)\n\n\tbuf.WriteString(fibfia.tag)\n\tbuf.WriteString(fibfia.AdviceCodeField())\n\tbuf.WriteString(fibfia.FormatLineOne(options))\n\tbuf.WriteString(fibfia.FormatLineTwo(options))\n\tbuf.WriteString(fibfia.FormatLineThree(options))\n\tbuf.WriteString(fibfia.FormatLineFour(options))\n\tbuf.WriteString(fibfia.FormatLineFive(options))\n\tbuf.WriteString(fibfia.FormatLineSix(options))\n\n\tif options.VariableLengthFields {\n\t\treturn fibfia.stripDelimiters(buf.String())\n\t} else {\n\t\treturn buf.String()\n\t}\n}",
"func (v *Variant) writeStreamInf(version int, buf *manifest.BufWrapper) {\n\tif v != nil {\n\t\tif v.IsIframe {\n\t\t\tbuf.WriteString(\"#EXT-X-I-FRAME-STREAM-INF:\")\n\t\t} else {\n\t\t\tbuf.WriteString(\"#EXT-X-STREAM-INF:\")\n\t\t}\n\n\t\tif !buf.WriteValidString(v.Bandwidth, fmt.Sprintf(\"BANDWIDTH=%s\", strconv.FormatInt(v.Bandwidth, 10))) {\n\t\t\tbuf.Err = attributeNotSetError(\"Variant\", \"BANDWIDTH\")\n\t\t\treturn\n\t\t}\n\t\tif version < 6 && v.ProgramID > 0 {\n\t\t\tbuf.WriteValidString(v.ProgramID, fmt.Sprintf(\",PROGRAM-ID=%s\", strconv.FormatInt(v.ProgramID, 10)))\n\t\t}\n\t\tbuf.WriteValidString(v.AvgBandwidth, fmt.Sprintf(\",AVERAGE-BANDWIDTH=%s\", strconv.FormatInt(v.AvgBandwidth, 10)))\n\t\tbuf.WriteValidString(v.Codecs, fmt.Sprintf(\",CODECS=\\\"%s\\\"\", v.Codecs))\n\t\tbuf.WriteValidString(v.Resolution, fmt.Sprintf(\",RESOLUTION=%s\", v.Resolution))\n\t\tbuf.WriteValidString(v.FrameRate, fmt.Sprintf(\",FRAME-RATE=%s\", strconv.FormatFloat(v.FrameRate, 'f', 3, 32)))\n\t\tbuf.WriteValidString(v.Video, fmt.Sprintf(\",VIDEO=\\\"%s\\\"\", v.Video))\n\t\t//If is not IFrame tag, adds AUDIO, SUBTITLES and CLOSED-CAPTIONS params\n\t\tif !v.IsIframe {\n\t\t\tbuf.WriteValidString(v.Audio, fmt.Sprintf(\",AUDIO=\\\"%s\\\"\", v.Audio))\n\t\t\tbuf.WriteValidString(v.Subtitles, fmt.Sprintf(\",SUBTITLES=\\\"%s\\\"\", v.Subtitles))\n\t\t\tbuf.WriteValidString(v.ClosedCaptions, fmt.Sprintf(\",CLOSED-CAPTIONS=\\\"%s\\\"\", v.ClosedCaptions))\n\t\t\t//If not IFrame, URI is in its own line\n\t\t\tbuf.WriteString(fmt.Sprintf(\"\\n%s\\n\", v.URI))\n\t\t} else {\n\t\t\t//If Iframe, URI is a param\n\t\t\tbuf.WriteValidString(v.URI, fmt.Sprintf(\",URI=\\\"%s\\\"\\n\", v.URI))\n\t\t}\n\t}\n}",
"func Debugft(ctx context.Context, format string, v ...interface{}) {\n\ttextWrap(ctx, fmt.Sprintf(format, v...), DebugLevel.String())\n}",
"func (stack RuntimeStack) Format(s fmt.State, verb rune) {\n\tswitch verb {\n\tcase 'v':\n\t\tif s.Flag('+') {\n\t\t\tfor _, pc := range stack {\n\t\t\t\tfmt.Fprintf(s, \"\\tat %+v\\n\", RuntimeFrame(pc))\n\t\t\t}\n\t\t} else {\n\t\t\tfor _, pc := range stack {\n\t\t\t\tfmt.Fprintf(s, \"\\tat %v\\n\", RuntimeFrame(pc))\n\t\t\t}\n\t\t}\n\t}\n}",
"func Formatter(k string, verb string, v interface{}) Field {\n\treturn String(k, fmt.Sprintf(verb, v))\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
Problem19 19. Remove Nth Node From End of List
|
func Problem19() {
head := &ListNode1{Val: 1}
/*head.Next = &ListNode1{Val: 2}
head.Next.Next = &ListNode1{Val: 3}
head.Next.Next.Next = &ListNode1{Val: 4}
head.Next.Next.Next.Next = &ListNode1{Val: 5}*/
h := removeNthFromEnd(head, 1)
for ; h != nil; h = h.Next {
fmt.Println(h.Val)
}
}
|
[
"func (ll *LinkedList) RemoveAtIndex(index int) {\n\tif index < 0 || index > ll.Size {\n\t\treturn\n\t}\n\n\tvar previous *Node\n\tcurrent := ll.Head\n\n\tcount := 0\n\n\tfor count < index {\n\t\tprevious = current\n\t\tcurrent = current.Next\n\t\tcount++\n\t}\n\n\tif index == 0 {\n\t\tll.Head = ll.Head.Next\n\t} else {\n\t\tprevious.Next = current.Next\n\t}\n\n}",
"func (list NumList) Drop(n int) NumList {\n\tl := len(list)\n\tif n > l {\n\t\treturn list[l:]\n\t} else {\n\t\treturn list[n:]\n\t}\n}",
"func removeKth(head *node, k int) *node {\n\tp := &head\n\tfor i := 0; i < k; i++ {\n\t\tp = &((*p).next)\n\t}\n\t*p = (*p).next\n\treturn head\n}",
"func (list FooList) Drop(n int) FooList {\n\tl := len(list)\n\tif n > l {\n\t\treturn list[l:]\n\t} else {\n\t\treturn list[n:]\n\t}\n}",
"func (s *skipList) remove(node *skipListNode) {\n\tif node == nil {\n\t\treturn\n\t}\n\n\tcurrent := s.head\n\n\tfor i := s.height; i >= 0; i-- {\n\n\t\t// If next is nil, move to the next level\n\t\tfor ; current.next[i] != nil; current = current.next[i] {\n\n\t\t\t// If the ttl of the next element is > than the element to be removed,\n\t\t\t// go down one level\n\t\t\tif current.next[i].ttl.Sub(node.ttl) > 0 {\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\t// If current next points to the node we are trying to remove,\n\t\t\t// change pointers, so current.next will point to node.next\n\t\t\tif current.next[i] == node {\n\t\t\t\tcurrent.next[i] = node.next[i]\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t}\n\n\t}\n}",
"func (l *List) remove(e Elementer) Elementer {\n\n\tif l.root == e {\n\t\tr := l.root\n\t\tif r.Next() == l.root {\n\n\t\t\tl.root = nil\n\t\t\tl.len = 0\n\t\t\tl.end = nil\n\t\t\treturn e\n\n\t\t}\n\t\tl.root = r.Next()\n\t\tl.end.SetNext(l.root)\n\n\t\tl.len--\n\t\tr.SetList(nil)\n\t\tr.SetNext(nil)\n\t\treturn e\n\t}\n\n\tp := l.GetBefore(e)\n\t// e is not in the list.\n\tif p == nil {\n\t\treturn e\n\t}\n\tn := e.Next()\n\tp.SetNext(n)\n\tif e == l.end {\n\t\tl.end = p\n\t}\n\tl.len--\n\te.SetNext(nil) // Let the element know that they don't have access to those Elementers.\n\te.SetList(nil)\n\n\treturn e\n}",
"func (list FooList) DropLast(n int) FooList {\n\tl := len(list)\n\tif n > l {\n\t\treturn list[l:]\n\t} else {\n\t\treturn list[0 : l-n]\n\t}\n}",
"func (l *list) delete(i int) {\n\tl = l.first.next // jump to the fisrt element\n\tfor j := 0; j < i; j++ {\n\t\tl = l.next\n\t\tif l == l.last {\n\t\t\tl = l.prev\n\t\t\tbreak // reached the end of list\n\t\t}\n\t}\n\n\t// drop selected node index from the list\n\t// and adjust pointers\n\tnext := l.next\n\tprev := l.prev\n\tprev.next = next\n\tnext.prev = prev\n\n}",
"func (l *List) remove(e Intrusive) Intrusive {\n\t// eprev -> enext\n\teprev, enext := e.Predecessor(), e.Successor()\n\teprev.SetElements(l, eprev.Predecessor(), enext)\n\tenext.SetElements(l, eprev, enext.Successor())\n\te.SetElements(nil, nil, nil)\n\tl.cnt--\n\treturn e\n}",
"func (this *LinkedList) Remove(index int) (interface{}, os.Error) {\n\tif index < 0 || index >= this.length {\n\t\treturn nil, RANGE_ERROR\n\t}\n\ttempNode := new(node)\n\tif tempNode.getPrev() != nil {\n\t\ttempNode.getPrev().setNext(tempNode.getNext())\n\t}\n\tif tempNode.getNext() != nil {\n\t\ttempNode.getNext().setPrev(tempNode.getPrev())\n\t}\n\t//special cases:\n\tif index == 0 {\n\t\tthis.head = this.head.getNext()\n\t} else if index == this.Len()-1 {\n\t\tthis.tail = this.tail.getPrev()\n\t}\n\tthis.length--\n\treturn tempNode.getValue(), nil\n}",
"func (list StringList) Drop(n int) StringList {\n\tif n == 0 {\n\t\treturn list\n\t}\n\n\tl := len(list)\n\tif n < l {\n\t\treturn list[n:]\n\t}\n\treturn list[l:]\n}",
"func (hof *DefaultHallOfFame) Remove(index int) {\n\tif hof.size != 0 {\n\t\thof.size--\n\t\tfor i := index; i < hof.size; i++ {\n\t\t\thof.items[i] = hof.items[i+1]\n\t\t}\n\t}\n}",
"func (this *MyLinkedList) DeleteAtIndex(index int) {\n\tif this.head == nil {\n\t\treturn\n\t}\n\n\tnode := this.head\n\tvar i int\n\n\t// Iterate to (index - 1) node, if possible\n\tfor i = 0; i < index-1; i++ {\n\t\tif node.next != nil {\n\t\t\tnode = node.next\n\t\t} else {\n\t\t\treturn\n\t\t}\n\t}\n\n\tif node.next == nil {\n\t\treturn\n\t}\n\n\tnode.next = node.next.next\n}",
"func (list NumList) DropLast(n int) NumList {\n\tl := len(list)\n\tif n > l {\n\t\treturn list[l:]\n\t} else {\n\t\treturn list[0 : l-n]\n\t}\n}",
"func (l *ExampleList) Remove(i *ExampleItem) {\r\n\tif i.Next != nil {\r\n\t\ti.Next.Prev = i.Prev\r\n\t}\r\n\tif i.Prev != nil {\r\n\t\ti.Prev.Next = i.Next\r\n\t}\r\n\tif l.last == i {\r\n\t\tl.last = i.Prev\r\n\t}\r\n\tif l.first == i {\r\n\t\tl.first = i.Next\r\n\t}\r\n\tl.length--\r\n}",
"func (dll *DLL) DeleteMiddle(pos int) int {\n\tif !(dll.CheckIfEmpty()) {\n\t\t//delete from any position\n\t\thead := dll.head\n\t\tfor i := 1; i <= pos; i++ {\n\t\t\tif head.next == nil && pos > i {\n\t\t\t\t//list is lesser than given position\n\t\t\t\treturn -1\n\t\t\t} else if i == pos {\n\t\t\t\t// delete from this location\n\t\t\t\thead.prev.next = head.next\n\t\t\t\thead.next.prev = head.prev\n\t\t\t\tdll.size--\n\t\t\t\treturn head.data\n\t\t\t}\n\t\t\thead = head.next\n\t\t}\n\t}\n\treturn -1\n}",
"func (l *list) delete(i int) {\n\tif i < l.length {\n\t\tif i == 0 {\n\t\t\tl.head = l.head.next\n\t\t\tif l.head != nil {\n\t\t\t\tl.head.prev = nil\n\t\t\t} else {\n\t\t\t\tl.tail = nil\n\t\t\t}\n\t\t} else {\n\t\t\tcurrent := l.head\n\t\t\tfor j := 0; j < i-1; j++ {\n\t\t\t\tcurrent = current.next\n\t\t\t}\n\t\t\tremoved := current.next\n\t\t\tcurrent.next = removed.next\n\t\t\tif removed.next != nil {\n\t\t\t\tremoved.next.prev = current\n\t\t\t} else {\n\t\t\t\tl.tail = current\n\t\t\t}\n\t\t}\n\t\tl.length--\n\t}\n}",
"func nthToLast(head *list.List, n int) *list.Node {\n if (head.Front() == nil || n > head.Len()) {\n return nil\n }\n counter := 0\n return ( nthToLastHelper(head.Front(), n, &counter) )\n}",
"func (d *T) Remove(n Span) {\n\tif n == 0 {\n\t\tpanic(\"ErrInternalLitsRemoveNil\")\n\t}\n\tsp := &d.spans[n]\n\td.nFree += sp.size()\n\td.rmq = append(d.rmq, n)\n\tif 2*d.nFree < len(d.D) {\n\t\treturn\n\t}\n\td.compact()\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
Mesh generates the mesh for the given string
|
func (f *Font) Mesh(str string, size int) ([]float32, []uint16) {
// Create the cache if it doesn't exist
if f.cache == nil {
f.cache = make(map[string]fontMesh)
}
// Return teh cache if we have it
cacheResult, hasCache := f.cache[str]
if hasCache {
return cacheResult.verts, cacheResult.indicies
}
result := f.font.Call("mesh", str, size)
verticies := TypedArrayToFloat32Slice(result.Get("verticies"))
indices := TypedArrayToUint16Slice(result.Get("indices"))
// vjs := result.Get("verticies")
// vlength := vjs.Get("length").Int()
// verticies = make([]float32, vlength)
// for i := 0; i < vlength; i++ {
// verticies[i] = float32(vjs.Index(i).Float())
// }
//ijs := result.Get("indices")
//ilength := ijs.Get("length").Int()
//indices := make([]uint16, ilength)
//for i := 0; i < ilength; i++ {
// indices[i] = uint16(ijs.Index(i).Int())
//}
// Save to the cache and return result
//log.Println("cache miss", str, ilength, len(indices))
f.cache[str] = fontMesh{verticies, indices}
return verticies, indices
}
|
[
"func NewMesh(ctx *pulumi.Context,\n\tname string, args *MeshArgs, opts ...pulumi.ResourceOption) (*Mesh, error) {\n\tif args == nil {\n\t\treturn nil, errors.New(\"missing one or more required arguments\")\n\t}\n\n\tif args.MeshId == nil {\n\t\treturn nil, errors.New(\"invalid value for required argument 'MeshId'\")\n\t}\n\treplaceOnChanges := pulumi.ReplaceOnChanges([]string{\n\t\t\"location\",\n\t\t\"meshId\",\n\t\t\"project\",\n\t})\n\topts = append(opts, replaceOnChanges)\n\topts = internal.PkgResourceDefaultOpts(opts)\n\tvar resource Mesh\n\terr := ctx.RegisterResource(\"google-native:networkservices/v1beta1:Mesh\", name, args, &resource, opts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &resource, nil\n}",
"func NewMesh(geometry Shape, material Appearance) *Mesh {\n\tm := Mesh{\n\t\tObject3D: NewObject3D(),\n\t\tgeometry: geometry,\n\t\tmaterial: material,\n\t}\n\n\tm.vertexBuffer = newVertexBuffer(geometry)\n\n\tif len(geometry.UVs()) > 0 {\n\t\tm.uvBuffer = newUvBuffer(geometry.UVs(), true)\n\t}\n\n\tif len(geometry.Normals()) > 0 {\n\t\tm.normalBuffer = newNormalBuffer(geometry)\n\t}\n\tm.index = generateIndex(geometry)\n\n\treturn &m\n}",
"func NewMesh() *Mesh {\n\tself := Mesh{}\n\tself.SetDefaults()\n\treturn &self\n}",
"func ParseOBJ(objLocation, matLocation string) (*Mesh, error) {\n\tdat, _ := ioutil.ReadFile(objLocation)\n\tstrDat := string(dat)\n\tre := regexp.MustCompile(`\\r?\\n`)\n\tstrDat = re.ReplaceAllString(strDat, \" \")\n\tstrArray := strings.Split(strDat, \" \")\n\n\tvar err error = nil\n\n\tm := Mesh{}\n\n\tmats, e := parseMat(matLocation)\n\n\tif e != nil {\n\t\terr = e\n\t}\n\n\tm.Materials = mats\n\n\tm.File = objLocation\n\n\tcurrentMaterial := \"\"\n\n\tfor i := 0; i < len(strArray); i++ {\n\t\tword := strArray[i]\n\t\tswitch word {\n\t\tcase \"mtllib\":\n\t\t\tm := parseMtllib(&i, strArray)\n\t\t\tfmt.Println(\"Parsed object material: \", m)\n\n\t\tcase \"o\":\n\t\t\to := parseObjectName(&i, strArray)\n\t\t\tfmt.Println(\"Parsed object: \", o)\n\n\t\tcase \"v\":\n\t\t\tv := parseVertex(&i, strArray)\n\t\t\t// fmt.Println(\"Parsed Vertex: \", v)\n\t\t\tm.Vs = append(m.Vs, v)\n\n\t\tcase \"vn\":\n\t\t\tvn := parseVertexNormal(&i, strArray)\n\t\t\t// fmt.Println(\"Parsed Vertex normal: \", vn)\n\t\t\tm.VNs = append(m.VNs, vn)\n\n\t\tcase \"vt\":\n\t\t\tvt := parseVertexTexture(&i, strArray)\n\t\t\t// fmt.Println(\"Parsed Vertex texture: \", vt)\n\t\t\tm.VTs = append(m.VTs, vt)\n\n\t\tcase \"usemtl\":\n\t\t\tusemtl := parseUseMtl(&i, strArray)\n\t\t\t// fmt.Println(\"Parsed usemtl: \", usemtl)\n\t\t\tcurrentMaterial = usemtl\n\n\t\tcase \"f\":\n\t\t\tf := parseFace(&i, strArray)\n\t\t\t// fmt.Println(\"Parsed Face: \", f)\n\t\t\tf.Material = currentMaterial\n\t\t\tm.Faces = append(m.Faces, f)\n\n\t\t}\n\n\t}\n\treturn &m, err\n\n}",
"func NewCube() *Mesh {\n\tmesh := NewMesh(POSITION, NORMAL, RGB, UV)\n\t// floor\n\tmesh.AddVertex( /* pos */ 0, 0, 0 /* normal */, 0, 0, -1 /* rgb */, 1, 0, 0 /* uv */, 0, 0)\n\tmesh.AddVertex(0, 1, 0, 0, 0, -1, 1, 0, 0, 1, 0)\n\tmesh.AddVertex(1, 1, 0, 0, 0, -1, 1, 0, 0, 1, 1)\n\tmesh.AddVertex(1, 0, 0, 0, 0, -1, 1, 0, 0, 0, 1)\n\t// top\n\tmesh.AddVertex(0, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0)\n\tmesh.AddVertex(1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1)\n\tmesh.AddVertex(1, 1, 1, 0, 0, 1, 1, 0, 1, 1, 1)\n\tmesh.AddVertex(0, 1, 1, 0, 0, 1, 1, 0, 1, 1, 0)\n\n\t// left side\n\tmesh.AddVertex(0, 0, 0, -1, 0, 0, 0, 1, 1, 0, 0)\n\tmesh.AddVertex(0, 0, 1, -1, 0, 0, 0, 1, 1, 1, 0)\n\tmesh.AddVertex(0, 1, 1, -1, 0, 0, 0, 1, 1, 1, 1)\n\tmesh.AddVertex(0, 1, 0, -1, 0, 0, 0, 1, 1, 0, 1)\n\n\t// right side\n\tmesh.AddVertex(1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0)\n\tmesh.AddVertex(1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1)\n\tmesh.AddVertex(1, 1, 1, 1, 0, 0, 1, 1, 0, 1, 1)\n\tmesh.AddVertex(1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0)\n\n\t// front\n\tmesh.AddVertex(0, 0, 0, 0, -1, 0, 0, 0, 1, 0, 0)\n\tmesh.AddVertex(1, 0, 0, 0, -1, 0, 0, 0, 1, 0, 1)\n\tmesh.AddVertex(1, 0, 1, 0, -1, 0, 0, 0, 1, 1, 1)\n\tmesh.AddVertex(0, 0, 1, 0, -1, 0, 0, 0, 1, 1, 0)\n\n\t// back\n\tmesh.AddVertex(0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 0)\n\tmesh.AddVertex(1, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1)\n\tmesh.AddVertex(1, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1)\n\tmesh.AddVertex(0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0)\n\n\tfor i := 0; i < mesh.VertexCount(); i += 4 {\n\t\tmesh.AddFace(uint16(i+0), uint16(i+1), uint16(i+2))\n\t\tmesh.AddFace(uint16(i+2), uint16(i+3), uint16(i+0))\n\t}\n\n\tmesh.Translate(-0.5, -0.5, -0.5)\n\treturn mesh\n}",
"func NewMesh(m MeshLoader) *Mesh {\n\treturn &Mesh{\n\t\tloader: m,\n\t}\n}",
"func NewMesh(ctx *pulumi.Context,\n\tname string, args *MeshArgs, opts ...pulumi.ResourceOption) (*Mesh, error) {\n\tif args == nil {\n\t\targs = &MeshArgs{}\n\t}\n\n\topts = internal.PkgResourceDefaultOpts(opts)\n\tvar resource Mesh\n\terr := ctx.RegisterResource(\"aws-native:appmesh:Mesh\", name, args, &resource, opts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &resource, nil\n}",
"func (s Shell) GenerateUnregularMesh(amountOfPointOnLevel, amountLevelsByHeight int) (m inp.Format, err error) {\n\terr = s.check()\n\tif err != nil {\n\t\treturn m, err\n\t}\n\tdeltaHeight := s.Height / float64(amountLevelsByHeight)\n\n\t// init number of point, cannot be less 1\n\tinitPoint := 1\n\n\tvar angleOffset float64\n\tl := (amountLevelsByHeight + 1) * amountOfPointOnLevel\n\tm.Nodes = make([]inp.Node, 0, l)\n\n\tfor level := 0; level <= amountLevelsByHeight; level++ {\n\t\televation := deltaHeight * float64(level)\n\t\tif level == amountLevelsByHeight {\n\t\t\televation = s.Height\n\t\t}\n\t\tda := 2. * math.Pi / float64(amountOfPointOnLevel)\n\t\tangleOffset += da / 2.\n\t\tfor i := 0; i < amountOfPointOnLevel; i++ {\n\t\t\tangle := da*float64(i) + angleOffset\n\t\t\tm.Nodes = append(m.Nodes, inp.Node{\n\t\t\t\tIndex: int(i+amountOfPointOnLevel*level) + initPoint,\n\t\t\t\tCoord: [3]float64{\n\t\t\t\t\ts.Diameter * float64(0.5) * math.Sin(angle),\n\t\t\t\t\televation,\n\t\t\t\t\ts.Diameter * float64(0.5) * math.Cos(angle)},\n\t\t\t})\n\t\t}\n\t}\n\t//fmt.Println(\"Generate points\")\n\n\t// generate triangles\n\tvar shell inp.Element\n\tshell.Name = ShellName\n\tshell.FE, err = inp.GetFiniteElementByName(\"S3\")\n\tif err != nil {\n\t\treturn m, err\n\t}\n\tl2 := amountLevelsByHeight * amountOfPointOnLevel\n\tshell.Data = make([]inp.ElementData, 0, l2)\n\tfor level := 0; level < amountLevelsByHeight; level++ {\n\t\tfor i := 0; i < amountOfPointOnLevel; i++ {\n\t\t\tif i+1 < amountOfPointOnLevel {\n\t\t\t\tquardToTriangle(&shell,\n\t\t\t\t\tint(i+amountOfPointOnLevel*level+initPoint),\n\t\t\t\t\tint(i+1+amountOfPointOnLevel*level+initPoint),\n\t\t\t\t\tint(i+amountOfPointOnLevel*(level+1)+initPoint),\n\t\t\t\t\tint(i+1+amountOfPointOnLevel*(level+1)+initPoint))\n\t\t\t} else {\n\t\t\t\tquardToTriangle(&shell,\n\t\t\t\t\tint(i+amountOfPointOnLevel*level+initPoint),\n\t\t\t\t\tint(0+amountOfPointOnLevel*level+initPoint),\n\t\t\t\t\tint(i+amountOfPointOnLevel*(level+1)+initPoint),\n\t\t\t\t\tint(0+amountOfPointOnLevel*(level+1)+initPoint))\n\t\t\t}\n\t\t}\n\t}\n\tm.Elements = append(m.Elements, shell)\n\t//fmt.Println(\"Generate elements\")\n\tm.AddUniqueIndexToElements()\n\n\tfmt.Printf(\"Create model with %5v points and %5v elements\\n\", len(m.Nodes), len(shell.Data))\n\t//fmt.Println(\"Return model\")\n\treturn m, nil\n}",
"func makeCubeGeometry(width, height, depth float32) mesh.Geometry {\n\t// half side lengths\n\thalfWidth := width / 2.0\n\thalfHeight := height / 2.0\n\thalfDepth := depth / 2.0\n\n\t// vertex positions\n\tv1 := []float32{-halfWidth, halfHeight, halfDepth}\n\tv2 := []float32{-halfWidth, -halfHeight, halfDepth}\n\tv3 := []float32{halfWidth, halfHeight, halfDepth}\n\tv4 := []float32{halfWidth, -halfHeight, halfDepth}\n\tv5 := []float32{-halfWidth, halfHeight, -halfDepth}\n\tv6 := []float32{-halfWidth, -halfHeight, -halfDepth}\n\tv7 := []float32{halfWidth, halfHeight, -halfDepth}\n\tv8 := []float32{halfWidth, -halfHeight, -halfDepth}\n\n\tpositions := geometry.Combine(\n\t\t// right\n\t\tv7, v8, v3,\n\t\tv3, v8, v4,\n\t\t// left\n\t\tv1, v2, v5,\n\t\tv5, v2, v6,\n\t\t// top\n\t\tv7, v3, v5,\n\t\tv5, v3, v1,\n\t\t// bottom\n\t\tv4, v8, v2,\n\t\tv2, v8, v6,\n\t\t// front\n\t\tv3, v4, v1,\n\t\tv1, v4, v2,\n\t\t//back\n\t\tv5, v6, v7,\n\t\tv7, v6, v8,\n\t)\n\n\t// tex coordinates\n\tt1 := []float32{0.0, 1.0}\n\tt2 := []float32{0.0, 0.0}\n\tt3 := []float32{1.0, 1.0}\n\tt4 := []float32{1.0, 0.0}\n\tuvs := geometry.Repeat(geometry.Combine(t1, t2, t3, t3, t2, t4), 6)\n\n\t// normals\n\tright := []float32{-1.0, 0.0, 0.0}\n\tleft := []float32{1.0, 0.0, 0.0}\n\ttop := []float32{0.0, -1.0, 0.0}\n\tbottom := []float32{0.0, 1.0, 0.0}\n\tfront := []float32{0.0, 0.0, -1.0}\n\tback := []float32{0.0, 0.0, 1.0}\n\tnormals := mesh.Combine(\n\t\tmesh.Repeat(right, 6),\n\t\tmesh.Repeat(left, 6),\n\t\tmesh.Repeat(top, 6),\n\t\tmesh.Repeat(bottom, 6),\n\t\tmesh.Repeat(front, 6),\n\t\tmesh.Repeat(back, 6),\n\t)\n\n\t// setup data\n\tdata := [][]float32{\n\t\tpositions,\n\t\tuvs,\n\t\tnormals,\n\t}\n\n\t// setup layout\n\tlayout := []mesh.VertexAttribute{\n\t\tmesh.MakeVertexAttribute(\"pos\", gl.FLOAT, 3, gl.STATIC_DRAW),\n\t\tmesh.MakeVertexAttribute(\"uv\", gl.FLOAT, 2, gl.STATIC_DRAW),\n\t\tmesh.MakeVertexAttribute(\"normal\", gl.FLOAT, 3, gl.STATIC_DRAW),\n\t}\n\n\treturn mesh.MakeGeometry(layout, data)\n}",
"func (API) Mesh(ctx context.Context, o interface{}, p *path.Mesh, r *path.ResolveConfig) (*api.Mesh, error) {\n\treturn nil, nil\n}",
"func (o RouteOutput) MeshName() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *Route) pulumi.StringOutput { return v.MeshName }).(pulumi.StringOutput)\n}",
"func (vg *VoxelGrid) Mesh() {\n\t// TODO: implement this function\n}",
"func CurveMesh(c Curve, n int, profile []Vector) *Mesh {\n\tm := len(profile)\n\ttriangles := make([]*Triangle, 0, n*m*2)\n\tc0 := make([]Vector, m)\n\tc1 := make([]Vector, m)\n\tCurveCrossSection(c, 0, profile, c0)\n\tfor i := 0; i < n; i++ {\n\t\tt := float64(i+1) / float64(n)\n\t\tCurveCrossSection(c, t, profile, c1)\n\t\tfor j0 := 0; j0 < m; j0++ {\n\t\t\tj1 := (j0 + 1) % m\n\t\t\tv00 := c0[j0]\n\t\t\tv10 := c1[j0]\n\t\t\tv01 := c0[j1]\n\t\t\tv11 := c1[j1]\n\t\t\ttriangles = append(triangles, NewTriangleForPoints(v11, v10, v00))\n\t\t\ttriangles = append(triangles, NewTriangleForPoints(v01, v11, v00))\n\t\t}\n\t\tc1, c0 = c0, c1\n\t}\n\treturn NewTriangleMesh(triangles)\n}",
"func (s *Server) initMesh(args *PilotArgs) error {\n\t// If a config file was specified, use it.\n\tif args.MeshConfig != nil {\n\t\ts.mesh = args.MeshConfig\n\t\treturn nil\n\t}\n\tvar mesh *meshconfig.MeshConfig\n\tvar err error\n\n\tif args.Mesh.ConfigFile != \"\" {\n\t\tmesh, err = cmd.ReadMeshConfig(args.Mesh.ConfigFile)\n\t\tif err != nil {\n\t\t\tlog.Warnf(\"failed to read mesh configuration, using default: %v\", err)\n\t\t}\n\t}\n\n\tif mesh == nil {\n\t\t// Config file either wasn't specified or failed to load - use a default mesh.\n\t\tif _, mesh, err = GetMeshConfig(s.kubeClient, kube.IstioNamespace, kube.IstioConfigMap); err != nil {\n\t\t\tlog.Warnf(\"failed to read mesh configuration: %v\", err)\n\t\t\treturn err\n\t\t}\n\n\t\t// Allow some overrides for testing purposes.\n\t\tif args.Mesh.MixerAddress != \"\" {\n\t\t\tmesh.MixerCheckServer = args.Mesh.MixerAddress\n\t\t\tmesh.MixerReportServer = args.Mesh.MixerAddress\n\t\t}\n\t}\n\n\tlog.Infof(\"mesh configuration %s\", spew.Sdump(mesh))\n\tlog.Infof(\"version %s\", version.Info.String())\n\tlog.Infof(\"flags %s\", spew.Sdump(args))\n\n\ts.mesh = mesh\n\treturn nil\n}",
"func writeObj(mesh *meshful.Mesh, w io.Writer) ([]string, error) {\n\t// a map used to not duplicate vertices written to the obj file\n\tvertexTracker := make(map[string]int)\n\n\t// list of vertex strings to be written to the obj file\n\tvar vertexList []string\n\n\t// faceLists groups lists of faces by their color/material\n\tfaceLists := make(map[string][]string)\n\n\t// loop through each triangle in the mesh\n\tfor _, triangle := range mesh.Triangles {\n\t\t// format the color into an obj string\n\t\tcolorStr := formatColor(triangle.Color)\n\n\t\t// check if that color or lack-of color has already been seen in another triangle\n\t\t_, exists := faceLists[colorStr]\n\t\t// if it has not been seen\n\t\tif !exists {\n\t\t\t// initialize a new face list for the new color\n\t\t\tfaceLists[colorStr] = []string{}\n\t\t}\n\n\t\t// tracks the 3 vertex numbers that make up the face\n\t\tverticesInFace := [3]int{}\n\n\t\t// for each vertex in the triangle\n\t\tfor i := 0; i < 3; i++ {\n\t\t\t// format the vertex to an obj style line\n\t\t\t// also use the string as the key in the vertexTracker map to avoid duplicate vertex lines\n\t\t\tvStr := formatVertex(triangle.Vertices[i])\n\n\t\t\tnumber, exists := vertexTracker[vStr]\n\t\t\t// if the vertex hasn't already been added as an obj string\n\t\t\tif !exists {\n\t\t\t\t// add it to the vertex list\n\t\t\t\tvertexList = append(vertexList, vStr)\n\n\t\t\t\t// store the vertex number in the vertexTracker map to be used by upcoming faces that share\n\t\t\t\t// this vertex\n\t\t\t\tvertexNumberInList := len(vertexList)\n\t\t\t\tvertexTracker[vStr] = vertexNumberInList\n\n\t\t\t\t// add the vertex number to the vertices that make up this face\n\t\t\t\tverticesInFace[i] = vertexNumberInList\n\t\t\t} else {\n\t\t\t\t// else the vertex already exists, so no need to add a new vertex line\n\t\t\t\t// just set that this vertex number is part of the current face\n\t\t\t\tverticesInFace[i] = number\n\t\t\t}\n\t\t}\n\n\t\t// format the face into an obj line\n\t\tfaceLists[colorStr] = append(faceLists[colorStr], formatFace(verticesInFace))\n\t}\n\n\t// write all the lines to the obj file\n\n\t// write comment header\n\theader := \"# meshful OBJ export (github.com/rknizzle/meshful)\\n\\n\"\n\t_, err := w.Write([]byte(header))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// write all the vertex lines to the file\n\tfor _, v := range vertexList {\n\t\t_, err := w.Write([]byte(v))\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\t// store the lines to write to the accompanying mtl file\n\tmtlData := []string{}\n\n\t// write each face grouped by color\n\tvar counter int = 1\n\tfor colorStr, list := range faceLists {\n\t\t// if there is no color specified for some faces just set the color to grey\n\t\tif colorStr == \"\" {\n\t\t\tcolorStr = \"Kd 0.3 0.3 0.3\\n\"\n\t\t}\n\n\t\t// for each color add the lines for the color in the mtl file\n\t\tmaterial := fmt.Sprintf(\"mtl%d\", counter)\n\t\t// newMaterial declares the new material in the file\n\t\t// and colorStr is the line that defines the materials RGB values\n\t\tnewMaterial := fmt.Sprintf(\"newmtl %s\", material)\n\t\t// append both lines to the list of lines to be written to the mtl file\n\t\tmtlData = append(mtlData, newMaterial)\n\t\tmtlData = append(mtlData, colorStr)\n\n\t\t// specify that the next faces will be using the newly created material\n\t\t_, err := w.Write([]byte(fmt.Sprintf(\"usemtl %s\\n\", material)))\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\t// write the face lines belonging to this color/material\n\t\tfor _, f := range list {\n\t\t\t_, err := w.Write([]byte(f))\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t}\n\t\tcounter++\n\t}\n\n\t// return the color/material info to write to an accompanying mtl file\n\treturn mtlData, nil\n}",
"func (o VirtualRouterOutput) MeshName() pulumi.StringOutput {\n\treturn o.ApplyT(func(v *VirtualRouter) pulumi.StringOutput { return v.MeshName }).(pulumi.StringOutput)\n}",
"func (action *Action) Mesh(swap string, expose string, userHome string, pidFile string) {\n\tdaemonRunning := util.IsDaemonRunning(pidFile)\n\tif !daemonRunning {\n\t\tlog.Printf(\"'KT Connect' not runing, you can only access local app from cluster\")\n\t} else {\n\t\tlog.Printf(\"'KT Connect' is runing, you can access local app from cluster and localhost\")\n\t}\n\n\tif swap == \"\" || expose == \"\" {\n\t\terr := fmt.Errorf(\"-expose is required\")\n\t\tpanic(err.Error())\n\t}\n\n\tfactory := connect.Connect{\n\t\tSwap: swap,\n\t\tExpose: expose,\n\t\tKubeconfig: action.Kubeconfig,\n\t\tNamespace: action.Namespace,\n\t\tImage: action.Image,\n\t\tDebug: action.Debug,\n\t}\n\n\tclientset, err := factory.GetClientSet()\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\n\tworkload, err := factory.Mesh(clientset)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\n\tc := make(chan os.Signal)\n\tsignal.Notify(c, syscall.SIGHUP, syscall.SIGINT, syscall.SIGTERM, syscall.SIGQUIT)\n\n\ts := <-c\n\tlog.Printf(\"[Exit] Signal is %s\", s)\n\tfactory.OnMeshExit(workload, clientset)\n}",
"func (API) Mesh(ctx context.Context, o interface{}, p *path.Mesh) (*api.Mesh, error) {\n\tif dc, ok := o.(drawCall); ok {\n\t\treturn drawCallMesh(ctx, dc, p)\n\t}\n\treturn nil, nil\n}",
"func createThicknessMesh(m *model3d.Mesh) *model3d.Mesh {\n\tdelta := m.Max().Sub(m.Min()).Norm() / 100.0\n\tcollider := model3d.MeshToCollider(m)\n\tsolid := model3d.NewColliderSolidHollow(collider, delta*4)\n\tm = model3d.MarchingCubesSearch(solid, delta, 8)\n\tm = m.EliminateCoplanar(1e-5)\n\treturn m\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
SetTLSConfig creates common TLS flags
|
func SetTLSConfig(flags *pflag.FlagSet, prefix string, certificatePath *string, certificateKeyPath *string, caCertPath *string, skipVerify *bool, enableClientVerification *bool) {
flags.StringVarP(certificatePath, prefix+"tls.certificate", "", "", "TLS certificate path (usually has the .crt or .pem extension)")
flags.StringVarP(certificateKeyPath, prefix+"tls.key", "", "", "TLS certificate key path (usually has the .key extension)")
flags.StringVarP(caCertPath, prefix+"tls.ca-certificate", "", "", "TLS CA certificate path (usually has the .pem extension)")
flags.BoolVarP(skipVerify, prefix+"tls.skip-verify", "", false, "Skip TLS certificate server verification (not secure)")
flags.BoolVarP(enableClientVerification, prefix+"tls.enable-client-verification", "", false, "Enable TLS certificate client verification for incoming connections")
}
|
[
"func (i *CDCInstance) setTLSConfig(ctx context.Context, enableTLS bool, configs map[string]any, paths meta.DirPaths) (map[string]any, error) {\n\treturn nil, nil\n}",
"func (s *Service) setTLSConfig(t *tls.Config) {\n\t// TLS options. Can be used without, but only for testing!!\n\tif s.config.TLSConf.Cert != \"\" && s.config.TLSConf.Key != \"\" {\n\t\t// TLS Certs\n\t\tcer, err := tls.LoadX509KeyPair(\n\t\t\ts.config.TLSConf.Cert,\n\t\t\ts.config.TLSConf.Key)\n\t\tif err != nil {\n\t\t\tlogger.Error.Fatal(\"Load of TLS certs failed\")\n\t\t}\n\t\tt.Certificates = []tls.Certificate{cer}\n\t}\n}",
"func SetupTLS(config *tls.Config) {\n\tconfig.CipherSuites = []uint16{\n\t\ttls.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,\n\t\ttls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,\n\n\t\ttls.TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA,\n\t\ttls.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA,\n\n\t\ttls.TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA,\n\t\ttls.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA,\n\n\t\ttls.TLS_RSA_WITH_AES_256_CBC_SHA,\n\t\ttls.TLS_RSA_WITH_AES_128_CBC_SHA,\n\t}\n\n\tconfig.MinVersion = tls.VersionTLS12\n\tconfig.SessionTicketsDisabled = false\n\tconfig.ClientSessionCache = tls.NewLRUClientSessionCache(\n\t\t1024)\n}",
"func (l *listener) configureTLS(config *tls.Config) {\n\tl.tlsMutex.Lock()\n\tif config == nil {\n\t\tconfig = &tls.Config{}\n\t} else {\n\t\t*l.tlsConfig = *config\n\t}\n\tl.tlsMutex.Unlock()\n}",
"func WithTLSConfig(conf *tls.Config) Option {\n\treturn func(c *config) { c.tlsConfig = conf }\n}",
"func (server *HttpServer) SetEnabledTLS(isEnabled bool, certFile, keyFile string) {\n\tserver.ServerConfig().EnabledTLS = isEnabled\n\tserver.ServerConfig().TLSCertFile = certFile\n\tserver.ServerConfig().TLSKeyFile = keyFile\n\tserver.Logger().Debug(\"DotWeb:HttpServer SetEnabledTLS [\"+strconv.FormatBool(isEnabled)+\",\"+certFile+\",\"+keyFile+\"]\", LogTarget_HttpServer)\n}",
"func createTlsConfig(tlsConfig int,tlsCert string) *tls.Config {\n\t//Insecure TLS \n\tif tlsConfig == 1 {\n\t\treturn &tls.Config{\n\t\t\tInsecureSkipVerify:true,\n\t\t}\n\t//Secure TLS\n\t} else{\n\t\tcaCertPool := x509.NewCertPool()\n\t\tcaCertPool.AppendCertsFromPEM([]byte(tlsCert))\n\t\treturn &tls.Config{\n\t\t\tRootCAs: caCertPool,\n\t\t}\n\t}\n}",
"func UpdateTLSConfig(zedcloudCtx *ZedCloudContext, clientCert *tls.Certificate) error {\n\ttlsConfig, err := GetTlsConfig(zedcloudCtx.DeviceNetworkStatus, clientCert, zedcloudCtx)\n\tif err != nil {\n\t\treturn err\n\t}\n\tzedcloudCtx.TlsConfig = tlsConfig\n\treturn nil\n}",
"func configTLS(opt *options.AdmissionOptions, restConfig *restclient.Config) (*tls.Config, error) {\n\tif len(opt.CertFile) != 0 && len(opt.KeyFile) != 0 {\n\t\tsCert, err := tls.LoadX509KeyPair(opt.CertFile, opt.KeyFile)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\treturn &tls.Config{\n\t\t\tCertificates: []tls.Certificate{sCert},\n\t\t}, nil\n\t}\n\n\tif len(restConfig.CertData) != 0 && len(restConfig.KeyData) != 0 {\n\t\tsCert, err := tls.X509KeyPair(restConfig.CertData, restConfig.KeyData)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\treturn &tls.Config{\n\t\t\tCertificates: []tls.Certificate{sCert},\n\t\t}, nil\n\t}\n\treturn nil, errors.New(\"tls: failed to find any tls config data\")\n}",
"func overrideTLS(opts *Options) error {\n\tif opts.TLSCert == \"\" {\n\t\treturn errors.New(\"TLS Server certificate must be present and valid\")\n\t}\n\tif opts.TLSKey == \"\" {\n\t\treturn errors.New(\"TLS Server private key must be present and valid\")\n\t}\n\n\ttc := TLSConfigOpts{}\n\ttc.CertFile = opts.TLSCert\n\ttc.KeyFile = opts.TLSKey\n\ttc.CaFile = opts.TLSCaCert\n\ttc.Verify = opts.TLSVerify\n\ttc.Ciphers = defaultCipherSuites()\n\n\tvar err error\n\topts.TLSConfig, err = GenTLSConfig(&tc)\n\treturn err\n}",
"func (config MsgNetworkConfig) EnableTLS(enabled bool) {\n\tC.msgnetwork_config_enable_tls(config.inner, C.bool(enabled))\n\truntime.KeepAlive(config)\n}",
"func GenTLSConfig(tc *TLSConfigOpts) (*tls.Config, error) {\n\t// Create the tls.Config from our options before including the certs.\n\t// It will determine the cipher suites that we prefer.\n\t// FIXME(dlc) change if ARM based.\n\tconfig := tls.Config{\n\t\tMinVersion: tls.VersionTLS12,\n\t\tCipherSuites: tc.Ciphers,\n\t\tPreferServerCipherSuites: true,\n\t\tCurvePreferences: tc.CurvePreferences,\n\t\tInsecureSkipVerify: tc.Insecure,\n\t}\n\n\tswitch {\n\tcase tc.CertFile != _EMPTY_ && tc.CertStore != certstore.STOREEMPTY:\n\t\treturn nil, certstore.ErrConflictCertFileAndStore\n\tcase tc.CertFile != _EMPTY_ && tc.KeyFile == _EMPTY_:\n\t\treturn nil, fmt.Errorf(\"missing 'key_file' in TLS configuration\")\n\tcase tc.CertFile == _EMPTY_ && tc.KeyFile != _EMPTY_:\n\t\treturn nil, fmt.Errorf(\"missing 'cert_file' in TLS configuration\")\n\tcase tc.CertFile != _EMPTY_ && tc.KeyFile != _EMPTY_:\n\t\t// Now load in cert and private key\n\t\tcert, err := tls.LoadX509KeyPair(tc.CertFile, tc.KeyFile)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"error parsing X509 certificate/key pair: %v\", err)\n\t\t}\n\t\tcert.Leaf, err = x509.ParseCertificate(cert.Certificate[0])\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"error parsing certificate: %v\", err)\n\t\t}\n\t\tconfig.Certificates = []tls.Certificate{cert}\n\tcase tc.CertStore != certstore.STOREEMPTY:\n\t\terr := certstore.TLSConfig(tc.CertStore, tc.CertMatchBy, tc.CertMatch, &config)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\t// Require client certificates as needed\n\tif tc.Verify {\n\t\tconfig.ClientAuth = tls.RequireAndVerifyClientCert\n\t}\n\t// Add in CAs if applicable.\n\tif tc.CaFile != \"\" {\n\t\trootPEM, err := os.ReadFile(tc.CaFile)\n\t\tif err != nil || rootPEM == nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tpool := x509.NewCertPool()\n\t\tok := pool.AppendCertsFromPEM(rootPEM)\n\t\tif !ok {\n\t\t\treturn nil, fmt.Errorf(\"failed to parse root ca certificate\")\n\t\t}\n\t\tconfig.ClientCAs = pool\n\t}\n\n\treturn &config, nil\n}",
"func OptHTTPServerTLSConfig(cfg *tls.Config) HTTPServerOption {\n\treturn func(s *http.Server) error {\n\t\ts.TLSConfig = cfg\n\t\treturn nil\n\t}\n}",
"func WithTLSConfig(tlsCFG TLSConfig) ConfigOptFn {\n\treturn func(cfg Config) Config {\n\t\tcfg.TLSConfig = tlsCFG\n\t\treturn cfg\n\t}\n}",
"func ConfigureTLS(nsqCfg *nsq.Config, tlsCfg *TLSConfig) {\n\tif tlsCfg.Inactive() {\n\t\treturn\n\t}\n\n\tnsqCfg.TlsV1 = true\n\terr := nsqCfg.Set(\"tls_root_ca_file\", tlsCfg.CACertFile)\n\tif err != nil {\n\t\tlog.Panic(err)\n\t}\n\tnsqCfg.TlsConfig.InsecureSkipVerify = false\n\tnsqCfg.TlsConfig.GetClientCertificate = func(cri *tls.CertificateRequestInfo) (*tls.Certificate, error) {\n\t\treturn LoadCertificate(tlsCfg.ClientCertFile)\n\t}\n}",
"func WithTLSConfig(opts ...func(*tls.Config) error) NodeOpt {\n\treturn func(cfg *NodeConfig) error {\n\t\ttlsCfg := &tls.Config{\n\t\t\tMinVersion: tls.VersionTLS12,\n\t\t\tPreferServerCipherSuites: true,\n\t\t\tCipherSuites: DefaultServerCiphers(),\n\t\t\tClientAuth: tls.RequestClientCert,\n\t\t}\n\t\tfor _, o := range opts {\n\t\t\tif err := o(tlsCfg); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t\tcfg.TLSConfig = tlsCfg\n\t\treturn nil\n\t}\n}",
"func TLSConfig(config *tls.Config) ClientOption {\n\tlog.Println(\"The TLSConfig client option is deprecated and will be removed.\")\n\treturn OptClientTLSConfig(config)\n}",
"func WithTLS(serverCA, serverCert, serverKey, peerCA, peerCert, peerKey string) Option {\n\treturn func(b *Bootstrapper) error {\n\t\tvals := []struct {\n\t\t\tname, val string\n\t\t}{\n\t\t\t{\"serverCA\", serverCA},\n\t\t\t{\"serverCert\", serverCert},\n\t\t\t{\"serverKey\", serverKey},\n\t\t\t{\"peerCA\", peerCA},\n\t\t\t{\"peerCert\", peerCert},\n\t\t\t{\"peerKey\", peerKey},\n\t\t}\n\t\tfor _, val := range vals {\n\t\t\tif val.val == \"\" {\n\t\t\t\treturn fmt.Errorf(\"%s must be provided, but was empty\", val.name)\n\t\t\t}\n\t\t}\n\n\t\tflags := []string{\n\t\t\t\"ETCD_CLIENT_CERT_AUTH=true\",\n\t\t\t\"ETCD_TRUSTED_CA_FILE=\" + serverCA,\n\t\t\t\"ETCD_CERT_FILE=\" + serverCert,\n\t\t\t\"ETCD_KEY_FILE=\" + serverKey,\n\t\t\t\"ETCD_PEER_CLIENT_CERT_AUTH=true\",\n\t\t\t\"ETCD_PEER_TRUSTED_CA_FILE=\" + peerCA,\n\t\t\t\"ETCD_PEER_CERT_FILE=\" + peerCert,\n\t\t\t\"ETCD_PEER_KEY_FILE=\" + peerKey,\n\t\t}\n\t\tb.additionalFlags = append(b.additionalFlags, flags...)\n\t\tb.protocol = \"https\"\n\t\treturn nil\n\t}\n}",
"func WithTLSEnabled(_ *Factory, cluster *fdbv1beta2.FoundationDBCluster) {\n\tcluster.Spec.MainContainer.EnableTLS = true\n\tcluster.Spec.SidecarContainer.EnableTLS = true\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
commandClient returns a pilosa.InternalHTTPClient for the command
|
func commandClient(cmd CommandWithTLSSupport, opts ...AnyClientOption) (*pilosa.InternalClient, error) {
internalopts, clientopts, err := separateOptions(opts...)
if err != nil {
return nil, errors.Wrap(err, "separating client options")
}
// we default dial timeout to 3s in commandClient, but prepend it
// to the option list so other options can override it.
clientopts = append([]pilosa.ClientOption{pilosa.ClientDialTimeoutOption(time.Second * 3)}, clientopts...)
internalopts = append([]pilosa.InternalClientOption{pilosa.WithSerializer(proto.Serializer{})}, internalopts...)
tls := cmd.TLSConfiguration()
tlsConfig, err := server.GetTLSConfig(&tls, cmd.Logger())
if err != nil {
return nil, errors.Wrap(err, "getting tls config")
}
client, err := pilosa.NewInternalClient(cmd.TLSHost(), pilosa.GetHTTPClient(tlsConfig, clientopts...), internalopts...)
if err != nil {
return nil, errors.Wrap(err, "getting internal client")
}
return client, err
}
|
[
"func CommandClient(cmd CommandWithTLSSupport) (*pilosa.InternalHTTPClient, error) {\n\ttlsConfig := cmd.TLSConfiguration()\n\tvar TLSConfig *tls.Config\n\tif tlsConfig.CertificatePath != \"\" && tlsConfig.CertificateKeyPath != \"\" {\n\t\tcert, err := tls.LoadX509KeyPair(tlsConfig.CertificatePath, tlsConfig.CertificateKeyPath)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tTLSConfig = &tls.Config{\n\t\t\tCertificates: []tls.Certificate{cert},\n\t\t\tInsecureSkipVerify: tlsConfig.SkipVerify,\n\t\t}\n\t}\n\tclient, err := pilosa.NewInternalHTTPClient(cmd.TLSHost(), pilosa.GetHTTPClient(TLSConfig))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn client, err\n}",
"func NewCommandClient(baseUrl string) interfaces.CommandClient {\n\treturn &CommandClient{\n\t\tbaseUrl: baseUrl,\n\t}\n}",
"func newClient() (mesosAgentClient, error) {\n\tmesosClientOnce.Do(func() {\n\t\t// Start Client\n\t\tapiURL := url.URL{\n\t\t\tScheme: \"http\",\n\t\t\tHost: *MesosAgentAddress,\n\t\t\tPath: \"/api/v1\",\n\t\t}\n\n\t\tmesosClient = &client{\n\t\t\thc: httpcli.New(\n\t\t\t\thttpcli.Endpoint(apiURL.String()),\n\t\t\t\thttpcli.Codec(codecs.ByMediaType[codecs.MediaTypeProtobuf]),\n\t\t\t\thttpcli.Do(httpcli.With(httpcli.Timeout(*MesosAgentTimeout))),\n\t\t\t),\n\t\t}\n\t})\n\n\t_, err := mesosClient.getVersion()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to get version\")\n\t}\n\treturn mesosClient, nil\n}",
"func NewClient(address string, opts ...ClientOpt) cmds.Executor {\n\tif !strings.HasPrefix(address, \"http://\") {\n\t\taddress = \"http://\" + address\n\t}\n\n\tc := &client{\n\t\tserverAddress: address,\n\t\thttpClient: http.DefaultClient,\n\t\tua: \"go-ipfs-cmds/http\",\n\t}\n\n\tfor _, opt := range opts {\n\t\topt(c)\n\t}\n\n\treturn c\n}",
"func GetClientCommand(ip string, ports string, language string, excludeports string, timeout int) string {\n\tlog.Log.Debug(\"Generating client command from these values [ \" + ip + \", \" + ports + \",\" + language + \" ]\")\n\t//listPort := strings.Join(src.CheckPorts(ports), \",\")\n\t//var listPort string\n\tportsArray := src.PortsToExclude(src.CheckPorts(ports),src.CheckPorts(excludeports))\n\tlistPort := strings.Join(portsArray, \",\")\n\n\tswitch language {\n\tcase \"python\":\n\t\treturn \"python -c \\\"import socket;socket.setdefaulttimeout(\" + strconv.Itoa(timeout) +\");[True if 0 == socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect_ex(('\" + ip + \"', port)) else next for port in (\" + listPort + \")]\\\"\"\n\tcase \"bash\":\n\t\treturn \"bash -c 'for port in {\" + listPort + \"}; do timeout \" + strconv.Itoa(timeout) +\" echo >/dev/tcp/\" + ip + \"/$port;done' 2>/dev/null\"\n\tcase \"powershell\":\n\t\treturn \"(\" + listPort + \") | % {echo ((new-object Net.Sockets.TcpClient).BeginConnect('\" + ip + \"',$_,$null,$null).AsyncWaitHandle.WaitOne(\" + strconv.Itoa(timeout * 1000) + \"))} 2>$null\"\n\tcase \"perl\":\n\t\treturn \"perl -MIO::Socket -e 'for $port (\" + listPort + \"){$socket=IO::Socket::INET->new(Proto=>tcp,PeerAddr=>\\\"\" + ip + \"\\\",PeerPort=>$port, Timeout => \" + strconv.Itoa(timeout) +\") ;}'\"\n\tcase \"ruby\":\n\t\treturn \"ruby -rsocket -rtimeout -e '\\\"\" + listPort + \"\\\".split(\\\",\\\").each do |port| sock = Socket.new(:INET, :STREAM);raw = Socket.sockaddr_in(port,\\\"\" + ip + \"\\\");begin Timeout.timeout(\" + strconv.Itoa(timeout) +\") do sock.connect(raw) end rescue nil end;sock.close end'\"\n\tcase \".net\":\n\t\tvar rev = \"using System;using System.Net;using System.Net.Sockets;namespace portscanner {class portscan {static void Main(){string s = \\\"\" + listPort + \"\\\";string[] ports = s.Split(',');foreach (var tmpPort in ports){var port = Convert.ToInt32(tmpPort);var timestamp = Convert.ToInt32(\" + strconv.Itoa(timeout) +\");TcpClient client = new TcpClient();client.ConnectAsync(\\\"\" + ip + \"\\\", port).Wait(timestamp * 1000);client.Close();}}}}\"\n\t\treturn \"Here is the command to compile that oneliner, don't forget to replace the .net version: \\r\\n\\r\\necho \" + rev + \" > portscanner.net && c:\\\\Windows\\\\Microsoft.NET\\\\Framework\\\\v{.netVersion}\\\\csc.exe portscanner.net && portscanner.exe\"\n\tdefault:\n\t\treturn \"The language requested is not provided.\"\n\t}\n\n}",
"func (s *Server) ClientCommand(ctx context.Context, in *pb.ClientCommandRequest) (*pb.ClientCommandResponse, error) {\n\treplyChan := make(chan pb.ClientCommandResponse)\n\tevent := Event{\n\t\trpc: RpcEvent{\n\t\t\tclientCommand: &RaftClientCommandRpcEvent{\n\t\t\t\trequest: *in,\n\t\t\t\tresponseChan: replyChan,\n\t\t\t},\n\t\t},\n }\n raftServer.events<- event\n\n result := <-replyChan\n return &result, nil\n}",
"func GetClient(clusterName string, manageConfig *apistructs.ManageConfig) (string, *httpclient.HTTPClient, error) {\n\tif manageConfig == nil {\n\t\treturn \"\", nil, fmt.Errorf(\"cluster %s manage config is nil\", clusterName)\n\t}\n\n\tinetPortal := \"inet://\"\n\n\thcOptions := []httpclient.OpOption{\n\t\thttpclient.WithHTTPS(),\n\t\thttpclient.WithTimeout(conf.ExecutorClientTimeout(), conf.ExecutorClientTimeout()),\n\t}\n\n\t// check mange config type\n\tswitch manageConfig.Type {\n\tcase apistructs.ManageProxy, apistructs.ManageToken:\n\t\t// cluster-agent -> (patch) cluster-manager\n\t\t// -> (update) eventBox -> (update) scheduler -> scheduler reload executor\n\t\tif manageConfig.Token == \"\" || manageConfig.Address == \"\" {\n\t\t\treturn \"\", nil, fmt.Errorf(\"token or address is empty\")\n\t\t}\n\n\t\thc := httpclient.New(hcOptions...)\n\t\thc.BearerTokenAuth(manageConfig.Token)\n\n\t\tif manageConfig.Type == apistructs.ManageToken {\n\t\t\treturn manageConfig.Address, hc, nil\n\t\t}\n\n\t\t// parseInetAddr parse inet addr, will add proxy header in custom http request\n\t\treturn fmt.Sprintf(\"%s%s/%s\", inetPortal, clusterName, manageConfig.Address), hc, nil\n\tcase apistructs.ManageCert:\n\t\tif len(manageConfig.KeyData) == 0 ||\n\t\t\tlen(manageConfig.CertData) == 0 {\n\t\t\treturn \"\", nil, fmt.Errorf(\"cert or key is empty\")\n\t\t}\n\n\t\tcertBase64, err := base64.StdEncoding.DecodeString(manageConfig.CertData)\n\t\tif err != nil {\n\t\t\treturn \"\", nil, err\n\t\t}\n\t\tkeyBase64, err := base64.StdEncoding.DecodeString(manageConfig.KeyData)\n\t\tif err != nil {\n\t\t\treturn \"\", nil, err\n\t\t}\n\n\t\tvar certOption httpclient.OpOption\n\n\t\tcertOption = httpclient.WithHttpsCertFromJSON(certBase64, keyBase64, nil)\n\n\t\tif len(manageConfig.CaData) != 0 {\n\t\t\tcaBase64, err := base64.StdEncoding.DecodeString(manageConfig.CaData)\n\t\t\tif err != nil {\n\t\t\t\treturn \"\", nil, err\n\t\t\t}\n\t\t\tcertOption = httpclient.WithHttpsCertFromJSON(certBase64, keyBase64, caBase64)\n\t\t}\n\t\thcOptions = append(hcOptions, certOption)\n\n\t\treturn manageConfig.Address, httpclient.New(hcOptions...), nil\n\tdefault:\n\t\treturn \"\", nil, fmt.Errorf(\"manage type is not support\")\n\t}\n}",
"func NewCommandClient(command string, options ...string) (*CommandClient, error) {\n\tcmd := exec.Command(command, options...)\n\tcmdcl := CommandClient{cmd: cmd}\n\tvar err error\n\tif cmdcl.stdin, err = cmdcl.cmd.StdinPipe(); err != nil {\n\t\treturn nil, err\n\t}\n\tif cmdcl.stdout, err = cmdcl.cmd.StdoutPipe(); err != nil {\n\t\treturn nil, err\n\t}\n\terr = cmd.Start()\n\tcmdcl.mutex = new(sync.Mutex)\n\treturn &cmdcl, err\n}",
"func (ap *AbstractP2P) ClientCmd() string {\n\t// torrentPath := path.Join(config.GetString(\"remote.tmpdir\"), ap.TransferFilePath())\n\ttorrentPath := \"\"\n\tcmd := fmt.Sprintf(\"%s %s\", ap.client, torrentPath)\n\treturn cmd\n}",
"func (r *Replayer) Client(ctx context.Context) (*http.Client, error) {\n\treturn &http.Client{Transport: r.proxy.Transport()}, nil\n}",
"func (f Factory) Client(base ...Opt) (*http.Client, error) {\n\topts := make([]Opt, 0, len(f.common)+len(base))\n\topts = append(opts, base...)\n\topts = append(opts, f.common...)\n\n\tvar cli http.Client\n\tvar err *multierror.Error\n\n\tfor _, opt := range opts {\n\t\terr = multierror.Append(err, opt(&cli))\n\t}\n\n\treturn &cli, err.ErrorOrNil()\n}",
"func (root *UserCmd) getUserClient() *client.UserClient { return root.host.client.GetUserClient() }",
"func getClient(url string) (*http.Client, error) {\n\tvar httpc *http.Client\n\tif url == defaultIpamPluginURL {\n\t\tdialContext, err := net.Dial(\"unix\", pluginSockPath)\n\t\tif err != nil {\n\t\t\tlogger.Errorf(\"[Azure CNS] Error.Dial context error %v\", err.Error())\n\t\t\treturn nil, err\n\t\t}\n\n\t\thttpc = &http.Client{\n\t\t\tTransport: &http.Transport{\n\t\t\t\tDialContext: func(_ context.Context, _, _ string) (net.Conn, error) {\n\t\t\t\t\treturn dialContext, nil\n\t\t\t\t},\n\t\t\t},\n\t\t}\n\t} else {\n\t\thttpc = &http.Client{}\n\t}\n\n\treturn httpc, nil\n}",
"func (c *RetryClient) Client() *BaseClient {\n\tc.mu.RLock()\n\tdefer c.mu.RUnlock()\n\treturn c.cli\n}",
"func NewCmdClient(f cmdutil.Factory) *cobra.Command {\n\tcmd := &cobra.Command{\n\t\tUse: \"client\",\n\t\tAliases: []string{\"clients\"},\n\t\tShort: \"Work with Clockify clients\",\n\t}\n\n\tcmd.AddCommand(list.NewCmdList(f, nil))\n\tcmd.AddCommand(add.NewCmdAdd(f, nil))\n\n\treturn cmd\n}",
"func Client() *http.Client {\n\treturn httpClient\n}",
"func (s *Server) cmdCLIENT(msg *Message, client *Client) (resp.Value, error) {\n\tstart := time.Now()\n\n\targs := msg.Args\n\tif len(args) == 1 {\n\t\treturn retrerr(errInvalidNumberOfArguments)\n\t}\n\n\tswitch strings.ToLower(args[1]) {\n\tcase \"list\":\n\t\tif len(args) != 2 {\n\t\t\treturn retrerr(errInvalidNumberOfArguments)\n\t\t}\n\t\tvar list []*Client\n\t\ts.connsmu.RLock()\n\t\tfor _, cc := range s.conns {\n\t\t\tlist = append(list, cc)\n\t\t}\n\t\ts.connsmu.RUnlock()\n\t\tsort.Slice(list, func(i, j int) bool {\n\t\t\treturn list[i].id < list[j].id\n\t\t})\n\t\tnow := time.Now()\n\t\tvar buf []byte\n\t\tfor _, client := range list {\n\t\t\tclient.mu.Lock()\n\t\t\tbuf = append(buf,\n\t\t\t\tfmt.Sprintf(\"id=%d addr=%s name=%s age=%d idle=%d\\n\",\n\t\t\t\t\tclient.id,\n\t\t\t\t\tclient.remoteAddr,\n\t\t\t\t\tclient.name,\n\t\t\t\t\tnow.Sub(client.opened)/time.Second,\n\t\t\t\t\tnow.Sub(client.last)/time.Second,\n\t\t\t\t)...,\n\t\t\t)\n\t\t\tclient.mu.Unlock()\n\t\t}\n\t\tif msg.OutputType == JSON {\n\t\t\t// Create a map of all key/value info fields\n\t\t\tvar cmap []map[string]interface{}\n\t\t\tclients := strings.Split(string(buf), \"\\n\")\n\t\t\tfor _, client := range clients {\n\t\t\t\tclient = strings.TrimSpace(client)\n\t\t\t\tm := make(map[string]interface{})\n\t\t\t\tvar hasFields bool\n\t\t\t\tfor _, kv := range strings.Split(client, \" \") {\n\t\t\t\t\tkv = strings.TrimSpace(kv)\n\t\t\t\t\tif split := strings.SplitN(kv, \"=\", 2); len(split) == 2 {\n\t\t\t\t\t\thasFields = true\n\t\t\t\t\t\tm[split[0]] = tryParseType(split[1])\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif hasFields {\n\t\t\t\t\tcmap = append(cmap, m)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tdata, _ := json.Marshal(cmap)\n\t\t\treturn resp.StringValue(`{\"ok\":true,\"list\":` + string(data) +\n\t\t\t\t`,\"elapsed\":\"` + time.Since(start).String() + \"\\\"}\"), nil\n\t\t}\n\t\treturn resp.BytesValue(buf), nil\n\tcase \"getname\":\n\t\tif len(args) != 2 {\n\t\t\treturn retrerr(errInvalidNumberOfArguments)\n\t\t}\n\t\tclient.mu.Lock()\n\t\tname := client.name\n\t\tclient.mu.Unlock()\n\t\tif msg.OutputType == JSON {\n\t\t\treturn resp.StringValue(`{\"ok\":true,\"name\":` + jsonString(name) +\n\t\t\t\t`,\"elapsed\":\"` + time.Since(start).String() + \"\\\"}\"), nil\n\t\t}\n\t\treturn resp.StringValue(name), nil\n\tcase \"setname\":\n\t\tif len(args) != 3 {\n\t\t\treturn retrerr(errInvalidNumberOfArguments)\n\t\t}\n\t\tname := msg.Args[2]\n\t\tfor i := 0; i < len(name); i++ {\n\t\t\tif name[i] < '!' || name[i] > '~' {\n\t\t\t\treturn retrerr(clientErrorf(\n\t\t\t\t\t\"Client names cannot contain spaces, newlines or special characters.\",\n\t\t\t\t))\n\t\t\t}\n\t\t}\n\t\tclient.mu.Lock()\n\t\tclient.name = name\n\t\tclient.mu.Unlock()\n\t\tif msg.OutputType == JSON {\n\t\t\treturn resp.StringValue(`{\"ok\":true,\"elapsed\":\"` +\n\t\t\t\ttime.Since(start).String() + \"\\\"}\"), nil\n\t\t}\n\t\treturn resp.SimpleStringValue(\"OK\"), nil\n\tcase \"kill\":\n\t\tif len(args) < 3 {\n\t\t\treturn retrerr(errInvalidNumberOfArguments)\n\t\t}\n\t\tvar useAddr bool\n\t\tvar addr string\n\t\tvar useID bool\n\t\tvar id string\n\t\tfor i := 2; i < len(args); i++ {\n\t\t\tif useAddr || useID {\n\t\t\t\treturn retrerr(errInvalidNumberOfArguments)\n\t\t\t}\n\t\t\targ := args[i]\n\t\t\tif strings.Contains(arg, \":\") {\n\t\t\t\taddr = arg\n\t\t\t\tuseAddr = true\n\t\t\t} else {\n\t\t\t\tswitch strings.ToLower(arg) {\n\t\t\t\tcase \"addr\":\n\t\t\t\t\ti++\n\t\t\t\t\tif i == len(args) {\n\t\t\t\t\t\treturn retrerr(errInvalidNumberOfArguments)\n\t\t\t\t\t}\n\t\t\t\t\taddr = args[i]\n\t\t\t\t\tuseAddr = true\n\t\t\t\tcase \"id\":\n\t\t\t\t\ti++\n\t\t\t\t\tif i == len(args) {\n\t\t\t\t\t\treturn retrerr(errInvalidNumberOfArguments)\n\t\t\t\t\t}\n\t\t\t\t\tid = args[i]\n\t\t\t\t\tuseID = true\n\t\t\t\tdefault:\n\t\t\t\t\treturn retrerr(clientErrorf(\"No such client\"))\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tvar closing []io.Closer\n\t\ts.connsmu.RLock()\n\t\tfor _, cc := range s.conns {\n\t\t\tif useID && fmt.Sprintf(\"%d\", cc.id) == id {\n\t\t\t\tif cc.closer != nil {\n\t\t\t\t\tclosing = append(closing, cc.closer)\n\t\t\t\t}\n\t\t\t} else if useAddr {\n\t\t\t\tif cc.remoteAddr == addr {\n\t\t\t\t\tif cc.closer != nil {\n\t\t\t\t\t\tclosing = append(closing, cc.closer)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\ts.connsmu.RUnlock()\n\t\tif len(closing) == 0 {\n\t\t\treturn retrerr(clientErrorf(\"No such client\"))\n\t\t}\n\t\t// go func() {\n\t\t// close the connections behind the scene\n\t\tfor _, closer := range closing {\n\t\t\tcloser.Close()\n\t\t}\n\t\t// }()\n\t\tif msg.OutputType == JSON {\n\t\t\treturn resp.StringValue(`{\"ok\":true,\"elapsed\":\"` +\n\t\t\t\ttime.Since(start).String() + \"\\\"}\"), nil\n\t\t}\n\t\treturn resp.SimpleStringValue(\"OK\"), nil\n\tdefault:\n\t\treturn retrerr(clientErrorf(\n\t\t\t\"Syntax error, try CLIENT (LIST | KILL | GETNAME | SETNAME)\",\n\t\t))\n\t}\n}",
"func NewClient(options ...Option) task.TaskInterface {\n\tc := &client{\n\t\thttpClient: http.DefaultClient,\n\t\thost: defaultHost,\n\t}\n\tfor _, o := range options {\n\t\to(c)\n\t}\n\treturn c\n}",
"func getClientForCommand(cmd *cobra.Command) (vtctldclient.VtctldClient, error) {\n\tif skipStr, ok := cmd.Annotations[skipClientCreationKey]; ok {\n\t\tskipClientCreation, err := strconv.ParseBool(skipStr)\n\t\tif err != nil {\n\t\t\tskipClientCreation = false\n\t\t}\n\n\t\tif skipClientCreation {\n\t\t\treturn nil, nil\n\t\t}\n\t}\n\n\tif VtctldClientProtocol != \"local\" && server == \"\" {\n\t\treturn nil, errNoServer\n\t}\n\n\treturn vtctldclient.New(VtctldClientProtocol, server)\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
separateOptions splits the list of AnyClientOption into the two possible types.
|
func separateOptions(opts ...AnyClientOption) ([]pilosa.InternalClientOption, []pilosa.ClientOption, error) {
internalopts := []pilosa.InternalClientOption{}
clientopts := []pilosa.ClientOption{}
for _, opt := range opts {
if iopt, ok := opt.(pilosa.InternalClientOption); ok {
internalopts = append(internalopts, iopt)
continue
}
if copt, ok := opt.(pilosa.ClientOption); ok {
clientopts = append(clientopts, copt)
continue
}
return nil, nil, errors.Errorf("opt: %+v of type %[1]T must be an InternalClientOption or a ClientOption", opt)
}
return internalopts, clientopts, nil
}
|
[
"func SplitArrayOption(str string) ([]string, error) {\n\t// Check that the beginning and ending are ( and ]\n\tif str[0] != '(' {\n\t\treturn nil, errors.New(\"no ( at start of string\")\n\t}\n\tif str[len(str)-1] != ')' {\n\t\treturn nil, errors.New(\"no ) at end of string\")\n\t}\n\tstr = str[1 : len(str)-1]\n\tstrs := strings.Split(str, \",\")\n\tfor i := range strs {\n\t\tstrs[i] = strings.TrimSpace(strs[i])\n\t}\n\tif len(strs) == 1 && strs[0] == \"\" {\n\t\treturn nil, nil\n\t}\n\treturn strs, nil\n}",
"func splitOptions(options string) []string {\n\tvar res []string\n\tvar sb strings.Builder\n\ti := 0\n\tfor i < len(options) {\n\t\tsb.Reset()\n\t\t// skip leading space\n\t\tfor i < len(options) && options[i] == ' ' {\n\t\t\ti++\n\t\t}\n\t\tif i == len(options) {\n\t\t\tbreak\n\t\t}\n\n\t\tlastWasEscape := false\n\n\t\tfor i < len(options) {\n\t\t\tif options[i] == ' ' && !lastWasEscape {\n\t\t\t\tbreak\n\t\t\t}\n\t\t\tif !lastWasEscape && options[i] == '\\\\' {\n\t\t\t\tlastWasEscape = true\n\t\t\t} else {\n\t\t\t\tlastWasEscape = false\n\t\t\t\tsb.WriteByte(options[i])\n\t\t\t}\n\t\t\ti++\n\t\t}\n\n\t\tres = append(res, sb.String())\n\t}\n\n\treturn res\n}",
"func (d *DHCPv4) StrippedOptions() []Option {\n\t// differently from Options() this function strips away anything coming\n\t// after the End option (normally just Pad options).\n\tstrippedOptions := []Option{}\n\tfor _, opt := range d.options {\n\t\tstrippedOptions = append(strippedOptions, opt)\n\t\tif opt.Code() == OptionEnd {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn strippedOptions\n}",
"func convertOptions(options wallet.Options) []wallet.Option {\n\tvar opts []wallet.Option\n\n\tif options.Coin != \"\" {\n\t\topts = append(opts, wallet.OptionCoinType(options.Coin))\n\t}\n\n\tif options.Bip44Coin != nil {\n\t\topts = append(opts, wallet.OptionBip44Coin(options.Bip44Coin))\n\t}\n\n\tif options.CryptoType != \"\" {\n\t\topts = append(opts, wallet.OptionCryptoType(options.CryptoType))\n\t}\n\n\tif options.Decoder != nil {\n\t\topts = append(opts, wallet.OptionDecoder(options.Decoder))\n\t}\n\n\tif options.Encrypt {\n\t\topts = append(opts, wallet.OptionEncrypt(true))\n\t\topts = append(opts, wallet.OptionPassword(options.Password))\n\t}\n\n\tif options.GenerateN > 0 {\n\t\topts = append(opts, wallet.OptionGenerateN(options.GenerateN))\n\t}\n\n\tif options.ScanN > 0 {\n\t\topts = append(opts, wallet.OptionScanN(options.ScanN))\n\t\topts = append(opts, wallet.OptionTransactionsFinder(options.TF))\n\t}\n\n\treturn opts\n}",
"func TestExtractOptions_MultiShortOptions(t *testing.T) {\n\tshortOptions := []string{\"a\", \"b\", \"c\"}\n\tshortOptionArgs := []string{\"-\" + strings.Join(shortOptions, \"\")}\n\n\toptions, args := extractOptions(shortOptionArgs...)\n\n\tif len(options) != len(shortOptions) {\n\t\tt.Errorf(\n\t\t\t\"%d number of options expected, but only %d were extracted\",\n\t\t\tlen(shortOptions),\n\t\t\tlen(options),\n\t\t)\n\t}\n\n\tif len(args) != 0 {\n\t\tt.Error(\"No arguments should have been extracted\")\n\t}\n}",
"func SeparateArgs(args []string) ([]string, []string) {\n\toptsArgs := []string{}\n\tcmdArgs := []string{}\n\tfor i, v := range args {\n\t\tif v == \"--\" && i+1 < len(args) {\n\t\t\tcmdArgs = args[i+1:]\n\t\t\tbreak\n\t\t}\n\t\toptsArgs = append(optsArgs, v)\n\t}\n\tif len(cmdArgs) <= 0 {\n\t\tcmdArgs, optsArgs = optsArgs, []string{}\n\t}\n\treturn optsArgs, cmdArgs\n}",
"func TestExtractOptions_OnlyOptions(t *testing.T) {\n\tonlyOptionArgs := []string{\"-f\", \"--foobar\"}\n\toptions, args := extractOptions(onlyOptionArgs...)\n\n\tif len(options) != len(onlyOptionArgs) {\n\t\tt.Errorf(\n\t\t\t\"%d number of options expected, but only %d were extracted\",\n\t\t\tlen(onlyOptionArgs),\n\t\t\tlen(options),\n\t\t)\n\t}\n\n\tif len(args) != 0 {\n\t\tt.Error(\"No arguments should have been extracted\")\n\t}\n}",
"func splitOption(opt, prefix string) (option, error) {\n\tkv := strings.Split(opt, \"=\")\n\n\tif len(kv) != 2 {\n\t\treturn option{}, pgerror.Newf(pgcode.ProtocolViolation,\n\t\t\t\"option %q is invalid, check '='\", opt)\n\t}\n\n\tkv[0] = strings.TrimPrefix(kv[0], prefix)\n\n\treturn option{key: strings.ReplaceAll(kv[0], \"-\", \"_\"), value: kv[1]}, nil\n}",
"func ExtractClientType(params map[string]string, secrets map[string]string, defaultClient ClientType) ClientType {\n\tclient := \"\"\n\tfor k, v := range secrets {\n\t\tif strings.ToLower(k) == \"client\" {\n\t\t\tclient = v\n\t\t\tbreak\n\t\t}\n\t}\n\n\tfor k, v := range params {\n\t\tif strings.ToLower(k) == \"client\" {\n\t\t\tclient = v\n\t\t\tbreak\n\t\t}\n\t}\n\n\treturn GetValidClientType(client, defaultClient)\n}",
"func MergeClientOptions(cs connstring.ConnString, opts ...*ClientOptions) *ClientOptions {\n\tc := Client()\n\tc.ConnString = cs\n\n\tfor _, opt := range opts {\n\t\tif opt == nil {\n\t\t\tcontinue\n\t\t}\n\t\tc.TopologyOptions = append(c.TopologyOptions, opt.TopologyOptions...)\n\n\t\tif an := opt.ConnString.AppName; an != \"\" {\n\t\t\tc.ConnString.AppName = an\n\t\t}\n\t\tif am := opt.ConnString.AuthMechanism; len(am) != 0 {\n\t\t\tc.ConnString.AuthMechanism = am\n\t\t}\n\t\tif amp := opt.ConnString.AuthMechanismProperties; amp != nil {\n\t\t\tc.ConnString.AuthMechanismProperties = amp\n\t\t}\n\t\tif as := opt.ConnString.AuthSource; len(as) != 0 {\n\t\t\tc.ConnString.AuthSource = as\n\t\t}\n\t\tif u := opt.ConnString.Username; len(u) != 0 {\n\t\t\tc.ConnString.Username = u\n\t\t}\n\t\tif p := opt.ConnString.Password; len(p) != 0 {\n\t\t\tc.ConnString.Password = p\n\t\t}\n\t\tif opt.ConnString.ConnectTimeoutSet {\n\t\t\tc.ConnString.ConnectTimeoutSet = true\n\t\t\tc.ConnString.ConnectTimeout = opt.ConnString.ConnectTimeout\n\t\t}\n\t\tif opt.ConnString.HeartbeatIntervalSet {\n\t\t\tc.ConnString.HeartbeatIntervalSet = true\n\t\t\tc.ConnString.HeartbeatInterval = opt.ConnString.HeartbeatInterval\n\t\t}\n\t\tif h := opt.ConnString.Hosts; h != nil {\n\t\t\tc.ConnString.Hosts = h\n\t\t}\n\t\tif opt.ConnString.LocalThresholdSet {\n\t\t\tc.ConnString.LocalThresholdSet = true\n\t\t\tc.ConnString.LocalThreshold = opt.ConnString.LocalThreshold\n\t\t}\n\t\tif opt.ConnString.MaxConnIdleTimeSet {\n\t\t\tc.ConnString.MaxConnIdleTimeSet = true\n\t\t\tc.ConnString.MaxConnIdleTime = opt.ConnString.MaxConnIdleTime\n\t\t}\n\t\tif opt.ConnString.MaxPoolSizeSet {\n\t\t\tc.ConnString.MaxPoolSizeSet = true\n\t\t\tc.ConnString.MaxPoolSize = opt.ConnString.MaxPoolSize\n\t\t}\n\t\tif opt.ReadConcern != nil {\n\t\t\tc.ReadConcern = opt.ReadConcern\n\t\t}\n\t\tif opt.ReadPreference != nil {\n\t\t\tc.ReadPreference = opt.ReadPreference\n\t\t}\n\t\tif opt.Registry != nil {\n\t\t\tc.Registry = opt.Registry\n\t\t}\n\t\tif rs := opt.ConnString.ReplicaSet; rs != \"\" {\n\t\t\tc.ConnString.ReplicaSet = rs\n\t\t}\n\t\tif opt.RetryWrites != nil {\n\t\t\tc.RetryWrites = opt.RetryWrites\n\t\t}\n\t\tif opt.ConnString.ServerSelectionTimeoutSet {\n\t\t\tc.ConnString.ServerSelectionTimeoutSet = true\n\t\t\tc.ConnString.ServerSelectionTimeout = opt.ConnString.ServerSelectionTimeout\n\t\t}\n\t\tif opt.ConnString.ConnectSet {\n\t\t\tc.ConnString.ConnectSet = true\n\t\t\tc.ConnString.Connect = opt.ConnString.Connect\n\t\t}\n\t\tif opt.ConnString.SocketTimeoutSet {\n\t\t\tc.ConnString.SocketTimeoutSet = true\n\t\t\tc.ConnString.SocketTimeout = opt.ConnString.SocketTimeout\n\t\t}\n\t\tif opt.ConnString.SSLSet {\n\t\t\tc.ConnString.SSLSet = true\n\t\t\tc.ConnString.SSL = opt.ConnString.SSL\n\t\t}\n\t\tif opt.ConnString.SSLClientCertificateKeyFileSet {\n\t\t\tc.ConnString.SSLClientCertificateKeyFileSet = true\n\t\t\tc.ConnString.SSLClientCertificateKeyFile = opt.ConnString.SSLClientCertificateKeyFile\n\t\t}\n\t\tif opt.ConnString.SSLClientCertificateKeyPasswordSet {\n\t\t\tc.ConnString.SSLClientCertificateKeyPasswordSet = true\n\t\t\tc.ConnString.SSLClientCertificateKeyPassword = opt.ConnString.SSLClientCertificateKeyPassword\n\t\t}\n\t\tif opt.ConnString.SSLInsecureSet {\n\t\t\tc.ConnString.SSLInsecureSet = true\n\t\t\tc.ConnString.SSLInsecure = opt.ConnString.SSLInsecure\n\t\t}\n\t\tif opt.ConnString.SSLCaFileSet {\n\t\t\tc.ConnString.SSLCaFileSet = true\n\t\t\tc.ConnString.SSLCaFile = opt.ConnString.SSLCaFile\n\t\t}\n\t\tif opt.WriteConcern != nil {\n\t\t\tc.WriteConcern = opt.WriteConcern\n\t\t}\n\t}\n\n\treturn c\n}",
"func (d *DHCPv4) ValidateOptions() {\n\t// TODO find duplicate options\n\tfoundOptionEnd := false\n\tfor _, opt := range d.options {\n\t\tif foundOptionEnd {\n\t\t\tif opt.Code() == OptionEnd {\n\t\t\t\tlog.Print(\"Warning: found duplicate End option\")\n\t\t\t}\n\t\t\tif opt.Code() != OptionEnd && opt.Code() != OptionPad {\n\t\t\t\tname := OptionCodeToString[opt.Code()]\n\t\t\t\tlog.Printf(\"Warning: found option %v (%v) after End option\", opt.Code(), name)\n\t\t\t}\n\t\t}\n\t\tif opt.Code() == OptionEnd {\n\t\t\tfoundOptionEnd = true\n\t\t}\n\t}\n\tif !foundOptionEnd {\n\t\tlog.Print(\"Warning: no End option found\")\n\t}\n}",
"func parseOptions(b []byte) ([]Option, error) {\n\tvar options []Option\n\tfor i := 0; len(b[i:]) != 0; {\n\t\t// Two bytes: option type and option length.\n\t\tif len(b[i:]) < 2 {\n\t\t\treturn nil, io.ErrUnexpectedEOF\n\t\t}\n\n\t\t// Type processed as-is, but length is stored in units of 8 bytes,\n\t\t// so expand it to the actual byte length.\n\t\tt := b[i]\n\t\tl := int(b[i+1]) * 8\n\n\t\t// Verify that we won't advance beyond the end of the byte slice.\n\t\tif l > len(b[i:]) {\n\t\t\treturn nil, io.ErrUnexpectedEOF\n\t\t}\n\n\t\t// Infer the option from its type value and use it for unmarshaling.\n\t\tvar o Option\n\t\tswitch t {\n\t\tcase optSourceLLA, optTargetLLA:\n\t\t\to = new(LinkLayerAddress)\n\t\tcase optMTU:\n\t\t\to = new(MTU)\n\t\tcase optPrefixInformation:\n\t\t\to = new(PrefixInformation)\n\t\tcase optRouteInformation:\n\t\t\to = new(RouteInformation)\n\t\tcase optRDNSS:\n\t\t\to = new(RecursiveDNSServer)\n\t\tcase optDNSSL:\n\t\t\to = new(DNSSearchList)\n\t\tcase optCaptivePortal:\n\t\t\to = new(CaptivePortal)\n\t\tcase optNonce:\n\t\t\to = new(Nonce)\n\t\tdefault:\n\t\t\to = new(RawOption)\n\t\t}\n\n\t\t// Unmarshal at the current offset, up to the expected length.\n\t\tif err := o.unmarshal(b[i : i+l]); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\t// Advance to the next option's type field.\n\t\ti += l\n\n\t\toptions = append(options, o)\n\t}\n\n\treturn options, nil\n}",
"func CredentialsOptionsFromEnv(envKey string) ([]option.ClientOption, error) {\n\topts := []option.ClientOption{}\n\tserviceAccountEncoded := GetEnvVar(envKey, \"x\") // base64 encoded json creds\n\tif serviceAccountEncoded == \"x\" {\n\t\treturn opts, nil\n\t}\n\tserviceAccountJSON, err := base64.StdEncoding.DecodeString(serviceAccountEncoded)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\topts = append(opts, option.WithCredentialsJSON(serviceAccountJSON))\n\treturn opts, nil\n}",
"func PossibleClientAuthenticationTypeValues() []ClientAuthenticationType {\n\treturn []ClientAuthenticationType{ClientAuthenticationTypeAzureAD, ClientAuthenticationTypePartnerClientAuthentication}\n}",
"func buildOptions(list ...Option) options {\n\topts := options{\n\t\tfrontendHandler: defaultFrontendHandler,\n\t\tbackendHandler: func(ctx context.Context) (handler http.Handler, err error) {\n\t\t\treturn nil, fmt.Errorf(\"backend handler is not configured\")\n\t\t},\n\t}\n\n\tfor _, o := range list {\n\t\to(&opts)\n\t}\n\n\treturn opts\n}",
"func Test_parseOptions(t *testing.T) {\n\tvar tests = []struct {\n\t\tdesc string\n\t\tbuf []byte\n\t\toptions Options\n\t\terr error\n\t}{\n\t\t{\n\t\t\tdesc: \"nil options bytes\",\n\t\t\toptions: Options{},\n\t\t},\n\t\t{\n\t\t\tdesc: \"empty options bytes\",\n\t\t\tbuf: []byte{},\n\t\t\toptions: Options{},\n\t\t},\n\t\t{\n\t\t\tdesc: \"too short options bytes\",\n\t\t\tbuf: []byte{0},\n\t\t\terr: ErrInvalidOptions,\n\t\t},\n\t\t{\n\t\t\tdesc: \"zero code, zero length option bytes\",\n\t\t\tbuf: []byte{0, 0, 0, 0},\n\t\t\toptions: Options{\n\t\t\t\t0: [][]byte{{}},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tdesc: \"zero code, zero length option bytes with trailing byte\",\n\t\t\tbuf: []byte{0, 0, 0, 0, 1},\n\t\t\terr: ErrInvalidOptions,\n\t\t},\n\t\t{\n\t\t\tdesc: \"zero code, length 3, incorrect length for data\",\n\t\t\tbuf: []byte{0, 0, 0, 3, 1, 2},\n\t\t\terr: ErrInvalidOptions,\n\t\t},\n\t\t{\n\t\t\tdesc: \"Rapid Commit, length 0\",\n\t\t\tbuf: []byte{0, 14, 0, 0},\n\t\t\toptions: Options{\n\t\t\t\tOptionRapidCommit: [][]byte{{}},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tdesc: \"client ID, length 1, value [1]\",\n\t\t\tbuf: []byte{0, 1, 0, 1, 1},\n\t\t\toptions: Options{\n\t\t\t\tOptionClientID: [][]byte{{1}},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tdesc: \"client ID, length 2, value [1 1] + server ID, length 3, value [1 2 3]\",\n\t\t\tbuf: []byte{\n\t\t\t\t0, 1, 0, 2, 1, 1,\n\t\t\t\t0, 2, 0, 3, 1, 2, 3,\n\t\t\t},\n\t\t\toptions: Options{\n\t\t\t\tOptionClientID: [][]byte{{1, 1}},\n\t\t\t\tOptionServerID: [][]byte{{1, 2, 3}},\n\t\t\t},\n\t\t},\n\t}\n\n\tfor i, tt := range tests {\n\t\tvar options Options\n\t\terr := (&options).UnmarshalBinary(tt.buf)\n\t\tif err != nil {\n\t\t\tif want, got := tt.err, err; want != got {\n\t\t\t\tt.Errorf(\"[%02d] test %q, unexpected error for parseOptions(%v): %v != %v\",\n\t\t\t\t\ti, tt.desc, tt.buf, want, got)\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\n\t\tif want, got := tt.options, options; !reflect.DeepEqual(want, got) {\n\t\t\tt.Errorf(\"[%02d] test %q, unexpected Options map for parseOptions(%v):\\n- want: %v\\n- got: %v\",\n\t\t\t\ti, tt.desc, tt.buf, want, got)\n\t\t}\n\n\t\tfor k, v := range tt.options {\n\t\t\tfor ii := range v {\n\t\t\t\tif want, got := cap(v[ii]), cap(options[k][ii]); want != got {\n\t\t\t\t\tt.Errorf(\"[%02d] test %q, option %d, unexpected capacity option data:\\n- want: %v\\n- got: %v\",\n\t\t\t\t\t\ti, tt.desc, ii, want, got)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}",
"func (d *Driver) ParseSendOptions(\n\to []base.SendOption,\n) *base.SendOptions {\n\tfinalOpts := &base.SendOptions{\n\t\tStripPrompt: base.DefaultSendOptionsStripPrompt,\n\t\tFailedWhenContains: d.FailedWhenContains,\n\t\tStopOnFailed: base.DefaultSendOptionsStopOnFailed,\n\t\tTimeoutOps: base.DefaultSendOptionsTimeoutOps,\n\t\tEager: base.DefaultSendOptionsEager,\n\t\t// only used with SendConfig(s), thus this should default to \"configuration\"\n\t\tDesiredPrivilegeLevel: \"configuration\",\n\t}\n\n\tif len(o) > 0 && o[0] != nil {\n\t\tfor _, option := range o {\n\t\t\toption(finalOpts)\n\t\t}\n\t}\n\n\treturn finalOpts\n}",
"func TestExtractOptions_OnlyArgs(t *testing.T) {\n\tonlyArgs := []string{\"arg1\", \"arg2\", \"arg3\", \"arg4\"}\n\toptions, args := extractOptions(onlyArgs...)\n\n\tif len(args) != len(onlyArgs) {\n\t\tt.Errorf(\n\t\t\t\"%d number of passive argumentss expected, but only %d were extracted\",\n\t\t\tlen(onlyArgs),\n\t\t\tlen(args),\n\t\t)\n\t}\n\n\tif len(options) != 0 {\n\t\tt.Error(\"No options should have been extracted\")\n\t}\n}",
"func (e Opts) Opts() []clientv3.OpOption {\n\tif len(e) == 0 {\n\t\treturn nil\n\t}\n\topts := []clientv3.OpOption{}\n\tfor _, o := range e {\n\t\tif o.WithCountOnly != nil && *o.WithCountOnly {\n\t\t\topts = append(opts, clientv3.WithCountOnly())\n\t\t}\n\t\tif o.WithCreatedNotify != nil && *o.WithCreatedNotify {\n\t\t\topts = append(opts, clientv3.WithCreatedNotify())\n\t\t}\n\t\tif o.WithFilterDelete != nil && *o.WithFilterDelete {\n\t\t\topts = append(opts, clientv3.WithFilterDelete())\n\t\t}\n\t\tif o.WithFilterPut != nil && *o.WithFilterPut {\n\t\t\topts = append(opts, clientv3.WithFilterPut())\n\t\t}\n\t\tif o.WithFirstCreate != nil && *o.WithFirstCreate {\n\t\t\topts = append(opts, clientv3.WithFirstCreate()...)\n\t\t}\n\t\tif o.WithFirstKey != nil && *o.WithFirstKey {\n\t\t\topts = append(opts, clientv3.WithFirstKey()...)\n\t\t}\n\t\tif o.WithFirstRev != nil && *o.WithFirstRev {\n\t\t\topts = append(opts, clientv3.WithFirstRev()...)\n\t\t}\n\t\tif o.WithFragment != nil && *o.WithFragment {\n\t\t\topts = append(opts, clientv3.WithFragment())\n\t\t}\n\t\tif o.WithFromKey != nil && *o.WithFromKey {\n\t\t\topts = append(opts, clientv3.WithFromKey())\n\t\t}\n\t\tif o.WithIgnoreLease != nil && *o.WithIgnoreLease {\n\t\t\topts = append(opts, clientv3.WithIgnoreLease())\n\t\t}\n\t\tif o.WithIgnoreValue != nil && *o.WithIgnoreValue {\n\t\t\topts = append(opts, clientv3.WithIgnoreValue())\n\t\t}\n\t\tif o.WithKeysOnly != nil && *o.WithKeysOnly {\n\t\t\topts = append(opts, clientv3.WithKeysOnly())\n\t\t}\n\t\tif o.WithLastCreate != nil && *o.WithLastCreate {\n\t\t\topts = append(opts, clientv3.WithLastCreate()...)\n\t\t}\n\t\tif o.WithLastKey != nil && *o.WithLastKey {\n\t\t\topts = append(opts, clientv3.WithLastKey()...)\n\t\t}\n\t\tif o.WithLastRev != nil && *o.WithLastRev {\n\t\t\topts = append(opts, clientv3.WithLastRev()...)\n\t\t}\n\t\tif o.WithLease != nil {\n\t\t\topts = append(opts, clientv3.WithLease(clientv3.LeaseID(*o.WithLease)))\n\t\t}\n\t\tif o.WithLimit != nil {\n\t\t\topts = append(opts, clientv3.WithLimit(*o.WithLimit))\n\t\t}\n\t\tif o.WithMaxCreateRev != nil {\n\t\t\topts = append(opts, clientv3.WithMaxCreateRev(*o.WithMaxCreateRev))\n\t\t}\n\t\tif o.WithMaxModRev != nil {\n\t\t\topts = append(opts, clientv3.WithMaxModRev(*o.WithMaxModRev))\n\t\t}\n\t\tif o.WithMinCreateRev != nil {\n\t\t\topts = append(opts, clientv3.WithMinCreateRev(*o.WithMinCreateRev))\n\t\t}\n\t\tif o.WithMinModRev != nil {\n\t\t\topts = append(opts, clientv3.WithMinModRev(*o.WithMinModRev))\n\t\t}\n\t\tif o.WithPrefix != nil && *o.WithPrefix {\n\t\t\topts = append(opts, clientv3.WithPrefix())\n\t\t}\n\t\tif o.WithPrevKV != nil && *o.WithPrevKV {\n\t\t\topts = append(opts, clientv3.WithPrevKV())\n\t\t}\n\t\tif o.WithProgressNotify != nil && *o.WithProgressNotify {\n\t\t\topts = append(opts, clientv3.WithProgressNotify())\n\t\t}\n\t\tif o.WithRange != nil {\n\t\t\topts = append(opts, clientv3.WithRange(*o.WithRange))\n\t\t}\n\t\tif o.WithRev != nil {\n\t\t\topts = append(opts, clientv3.WithRev(*o.WithRev))\n\t\t}\n\t\tif o.WithSerializable != nil && *o.WithSerializable {\n\t\t\topts = append(opts, clientv3.WithSerializable())\n\t\t}\n\t}\n\treturn opts\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
ReadFile reads a PNG file specified by imgPath and returns it as an image.Image.
|
func ReadFile(imgPath string) (img image.Image, err error) {
fr, err := os.Open(imgPath)
if err != nil {
return nil, err
}
defer fr.Close()
img, err = png.Decode(fr)
if err != nil {
return nil, err
}
return img, nil
}
|
[
"func Load(filePath string) (*Image, error) {\n\n\tinReader, err := os.Open(filePath)\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer inReader.Close()\n\n\tinImg, err := png.Decode(inReader)\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tinBounds := inImg.Bounds()\n\n\toutImg := image.NewRGBA64(inBounds)\n\n\treturn &Image{inImg, outImg}, nil\n}",
"func Load(filePath string) (*Image, error) {\n\n\tinReader, err := os.Open(filePath)\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer inReader.Close()\n\n\tinImg, err := png.Decode(inReader)\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tinBounds := inImg.Bounds()\n\n\toutImg := image.NewRGBA64(inBounds)\n\n\ttmpImg := image.NewRGBA64(inBounds)\n\n\treturn &Image{inImg, tmpImg, outImg}, nil\n}",
"func (p *PngData) Read(f *os.File) error {\n\tvalid, header := ValidatePng(f)\n\tif valid {\n\t\tp.header = header\n\t\terr := p.readChunks(f)\n\t\tif err != io.EOF {\n\t\t\treturn err\n\t\t}\n\t} else {\n\t\treturn errors.New(\"invalid png\")\n\t}\n\treturn nil\n}",
"func ReadImage(path string) (ImageHandler, error) {\n\treader, err := os.Open(path)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\timg, _, err := image.Decode(reader)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tswitch img.(type) {\n\tcase *image.NRGBA:\n\t\treturn &NRGBAImageHandler{\n\t\t\tImage: img.(*image.NRGBA),\n\t\t\tImageType: ImageTypeNRGBA,\n\t\t}, nil\n\n\tcase *image.NRGBA64:\n\t\treturn &NRGBA64ImageHandler{\n\t\t\tImage: img.(*image.NRGBA64),\n\t\t\tImageType: ImageTypeNRGBA64,\n\t\t}, nil\n\n\tcase *image.RGBA:\n\t\treturn &RGBAImageHandler{\n\t\t\tImage: img.(*image.RGBA),\n\t\t\tImageType: ImageTypeRGBA,\n\t\t}, nil\n\n\tcase *image.RGBA64:\n\t\treturn &RGBA64ImageHandler{\n\t\t\tImage: img.(*image.RGBA64),\n\t\t\tImageType: ImageTypeRGBA64,\n\t\t}, nil\n\n\tcase *image.Gray:\n\t\treturn &GrayImageHandler{\n\t\t\tImage: img.(*image.Gray),\n\t\t\tImageType: ImageTypeGray,\n\t\t}, nil\n\n\tcase *image.Gray16:\n\t\treturn &Gray16ImageHandler{\n\t\t\tImage: img.(*image.Gray16),\n\t\t\tImageType: ImageTypeGray16,\n\t\t}, nil\n\n\tcase *image.Paletted:\n\t\treturn &PalettedImageHandler{\n\t\t\tImage: img.(*image.Paletted),\n\t\t\tImageType: ImageTypePaletted,\n\t\t}, nil\n\n\tdefault:\n\t\treturn nil, ErrUnsupportedImageFormat\n\t}\n}",
"func ReadPNGChunck() {\n\tfile, err := os.Open(\"Lenna2.png\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tchunks := readChunks(file)\n\tfor _, chunk := range chunks {\n\t\tdumpChunk(chunk)\n\t}\n}",
"func Load(filename string) (image.Image, string, error) {\n\tf, err := os.Open(filename)\n\tif err != nil {\n\t\treturn nil, \"\", errors.Wrap(err, \"fail to open file\")\n\t}\n\tdefer f.Close()\n\tsrc, format, err := image.Decode(f)\n\tif err != nil {\n\t\treturn src, format, errors.Wrap(err, \"fail to decode file as image\")\n\t}\n\treturn src, format, nil\n}",
"func loadImage(filePath string) (image.Image, error) {\n\tfImage, err := os.Open(filePath)\n\tcheckError(err)\n\n\tdefer fImage.Close()\n\n\timg, _, err := image.Decode(fImage)\n\tcheckError(err)\n\n\treturn img, nil\n}",
"func readImage(file_name string, i int) image.Image {\n\n\t// Input the image\n\tfmt.Println(\"Starting to read image: \", i)\n\tpicture, err := os.Open(file_name)\n\tif err != nil {\n\t\tfmt.Println(\"Sadly, an error has occured with this image: \", err)\n\t}\n\n\t// Close the connection when we're done\n\tdefer picture.Close()\n\n\t// Decode the image\n\ttheImage, _, err := image.Decode(picture)\n\tif err != nil {\n\t\tfmt.Println(\"Sadly, an error has occured with this image: \", err)\n\t}\n\n\treturn theImage\n}",
"func LoadPng(fileName string) (*BinaryMsg, error) {\n\tfile, err := os.Open(fileName)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer file.Close()\n\n\tm, err := png.Decode(file)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tbuf := new(bytes.Buffer)\n\tif err := png.Encode(buf, m); err != nil {\n\t\treturn nil, err\n\t}\n\n\tbinMsg := &BinaryMsg{\n\t\tId: fileName,\n\t\tType: \"png\",\n\t\tWidth: m.Bounds().Max.X,\n\t\tHeight: m.Bounds().Max.Y,\n\t\tData: buf.Bytes(),\n\t}\n\treturn binMsg, nil\n}",
"func GetImageFromFilePath(filePath string) image.Image {\n\tf, err := os.Open(filePath)\n\tif err != nil {\n\t\tErrorHandler(err)\n\t}\n\timage, _, err := image.Decode(f)\n\tif err != nil {\n\t\tErrorHandler(err)\n\t}\n\treturn image\n}",
"func LoadPicture(path string)(pixel.Picture, error) {\n\tfile,err:=os.Open(path)\n\tif err!=nil{\n\t\treturn nil,err\n\t}\n\tdefer file.Close()\n\timg,_,err:=image.Decode(file)\n\tif err!=nil{\n\t\treturn nil,err\n\t}\n\treturn pixel.PictureDataFromImage(img),nil\n}",
"func ImageRead(buf []byte, v *Image) int {\n\tb := 0\n\n\tv.Id = xgb.Get32(buf[b:])\n\tb += 4\n\n\tv.Width = xgb.Get16(buf[b:])\n\tb += 2\n\n\tv.Height = xgb.Get16(buf[b:])\n\tb += 2\n\n\tv.DataSize = xgb.Get32(buf[b:])\n\tb += 4\n\n\tv.NumPlanes = xgb.Get32(buf[b:])\n\tb += 4\n\n\tv.Pitches = make([]uint32, v.NumPlanes)\n\tfor i := 0; i < int(v.NumPlanes); i++ {\n\t\tv.Pitches[i] = xgb.Get32(buf[b:])\n\t\tb += 4\n\t}\n\n\tb = (b + 3) & ^3 // alignment gap\n\n\tv.Offsets = make([]uint32, v.NumPlanes)\n\tfor i := 0; i < int(v.NumPlanes); i++ {\n\t\tv.Offsets[i] = xgb.Get32(buf[b:])\n\t\tb += 4\n\t}\n\n\tv.Data = make([]byte, v.DataSize)\n\tcopy(v.Data[:v.DataSize], buf[b:])\n\tb += int(v.DataSize)\n\n\treturn b\n}",
"func Read(r io.Reader) (Icon, error) {\n\tvar header [6]byte\n\n\tp := header[:]\n\tif _, err := io.ReadFull(r, p); err != nil {\n\t\treturn nil, err\n\t}\n\n\tle := binary.LittleEndian\n\tzero, format, nimages := le.Uint16(p[0:2]), le.Uint16(p[2:4]), int(le.Uint16(p[4:6]))\n\tif zero != 0 || format != 1 {\n\t\treturn nil, ErrFormat\n\t}\n\n\tif nimages == 0 {\n\t\treturn nil, ErrEmpty\n\t}\n\n\tico, err := ioutil.ReadAll(&io.LimitedReader{\n\t\tR: r,\n\t\tN: 1 << 20, // 1M\n\t})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif len(ico) < nimages*ideSize {\n\t\treturn nil, io.ErrUnexpectedEOF\n\t}\n\n\tvar icon Icon\n\tfor i := 0; i < nimages; i++ {\n\t\tp := ico[i*ideSize:]\n\t\tsiz, ofs := int(le.Uint32(p[8:12])), int(le.Uint32(p[12:16]))\n\n\t\tofs -= headerSize\n\n\t\tif ofs < 0 || len(ico) < ofs+siz {\n\t\t\t// pixel data outside file\n\t\t\treturn nil, ErrFormat\n\t\t}\n\n\t\tim, err := decodeImage(ico[ofs : ofs+siz])\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\ticon.Add(im)\n\t}\n\n\treturn icon, nil\n}",
"func ReadImage(fpath string) (meta FileMeta, err error) {\n\tf, err := os.Open(fpath)\n\tif err != nil {\n\t\treturn\n\t}\n\tdefer f.Close()\n\n\tdefer func() {\n\t\t// alt dimensions\n\t\tif meta.Width == 0 || meta.Height == 0 {\n\t\t\timgConfig, _, _err := image.DecodeConfig(f)\n\t\t\tif _err == nil {\n\t\t\t\tmeta.Width = imgConfig.Width\n\t\t\t\tmeta.Height = imgConfig.Height\n\t\t\t}\n\t\t}\n\t\t// TODO: PNGs don't get dimensions\n\t}()\n\n\tx, _err := exif.Decode(f)\n\tif _err != nil {\n\t\terr = ErrSkipFile\n\t\treturn\n\t}\n\n\tvar width, height int\n\t_width, _err := x.Get(exif.PixelXDimension)\n\tif _err == nil {\n\t\t_height, _err := x.Get(exif.PixelYDimension)\n\t\tif _err == nil {\n\t\t\twidth, _ = _width.Int(0)\n\t\t\theight, _ = _height.Int(0)\n\t\t}\n\t}\n\n\tmeta.Width = width\n\tmeta.Height = height\n\n\ttm, _err := x.DateTime()\n\tif _err != nil || tm.IsZero() {\n\t\terr = ErrSkipFile\n\t\treturn\n\t}\n\n\tmeta.Time = tm\n\treturn\n}",
"func Reader(img *image.NRGBA, fmt Format) (io.Reader, error) {\n\tbuf := bytes.Buffer{}\n\n\tif err := Encode(&buf, img, fmt); err != nil {\n\t\treturn nil, err\n\t}\n\treturn bytes.NewReader(buf.Bytes()), nil\n}",
"func (l *loader) png(name string) (i image.Image, err error) {\n\tvar file io.ReadCloser\n\tif file, err = l.getResource(l.dir[img], name+\".png\"); err == nil {\n\t\tdefer file.Close()\n\t\tif i, err = png.Decode(file); err == nil {\n\t\t\treturn\n\t\t}\n\t}\n\treturn\n}",
"func LoadImageFromFile(filename string) *Monkey {\n\tsliceOfBytes, err := ioutil.ReadFile(filename)\n\tutil.CheckError(err)\n\tdata := string(sliceOfBytes)\n\tmonkey := &Monkey{}\n\tmonkey.SetRawData(data)\n\treturn monkey\n}",
"func loadImage(file string) (uint32, error) {\n\timgFile, err := os.Open(file)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\timg, _, err := image.Decode(imgFile)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\n\trgba := image.NewRGBA(img.Bounds())\n\tif rgba.Stride != rgba.Rect.Size().X*4 {\n\t\treturn 0, errors.New(\"incorrect stride\")\n\t}\n\tdraw.Draw(rgba, rgba.Bounds(), img, image.Point{0, 0}, draw.Src)\n\n\treturn loadTexture(rgba), nil\n}",
"func TestPngFile(t *testing.T) {\n\ttestFile(t, \"./testdata/sample.png\", \"image/png\")\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
WriteFile writes the image data to a PNG file specified by imgPath. WriteFile creates the named file using mode 0666 (before umask), truncating it if it already exists.
|
func WriteFile(imgPath string, img image.Image) (err error) {
fw, err := os.Create(imgPath)
if err != nil {
return err
}
defer fw.Close()
err = png.Encode(fw, img)
if err != nil {
return err
}
return nil
}
|
[
"func writeImage(img *image.Paletted, path string) {\n\tout, err := os.Create(path)\n\tif err != nil {\n\t\tdie(\"Failed to open image for write %s: %v\", path, err)\n\t}\n\tdefer func() {\n\t\terr = out.Close()\n\t\tif err != nil {\n\t\t\tdie(\"Failed to close image for write %s: %v\", path, err)\n\t\t}\n\t}()\n\n\terr = png.Encode(out, img)\n\tif err != nil {\n\t\tdie(\"Failed to encode image %s: %v\", path, err)\n\t}\n\n\tdebugf(\"Written image %s\", path)\n}",
"func WriteImageFile(img image.Image, outputPath string, config options.Options) error {\n\n\tofd, err := os.OpenFile(outputPath, os.O_WRONLY|os.O_TRUNC|os.O_CREATE, 0755)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer ofd.Close()\n\n\treturn WriteImage(img, ofd, config)\n}",
"func WritePngImageFile(img image.Image, path string) error {\n\timgFp, err := os.Create(path)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer imgFp.Close()\n\n\terr = png.Encode(imgFp, img)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}",
"func (o *DefaultOS) IOUtilWriteFile(filename string, data []byte, perm os.FileMode) error {\r\n\treturn ioutil.WriteFile(filename, data, perm)\r\n}",
"func saveImgFile(name string, m *image.RGBA) error {\n\tos.MkdirAll(path.Dir(name), os.ModePerm)\n\tfw, err := os.Create(name)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"fail to create image file: %v\", err)\n\t}\n\tdefer fw.Close()\n\n\tif err = png.Encode(fw, m); err != nil {\n\t\treturn fmt.Errorf(\"fail to encode image file: %v\", err)\n\t}\n\truntime.GC()\n\treturn nil\n}",
"func (bit *Bitmap) WritePNG(path string) bool {\n\treturn bool(C.ulBitmapWritePNG(bit.b, C.CString(path)))\n}",
"func WritePNG(img image.Image, filename string) error {\n\twriter, err := os.Create(filename)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tdefer writer.Close()\n\n\treturn png.Encode(writer, img)\n}",
"func WritePNG(file string, i image.Image) error {\n\tf, err := os.Create(file)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer f.Close()\n\terr = png.Encode(f, i)\n\tif err == nil {\n\t\tfmt.Printf(\"\\n-> %v\\n\", file)\n\t}\n\treturn err\n}",
"func WriteImage(img image.Image, filename string) {\n\tout, err := os.Create(filename)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tif err = png.Encode(out, img); err != nil {\n\t\tlog.Fatal(err)\n\t}\n}",
"func WriteImage(w io.Writer, args string, data []byte) error {\n\tsize := len(data)\n\tenc := base64.StdEncoding\n\tencoded := make([]byte, enc.EncodedLen(size))\n\tenc.Encode(encoded, data)\n\n\tfmt.Fprintf(w, \"\\033]1337;File=size=%d\", size)\n\tif len(args) > 0 {\n\t\tfmt.Fprintf(w, \";%s:\", args)\n\t} else {\n\t\tfmt.Fprint(w, \":\")\n\t}\n\t_, err := w.Write(encoded)\n\tif err != nil {\n\t\treturn err\n\t}\n\t_, err = io.WriteString(w, \"\\x07\")\n\treturn err\n}",
"func (o *ReadOnlyOS) IOUtilWriteFile(filename string, data []byte, perm os.FileMode) error {\r\n\treturn ErrReadOnly\r\n}",
"func WriteFile(filepath string, b []byte) error {\n\treturn ioutil.WriteFile(filepath, b, 0660)\n}",
"func (cv Canvas) Write(filename string) (bool) {\n cv.Update()\n status := C.MagickWriteImage(cv.wand, C.CString(filename))\n if status == C.MagickFalse {\n return false\n }\n return true\n}",
"func (e *Editor) WriteImage(imgFile string, widthInRW, heightInLC int) (err error) {\n\tif widthInRW <= 0 {\n\t\treturn fmt.Errorf(\"widthInRW must be greater than zero, but %d\", widthInRW)\n\t}\n\n\te.frame.mu.Lock()\n\tdefer e.frame.mu.Unlock()\n\n\timgText := fmt.Sprintf(\"<img src=%q width=%d height=%d >\", path.Base(imgFile), widthInRW, heightInLC)\n\terr = e.appendText(imgText, &imageBox{\n\t\tsrc: imgFile,\n\t\tdstWidthInRW: widthInRW,\n\t\tdstHeightInLC: heightInLC,\n\t})\n\treturn\n}",
"func writeImage(w http.ResponseWriter, img *image.Image) {\n\n\tbuffer := new(bytes.Buffer)\n\tif err := jpeg.Encode(buffer, *img, nil); err != nil {\n\t\tlog.Println(\"unable to encode image.\")\n\t}\n\n\tw.Header().Set(\"Content-Type\", \"image/png\")\n\tw.Header().Set(\"Content-Length\", strconv.Itoa(len(buffer.Bytes())))\n\tif _, err := w.Write(buffer.Bytes()); err != nil {\n\t\tlog.Println(\"unable to write image.\")\n\t}\n}",
"func SavePng(outdir, fnameKey string, img image.Image) {\n\n\t// create file\n\tfurl := path.Join(outdir, fnameKey+\".png\")\n\tfile, err := os.Create(furl)\n\tif err != nil {\n\t\tchk.Panic(\"cannot create file at\")\n\t}\n\tdefer file.Close()\n\n\t// encode png\n\terr = png.Encode(file, img)\n\tif err != nil {\n\t\tchk.Panic(\"cannot encode image\")\n\t}\n\tio.Pf(\"file <%s> written\\n\", furl)\n}",
"func (handler *PalettedImageHandler) SaveImage(filePath string) error {\n\tnewfile, err := os.Create(filePath)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer newfile.Close()\n\tpng.Encode(newfile, handler.Image)\n\treturn nil\n}",
"func WriteToFile(g *gif.GIF, filename string) error {\n\tfile, fileErr := os.Create(filename)\n\tif fileErr != nil {\n\t\treturn fileErr\n\t}\n\n\tencodeErr := gif.EncodeAll(file, g)\n\tif encodeErr != nil {\n\t\treturn encodeErr\n\t}\n\treturn nil\n}",
"func WriteIo(fileName string, fio io.Reader) error {\n\tdata, err := io.ReadAll(fio)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn os.WriteFile(fileName, data, 0655)\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
NewListBotAliasesPaginator returns a new ListBotAliasesPaginator
|
func NewListBotAliasesPaginator(client ListBotAliasesAPIClient, params *ListBotAliasesInput, optFns ...func(*ListBotAliasesPaginatorOptions)) *ListBotAliasesPaginator {
if params == nil {
params = &ListBotAliasesInput{}
}
options := ListBotAliasesPaginatorOptions{}
if params.MaxResults != nil {
options.Limit = *params.MaxResults
}
for _, fn := range optFns {
fn(&options)
}
return &ListBotAliasesPaginator{
options: options,
client: client,
params: params,
firstPage: true,
}
}
|
[
"func (resourceController *ResourceControllerV2) NewResourceAliasesPager(options *ListResourceAliasesOptions) (pager *ResourceAliasesPager, err error) {\n\tif options.Start != nil && *options.Start != \"\" {\n\t\terr = fmt.Errorf(\"the 'options.Start' field should not be set\")\n\t\treturn\n\t}\n\n\tvar optionsCopy ListResourceAliasesOptions = *options\n\tpager = &ResourceAliasesPager{\n\t\thasNext: true,\n\t\toptions: &optionsCopy,\n\t\tclient: resourceController,\n\t}\n\treturn\n}",
"func (p *ListBotAliasesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListBotAliasesOutput, error) {\n\tif !p.HasMorePages() {\n\t\treturn nil, fmt.Errorf(\"no more pages available\")\n\t}\n\n\tparams := *p.params\n\tparams.NextToken = p.nextToken\n\n\tvar limit *int32\n\tif p.options.Limit > 0 {\n\t\tlimit = &p.options.Limit\n\t}\n\tparams.MaxResults = limit\n\n\tresult, err := p.client.ListBotAliases(ctx, ¶ms, optFns...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tp.firstPage = false\n\n\tprevToken := p.nextToken\n\tp.nextToken = result.NextToken\n\n\tif p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken {\n\t\tp.nextToken = nil\n\t}\n\n\treturn result, nil\n}",
"func (resourceController *ResourceControllerV2) NewResourceBindingsForAliasPager(options *ListResourceBindingsForAliasOptions) (pager *ResourceBindingsForAliasPager, err error) {\n\tif options.Start != nil && *options.Start != \"\" {\n\t\terr = fmt.Errorf(\"the 'options.Start' field should not be set\")\n\t\treturn\n\t}\n\n\tvar optionsCopy ListResourceBindingsForAliasOptions = *options\n\tpager = &ResourceBindingsForAliasPager{\n\t\thasNext: true,\n\t\toptions: &optionsCopy,\n\t\tclient: resourceController,\n\t}\n\treturn\n}",
"func ExampleLambda_ListAliases_shared00() {\n\tsvc := lambda.New(session.New())\n\tinput := &lambda.ListAliasesInput{\n\t\tFunctionName: aws.String(\"my-function\"),\n\t}\n\n\tresult, err := svc.ListAliases(input)\n\tif err != nil {\n\t\tif aerr, ok := err.(awserr.Error); ok {\n\t\t\tswitch aerr.Code() {\n\t\t\tcase lambda.ErrCodeServiceException:\n\t\t\t\tfmt.Println(lambda.ErrCodeServiceException, aerr.Error())\n\t\t\tcase lambda.ErrCodeResourceNotFoundException:\n\t\t\t\tfmt.Println(lambda.ErrCodeResourceNotFoundException, aerr.Error())\n\t\t\tcase lambda.ErrCodeInvalidParameterValueException:\n\t\t\t\tfmt.Println(lambda.ErrCodeInvalidParameterValueException, aerr.Error())\n\t\t\tcase lambda.ErrCodeTooManyRequestsException:\n\t\t\t\tfmt.Println(lambda.ErrCodeTooManyRequestsException, aerr.Error())\n\t\t\tdefault:\n\t\t\t\tfmt.Println(aerr.Error())\n\t\t\t}\n\t\t} else {\n\t\t\t// Print the error, cast err to awserr.Error to get the Code and\n\t\t\t// Message from an error.\n\t\t\tfmt.Println(err.Error())\n\t\t}\n\t\treturn\n\t}\n\n\tfmt.Println(result)\n}",
"func (resourceController *ResourceControllerV2) NewResourceAliasesForInstancePager(options *ListResourceAliasesForInstanceOptions) (pager *ResourceAliasesForInstancePager, err error) {\n\tif options.Start != nil && *options.Start != \"\" {\n\t\terr = fmt.Errorf(\"the 'options.Start' field should not be set\")\n\t\treturn\n\t}\n\n\tvar optionsCopy ListResourceAliasesForInstanceOptions = *options\n\tpager = &ResourceAliasesForInstancePager{\n\t\thasNext: true,\n\t\toptions: &optionsCopy,\n\t\tclient: resourceController,\n\t}\n\treturn\n}",
"func (nd *Node) GetAliases() []*Host {\n\treturn nd.aliases.Load().([]*Host)\n}",
"func (o *Host) GetAliases() []string {\n\tif o == nil || o.Aliases == nil {\n\t\tvar ret []string\n\t\treturn ret\n\t}\n\treturn o.Aliases\n}",
"func (cl CommandList) GetAllAliases() string {\n\n\tallaliases := \"\"\n\n\tfor _, v := range cl {\n\t\tif !v.Hidden {\n\t\t\tallaliases += v.aliases()\n\t\t}\n\t}\n\treturn allaliases\n}",
"func (a *ResourceAliasesApiService) ListResourceAliases(ctx _context.Context, authorization string, localVarOptionals *ListResourceAliasesOpts) (ResourceAliasesList, *_nethttp.Response, error) {\n\tvar (\n\t\tlocalVarHTTPMethod = _nethttp.MethodGet\n\t\tlocalVarPostBody interface{}\n\t\tlocalVarFormFileName string\n\t\tlocalVarFileName string\n\t\tlocalVarFileBytes []byte\n\t\tlocalVarReturnValue ResourceAliasesList\n\t)\n\n\t// create path and map variables\n\tlocalVarPath := a.client.cfg.BasePath + \"/resource_aliases\"\n\tlocalVarHeaderParams := make(map[string]string)\n\tlocalVarQueryParams := _neturl.Values{}\n\tlocalVarFormParams := _neturl.Values{}\n\n\tif localVarOptionals != nil && localVarOptionals.Guid.IsSet() {\n\t\tlocalVarQueryParams.Add(\"guid\", parameterToString(localVarOptionals.Guid.Value(), \"\"))\n\t}\n\tif localVarOptionals != nil && localVarOptionals.Name.IsSet() {\n\t\tlocalVarQueryParams.Add(\"name\", parameterToString(localVarOptionals.Name.Value(), \"\"))\n\t}\n\tif localVarOptionals != nil && localVarOptionals.ResourceInstanceId.IsSet() {\n\t\tlocalVarQueryParams.Add(\"resource_instance_id\", parameterToString(localVarOptionals.ResourceInstanceId.Value(), \"\"))\n\t}\n\tif localVarOptionals != nil && localVarOptionals.RegionInstanceId.IsSet() {\n\t\tlocalVarQueryParams.Add(\"region_instance_id\", parameterToString(localVarOptionals.RegionInstanceId.Value(), \"\"))\n\t}\n\tif localVarOptionals != nil && localVarOptionals.ResourceId.IsSet() {\n\t\tlocalVarQueryParams.Add(\"resource_id\", parameterToString(localVarOptionals.ResourceId.Value(), \"\"))\n\t}\n\tif localVarOptionals != nil && localVarOptionals.ResourceGroupId.IsSet() {\n\t\tlocalVarQueryParams.Add(\"resource_group_id\", parameterToString(localVarOptionals.ResourceGroupId.Value(), \"\"))\n\t}\n\tif localVarOptionals != nil && localVarOptionals.Limit.IsSet() {\n\t\tlocalVarQueryParams.Add(\"limit\", parameterToString(localVarOptionals.Limit.Value(), \"\"))\n\t}\n\t// to determine the Content-Type header\n\tlocalVarHTTPContentTypes := []string{}\n\n\t// set Content-Type header\n\tlocalVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes)\n\tif localVarHTTPContentType != \"\" {\n\t\tlocalVarHeaderParams[\"Content-Type\"] = localVarHTTPContentType\n\t}\n\n\t// to determine the Accept header\n\tlocalVarHTTPHeaderAccepts := []string{\"application/json\"}\n\n\t// set Accept header\n\tlocalVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts)\n\tif localVarHTTPHeaderAccept != \"\" {\n\t\tlocalVarHeaderParams[\"Accept\"] = localVarHTTPHeaderAccept\n\t}\n\tlocalVarHeaderParams[\"Authorization\"] = parameterToString(authorization, \"\")\n\tif ctx != nil {\n\t\t// API Key Authentication\n\t\tif auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {\n\t\t\tvar key string\n\t\t\tif auth.Prefix != \"\" {\n\t\t\t\tkey = auth.Prefix + \" \" + auth.Key\n\t\t\t} else {\n\t\t\t\tkey = auth.Key\n\t\t\t}\n\t\t\tlocalVarHeaderParams[\"Authorization\"] = key\n\t\t}\n\t}\n\tr, err := a.client.prepareRequest(ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFormFileName, localVarFileName, localVarFileBytes)\n\tif err != nil {\n\t\treturn localVarReturnValue, nil, err\n\t}\n\n\tlocalVarHTTPResponse, err := a.client.callAPI(r)\n\tif err != nil || localVarHTTPResponse == nil {\n\t\treturn localVarReturnValue, localVarHTTPResponse, err\n\t}\n\n\tlocalVarBody, err := _ioutil.ReadAll(localVarHTTPResponse.Body)\n\tlocalVarHTTPResponse.Body.Close()\n\tif err != nil {\n\t\treturn localVarReturnValue, localVarHTTPResponse, err\n\t}\n\n\tif localVarHTTPResponse.StatusCode >= 300 {\n\t\tnewErr := GenericOpenAPIError{\n\t\t\tbody: localVarBody,\n\t\t\terror: localVarHTTPResponse.Status,\n\t\t}\n\t\tif localVarHTTPResponse.StatusCode == 200 {\n\t\t\tvar v ResourceAliasesList\n\t\t\terr = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get(\"Content-Type\"))\n\t\t\tif err != nil {\n\t\t\t\tnewErr.error = err.Error()\n\t\t\t\treturn localVarReturnValue, localVarHTTPResponse, newErr\n\t\t\t}\n\t\t\tnewErr.model = v\n\t\t\treturn localVarReturnValue, localVarHTTPResponse, newErr\n\t\t}\n\t\tif localVarHTTPResponse.StatusCode == 401 {\n\t\t\tvar v ErrorReport\n\t\t\terr = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get(\"Content-Type\"))\n\t\t\tif err != nil {\n\t\t\t\tnewErr.error = err.Error()\n\t\t\t\treturn localVarReturnValue, localVarHTTPResponse, newErr\n\t\t\t}\n\t\t\tnewErr.model = v\n\t\t\treturn localVarReturnValue, localVarHTTPResponse, newErr\n\t\t}\n\t\tif localVarHTTPResponse.StatusCode == 403 {\n\t\t\tvar v ErrorReport\n\t\t\terr = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get(\"Content-Type\"))\n\t\t\tif err != nil {\n\t\t\t\tnewErr.error = err.Error()\n\t\t\t\treturn localVarReturnValue, localVarHTTPResponse, newErr\n\t\t\t}\n\t\t\tnewErr.model = v\n\t\t\treturn localVarReturnValue, localVarHTTPResponse, newErr\n\t\t}\n\t\tif localVarHTTPResponse.StatusCode == 404 {\n\t\t\tvar v ErrorReport\n\t\t\terr = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get(\"Content-Type\"))\n\t\t\tif err != nil {\n\t\t\t\tnewErr.error = err.Error()\n\t\t\t\treturn localVarReturnValue, localVarHTTPResponse, newErr\n\t\t\t}\n\t\t\tnewErr.model = v\n\t\t\treturn localVarReturnValue, localVarHTTPResponse, newErr\n\t\t}\n\t\tif localVarHTTPResponse.StatusCode == 429 {\n\t\t\tvar v ErrorReport\n\t\t\terr = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get(\"Content-Type\"))\n\t\t\tif err != nil {\n\t\t\t\tnewErr.error = err.Error()\n\t\t\t\treturn localVarReturnValue, localVarHTTPResponse, newErr\n\t\t\t}\n\t\t\tnewErr.model = v\n\t\t\treturn localVarReturnValue, localVarHTTPResponse, newErr\n\t\t}\n\t\treturn localVarReturnValue, localVarHTTPResponse, newErr\n\t}\n\n\terr = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get(\"Content-Type\"))\n\tif err != nil {\n\t\tnewErr := GenericOpenAPIError{\n\t\t\tbody: localVarBody,\n\t\t\terror: err.Error(),\n\t\t}\n\t\treturn localVarReturnValue, localVarHTTPResponse, newErr\n\t}\n\n\treturn localVarReturnValue, localVarHTTPResponse, nil\n}",
"func OptionAliases(aliases map[Identifier]Identifier) Option {\n\treturn Option{optionAliases: aliases}\n}",
"func DisplayAliases(upd tgbotapi.Update, bot *tgbotapi.BotAPI) {\n\tvar userIdStr string\n\tvar curPage int64\n\tif upd.Message == nil {\n\t\tsplitString := strings.Split(upd.CallbackQuery.Data, \" \")\n\t\tuserIdStr = splitString[1]\n\t\tcurPage, _ = strconv.ParseInt(splitString[2], 10, 32)\n\t\tconfig := tgbotapi.NewCallback(upd.CallbackQuery.ID, \"\") //We don't need this so get it outta da way.\n\t\tbot.AnswerCallbackQuery(config)\n\t} else {\n\t\treturn\n\t}\n\tuserIdStr = strings.Trim(userIdStr, \" \")\n\tuserId, err := strconv.ParseInt(userIdStr, 10, 64)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tchatUser := models.ChatUserFromID(userId)\n\tinfoMessage := GetUserInfoResponse(chatUser)\n\toutmsg := infoMessage.Text\n\taliases := models.GetAliases(chatUser)\n\tif len(aliases) > 0 {\n\t\toutmsg += \"\\nKnown aliases:\"\n\t\tif len(aliases) <= 10 {\n\t\t\tfor _, alias := range aliases {\n\t\t\t\toutmsg += \"\\n\" + alias.Name\n\t\t\t}\n\t\t} else {\n\t\t\tpage := aliases[curPage*5:]\n\t\t\tfor _, alias := range page[:5] {\n\t\t\t\toutmsg += \"\\n\" + alias.Name\n\t\t\t}\n\t\t}\n\t} else {\n\t\toutmsg += \"\\n No Aliases found\"\n\t}\n\teditMsg := tgbotapi.NewEditMessageText(upd.CallbackQuery.Message.Chat.ID, upd.CallbackQuery.Message.MessageID, outmsg)\n\tinlineKeyboard := MakeUserInfoInlineKeyboardRefreshAliasButton(chatUser.ID, curPage, int64(len(aliases)/5))\n\teditMsg.ReplyMarkup = &inlineKeyboard\n\tbot.Send(editMsg)\n}",
"func Aliases(list ...string) {\n\tCommandLine.Aliases(list...)\n}",
"func (c *Commands) addAliases(command *Command, aliases []alias.Alias) {\n\tnames := make([]string, 0, len(aliases))\n\tfor i := range aliases {\n\t\tif c.aliasIsValidCommandChild(command, aliases[i]) && command.matchAlias(aliases[i]) {\n\t\t\tnames = append(names, aliases[i].Name)\n\t\t}\n\t}\n\tcommand.Aliases = append(command.Aliases, names...)\n}",
"func (c *Client) GetAliases(alias string) ([]Alias, error) {\n\tvar aliases []Alias\n\n\tpath := fmt.Sprintf(\"_cat/aliases/%s?h=alias,index,filter,routing.index,routing.search\", alias)\n\terr := handleErrWithStruct(c.buildGetRequest(path), &aliases)\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn aliases, nil\n}",
"func (s *AppEngineService) ListDeviceAliases(realm string, deviceID string, token string) (map[string]string, error) {\n\tdeviceDetails, err := s.GetDevice(realm, deviceID, AstarteDeviceID, token)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn deviceDetails.Aliases, nil\n}",
"func New(dbURI string) (*Manager, error) {\n\tlog.Info(\"creating database connection to \" + dbURI)\n\tdb, err := meta.NewStorage(dbURI, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tlog.Info(\"successfully created database connection\")\n\tmgr := &Manager{db, make(map[string]*storage.Storage), mux.NewRouter()}\n\tmgr.mux.Path(\"/alias/{scope}\").HandlerFunc(mgr.handleGetFullAliasList)\n\tmgr.mux.Path(\"/alias/{scope}/{key}\").Methods(\"GET\").HandlerFunc(mgr.handleGetAlias)\n\tmgr.mux.Path(\"/alias/{scope}/{key}\").Methods(\"POST\").HandlerFunc(mgr.handleCreateAlias)\n\tmgr.mux.Path(\"/alias/{scope}/{key}\").Methods(\"PUT\").HandlerFunc(mgr.handlePutAlias)\n\tmgr.mux.Path(\"/alias/{scope}/{key}\").Methods(\"DELETE\").HandlerFunc(mgr.handleDeleteAlias)\n\tlog.Info(\"successfully initialized alias manager\")\n\treturn mgr, nil\n}",
"func (s *StorageInterface) GetAllAliases(secret string) []AliasInfo {\n\tshowHidden := secret == s.secret\n\tstmt, err := s.db.Prepare(\"select orig, alias, rec_id from aliases\")\n\tif err != nil {\n\t\tLog.Fatal(err)\n\t}\n\tdefer stmt.Close()\n\n\trows, err := stmt.Query()\n\tif err != nil {\n\t\tLog.Fatal(err)\n\t}\n\tdefer rows.Close()\n\tvar ret []AliasInfo\n\tfor rows.Next() {\n\t\tvar orig string\n\t\tvar alias string\n\t\tvar recID int\n\t\trows.Scan(&orig, &alias, &recID)\n\t\tif strings.HasPrefix(alias, \"_\") && !showHidden {\n\t\t\tcontinue\n\t\t}\n\t\tstrID := strconv.Itoa(recID)\n\t\tret = append(ret, AliasInfo{Alias: alias, Orig: orig, id: strID})\n\t}\n\treturn ret\n\n}",
"func (o *AliasesProperty) AddAliases(values interface{}) error {\n\treturn AddValuesToList(&o.Aliases, values)\n}",
"func NewAdminMatcher(admins config.UserList, slackClient client.SlackClient, matcher Matcher) Matcher {\n\treturn adminMatcher{matcher, admins, slackClient}\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
NextPage retrieves the next ListBotAliases page.
|
func (p *ListBotAliasesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListBotAliasesOutput, error) {
if !p.HasMorePages() {
return nil, fmt.Errorf("no more pages available")
}
params := *p.params
params.NextToken = p.nextToken
var limit *int32
if p.options.Limit > 0 {
limit = &p.options.Limit
}
params.MaxResults = limit
result, err := p.client.ListBotAliases(ctx, ¶ms, optFns...)
if err != nil {
return nil, err
}
p.firstPage = false
prevToken := p.nextToken
p.nextToken = result.NextToken
if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken {
p.nextToken = nil
}
return result, nil
}
|
[
"func (p *GetBotsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetBotsOutput, error) {\n\tif !p.HasMorePages() {\n\t\treturn nil, fmt.Errorf(\"no more pages available\")\n\t}\n\n\tparams := *p.params\n\tparams.NextToken = p.nextToken\n\n\tvar limit *int32\n\tif p.options.Limit > 0 {\n\t\tlimit = &p.options.Limit\n\t}\n\tparams.MaxResults = limit\n\n\tresult, err := p.client.GetBots(ctx, ¶ms, optFns...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tp.firstPage = false\n\n\tprevToken := p.nextToken\n\tp.nextToken = result.NextToken\n\n\tif p.options.StopOnDuplicateToken &&\n\t\tprevToken != nil &&\n\t\tp.nextToken != nil &&\n\t\t*prevToken == *p.nextToken {\n\t\tp.nextToken = nil\n\t}\n\n\treturn result, nil\n}",
"func (p *ListEngagementsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListEngagementsOutput, error) {\n\tif !p.HasMorePages() {\n\t\treturn nil, fmt.Errorf(\"no more pages available\")\n\t}\n\n\tparams := *p.params\n\tparams.NextToken = p.nextToken\n\n\tvar limit *int32\n\tif p.options.Limit > 0 {\n\t\tlimit = &p.options.Limit\n\t}\n\tparams.MaxResults = limit\n\n\tresult, err := p.client.ListEngagements(ctx, ¶ms, optFns...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tp.firstPage = false\n\n\tprevToken := p.nextToken\n\tp.nextToken = result.NextToken\n\n\tif p.options.StopOnDuplicateToken &&\n\t\tprevToken != nil &&\n\t\tp.nextToken != nil &&\n\t\t*prevToken == *p.nextToken {\n\t\tp.nextToken = nil\n\t}\n\n\treturn result, nil\n}",
"func (p *ListTargetsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTargetsOutput, error) {\n\tif !p.HasMorePages() {\n\t\treturn nil, fmt.Errorf(\"no more pages available\")\n\t}\n\n\tparams := *p.params\n\tparams.NextToken = p.nextToken\n\n\tvar limit *int32\n\tif p.options.Limit > 0 {\n\t\tlimit = &p.options.Limit\n\t}\n\tparams.MaxResults = limit\n\n\tresult, err := p.client.ListTargets(ctx, ¶ms, optFns...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tp.firstPage = false\n\n\tprevToken := p.nextToken\n\tp.nextToken = result.NextToken\n\n\tif p.options.StopOnDuplicateToken &&\n\t\tprevToken != nil &&\n\t\tp.nextToken != nil &&\n\t\t*prevToken == *p.nextToken {\n\t\tp.nextToken = nil\n\t}\n\n\treturn result, nil\n}",
"func (p *ListDiscoverersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDiscoverersOutput, error) {\n\tif !p.HasMorePages() {\n\t\treturn nil, fmt.Errorf(\"no more pages available\")\n\t}\n\n\tparams := *p.params\n\tparams.NextToken = p.nextToken\n\n\tparams.Limit = p.options.Limit\n\n\tresult, err := p.client.ListDiscoverers(ctx, ¶ms, optFns...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tp.firstPage = false\n\n\tprevToken := p.nextToken\n\tp.nextToken = result.NextToken\n\n\tif p.options.StopOnDuplicateToken &&\n\t\tprevToken != nil &&\n\t\tp.nextToken != nil &&\n\t\t*prevToken == *p.nextToken {\n\t\tp.nextToken = nil\n\t}\n\n\treturn result, nil\n}",
"func (m *MockClient) NextLedgersPage(page hProtocol.LedgersPage) (hProtocol.LedgersPage, error) {\n\ta := m.Called(page)\n\treturn a.Get(0).(hProtocol.LedgersPage), a.Error(1)\n}",
"func (p *ListPermissionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPermissionsOutput, error) {\n\tif !p.HasMorePages() {\n\t\treturn nil, fmt.Errorf(\"no more pages available\")\n\t}\n\n\tparams := *p.params\n\tparams.NextToken = p.nextToken\n\n\tvar limit *int32\n\tif p.options.Limit > 0 {\n\t\tlimit = &p.options.Limit\n\t}\n\tparams.MaxResults = limit\n\n\tresult, err := p.client.ListPermissions(ctx, ¶ms, optFns...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tp.firstPage = false\n\n\tprevToken := p.nextToken\n\tp.nextToken = result.NextToken\n\n\tif p.options.StopOnDuplicateToken &&\n\t\tprevToken != nil &&\n\t\tp.nextToken != nil &&\n\t\t*prevToken == *p.nextToken {\n\t\tp.nextToken = nil\n\t}\n\n\treturn result, nil\n}",
"func (p *ListElasticsearchVersionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListElasticsearchVersionsOutput, error) {\n\tif !p.HasMorePages() {\n\t\treturn nil, fmt.Errorf(\"no more pages available\")\n\t}\n\n\tparams := *p.params\n\tparams.NextToken = p.nextToken\n\n\tparams.MaxResults = p.options.Limit\n\n\tresult, err := p.client.ListElasticsearchVersions(ctx, ¶ms, optFns...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tp.firstPage = false\n\n\tprevToken := p.nextToken\n\tp.nextToken = result.NextToken\n\n\tif p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken {\n\t\tp.nextToken = nil\n\t}\n\n\treturn result, nil\n}",
"func (p *ListMemberAccountsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListMemberAccountsOutput, error) {\n\tif !p.HasMorePages() {\n\t\treturn nil, fmt.Errorf(\"no more pages available\")\n\t}\n\n\tparams := *p.params\n\tparams.NextToken = p.nextToken\n\n\tvar limit *int32\n\tif p.options.Limit > 0 {\n\t\tlimit = &p.options.Limit\n\t}\n\tparams.MaxResults = limit\n\n\tresult, err := p.client.ListMemberAccounts(ctx, ¶ms, optFns...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tp.firstPage = false\n\n\tprevToken := p.nextToken\n\tp.nextToken = result.NextToken\n\n\tif p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken {\n\t\tp.nextToken = nil\n\t}\n\n\treturn result, nil\n}",
"func (p *ListCustomRoutingPortMappingsByDestinationPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListCustomRoutingPortMappingsByDestinationOutput, error) {\n\tif !p.HasMorePages() {\n\t\treturn nil, fmt.Errorf(\"no more pages available\")\n\t}\n\n\tparams := *p.params\n\tparams.NextToken = p.nextToken\n\n\tvar limit *int32\n\tif p.options.Limit > 0 {\n\t\tlimit = &p.options.Limit\n\t}\n\tparams.MaxResults = limit\n\n\tresult, err := p.client.ListCustomRoutingPortMappingsByDestination(ctx, ¶ms, optFns...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tp.firstPage = false\n\n\tprevToken := p.nextToken\n\tp.nextToken = result.NextToken\n\n\tif p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken {\n\t\tp.nextToken = nil\n\t}\n\n\treturn result, nil\n}",
"func (p *ListIntentsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListIntentsOutput, error) {\n\tif !p.HasMorePages() {\n\t\treturn nil, fmt.Errorf(\"no more pages available\")\n\t}\n\n\tparams := *p.params\n\tparams.NextToken = p.nextToken\n\n\tvar limit *int32\n\tif p.options.Limit > 0 {\n\t\tlimit = &p.options.Limit\n\t}\n\tparams.MaxResults = limit\n\n\tresult, err := p.client.ListIntents(ctx, ¶ms, optFns...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tp.firstPage = false\n\n\tprevToken := p.nextToken\n\tp.nextToken = result.NextToken\n\n\tif p.options.StopOnDuplicateToken &&\n\t\tprevToken != nil &&\n\t\tp.nextToken != nil &&\n\t\t*prevToken == *p.nextToken {\n\t\tp.nextToken = nil\n\t}\n\n\treturn result, nil\n}",
"func (p *ListControlsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListControlsOutput, error) {\n\tif !p.HasMorePages() {\n\t\treturn nil, fmt.Errorf(\"no more pages available\")\n\t}\n\n\tparams := *p.params\n\tparams.NextToken = p.nextToken\n\n\tvar limit *int32\n\tif p.options.Limit > 0 {\n\t\tlimit = &p.options.Limit\n\t}\n\tparams.MaxResults = limit\n\n\tresult, err := p.client.ListControls(ctx, ¶ms, optFns...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tp.firstPage = false\n\n\tprevToken := p.nextToken\n\tp.nextToken = result.NextToken\n\n\tif p.options.StopOnDuplicateToken &&\n\t\tprevToken != nil &&\n\t\tp.nextToken != nil &&\n\t\t*prevToken == *p.nextToken {\n\t\tp.nextToken = nil\n\t}\n\n\treturn result, nil\n}",
"func (s *Shodan) NextPage() (*Result, error) {\n\tif s.query == \"\" {\n\t\treturn nil, errors.New(\"Error getting next page, no previous query\")\n\t}\n\treturn s.Search(s.query, s.page+1)\n}",
"func (p *GetBuiltinIntentsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetBuiltinIntentsOutput, error) {\n\tif !p.HasMorePages() {\n\t\treturn nil, fmt.Errorf(\"no more pages available\")\n\t}\n\n\tparams := *p.params\n\tparams.NextToken = p.nextToken\n\n\tvar limit *int32\n\tif p.options.Limit > 0 {\n\t\tlimit = &p.options.Limit\n\t}\n\tparams.MaxResults = limit\n\n\tresult, err := p.client.GetBuiltinIntents(ctx, ¶ms, optFns...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tp.firstPage = false\n\n\tprevToken := p.nextToken\n\tp.nextToken = result.NextToken\n\n\tif p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken {\n\t\tp.nextToken = nil\n\t}\n\n\treturn result, nil\n}",
"func (p *ListRelatedResourcesForAuditFindingPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListRelatedResourcesForAuditFindingOutput, error) {\n\tif !p.HasMorePages() {\n\t\treturn nil, fmt.Errorf(\"no more pages available\")\n\t}\n\n\tparams := *p.params\n\tparams.NextToken = p.nextToken\n\n\tvar limit *int32\n\tif p.options.Limit > 0 {\n\t\tlimit = &p.options.Limit\n\t}\n\tparams.MaxResults = limit\n\n\tresult, err := p.client.ListRelatedResourcesForAuditFinding(ctx, ¶ms, optFns...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tp.firstPage = false\n\n\tprevToken := p.nextToken\n\tp.nextToken = result.NextToken\n\n\tif p.options.StopOnDuplicateToken &&\n\t\tprevToken != nil &&\n\t\tp.nextToken != nil &&\n\t\t*prevToken == *p.nextToken {\n\t\tp.nextToken = nil\n\t}\n\n\treturn result, nil\n}",
"func (p *ListAccessPointsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAccessPointsOutput, error) {\n\tif !p.HasMorePages() {\n\t\treturn nil, fmt.Errorf(\"no more pages available\")\n\t}\n\n\tparams := *p.params\n\tparams.NextToken = p.nextToken\n\n\tparams.MaxResults = p.options.Limit\n\n\tresult, err := p.client.ListAccessPoints(ctx, ¶ms, optFns...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tp.firstPage = false\n\n\tprevToken := p.nextToken\n\tp.nextToken = result.NextToken\n\n\tif p.options.StopOnDuplicateToken &&\n\t\tprevToken != nil &&\n\t\tp.nextToken != nil &&\n\t\t*prevToken == *p.nextToken {\n\t\tp.nextToken = nil\n\t}\n\n\treturn result, nil\n}",
"func (p *ListModelExplainabilityJobDefinitionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListModelExplainabilityJobDefinitionsOutput, error) {\n\tif !p.HasMorePages() {\n\t\treturn nil, fmt.Errorf(\"no more pages available\")\n\t}\n\n\tparams := *p.params\n\tparams.NextToken = p.nextToken\n\n\tvar limit *int32\n\tif p.options.Limit > 0 {\n\t\tlimit = &p.options.Limit\n\t}\n\tparams.MaxResults = limit\n\n\tresult, err := p.client.ListModelExplainabilityJobDefinitions(ctx, ¶ms, optFns...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tp.firstPage = false\n\n\tprevToken := p.nextToken\n\tp.nextToken = result.NextToken\n\n\tif p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken {\n\t\tp.nextToken = nil\n\t}\n\n\treturn result, nil\n}",
"func (p *ListTableStorageOptimizersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTableStorageOptimizersOutput, error) {\n\tif !p.HasMorePages() {\n\t\treturn nil, fmt.Errorf(\"no more pages available\")\n\t}\n\n\tparams := *p.params\n\tparams.NextToken = p.nextToken\n\n\tvar limit *int32\n\tif p.options.Limit > 0 {\n\t\tlimit = &p.options.Limit\n\t}\n\tparams.MaxResults = limit\n\n\tresult, err := p.client.ListTableStorageOptimizers(ctx, ¶ms, optFns...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tp.firstPage = false\n\n\tprevToken := p.nextToken\n\tp.nextToken = result.NextToken\n\n\tif p.options.StopOnDuplicateToken &&\n\t\tprevToken != nil &&\n\t\tp.nextToken != nil &&\n\t\t*prevToken == *p.nextToken {\n\t\tp.nextToken = nil\n\t}\n\n\treturn result, nil\n}",
"func (p *ListLocationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListLocationsOutput, error) {\n\tif !p.HasMorePages() {\n\t\treturn nil, fmt.Errorf(\"no more pages available\")\n\t}\n\n\tparams := *p.params\n\tparams.NextToken = p.nextToken\n\n\tvar limit *int32\n\tif p.options.Limit > 0 {\n\t\tlimit = &p.options.Limit\n\t}\n\tparams.MaxResults = limit\n\n\tresult, err := p.client.ListLocations(ctx, ¶ms, optFns...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tp.firstPage = false\n\n\tprevToken := p.nextToken\n\tp.nextToken = result.NextToken\n\n\tif p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken {\n\t\tp.nextToken = nil\n\t}\n\n\treturn result, nil\n}",
"func (m *MockClient) NextOffersPage(page hProtocol.OffersPage) (hProtocol.OffersPage, error) {\n\ta := m.Called(page)\n\treturn a.Get(0).(hProtocol.OffersPage), a.Error(1)\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
NewMsgBlockLocator returns a new kaspa locator message that conforms to the Message interface. See MsgBlockLocator for details.
|
func NewMsgBlockLocator(locatorHashes []*externalapi.DomainHash) *MsgBlockLocator {
return &MsgBlockLocator{
BlockLocatorHashes: locatorHashes,
}
}
|
[
"func New() *block {\n\treturn &block{\n\t\trelayChan: make(chan Message, relayChanSize),\n\t\trelayMsgSeen: map[string]struct{}{},\n\t}\n}",
"func NewGetBlocksMessage(blockLocator []*wire.Hash, stopHash *wire.Hash) *GetBlocksMessage {\n\tmsg := &GetBlocksMessage{\n\t\tRawStopHash: *stopHash,\n\t}\n\tfor _, hash := range blockLocator {\n\t\tmsg.RawBlockLocator = append(msg.RawBlockLocator, *hash)\n\t}\n\treturn msg\n}",
"func NewMsgBlock(hdr *BlockHeader, txns []*MsgTx) *MsgBlock {\n\treturn &MsgBlock{\n\t\tBlockHeader: hdr,\n\t\tTxns: txns,\n\t}\n}",
"func CreateLocator(cfg *config.Config) SupernodeLocator {\n\tmutex.Lock()\n\tdefer mutex.Unlock()\n\treturn DefaultBuilder(cfg)\n}",
"func NewBlock(data string, prevBlockHash []byte) *Block {\n block := &Block{time.Now().Unix(), []byte(data), prevBlockHash, []byte{}}\n block.SetHash()\n return block;\n}",
"func (msg *GetHeadersMessage) GetBlockLocator() []*wire.Hash {\n\tblockLocator := []*wire.Hash{}\n\tfor _, rawHash := range msg.RawBlockLocator {\n\t\thash, _ := wire.NewHash(rawHash[:])\n\t\tblockLocator = append(blockLocator, hash)\n\t}\n\treturn blockLocator\n}",
"func newCheckpointMessage(seqNum string) *actionMessage {\n\treturn &actionMessage{\n\t\tAction: kclActionTypeCheckpoint,\n\t\tCheckpoint: seqNum,\n\t}\n}",
"func (c *chainView) BlockLocator(node *blockNode) BlockLocator {\n\tc.mtx.Lock()\n\tlocator := c.blockLocator(node)\n\tc.mtx.Unlock()\n\treturn locator\n}",
"func (c *chainView) blockLocator(node *blockNode) BlockLocator {\n\t// Use the current tip if requested.\n\tif node == nil {\n\t\tnode = c.tip()\n\t}\n\tif node == nil {\n\t\treturn nil\n\t}\n\n\t// Calculate the max number of entries that will ultimately be in the\n\t// block locator. See the description of the algorithm for how these\n\t// numbers are derived.\n\tvar maxEntries uint8\n\tif node.height <= 12 {\n\t\tmaxEntries = uint8(node.height) + 1\n\t} else {\n\t\t// Requested hash itself + previous 10 entries + genesis block.\n\t\t// Then floor(log2(height-10)) entries for the skip portion.\n\t\tadjustedHeight := uint32(node.height) - 10\n\t\tmaxEntries = 12 + fastLog2Floor(adjustedHeight)\n\t}\n\tlocator := make(BlockLocator, 0, maxEntries)\n\n\tstep := int32(1)\n\tfor node != nil {\n\t\tlocator = append(locator, &node.hash)\n\n\t\t// Nothing more to add once the genesis block has been added.\n\t\tif node.height == 0 {\n\t\t\tbreak\n\t\t}\n\n\t\t// Calculate height of previous node to include ensuring the\n\t\t// final node is the genesis block.\n\t\theight := node.height - step\n\t\tif height < 0 {\n\t\t\theight = 0\n\t\t}\n\n\t\t// When the node is in the current chain view, all of its\n\t\t// ancestors must be too, so use a much faster O(1) lookup in\n\t\t// that case. Otherwise, fall back to walking backwards through\n\t\t// the nodes of the other chain to the correct ancestor.\n\t\tif c.contains(node) {\n\t\t\tnode = c.nodes[height]\n\t\t} else {\n\t\t\tnode = node.Ancestor(height)\n\t\t}\n\n\t\t// Once 11 entries have been included, start doubling the\n\t\t// distance between included hashes.\n\t\tif len(locator) > 10 {\n\t\t\tstep *= 2\n\t\t}\n\t}\n\n\treturn locator\n}",
"func NewBlocksMessage(blocks []*massutil.Block) (*BlocksMessage, error) {\n\trawBlocks := [][]byte{}\n\tfor _, block := range blocks {\n\t\tdata, err := block.Bytes(wire.Packet)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\trawBlocks = append(rawBlocks, data)\n\t}\n\treturn &BlocksMessage{RawBlocks: rawBlocks}, nil\n}",
"func NewMsgMerkleBlock(bh *BlockHeader) *MsgMerkleBlock {\n\treturn &MsgMerkleBlock{\n\t\tHeader: *bh,\n\t\tTransactions: 0,\n\t\tHashes: make([]*chainhash.Hash, 0),\n\t\tSHashes: make([]*chainhash.Hash, 0),\n\t\tFlags: make([]byte, 0),\n\t}\n}",
"func NewMsgMerkleBlock(bh *BlockHeader) *MsgMerkleBlock {\n\treturn &MsgMerkleBlock{\n\t\tHeader: *bh,\n\t\tTransactions: 0,\n\t\tHashes: make([]*chainhash.Hash, 0),\n\t\tFlags: make([]byte, 0),\n\t}\n}",
"func (msg *GetBlocksMessage) GetBlockLocator() []*wire.Hash {\n\tblockLocator := []*wire.Hash{}\n\tfor _, rawHash := range msg.RawBlockLocator {\n\t\thash, _ := wire.NewHash(rawHash[:])\n\t\tblockLocator = append(blockLocator, hash)\n\t}\n\treturn blockLocator\n}",
"func NewMempoolAtBlock(st *Storage, block *types.StoredBlock) (*Mempool, error) {\n\treorgBase, err := st.ReorgBase(&block.Block)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif reorgBase.Hash != block.Hash {\n\t\treturn nil, errors.Errorf(\n\t\t\t\"block %s is not on eventual consensus chain %s\",\n\t\t\tblock.Hash, reorgBase.Hash,\n\t\t)\n\t}\n\n\tm, err := newMempoolWithoutBlock(st, block.FirstSeen)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tblockEvent, err := m.newBlockEvent(block)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif err := m.ApplyEvent(blockEvent); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn m, nil\n}",
"func New(cfg *config.Config, hub *component.ComponentHub) (*SimpleBlockFactory, error) {\n\ts := &SimpleBlockFactory{\n\t\tComponentHub: hub,\n\t\tjobQueue: make(chan interface{}, slotQueueMax),\n\t\tblockInterval: cfg.Consensus.BlockInterval,\n\t\tmaxBlockBodySize: util.MaxBlockBodySize(),\n\t\tonReorganizing: util.BcNoReorganizing,\n\t\tquit: make(chan interface{}),\n\t}\n\n\ts.txOp = util.NewCompTxOp(\n\t\tutil.NewBlockLimitOp(s.maxBlockBodySize),\n\t\tfunc(txIn *types.Tx) error {\n\t\t\tselect {\n\t\t\tcase <-s.quit:\n\t\t\t\treturn util.ErrQuit\n\t\t\tdefault:\n\t\t\t\treturn nil\n\t\t\t}\n\t\t},\n\t)\n\n\treturn s, nil\n}",
"func NewBlock(s Spec) *Block {\n\n\tnb := &Block{\n\t\tName: s.Name,\n\t\tInputs: make(map[string]*Input),\n\t\tOutputs: make(map[string]*Output),\n\t\tQuitChan: make(chan bool),\n\t}\n\n\tfor _, v := range s.Inputs {\n\t\tnb.AddInput(v)\n\t}\n\n\tfor _, v := range s.Outputs {\n\t\tnb.AddOutput(v)\n\t}\n\n\tnb.Kernel = s.Kernel\n\n\treturn nb\n}",
"func CreateNextBlock(rl Reader, messages []*cb.Envelope) *cb.Block {\n\tvar nextBlockNumber uint64\n\tvar previousBlockHash []byte\n\tvar err error\n\n\tif rl.Height() > 0 {\n\t\tit, _ := rl.Iterator(&ab.SeekPosition{\n\t\t\tType: &ab.SeekPosition_Newest{\n\t\t\t\tNewest: &ab.SeekNewest{},\n\t\t\t},\n\t\t})\n\t\tblock, status := it.Next()\n\t\tif status != cb.Status_SUCCESS {\n\t\t\tpanic(\"Error seeking to newest block for chain with non-zero height\")\n\t\t}\n\t\tnextBlockNumber = block.Header.Number + 1\n\t\tpreviousBlockHash = protoutil.BlockHeaderHash(block.Header)\n\t}\n\n\tdata := &cb.BlockData{\n\t\tData: make([][]byte, len(messages)),\n\t}\n\n\tfor i, msg := range messages {\n\t\tdata.Data[i], err = proto.Marshal(msg)\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t}\n\n\tblock := protoutil.NewBlock(nextBlockNumber, previousBlockHash)\n\tblock.Header.DataHash = protoutil.BlockDataHash(data)\n\tblock.Data = data\n\n\treturn block\n}",
"func NewBlock(raw []byte) *Block {\n\tblock := &Block{}\n\tblock.RlpDecode(raw)\n\n\treturn block\n}",
"func NewBlockMonitor(con *ftm.Client, buffer chan *evtTransaction, rescan chan bool, repo Repository, log logger.Logger, wg *sync.WaitGroup) *blockMonitor {\n\t// create new scanner instance\n\treturn &blockMonitor{\n\t\tservice: newService(\"block monitor\", repo, log, wg),\n\t\ttxChan: buffer,\n\t\treScan: rescan,\n\t\tcon: con,\n\t}\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
a lowercase version of marshal to allow for a call from marshalNonProtoField without upsetting TestProtoMarshal().
|
func (j *JSONPb) marshal(v interface{}) ([]byte, error) {
// NB: we use proto.Message here because grpc-gateway passes us protos that
// we don't control and thus don't implement protoutil.Message.
if pb, ok := v.(proto.Message); ok {
var buf bytes.Buffer
marshalFn := (*jsonpb.Marshaler)(j).Marshal
if err := marshalFn(&buf, pb); err != nil {
return nil, err
}
return buf.Bytes(), nil
}
return j.marshalNonProtoField(v)
}
|
[
"func MarshalString(pb proto.Message) (string, error) {\n\t// First, we marshal proto to JSON to recover the original field names.\n\t// We need to do this because if we marshal the proto.Message directly to\n\t// YAML, it will use the mangled-for-go names.\n\tma := jsonpb.Marshaler{\n\t\tEnumsAsInts: false,\n\t\tEmitDefaults: false,\n\t\tOrigName: true,\n\t}\n\n\tjs, err := ma.MarshalToString(pb)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\t// Then we unmarshal from JSON.\n\tvar j interface{}\n\tif err := json.Unmarshal([]byte(js), &j); err != nil {\n\t\treturn \"\", err\n\t}\n\n\t// Finally, we marshal to YAML.\n\tvar y []byte\n\ty, err = yaml.Marshal(j)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn string(y), nil\n}",
"func (lr ExportResponse) MarshalProto() ([]byte, error) {\n\treturn lr.orig.Marshal()\n}",
"func TestMarshalCorners(t *testing.T) {\n\t// Ensure encode of an invalid reflect value returns the expected\n\t// error.\n\ttestName := \"Encode invalid reflect value\"\n\texpectedN := 0\n\texpectedErr := error(&MarshalError{ErrorCode: ErrUnsupportedType})\n\texpectedVal := []byte{}\n\tdata := newFixedWriter(expectedN)\n\tn, err := TstEncode(data)(reflect.Value{})\n\ttestExpectedMRet(t, testName, n, expectedN, err, expectedErr)\n\tif !reflect.DeepEqual(data.Bytes(), expectedVal) {\n\t\tt.Errorf(\"%s: unexpected result - got: %x want: %x\\n\",\n\t\t\ttestName, data.Bytes(), expectedVal)\n\t}\n\n\t// Ensure marshal of a struct with both exported and unexported fields\n\t// skips the unexported fields but still marshals to the exported\n\t// fields.\n\ttype unexportedStruct struct {\n\t\tunexported int\n\t\tExported int\n\t}\n\ttestName = \"Marshal struct with exported and unexported fields\"\n\ttstruct := unexportedStruct{0, 1}\n\texpectedN = 4\n\texpectedErr = nil\n\texpectedVal = []byte{0x00, 0x00, 0x00, 0x01}\n\tdata = newFixedWriter(expectedN)\n\tn, err = Marshal(data, tstruct)\n\ttestExpectedMRet(t, testName, n, expectedN, err, expectedErr)\n\tif !reflect.DeepEqual(data.Bytes(), expectedVal) {\n\t\tt.Errorf(\"%s: unexpected result - got: %x want: %x\\n\",\n\t\t\ttestName, data.Bytes(), expectedVal)\n\t}\n\n}",
"func (vm *VersionMetadata) marshal() ([]byte, error) {\n\treturn proto.Marshal(vm)\n}",
"func marshalProtoMessage(v interface{}) ([]byte, error) {\n\tvv, ok := v.(proto.Message)\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"failed to marshal, message is %T, want proto.Message\", v)\n\t}\n\treturn proto.Marshal(vv)\n}",
"func (m *FooRequest) Marshal() []byte {\n\twriter := jspb.NewWriter()\n\tm.MarshalToWriter(writer)\n\treturn writer.GetResult()\n}",
"func MarshalUntyped(msg map[string]any) ([]string, error) {\n\treturn appendFlags(nil, nil, reflect.ValueOf(msg))\n}",
"func Marshal(data interface{}) (*rpc.TypedData, error) {\n\treturn typedDataEncoder.Encode(data)\n}",
"func Marshal(w io.Writer, v interface{}) (int, error) {\n // delegate to xdr package's Marshal\n return xdr.Marshal(w, v)\n }",
"func Marshal(v interface{}) ([]byte, error) {\n\tvar buf bytes.Buffer\n\tif err := encodeValue(&buf, reflect.ValueOf(v)); err != nil {\n\t\treturn nil, err\n\t}\n\treturn buf.Bytes(), nil\n}",
"func callMarshalJSON(v reflect.Value) ([]byte, error) {\n\tif method := v.MethodByName(marshalJSON); method.Kind() != reflect.Invalid {\n\t\tmarsh := v.Interface().(json.Marshaler)\n\t\treturn marsh.MarshalJSON()\n\t}\n\n\tif v.Kind() == reflect.Ptr {\n\t\tv = v.Elem()\n\t} else {\n\t\tif v.CanAddr() {\n\t\t\tv = v.Addr()\n\t\t}\n\t}\n\n\tif method := v.MethodByName(unmarshalJSON); method.Kind() != reflect.Invalid {\n\t\tmarsh := v.Interface().(json.Marshaler)\n\t\treturn marsh.MarshalJSON()\n\t}\n\n\tpanic(fmt.Sprintf(\"callMarshalJSON called on type %T that does not have MarshalJSON defined\", v.Interface()))\n}",
"func Marshal(aStruct interface{}) ([]byte, error) {\n\ttmpMap, err := StructToMap(aStruct)\n\tif err != nil {return nil, err}\n\treturn msgpack.Marshal(tmpMap)\n}",
"func TestMarshalUnsetRequiredFields(t *testing.T) {\n\tmsgExt := &pb.Real{}\n\tproto.SetExtension(msgExt, pb.E_Extm, &pb.MsgWithRequired{})\n\n\ttests := []struct {\n\t\tdesc string\n\t\tmarshaler *Marshaler\n\t\tpb proto.Message\n\t}{\n\t\t{\n\t\t\tdesc: \"direct required field\",\n\t\t\tmarshaler: &Marshaler{},\n\t\t\tpb: &pb.MsgWithRequired{},\n\t\t},\n\t\t{\n\t\t\tdesc: \"direct required field + emit defaults\",\n\t\t\tmarshaler: &Marshaler{Omit: OmitOptions{All: true}},\n\t\t\tpb: &pb.MsgWithRequired{},\n\t\t},\n\t\t{\n\t\t\tdesc: \"indirect required field\",\n\t\t\tmarshaler: &Marshaler{},\n\t\t\tpb: &pb.MsgWithIndirectRequired{Subm: &pb.MsgWithRequired{}},\n\t\t},\n\t\t{\n\t\t\tdesc: \"indirect required field + emit defaults\",\n\t\t\tmarshaler: &Marshaler{Omit: OmitOptions{All: true}},\n\t\t\tpb: &pb.MsgWithIndirectRequired{Subm: &pb.MsgWithRequired{}},\n\t\t},\n\t\t{\n\t\t\tdesc: \"direct required wkt field\",\n\t\t\tmarshaler: &Marshaler{},\n\t\t\tpb: &pb.MsgWithRequiredWKT{},\n\t\t},\n\t\t{\n\t\t\tdesc: \"direct required wkt field + emit defaults\",\n\t\t\tmarshaler: &Marshaler{Omit: OmitOptions{All: true}},\n\t\t\tpb: &pb.MsgWithRequiredWKT{},\n\t\t},\n\t\t{\n\t\t\tdesc: \"direct required bytes field\",\n\t\t\tmarshaler: &Marshaler{},\n\t\t\tpb: &pb.MsgWithRequiredBytes{},\n\t\t},\n\t\t{\n\t\t\tdesc: \"required in map value\",\n\t\t\tmarshaler: &Marshaler{},\n\t\t\tpb: &pb.MsgWithIndirectRequired{\n\t\t\t\tMapField: map[string]*pb.MsgWithRequired{\n\t\t\t\t\t\"key\": {},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tdesc: \"required in repeated item\",\n\t\t\tmarshaler: &Marshaler{},\n\t\t\tpb: &pb.MsgWithIndirectRequired{\n\t\t\t\tSliceField: []*pb.MsgWithRequired{\n\t\t\t\t\t{Str: proto.String(\"hello\")},\n\t\t\t\t\t{},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tdesc: \"required inside oneof\",\n\t\t\tmarshaler: &Marshaler{},\n\t\t\tpb: &pb.MsgWithOneof{\n\t\t\t\tUnion: &pb.MsgWithOneof_MsgWithRequired{&pb.MsgWithRequired{}},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tdesc: \"required inside extension\",\n\t\t\tmarshaler: &Marshaler{},\n\t\t\tpb: msgExt,\n\t\t},\n\t}\n\n\tfor _, tc := range tests {\n\t\tif _, err := tc.marshaler.Marshal(tc.pb); err == nil {\n\t\t\tt.Errorf(\"%s: expecting error in marshaling with unset required fields %+v\", tc.desc, tc.pb)\n\t\t}\n\t}\n}",
"func (s customMarshallStruct) MarshalGo(v interface{}) (interface{}, error) {\n\treturn map[string]interface{}{\n\t\t\"int\": s.privateInteger,\n\t\t\"string\": s.privateString,\n\t\t\"bool\": *s.privateBoolPointer,\n\t}, nil\n}",
"func (b *Schema) toJSON(msg proto.Message) (string, error) {\n\t// Marshal from proto to json bytes\n\tm := jsonpb.Marshaler{}\n\tout, err := m.MarshalToString(msg)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\treturn out, nil\n}",
"func marshalMessage(msg proto.Message, format Format, wrap bool) ([]byte, error) {\n\tif msg == nil {\n\t\tpanic(\"msg is nil\")\n\t}\n\n\tvar buf bytes.Buffer\n\tswitch format {\n\n\tcase FormatBinary:\n\t\treturn proto.Marshal(msg)\n\n\tcase FormatJSONPB:\n\t\tif wrap {\n\t\t\tbuf.WriteString(JSONPBPrefix)\n\t\t}\n\t\tm := jsonpb.Marshaler{}\n\t\tif err := m.Marshal(&buf, msg); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif wrap {\n\t\t\tbuf.WriteRune('\\n')\n\t\t}\n\t\treturn buf.Bytes(), nil\n\n\tcase FormatText:\n\t\tif err := proto.MarshalText(&buf, msg); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn buf.Bytes(), nil\n\n\tdefault:\n\t\tpanic(fmt.Errorf(\"impossible: invalid format %d\", format))\n\t}\n}",
"func marshal(trace *tempopb.Trace, dataEncoding string) ([]byte, error) {\n\tswitch dataEncoding {\n\tcase \"\":\n\t\treturn proto.Marshal(trace)\n\tcase \"v1\":\n\t\ttraceBytes := &tempopb.TraceBytes{}\n\t\tbytes, err := proto.Marshal(trace)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\ttraceBytes.Traces = append(traceBytes.Traces, bytes)\n\n\t\treturn proto.Marshal(traceBytes)\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"unrecognized dataEncoding in Unmarshal %s\", dataEncoding)\n\t}\n}",
"func Marshal(v interface{}) ([]byte, error) {\n\tstringified, err := Stringify(v)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn json.Marshal(stringified)\n}",
"func Marshal(val interface{}) ([]byte, error) {\n\treturn MarshalWithRegistry(defaultRegistry, val)\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
NewService creates a new location.Service using a HistoryService and a geocode.Geocoder.
|
func NewService(
hist location.HistoryService,
geo geocode.Geocoder,
opts ...ServiceOption,
) location.Service {
opt := ServiceOptions{
Logger: logutil.NoopEntry(),
Tracer: new(opentracing.NoopTracer),
RegionGeocodeLevel: geocode.CityLevel,
}
for _, apply := range opts {
apply(&opt)
}
return service{
HistoryService: hist,
geo: geo,
regionLevel: opt.RegionGeocodeLevel,
log: logutil.WithComponent(opt.Logger, (*service)(nil)),
tracer: opt.Tracer,
}
}
|
[
"func newGeocodingService(sling *sling.Sling) *GeocodingService {\n\treturn &GeocodingService{\n\t\tsling: sling,\n\t}\n}",
"func newGeoCodingService(geoCodingServiceConfig *geoCodingServiceConfig) (*GeoCodingService, *errortools.Error) {\n\tif geoCodingServiceConfig.APIKey == \"\" {\n\t\treturn nil, errortools.ErrorMessage(\"APIKey not provided\")\n\t}\n\n\treturn &GeoCodingService{\n\t\tapiKey: geoCodingServiceConfig.APIKey,\n\t\tsling: geoCodingServiceConfig.Sling.Path(\"geocode/\"),\n\t}, nil\n}",
"func newService() v1.Service {\n\tret := v1.Service{\n\t\tTypeMeta: meta.TypeMeta{\n\t\t\tKind: \"Service\",\n\t\t\tAPIVersion: \"v1\",\n\t\t},\n\t\tObjectMeta: meta.ObjectMeta{\n\t\t\tName: fmt.Sprintf(\"%v\", uuid.NewUUID()),\n\t\t\tNamespace: \"default\",\n\t\t},\n\t\tSpec: v1.ServiceSpec{\n\t\t\tType: v1.ServiceTypeLoadBalancer,\n\t\t\tLoadBalancerIP: \"1.2.3.4\",\n\t\t},\n\t}\n\n\tret.SelfLink = fmt.Sprintf(\"%s/%s\", ret.Namespace, ret.Name)\n\treturn ret\n}",
"func NewService(program string, args ...string) *service {\n\tlog.Println(\"NewLocal service\")\n\treturn &service{\n\t\tprogram: program,\n\t\targs: args,\n\t}\n}",
"func NewService(addr string, store fsm.Store) *Service {\n return &Service{\n addr: addr,\n\tstore: store,\n }\n}",
"func newService(c *onet.Context) (onet.Service, error) {\n\ts := &Service{\n\t\tServiceProcessor: onet.NewServiceProcessor(c),\n\t}\n\tif err := s.RegisterHandlers(s.CreateSkipchain, s.SetKeyValue,\n\t\ts.GetProof); err != nil {\n\t\tlog.ErrFatal(err, \"Couldn't register messages\")\n\t}\n\tif err := s.tryLoad(); err != nil {\n\t\tlog.Error(err)\n\t\treturn nil, err\n\t}\n\treturn s, nil\n}",
"func newService(client gwc.Doer) *service {\n\treturn &service{gwc.NewGroup(client)}\n}",
"func newService(localService *localserviceV1alpha1.LocalService, node string) *corev1.Service {\n\tspec := localService.Spec.ServiceSpec.DeepCopy()\n\tspec.Selector[RackKey] = node\n\treturn &corev1.Service{\n\t\tObjectMeta: metav1.ObjectMeta{\n\t\t\tName: localService.Name + \"-\" + node,\n\t\t\tNamespace: localService.Namespace,\n\t\t\tOwnerReferences: []metav1.OwnerReference{\n\t\t\t\t*metav1.NewControllerRef(localService, localserviceV1alpha1.SchemeGroupVersion.WithKind(\"LocalService\")),\n\t\t\t},\n\t\t\tLabels: map[string]string{\n\t\t\t\tOwnerKey: localService.Name,\n\t\t\t},\n\t\t},\n\t\tSpec: *spec,\n\t}\n}",
"func New(address, user string) *Service {\n\tres := &Service{}\n\tif address == \"\" || user == \"\" {\n\t\treturn res\n\t}\n\tres.bridge = huego.New(address, user)\n\treturn res\n}",
"func newService(\n\trepo repository.Repository,\n\thub *hub.Hub,\n\tsource interface{},\n\tlogger *zap.Logger,\n\tconfig *config.Config,\n) (Sync, error) {\n\tservice := &Service{\n\t\thub: hub,\n\t\trepo: repo,\n\t\tlogger: logger,\n\t}\n\n\tduration, err := time.ParseDuration(config.General.Sync.Interval)\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tservice.duration = duration\n\n\tswitch sourceType := source.(type) {\n\tcase ldap.LDAP:\n\t\tservice.ldap = sourceType\n\t\tservice.sourceType = \"ldap\"\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"no valid source type added\")\n\t}\n\n\terr = service.Start()\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tservice.initEventhandler()\n\n\treturn service, nil\n}",
"func NewService(services map[string][]*interop.Service) *ServiceImpl {\n\treturn &ServiceImpl{registeredServices: services}\n}",
"func ServiceNew(c echo.Context) error {\n\tdefer c.Request().Body.Close()\n\terr := validatePermission(c, \"core_service_new\")\n\tif err != nil {\n\t\treturn returnInvalidResponse(http.StatusForbidden, err, fmt.Sprintf(\"%s\", err))\n\t}\n\n\tservicePayload := ServicePayload{}\n\n\tpayloadRules := govalidator.MapData{\n\t\t\"name\": []string{\"required\"},\n\t\t\"image\": []string{\"required\"},\n\t\t\"status\": []string{\"required\", \"active_inactive\"},\n\t\t\"description\": []string{},\n\t}\n\n\tvalidate := validateRequestPayload(c, payloadRules, &servicePayload)\n\tif validate != nil {\n\t\treturn returnInvalidResponse(http.StatusUnprocessableEntity, validate, \"Hambatan validasi\")\n\t}\n\n\tunbased, _ := base64.StdEncoding.DecodeString(servicePayload.Image)\n\tfilename := \"svc\" + strconv.FormatInt(time.Now().Unix(), 10)\n\turl, err := asira.App.S3.UploadJPEG(unbased, filename)\n\tif err != nil {\n\t\tNLog(\"error\", \"ServiceNew\", map[string]interface{}{\"message\": \"upload image error\", \"error\": err}, c.Get(\"user\").(*jwt.Token), \"\", false)\n\n\t\treturn returnInvalidResponse(http.StatusInternalServerError, err, \"Gagal membuat layanan bank baru\")\n\t}\n\n\tservice := models.Service{\n\t\tName: servicePayload.Name,\n\t\tImage: url,\n\t\tStatus: servicePayload.Status,\n\t\tDescription: servicePayload.Description,\n\t}\n\n\terr = service.Create()\n\tif err != nil {\n\t\tNLog(\"error\", \"ServiceNew\", map[string]interface{}{\"message\": \"service create error\", \"error\": err}, c.Get(\"user\").(*jwt.Token), \"\", false)\n\n\t\treturn returnInvalidResponse(http.StatusInternalServerError, err, \"Gagal membuat layanan baru\")\n\t}\n\n\tmiddlewares.SubmitKafkaPayload(service, \"service_create\")\n\tif err != nil {\n\t\tNLog(\"error\", \"ServiceNew\", map[string]interface{}{\"message\": \"kafka submit error\", \"error\": err, \"service\": service}, c.Get(\"user\").(*jwt.Token), \"\", false)\n\n\t\treturn returnInvalidResponse(http.StatusInternalServerError, err, \"Gagal membuat layanan baru\")\n\t}\n\n\tNAudittrail(models.Service{}, service, c.Get(\"user\").(*jwt.Token), \"service\", fmt.Sprint(service.ID), \"create\")\n\n\treturn c.JSON(http.StatusCreated, service)\n}",
"func NewService() (*Service, error) {\n\n\treturn &Service{\n\t\tworkersMap: make(map[string]*Worker),\n\t}, nil\n}",
"func New() *Service {\r\n\treturn &Service{}\r\n}",
"func NewService(cfg *Cfg, db *gorm.DB, instaAPI *InstaAPI) *gin.Engine {\n\tapi := NewPhileasAPI(cfg, db, instaAPI)\n\n\ts := gin.New()\n\ts.Use(gin.Logger())\n\tginLoadHTMLGlob(s, \"templates/*\")\n\ts.Static(\"/static\", \"static\")\n\ts.StaticFile(\"/favicon.ico\", \"static/favicon.ico\")\n\n\ts.GET(\"/ping\", api.ping)\n\ts.GET(\"/loc/:location-id\", api.location)\n\ts.GET(\"/top\", api.mapper)\n\ts.GET(\"/top.json\", api.topJSON)\n\ts.GET(\"/countries.json\", api.countriesJSON)\n\ts.GET(\"/stats.json\", api.statsJSON)\n\n\treturn s\n}",
"func NewService(\n\tcfg *configs.Config,\n\tstore Store,\n\tkm keys.Manager,\n\tfc *client.Client,\n\twp *jobs.WorkerPool,\n\ttxs *transactions.Service,\n) *Service {\n\t// TODO(latenssi): safeguard against nil config?\n\tsvc := &Service{store, km, fc, wp, txs, cfg}\n\n\t// Register asynchronous job executor.\n\twp.RegisterExecutor(AccountCreateJobType, svc.executeAccountCreateJob)\n\n\treturn svc\n}",
"func createService(svc Service) error {\n\treturn nil\n}",
"func (c *DefaultApiService) CreateService(params *CreateServiceParams) (*ProxyV1Service, error) {\n\tpath := \"/v1/Services\"\n\n\tdata := url.Values{}\n\theaders := make(map[string]interface{})\n\n\tif params != nil && params.CallbackUrl != nil {\n\t\tdata.Set(\"CallbackUrl\", *params.CallbackUrl)\n\t}\n\tif params != nil && params.ChatInstanceSid != nil {\n\t\tdata.Set(\"ChatInstanceSid\", *params.ChatInstanceSid)\n\t}\n\tif params != nil && params.DefaultTtl != nil {\n\t\tdata.Set(\"DefaultTtl\", fmt.Sprint(*params.DefaultTtl))\n\t}\n\tif params != nil && params.GeoMatchLevel != nil {\n\t\tdata.Set(\"GeoMatchLevel\", *params.GeoMatchLevel)\n\t}\n\tif params != nil && params.InterceptCallbackUrl != nil {\n\t\tdata.Set(\"InterceptCallbackUrl\", *params.InterceptCallbackUrl)\n\t}\n\tif params != nil && params.NumberSelectionBehavior != nil {\n\t\tdata.Set(\"NumberSelectionBehavior\", *params.NumberSelectionBehavior)\n\t}\n\tif params != nil && params.OutOfSessionCallbackUrl != nil {\n\t\tdata.Set(\"OutOfSessionCallbackUrl\", *params.OutOfSessionCallbackUrl)\n\t}\n\tif params != nil && params.UniqueName != nil {\n\t\tdata.Set(\"UniqueName\", *params.UniqueName)\n\t}\n\n\tresp, err := c.requestHandler.Post(c.baseURL+path, data, headers)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tdefer resp.Body.Close()\n\n\tps := &ProxyV1Service{}\n\tif err := json.NewDecoder(resp.Body).Decode(ps); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn ps, err\n}",
"func NewService(repository entity.OrderRepository, logger log.Logger) OrderService {\n\treturn &orderService{\n\t\trepository: repository,\n\t\tlogger: logger,\n\t}\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
WithTracer configures a Service to trace calls with t.
|
func WithTracer(t opentracing.Tracer) ServiceOption {
return func(opt *ServiceOptions) { opt.Tracer = t }
}
|
[
"func WithTracer(t opentracing.Tracer) ContextOption {\n\treturn func(ctx *Context) {\n\t\tctx.tracer = t\n\t}\n}",
"func WithTracer(ctx context.Context, tracer opentracing.Tracer) context.Context {\n\treturn context.WithValue(ctx, tracerKey{}, tracer)\n}",
"func (t *Trigger) configureTracer() {\n\ttracer := TracerNoOP\n\tif setting, ok := t.config.Settings[settingTracer]; ok {\n\t\ttracer = setting.(string)\n\t}\n\ttracerEndpoint := \"\"\n\tif setting, ok := t.config.Settings[settingTracerEndpoint]; ok {\n\t\ttracerEndpoint = setting.(string)\n\t}\n\ttracerToken := \"\"\n\tif setting, ok := t.config.Settings[settingTracerToken]; ok {\n\t\ttracerToken = setting.(string)\n\t}\n\ttracerDebug := false\n\tif setting, ok := t.config.Settings[settingTracerDebug]; ok {\n\t\ttracerDebug = setting.(bool)\n\t}\n\ttracerSameSpan := false\n\tif setting, ok := t.config.Settings[settingTracerSameSpan]; ok {\n\t\ttracerSameSpan = setting.(bool)\n\t}\n\ttracerID128Bit := true\n\tif setting, ok := t.config.Settings[settingTracerID128Bit]; ok {\n\t\ttracerID128Bit = setting.(bool)\n\t}\n\n\tswitch tracer {\n\tcase TracerNoOP:\n\t\topentracing.SetGlobalTracer(&opentracing.NoopTracer{})\n\tcase TracerZipKin:\n\t\tif tracerEndpoint == \"\" {\n\t\t\tpanic(ErrorTracerEndpointRequired)\n\t\t}\n\n\t\tcollector, err := zipkin.NewHTTPCollector(tracerEndpoint)\n\t\tif err != nil {\n\t\t\tpanic(fmt.Sprintf(\"unable to create Zipkin HTTP collector: %+v\\n\", err))\n\t\t}\n\n\t\trecorder := zipkin.NewRecorder(collector, tracerDebug,\n\t\t\tgetLocalIP(), t.config.Name)\n\n\t\ttracer, err := zipkin.NewTracer(\n\t\t\trecorder,\n\t\t\tzipkin.ClientServerSameSpan(tracerSameSpan),\n\t\t\tzipkin.TraceID128Bit(tracerID128Bit),\n\t\t)\n\t\tif err != nil {\n\t\t\tpanic(fmt.Sprintf(\"unable to create Zipkin tracer: %+v\\n\", err))\n\t\t}\n\n\t\topentracing.SetGlobalTracer(tracer)\n\tcase TracerAPPDash:\n\t\tif tracerEndpoint == \"\" {\n\t\t\tpanic(ErrorTracerEndpointRequired)\n\t\t}\n\n\t\tcollector := appdash.NewRemoteCollector(tracerEndpoint)\n\t\tchunkedCollector := appdash.NewChunkedCollector(collector)\n\t\ttracer := appdashtracing.NewTracer(chunkedCollector)\n\t\topentracing.SetGlobalTracer(tracer)\n\tcase TracerLightStep:\n\t\tif tracerToken == \"\" {\n\t\t\tpanic(ErrorTracerTokenRequired)\n\t\t}\n\n\t\tlightstepTracer := lightstep.NewTracer(lightstep.Options{\n\t\t\tAccessToken: tracerToken,\n\t\t})\n\n\t\topentracing.SetGlobalTracer(lightstepTracer)\n\tdefault:\n\t\tpanic(ErrorInvalidTracer)\n\t}\n}",
"func InitTracer(ctx context.Context, serviceName, otlpAddress string) (func(), error) {\n\tres, err := resource.New(ctx,\n\t\tresource.WithAttributes(\n\t\t\tsemconv.ServiceNameKey.String(serviceName),\n\t\t),\n\t)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to create resource: %w\", err)\n\t}\n\n\t// Set up a trace exporter\n\texporter, err := otlptracegrpc.New(ctx,\n\t\totlptracegrpc.WithInsecure(),\n\t\totlptracegrpc.WithEndpoint(otlpAddress),\n\t)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to create trace exporter: %w\", err)\n\t}\n\n\t// Register the trace exporter with a TracerProvider, using a batch\n\t// span processor to aggregate spans before export.\n\tbsp := sdktrace.NewBatchSpanProcessor(exporter)\n\tprovider := sdktrace.NewTracerProvider(\n\t\tsdktrace.WithSampler(sdktrace.AlwaysSample()),\n\t\tsdktrace.WithResource(res),\n\t\tsdktrace.WithSpanProcessor(bsp),\n\t)\n\n\t// set global propagator to tracecontext (the default is no-op).\n\totel.SetTextMapPropagator(propagation.TraceContext{})\n\totel.SetTracerProvider(provider)\n\n\treturn func() {\n\t\tif err := exporter.Shutdown(ctx); err != nil {\n\t\t\tlog.Errorf(\"failed to stop exporter: %v\", err)\n\t\t}\n\t}, nil\n}",
"func Tracing(serviceName string, opts ...TraceOption) gin.HandlerFunc {\n\tcfg := traceConfig{}\n\tfor _, opt := range opts {\n\t\topt(&cfg)\n\t}\n\tif cfg.TracerProvider == nil {\n\t\tcfg.TracerProvider = otel.GetTracerProvider()\n\t}\n\ttracer := cfg.TracerProvider.Tracer(\n\t\ttracerName,\n\t\toteltrace.WithInstrumentationVersion(otelcontrib.SemVersion()),\n\t)\n\tif cfg.Propagators == nil {\n\t\tcfg.Propagators = otel.GetTextMapPropagator()\n\t}\n\n\treturn func(c *gin.Context) {\n\t\tc.Set(tracerKey, tracer)\n\t\tsavedCtx := c.Request.Context()\n\t\tdefer func() {\n\t\t\tc.Request = c.Request.WithContext(savedCtx)\n\t\t}()\n\t\tctx := cfg.Propagators.Extract(savedCtx, propagation.HeaderCarrier(c.Request.Header))\n\t\troute := c.FullPath()\n\t\topts := []oteltrace.SpanStartOption{\n\t\t\toteltrace.WithAttributes(semconv.NetAttributesFromHTTPRequest(\"tcp\", c.Request)...),\n\t\t\toteltrace.WithAttributes(semconv.EndUserAttributesFromHTTPRequest(c.Request)...),\n\t\t\toteltrace.WithAttributes(semconv.HTTPServerAttributesFromHTTPRequest(serviceName, route, c.Request)...),\n\t\t\toteltrace.WithSpanKind(oteltrace.SpanKindServer),\n\t\t}\n\t\tspanName := route\n\t\tif spanName == \"\" {\n\t\t\tspanName = fmt.Sprintf(\"HTTP %s route not found\", c.Request.Method)\n\t\t}\n\t\tctx, span := tracer.Start(ctx, spanName, opts...)\n\t\tdefer span.End()\n\n\t\t// pass the span through the request context\n\t\tc.Request = c.Request.WithContext(ctx)\n\n\t\t// serve the request to the next interceptor\n\t\tc.Next()\n\n\t\tstatus := c.Writer.Status()\n\t\tattrs := semconv.HTTPAttributesFromHTTPStatusCode(status)\n\t\tspanStatus, spanMessage := semconv.SpanStatusFromHTTPStatusCode(status)\n\t\tspan.SetAttributes(attrs...)\n\t\tspan.SetStatus(spanStatus, spanMessage)\n\t\tif len(c.Errors) > 0 {\n\t\t\tspan.SetAttributes(attribute.String(\"gin.errors\", c.Errors.String()))\n\t\t}\n\t}\n}",
"func (o *Options) applyTracer(v opentracing.Tracer) error {\n\tif v == nil {\n\t\tpanic(\"tracer must not be nil\")\n\t}\n\n\to.Tracer = v\n\treturn nil\n}",
"func NewWithOptions(opts TracerOptions) Tracer {\n\tif opts.Writer == nil {\n\t\topts.Writer = os.Stdout\n\t}\n\n\tif opts.ServiceName == \"\" {\n\t\topts.ServiceName = os.Getenv(\"CTRACE_SERVICE_NAME\")\n\t}\n\n\treturn &tracer{\n\t\toptions: opts,\n\t\tSpanReporter: NewSpanReporter(opts.Writer, NewSpanEncoder()),\n\t\tspanPool: &sync.Pool{New: func() interface{} { return &span{} }},\n\t\trng: rand.New(rand.NewSource(time.Now().UnixNano())),\n\t\ttextMapPropagator: newTextMapPropagator(),\n\t\thttpHeadersPropagator: newHTTPHeadersPropagator(),\n\t}\n}",
"func WrapWithTracer(r *http.Request, rt *RequestTracer) *http.Request {\n\treturn r.WithContext(context.WithValue(r.Context(), tracerKey, rt))\n}",
"func Tracing(service string, op string) startup_http.HttpMiddleware {\n\n\treturn func(handler http.Handler) http.Handler {\n\t\treturn http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {\n\t\t\tctx := req.Context()\n\n\t\t\t// Check if we already have a span. This happens when the user is\n\t\t\t// chaining multiple tracing middleware\n\t\t\tif existingSpan := opentracing.SpanFromContext(ctx); existingSpan != nil {\n\t\t\t\t// update existing span\n\t\t\t\texistingSpan.SetOperationName(op)\n\t\t\t\texistingSpan.SetTag(\"dd.service\", service)\n\n\t\t\t\t// continue\n\t\t\t\thandler.ServeHTTP(w, req)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\t// extract a span from the incoming request\n\t\t\twireContext, err := opentracing.GlobalTracer().Extract(\n\t\t\t\topentracing.HTTPHeaders, opentracing.HTTPHeadersCarrier(req.Header))\n\n\t\t\tif err != nil && err != opentracing.ErrSpanContextNotFound {\n\t\t\t\t// ignore errors but show a small warning.\n\t\t\t\tlog := GetLogger(ctx, \"httpd\")\n\t\t\t\tlog.Warnf(\"Could not extract tracer from http headers: %s\", err)\n\t\t\t}\n\n\t\t\t// start a new server side trace\n\t\t\tserverSpan := opentracing.StartSpan(op, ext.RPCServerOption(wireContext))\n\t\t\tdefer serverSpan.Finish()\n\n\t\t\t// use a clean url as resource\n\t\t\tserverSpan.SetTag(\"dd.service\", service)\n\t\t\text.HTTPMethod.Set(serverSpan, req.Method)\n\t\t\text.HTTPUrl.Set(serverSpan, cleanUrl(req.URL.String()))\n\n\t\t\t// record and log the status code of the response\n\t\t\trl, w := responseLoggerOf(w)\n\t\t\tdefer rl.addStatusToSpan(serverSpan)\n\n\t\t\t// put the span into the context\n\t\t\tctx = opentracing.ContextWithSpan(ctx, serverSpan)\n\t\t\thandler.ServeHTTP(w, req.WithContext(ctx))\n\t\t})\n\t}\n}",
"func WithTrace(ctx context.Context, operationName string, tags map[string]interface{}, f func(context.Context)) {\n\tt := StartTrace(ctx, operationName)\n\tdefer func() {\n\t\tif r := recover(); r != nil {\n\t\t\tLog(ctx, operationName, fmt.Errorf(\"panic: %v\", r))\n\t\t}\n\t\tt.Finish(tags)\n\t}()\n\n\tf(t.NewChildContext())\n}",
"func (s *Service) configureTracing(c TraceConfig) {\n\tlog.Info(\"applying trace configuration '%s'...\", c)\n\ttrace.ApplyConfig(trace.Config{DefaultSampler: c.Sampler()})\n}",
"func WithTracerConfig(options TracerOptions) TracerOption {\n\treturn func(o *TracerOptions) {\n\t\t*o = options\n\t}\n}",
"func WithTracerProvider(tp trace.TracerProvider) Option {\n\treturn func(c *Component) {\n\t\tc.ctx = tracing.NewContextWithTracerProvider(c.ctx, tp)\n\t\tc.AddContextFiller(func(ctx context.Context) context.Context {\n\t\t\treturn tracing.NewContextWithTracerProvider(ctx, tp)\n\t\t})\n\t}\n}",
"func NewTracer() *Tracer {\n\treturn &Tracer{\n\t\tmconn: &utils.MuxConn{},\n\t\troute: make([]node, 0),\n\t}\n}",
"func InitializeTracing(serviceName string) {\n\tcfg := &jaegerconfig.Configuration{\n\t\tServiceName: serviceName,\n\t\tSampler: &jaegerconfig.SamplerConfig{\n\t\t\tType: \"const\",\n\t\t\tParam: 1,\n\t\t},\n\t\tReporter: &jaegerconfig.ReporterConfig{\n\t\t\tLogSpans: true,\n\t\t},\n\t}\n\ttrc, cls, err := cfg.NewTracer(jaegerconfig.Logger(jaeger.StdLogger))\n\tif err != nil {\n\t\tfmt.Println(\"Error initialiazing Tracing for servicename :\", serviceName)\n\t}\n\ttracer = trc\n\tcloser = cls\n\topentracing.SetGlobalTracer(tracer)\n\t//\treturn tracer, closer\n}",
"func NewServiceClassTracer(in sacloud.ServiceClassAPI) sacloud.ServiceClassAPI {\n\treturn &ServiceClassTracer{\n\t\tInternal: in,\n\t}\n}",
"func NewTracer(opts ...TracerOption) goa.Middleware {\n\to := &tracerOptions{\n\t\ttraceIDFunc: shortID,\n\t\tspanIDFunc: shortID,\n\t\tsamplingPercent: 100,\n\t\tsampleSize: 1000, // only applies if maxSamplingRate is set\n\t}\n\tfor _, opt := range opts {\n\t\to = opt(o)\n\t}\n\tvar sampler Sampler\n\tif o.maxSamplingRate > 0 {\n\t\tsampler = NewAdaptiveSampler(o.maxSamplingRate, o.sampleSize)\n\t} else {\n\t\tsampler = NewFixedSampler(o.samplingPercent)\n\t}\n\treturn func(h goa.Handler) goa.Handler {\n\t\treturn func(ctx context.Context, rw http.ResponseWriter, req *http.Request) error {\n\t\t\t// insert a new trace ID only if not already being traced.\n\t\t\ttraceID := req.Header.Get(TraceIDHeader)\n\t\t\tif traceID == \"\" {\n\t\t\t\t// insert tracing only within sample.\n\t\t\t\tif sampler.Sample() {\n\t\t\t\t\ttraceID = o.traceIDFunc()\n\t\t\t\t} else {\n\t\t\t\t\treturn h(ctx, rw, req)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// insert IDs into context to enable tracing.\n\t\t\tspanID := o.spanIDFunc()\n\t\t\tparentID := req.Header.Get(ParentSpanIDHeader)\n\t\t\tctx = WithTrace(ctx, traceID, spanID, parentID)\n\t\t\treturn h(ctx, rw, req)\n\t\t}\n\t}\n}",
"func initTracer(config map[string]string) func() {\n\t// Jaeger exporter\n\tendpoint := config[\"endpoint\"]\n\texporter, err := jaeger.NewRawExporter(jaeger.WithCollectorEndpoint(jaeger.WithEndpoint(endpoint)))\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\t// ParentBased es para que si el padre no se tracea, los hijos tampoco\n\ttracerProvider := sdktrace.NewTracerProvider(\n\t\tsdktrace.WithSampler(sdktrace.ParentBased(sdktrace.TraceIDRatioBased(1))), // Tunear el \"factor\", ahora está puesto a 1 para tracear siempre\n\t\tsdktrace.WithBatcher(exporter),\n\t\tsdktrace.WithResource(resource.NewWithAttributes(\n\t\t\tsemconv.ServiceNameKey.String(\"Pruebas4\"),\n\t\t\tsemconv.HostImageVersionKey.String(\"ImageVersion 1.2.3\"),\n\t\t)),\n\t)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\t// Almacenamos el tracerProvider globalmente\n\totel.SetTracerProvider(tracerProvider)\n\totel.SetTextMapPropagator(propagation.NewCompositeTextMapPropagator(propagation.TraceContext{}, propagation.Baggage{}))\n\n\treturn func() {\n\t\t// Shutdown will flush any remaining spans and shut down the exporter.\n\t\terr = tracerProvider.Shutdown(context.Background())\n\t\tif err != nil {\n\t\t\tlog.Fatalf(\"%s: %v\", \"failed to shutdown TracerProvider\", err)\n\t\t}\n\t}\n}",
"func Trace(t Tracer, e error, traceOptions *TraceOptions) (err error) {\n\tif traceOptions == nil {\n\t\ttraceOptions = t.DefaultTraceOptions()\n\t}\n\n\t// If no timeouts are specified, the timeout channel will block\n\t// forever (i.e. it will return only after the tracer exits).\n\t// We create the timer first to account for the work below, but\n\t// we won't wrap setup in a timeout as it's unlikely to be\n\t// a bottleneck.\n\tvar timeout <-chan time.Time\n\n\tif traceOptions.Timeout == 0 {\n\t\tto := t.DefaultTraceOptions().Timeout\n\t\ttimeout = time.After(to)\n\t\tt.Logf(LogDebug, \"Tracer timeout: %v\\n\", to)\n\t} else if traceOptions.Timeout > 0 {\n\t\ttimeout = time.After(traceOptions.Timeout)\n\t\tt.Logf(LogDebug, \"Tracer timeout: %v\\n\", traceOptions.Timeout)\n\t}\n\n\t// We create a new options slice to avoid modifying the base\n\t// set of tracer options just for this particular trace\n\t// invocation.\n\toptions := t.Options()\n\n\t// If the caller has requested a trace with thread-specific options,\n\t// then add the relevant thread specifications to the options list.\n\tif traceOptions.CallerOnly || traceOptions.Faulted {\n\t\truntime.LockOSThread()\n\t\tdefer runtime.UnlockOSThread()\n\n\t\tif tid, err := gettid(); err == nil {\n\t\t\tt.Logf(LogDebug, \"Retrieved tid: %v\\n\", tid)\n\n\t\t\tif traceOptions.CallerOnly {\n\t\t\t\toptions = t.AddThreadFilter(options, tid)\n\t\t\t}\n\n\t\t\tif traceOptions.Faulted {\n\t\t\t\toptions = t.AddFaultedThread(options, tid)\n\t\t\t}\n\t\t} else {\n\t\t\tt.Logf(LogWarning, \"Failed to retrieve tid: %v\\n\", err)\n\t\t}\n\t}\n\n\t// Report caller's goid\n\tvar buf [64]byte\n\tn := runtime.Stack(buf[:], false)\n\tidField := strings.Fields(strings.TrimPrefix(string(buf[:n]), \"goroutine \"))[0]\n\tif goid, err := strconv.Atoi(idField); err == nil {\n\t\tt.Logf(LogDebug, \"Retrieved goid: %v\\n\", goid)\n\t\toptions = t.AddCallerGo(options, goid)\n\t} else {\n\t\tt.Logf(LogWarning, \"Failed to retrieve goid: %v\\n\", err)\n\t}\n\n\tif e != nil {\n\t\toptions = t.AddKV(options, \"error\", e.Error())\n\t\tif traceOptions.ErrClassification {\n\t\t\toptions = t.AddClassifier(options,\n\t\t\t\treflect.TypeOf(e).String())\n\t\t}\n\t}\n\n\tfor _, c := range traceOptions.Classifications {\n\t\toptions = t.AddClassifier(options, c)\n\t}\n\n\tstate.m.RLock()\n\tkfPanic := state.c.PanicOnKillFailure\n\trl := state.c.RateLimit\n\tsynchronousPut := state.c.SynchronousPut\n\tstate.m.RUnlock()\n\n\tselect {\n\tcase <-timeout:\n\t\terr = errors.New(\"Tracer lock acquisition timed out\")\n\t\tt.Logf(LogError, \"%v\\n\", err)\n\n\t\treturn\n\tcase <-traceLock:\n\t\tbreak\n\t}\n\n\t// We now hold the trace lock.\n\t// Allow another tracer to execute (i.e. by re-populating the\n\t// traceLock channel) as long as the current tracer has\n\t// exited.\n\tdefer func() {\n\t\tgo traceUnlockRL(t, rl)\n\t}()\n\n\tdone := make(chan tracerResult, 1)\n\ttracer := t.Finalize(options)\n\n\tif traceOptions.SpawnedGs != nil {\n\t\ttraceOptions.SpawnedGs.Add(1)\n\t}\n\n\tgo func() {\n\t\tif traceOptions.SpawnedGs != nil {\n\t\t\tdefer traceOptions.SpawnedGs.Done()\n\t\t}\n\n\t\tt.Logf(LogDebug, \"Starting tracer %v\\n\", tracer)\n\n\t\tvar res tracerResult\n\n\t\tres.stdOut, res.err = tracer.Output()\n\t\tdone <- res\n\n\t\tt.Logf(LogDebug, \"Tracer finished execution\\n\")\n\t}()\n\n\tt.Logf(LogDebug, \"Waiting for tracer completion...\\n\")\n\n\tvar res tracerResult\n\n\tselect {\n\tcase <-timeout:\n\t\tif err = tracer.Process.Kill(); err != nil {\n\t\t\tt.Logf(LogError,\n\t\t\t\t\"Failed to kill tracer upon timeout: %v\\n\",\n\t\t\t\terr)\n\n\t\t\tif kfPanic {\n\t\t\t\tt.Logf(LogWarning,\n\t\t\t\t\t\"PanicOnKillFailure set; \"+\n\t\t\t\t\t\t\"panicking\\n\")\n\t\t\t\tpanic(err)\n\t\t\t}\n\t\t}\n\n\t\terr = errors.New(\"Tracer execution timed out\")\n\t\tt.Logf(LogError, \"%v; process killed\\n\", err)\n\n\t\treturn\n\tcase res = <-done:\n\t\tbreak\n\t}\n\n\t// Tracer execution has completed by this point.\n\tif res.err != nil {\n\t\tt.Logf(LogError, \"Tracer failed to run: %v\\n\",\n\t\t\tres.err)\n\t\terr = res.err\n\n\t\treturn\n\t}\n\n\tif t.PutOnTrace() == false {\n\t\tt.Logf(LogDebug, \"Trace request complete\\n\")\n\n\t\treturn\n\t}\n\n\tputFn := func() error {\n\t\tt.Logf(LogDebug, \"Uploading snapshot...\")\n\n\t\tif err := t.Put(res.stdOut); err != nil {\n\t\t\tt.Logf(LogError, \"Failed to upload snapshot: %s\",\n\t\t\t\terr)\n\n\t\t\treturn err\n\t\t}\n\n\t\tt.Logf(LogDebug, \"Successfully uploaded snapshot\\n\")\n\n\t\treturn nil\n\t}\n\n\tif synchronousPut {\n\t\terr = putFn()\n\t} else {\n\t\tt.Logf(LogDebug, \"Starting asynchronous put...\\n\")\n\n\t\tif traceOptions.SpawnedGs != nil {\n\t\t\ttraceOptions.SpawnedGs.Add(1)\n\t\t}\n\n\t\tgo func() {\n\t\t\tif traceOptions.SpawnedGs != nil {\n\t\t\t\tdefer traceOptions.SpawnedGs.Done()\n\t\t\t}\n\n\t\t\tputFn()\n\t\t}()\n\t}\n\n\tt.Logf(LogDebug, \"Trace request complete\\n\")\n\n\treturn\n}",
"func RequestTracer(inject Inject) gin.HandlerFunc {\n\treturn func(c *gin.Context) {\n\t\tif opentracing.IsGlobalTracerRegistered() {\n\t\t\treq := c.Request\n\n\t\t\twireContext, err := opentracing.GlobalTracer().Extract(\n\t\t\t\topentracing.HTTPHeaders,\n\t\t\t\topentracing.HTTPHeadersCarrier(req.Header))\n\t\t\tif err != nil && err == opentracing.ErrSpanContextNotFound {\n\t\t\t\t// Log potential tracing errors\n\t\t\t}\n\n\t\t\t// list path parameters and parameter names\n\t\t\tparams := map[string]string{}\n\t\t\tfor _, p := range c.Params {\n\t\t\t\tparams[p.Value] = p.Key\n\t\t\t}\n\n\t\t\t// Create server span or create new root span\n\t\t\tserverSpan, ctx := opentracing.StartSpanFromContext(\n\t\t\t\treq.Context(),\n\t\t\t\tutils.GetResourceName(req, params),\n\t\t\t\text.RPCServerOption(wireContext),\n\t\t\t)\n\n\t\t\t// Ensure that span is finished and return status is added to it\n\t\t\tdefer func() {\n\t\t\t\tdefer serverSpan.Finish()\n\n\t\t\t\text.HTTPStatusCode.Set(serverSpan, uint16(c.Writer.Status()))\n\t\t\t\tif len(c.Errors) > 0 {\n\t\t\t\t\tserverSpan.SetTag(\"server.errors\", c.Errors[0].Error())\n\t\t\t\t\text.Error.Set(serverSpan, true)\n\t\t\t\t}\n\t\t\t}()\n\n\t\t\t// Add tags to span\n\t\t\text.HTTPMethod.Set(serverSpan, req.Method)\n\t\t\text.HTTPUrl.Set(serverSpan, req.URL.Path)\n\t\t\tserverSpan.SetTag(\"span.type\", \"web\")\n\n\t\t\t// Add span to Request object Context\n\t\t\tctx = opentracing.ContextWithSpan(ctx, serverSpan)\n\n\t\t\t// Inject specific handling to spans\n\t\t\tif inject != nil {\n\t\t\t\tctx = inject(ctx, serverSpan)\n\t\t\t}\n\n\t\t\treq = req.WithContext(ctx)\n\n\t\t\t// Add updated context to request\n\t\t\tc.Request = req\n\t\t}\n\t\tc.Next()\n\t}\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
WithRegionGeocodeLevel configures the geocoding level that a Service uses to reversegeocode my current region.
|
func WithRegionGeocodeLevel(l geocode.Level) ServiceOption {
return func(opt *ServiceOptions) { opt.RegionGeocodeLevel = l }
}
|
[
"func (g *Geocoder) ReverseGeocode(ctx context.Context, lat, lng float64) (*GoogleResponse, error) {\n\terr := g.limiter.Wait(ctx)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tur, err := g.buildURL(lat, lng)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tt := time.Now()\n\tresp, err := g.client.Get(ur.String())\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer resp.Body.Close()\n\n\tif g.observer != nil {\n\t\tg.observer.ObserveHTTPRequest(\"google\", time.Since(t))\n\t}\n\n\tvar res *GoogleResponse\n\tif err := json.NewDecoder(resp.Body).Decode(&res); err != nil {\n\t\treturn nil, err\n\t}\n\n\tif res.Status == GRS_OVER_QUERY_LIMIT {\n\t\tg.limiter.SetLimit(rate.Limit(0))\n\t\ttime.Sleep(g.overQuerySleepDuration)\n\t\tg.limiter.SetLimit(rate.Limit(g.rps))\n\t}\n\n\treturn res, nil\n}",
"func (r *requestProcessor) Geocode(address string) (GResponse, error) {\n\t//query url\n\turl := BASE_URL +\n\t\t\"address=\" + url.QueryEscape(address) +\n\t\t\"&language=\" + r.lang +\n\t\t\"&key=\" + r.apiKey\n\n\treturn r.processRequest(url)\n}",
"func ReverseGeocode(id string, code string, lat string, lon string, radius int) (*Base, error) {\n\tprox := []string{lat, lon, strconv.Itoa(radius)}\n\tu, err := url.Parse(baseReverseGeocodeURL)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tq := u.Query()\n\tq.Set(\"prox\", strings.Join(prox, \",\"))\n\tq.Set(\"mode\", \"retrieveAddresses\")\n\tu.RawQuery = q.Encode()\n\n\tres, err := http.Get(u.String())\n\tif err != nil {\n\t\tfmt.Println(\"Hi I'm Get error\", err)\n\t\treturn nil, err\n\t}\n\n\tvar result Base\n\tif err := json.NewDecoder(res.Body).Decode(&result); err != nil {\n\t\tres.Body.Close()\n\t\tfmt.Println(\"Error: \", err)\n\t\treturn nil, err\n\t}\n\n\tres.Body.Close()\n\t// TODO: Handle parsing of JSON and only return the address.\n\treturn &result, err\n}",
"func WithRegionName(region string) Option {\n\treturn func(c *Client) error {\n\t\tc.regionName = region\n\t\treturn nil\n\t}\n}",
"func (r *ExtremalRegion) Level() int { return r.level }",
"func WithRegion(ctx context.Context, regionType string, fn func()) {}",
"func (repo *MongoRepository) UpdateRegion(e *geoModel.Region) error {\n\ts := repo.Session.Copy()\n\tdefer s.Close()\n\n\tcol := s.DB(repo.db).C(string(e.Type))\n\terr := col.Update(bson.M{\"geo_id\": e.GeoID}, e)\n\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to update region. %w\", err)\n\t}\n\n\treturn nil\n}",
"func (oci *OCI) ChangeRegion(regionName string) (err error) {\n\n\ti, err := oci.NewIdentityClient()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\terr = i.IsRegionAvailable(regionName)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\ttenancyOCID, _ := oci.config.TenancyOCID()\n\tuserOCID, _ := oci.config.UserOCID()\n\tkeyFingerprint, _ := oci.config.KeyFingerprint()\n\tprivateRSAKey, _ := oci.config.PrivateRSAKey()\n\n\tvar privateKey = &pem.Block{\n\t\tType: \"PRIVATE KEY\",\n\t\tBytes: x509.MarshalPKCS1PrivateKey(privateRSAKey),\n\t}\n\n\tprivateKeyPEM := pem.EncodeToMemory(privateKey)\n\n\tconfig := common.NewRawConfigurationProvider(tenancyOCID, userOCID, regionName, keyFingerprint, string(privateKeyPEM), nil)\n\toci.config = config\n\n\treturn\n}",
"func (rb *TrainedModelConfigBuilder) LicenseLevel(licenselevel string) *TrainedModelConfigBuilder {\n\trb.v.LicenseLevel = &licenselevel\n\treturn rb\n}",
"func WithRegion(region string) ClientOption {\n\treturn func(c *Client) error {\n\t\tc.Region = region\n\t\treturn nil\n\t}\n}",
"func (repo *MongoRepository) UpdateGeoRegion(r *geoModel.GeoRegion) error {\n\ts := repo.Session.Copy()\n\tdefer s.Close()\n\n\tcol := s.DB(repo.db).C(repo.geoCoordinatesTable)\n\terr := col.Update(bson.M{\"geo_id\": r.GeoID}, r)\n\n\tif err != nil {\n\t\treturn fmt.Errorf(\"failed to update geo region. %w\", err)\n\t}\n\n\treturn nil\n}",
"func NewReverseGeocodingClient(httpClient *http.Client, appID string, appCode string) *Client {\n\tbase := sling.New().Client(httpClient).Base(\"https://reverse.geocoder.api.here.com/6.2/\")\n\treturn &Client{\n\t\tsling: base,\n\t\tReverseGeocoding: newReverseGeocodingService(base.New(), appID, appCode),\n\t}\n}",
"func (o *DirectLink) SetRegionName(v string) {\n\to.RegionName = &v\n}",
"func GenerateRegionMapWithRoutes(seed int64, regionMap RegionMap) (RegionMap, error) {\n\trand.Seed(seed)\n\tcityClusters, err := clusterCities(regionMap.Cities)\n\tif err != nil {\n\t\treturn RegionMap{}, err\n\t}\n\troutes := generateRoutes(cityClusters)\n\tregionMap.Routes = routes\n\treturn regionMap, nil\n}",
"func (o *GetAllZonesUsingGETParams) SetRegionName(regionName string) {\n\to.RegionName = regionName\n}",
"func (o *CityMetric) SetSubregion(v string) {\n\to.Subregion = &v\n}",
"func (o GetRulesRuleBindVpcOutput) RegionName() pulumi.StringOutput {\n\treturn o.ApplyT(func(v GetRulesRuleBindVpc) string { return v.RegionName }).(pulumi.StringOutput)\n}",
"func WithDeflateLevel(level int) OptionFunc {\n\treturn func(cfg *Config) error {\n\t\tif level < -2 || level > 9 {\n\t\t\treturn errors.New(\"provided deflate level value not in the [-2, 9] range\")\n\t\t}\n\n\t\tcfg.deflateLevel = level\n\t\treturn nil\n\t}\n}",
"func WithCompressionLevel(level int) LayerOption {\n\treturn func(l *layer) {\n\t\tl.compressionLevel = level\n\t}\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
ExecuteHealthCheckFunctions executes all the health check functions, injects clients and logger & aggregates the results. returns an Result for each HealthConditionType (e.g ControlPlaneHealthy)
|
func (a *Actuator) ExecuteHealthCheckFunctions(ctx context.Context, request types.NamespacedName) (*[]Result, error) {
var (
shootClient client.Client
channel = make(chan channelResult)
wg sync.WaitGroup
)
wg.Add(len(a.healthChecks))
for _, hc := range a.healthChecks {
// clone to avoid problems during parallel execution
check := hc.HealthCheck.DeepCopy()
SeedClientInto(a.seedClient, check)
if _, ok := check.(ShootClient); ok {
if shootClient == nil {
var err error
_, shootClient, err = util.NewClientForShoot(ctx, a.seedClient, request.Namespace, client.Options{})
if err != nil {
msg := fmt.Errorf("failed to create shoot client in namespace '%s': %v", request.Namespace, err)
a.logger.Error(err, msg.Error())
return nil, msg
}
}
ShootClientInto(shootClient, check)
}
check.SetLoggerSuffix(a.provider, a.extensionKind)
go func(ctx context.Context, request types.NamespacedName, check HealthCheck, preCheckFunc PreCheckFunc, healthConditionType string) {
defer wg.Done()
if preCheckFunc != nil {
obj := a.getExtensionObjFunc()
if err := a.seedClient.Get(ctx, client.ObjectKey{Namespace: request.Namespace, Name: request.Name}, obj); err != nil {
channel <- channelResult{
healthCheckResult: &SingleCheckResult{
Status: gardencorev1beta1.ConditionFalse,
Detail: err.Error(),
Reason: "ReadExtensionObjectFailed",
},
error: err,
healthConditionType: healthConditionType,
}
return
}
cluster, err := extensionscontroller.GetCluster(ctx, a.seedClient, request.Namespace)
if err != nil {
channel <- channelResult{
healthCheckResult: &SingleCheckResult{
Status: gardencorev1beta1.ConditionFalse,
Detail: err.Error(),
Reason: "ReadClusterObjectFailed",
},
error: err,
healthConditionType: healthConditionType,
}
return
}
if !preCheckFunc(obj, cluster) {
a.logger.V(6).Info("Skipping health check as pre check function returned false", "condition type", healthConditionType)
channel <- channelResult{
healthCheckResult: &SingleCheckResult{
Status: gardencorev1beta1.ConditionTrue,
},
error: nil,
healthConditionType: healthConditionType,
}
return
}
}
healthCheckResult, err := check.Check(ctx, request)
channel <- channelResult{
healthCheckResult: healthCheckResult,
error: err,
healthConditionType: healthConditionType,
}
}(ctx, request, check, hc.PreCheckFunc, hc.ConditionType)
}
// close channel when wait group has 0 counter
go func() {
wg.Wait()
close(channel)
}()
groupedHealthCheckResults := make(map[string]*checkResultForConditionType)
// loop runs until channel is closed
for channelResult := range channel {
if groupedHealthCheckResults[channelResult.healthConditionType] == nil {
groupedHealthCheckResults[channelResult.healthConditionType] = &checkResultForConditionType{}
}
if channelResult.error != nil {
groupedHealthCheckResults[channelResult.healthConditionType].failedChecks = append(groupedHealthCheckResults[channelResult.healthConditionType].failedChecks, channelResult.error)
continue
}
if channelResult.healthCheckResult.Status == gardencorev1beta1.ConditionFalse {
groupedHealthCheckResults[channelResult.healthConditionType].unsuccessfulChecks = append(groupedHealthCheckResults[channelResult.healthConditionType].unsuccessfulChecks, healthCheckUnsuccessful{reason: channelResult.healthCheckResult.Reason, detail: channelResult.healthCheckResult.Detail})
groupedHealthCheckResults[channelResult.healthConditionType].codes = append(groupedHealthCheckResults[channelResult.healthConditionType].codes, channelResult.healthCheckResult.Codes...)
continue
}
if channelResult.healthCheckResult.Status == gardencorev1beta1.ConditionProgressing {
groupedHealthCheckResults[channelResult.healthConditionType].progressingChecks = append(groupedHealthCheckResults[channelResult.healthConditionType].progressingChecks, healthCheckProgressing{reason: channelResult.healthCheckResult.Reason, detail: channelResult.healthCheckResult.Detail, threshold: channelResult.healthCheckResult.ProgressingThreshold})
groupedHealthCheckResults[channelResult.healthConditionType].codes = append(groupedHealthCheckResults[channelResult.healthConditionType].codes, channelResult.healthCheckResult.Codes...)
continue
}
groupedHealthCheckResults[channelResult.healthConditionType].successfulChecks++
}
var checkResults []Result
for conditionType, result := range groupedHealthCheckResults {
if len(result.unsuccessfulChecks) > 0 || len(result.failedChecks) > 0 {
var details strings.Builder
if len(result.unsuccessfulChecks) > 0 {
details.WriteString("Unsuccessful checks: ")
}
for index, check := range result.unsuccessfulChecks {
details.WriteString(fmt.Sprintf("%d) %s: %s. ", index+1, check.reason, check.detail))
}
if len(result.progressingChecks) > 0 {
details.WriteString("Progressing checks: ")
}
for index, check := range result.progressingChecks {
details.WriteString(fmt.Sprintf("%d) %s: %s. ", index+1, check.reason, check.detail))
}
if len(result.failedChecks) > 0 {
details.WriteString("Failed checks: ")
}
for index, err := range result.failedChecks {
details.WriteString(fmt.Sprintf("%d) %s. ", index+1, err.Error()))
}
checkResults = append(checkResults, Result{
HealthConditionType: conditionType,
Status: gardencorev1beta1.ConditionFalse,
Detail: pointer.StringPtr(details.String()),
SuccessfulChecks: result.successfulChecks,
UnsuccessfulChecks: len(result.unsuccessfulChecks),
FailedChecks: len(result.failedChecks),
Codes: result.codes,
})
continue
}
if len(result.progressingChecks) > 0 {
var (
details strings.Builder
threshold *time.Duration
)
details.WriteString("Progressing checks: ")
for index, check := range result.progressingChecks {
details.WriteString(fmt.Sprintf("%d) %s: %s. ", index+1, check.reason, check.detail))
if check.threshold != nil && (threshold == nil || *threshold > *check.threshold) {
threshold = check.threshold
}
}
checkResults = append(checkResults, Result{
HealthConditionType: conditionType,
Status: gardencorev1beta1.ConditionProgressing,
ProgressingThreshold: threshold,
Detail: pointer.StringPtr(details.String()),
SuccessfulChecks: result.successfulChecks,
ProgressingChecks: len(result.progressingChecks),
Codes: result.codes,
})
continue
}
checkResults = append(checkResults, Result{
HealthConditionType: conditionType,
Status: gardencorev1beta1.ConditionTrue,
SuccessfulChecks: result.successfulChecks,
})
}
return &checkResults, nil
}
|
[
"func (c grpcHealthcheck) Execute() (details interface{}, err error) {\n\tc.log.Debug().Msg(\"Running check...\")\n\tctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)\n\tdefer cancel()\n\treturn c.client.Healthcheck(ctx, &empty.Empty{})\n}",
"func (e *Environment) HealthCheck(ctx context.Context) error {\n\n\tconst banner = \"Running a quick health check on services\"\n\tlog.Info(banner)\n\n\tvar i int\n\tvar l int\n\tvar err error\n\tvar health_waiter sync.WaitGroup\n\tfor _, service := range e.Config.Services {\n\t\tif service.HealthEndpoint != \"\" {\n\t\t\tl += 1\n\t\t\thealth_waiter.Add(1)\n\t\t\tgo func(service *nhost.Service) {\n\n\t\t\t\tfor counter := 1; counter <= 240; counter++ {\n\t\t\t\t\tselect {\n\t\t\t\t\tcase <-ctx.Done():\n\t\t\t\t\t\tlog.WithFields(logrus.Fields{\n\t\t\t\t\t\t\t\"type\": \"service\",\n\t\t\t\t\t\t\t\"container\": service.Name,\n\t\t\t\t\t\t}).Debug(\"Health check cancelled\")\n\t\t\t\t\t\treturn\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tif healthy := service.Healthz(); healthy {\n\t\t\t\t\t\t\tif !logger.DEBUG {\n\t\t\t\t\t\t\t\ti += 1\n\t\t\t\t\t\t\t\tfmt.Printf(\"\\rComplete: (%d/%d)\", i, l)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tlog.WithFields(logrus.Fields{\n\t\t\t\t\t\t\t\t\"type\": \"service\",\n\t\t\t\t\t\t\t\t\"container\": service.Name,\n\t\t\t\t\t\t\t}).Debug(\"Health check successful\")\n\n\t\t\t\t\t\t\t// Activate the service\n\t\t\t\t\t\t\tservice.Activate()\n\n\t\t\t\t\t\t\thealth_waiter.Done()\n\n\t\t\t\t\t\t\treturn\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttime.Sleep(1 * time.Second)\n\t\t\t\t\t\tlog.WithFields(logrus.Fields{\n\t\t\t\t\t\t\t\"type\": \"container\",\n\t\t\t\t\t\t\t\"component\": service.Name,\n\t\t\t\t\t\t}).Debugf(\"Health check attempt #%v unsuccessful\", counter)\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tlog.WithFields(logrus.Fields{\n\t\t\t\t\t\"type\": \"service\",\n\t\t\t\t\t\"container\": service.Name,\n\t\t\t\t}).Error(\"Health check failed\")\n\t\t\t\terr = errors.New(\"health check of at least 1 service has failed\")\n\n\t\t\t}(service)\n\t\t} else {\n\n\t\t\t//\n\t\t\t//\tIf any service doesn't have a health check endpoint,\n\t\t\t//\tthen, by default, declare it active.\n\t\t\t//\n\t\t\t//\tThis is being done to prevent the enviroment from failing activation checks.\n\t\t\t//\tBecause we are not performing health checks on postgres and mailhog,\n\t\t\t//\tthey end up making the entire environment fail activation check.\n\t\t\tservice.Active = true\n\t\t}\n\t}\n\n\t// wait for all healthchecks to pass\n\thealth_waiter.Wait()\n\tif !logger.DEBUG {\n\t\tfmt.Printf(\"\\r\")\n\t}\n\treturn err\n}",
"func (s *StandardEndpoints) SetHealthCheckFuncs(interval time.Duration, healthchecks ...HealthCheckFunc) {\n\ts.locker.Lock()\n\tdefer s.locker.Unlock()\n\ts.healthChecks = healthchecks\n\tif s.healthCheckTimer != nil {\n\t\ts.healthCheckTimer.Stop()\n\t}\n\n\t// stop any existing timers first, so you could pass in an empty array to stop it..\n\tif len(healthchecks) == 0 {\n\t\treturn\n\t}\n\n\t// fire right away, then adjust to interval\n\ts.healthCheckTimer = time.AfterFunc(1, func() {\n\t\treport := HealthCheckReport{}\n\t\tstart := time.Now()\n\n\t\tvar results []HealthCheckResult\n\t\tfor _, chk := range healthchecks {\n\t\t\tresults = append(results, chk())\n\t\t}\n\t\treport.Results = results\n\t\treport.Duration = ReportDuration(time.Since(start))\n\t\treport.Timestamp = time.Now().UTC()\n\n\t\ts.locker.Lock()\n\t\tdefer s.locker.Unlock()\n\t\ts.healthReport = report\n\t\ts.healthCheckTimer.Reset(interval)\n\t})\n}",
"func Healthchecks(argv []string, cmdr cmd.Commander) error {\n\tusage := executable.Render(`\nValid commands for healthchecks:\n\nhealthchecks:list list healthchecks for an app\nhealthchecks:set set healthchecks for an app\nhealthchecks:unset unset healthchecks for an app\n\nUse '{{.Name}} help [command]' to learn more.\n`)\n\n\tswitch argv[0] {\n\tcase \"healthchecks:list\":\n\t\treturn healthchecksList(argv, cmdr)\n\tcase \"healthchecks:set\":\n\t\treturn healthchecksSet(argv, cmdr)\n\tcase \"healthchecks:unset\":\n\t\treturn healthchecksUnset(argv, cmdr)\n\tdefault:\n\t\tif printHelp(argv, usage) {\n\t\t\treturn nil\n\t\t}\n\n\t\tif argv[0] == \"healthchecks\" {\n\t\t\targv[0] = \"healthchecks:list\"\n\t\t\treturn healthchecksList(argv, cmdr)\n\t\t}\n\n\t\tPrintUsage(cmdr)\n\t\treturn nil\n\t}\n}",
"func (sw *SdkWrapper) CreateHealthChecks(project string, healthCheck *compute.HealthCheck) error {\n\tblog.V(3).Infof(\"CreateHealthChecks input: project/%s, healthCheck/%v\", project, healthCheck)\n\n\tstartTime := time.Now()\n\n\tmf := func(ret string) {\n\t\tmetrics.ReportLibRequestMetric(\n\t\t\tSystemNameInMetric,\n\t\t\tHandlerNameInMetricSDK,\n\t\t\t\"CreateHealthChecks\", ret, startTime)\n\t}\n\tsw.tryThrottle()\n\n\tresp, err := sw.computeService.HealthChecks.Insert(project, healthCheck).Do()\n\tif err != nil {\n\t\tmf(metrics.LibCallStatusErr)\n\t\terrMsg := fmt.Sprintf(\"CreateHealthChecks failed, err %s\", err.Error())\n\t\tblog.Errorf(errMsg)\n\t\treturn fmt.Errorf(errMsg)\n\t}\n\t// add default timeout to rpc call\n\tctx, cancel := context.WithTimeout(context.Background(), defaultTimeout)\n\tdefer cancel()\n\tif inErr := sw.Wait(ctx, project, resp); inErr != nil {\n\t\tmf(metrics.LibCallStatusTimeout)\n\t\terrMsg := fmt.Sprintf(\"CreateHealthChecks failed, err %s\", inErr.Error())\n\t\tblog.Errorf(errMsg)\n\t\treturn fmt.Errorf(errMsg)\n\t}\n\n\tblog.V(3).Infof(\"CreateHealthChecks response: %s\", common.ToJsonString(resp))\n\tmf(metrics.LibCallStatusOK)\n\treturn nil\n}",
"func (hm *HostMonitor) RunMonitoringChecks(settings *evergreen.Settings) []error {\n\tgrip.Info(\"Running host monitoring checks...\")\n\n\t// used to store any errors that occur\n\tvar errors []error\n\n\tfor _, f := range hm.monitoringFuncs {\n\n\t\t// continue on error to allow the other monitoring functions to run\n\t\tif errs := f(settings); errs != nil {\n\t\t\terrors = append(errors, errs...)\n\t\t}\n\t}\n\n\tgrip.Info(\"Finished running host monitoring checks\")\n\n\treturn errors\n\n}",
"func (sw *SdkWrapper) CreateHealthChecks(project string, healthCheck *compute.HealthCheck) error {\n\tblog.V(3).Infof(\"CreateHealthChecks input: project/%s, healthCheck/%v\", project, healthCheck)\n\n\tstartTime := time.Now()\n\n\tmf := func(ret string) {\n\t\tmetrics.ReportLibRequestMetric(\n\t\t\tSystemNameInMetric,\n\t\t\tHandlerNameInMetricSDK,\n\t\t\t\"CreateHealthChecks\", ret, startTime)\n\t}\n\tsw.tryThrottle()\n\n\tresp, err := sw.computeService.HealthChecks.Insert(project, healthCheck).Do()\n\tif err != nil {\n\t\tmf(metrics.LibCallStatusErr)\n\t\terrMsg := fmt.Sprintf(\"CreateHealthChecks failed, err %s\", err.Error())\n\t\tblog.Errorf(errMsg)\n\t\treturn fmt.Errorf(errMsg)\n\t}\n\tctx, cancel := context.WithTimeout(context.Background(), defaultTimeout)\n\tdefer cancel()\n\tif err := sw.Wait(ctx, project, resp); err != nil {\n\t\tmf(metrics.LibCallStatusTimeout)\n\t\terrMsg := fmt.Sprintf(\"CreateHealthChecks failed, err %s\", err.Error())\n\t\tblog.Errorf(errMsg)\n\t\treturn fmt.Errorf(errMsg)\n\t}\n\n\tblog.V(3).Infof(\"CreateHealthChecks response: %s\", common.ToJsonString(resp))\n\tmf(metrics.LibCallStatusOK)\n\treturn nil\n}",
"func HealthHandler() http.HandlerFunc {\n\treturn func(w http.ResponseWriter, _ *http.Request) {\n\t\tvar errors []string\n\t\tvar warnings []string\n\t\tfor name, res := range checksResults(&requiredChecks) {\n\t\t\tif res.State == Err {\n\t\t\t\terrors = append(errors, fmt.Sprintf(\"%s: %s\", name, res.Msg))\n\t\t\t} else if res.State == Warn {\n\t\t\t\twarnings = append(warnings, fmt.Sprintf(\"%s: %s\", name, res.Msg))\n\t\t\t}\n\t\t}\n\t\tif len(errors) > 0 {\n\t\t\tlog.Logger().Info().Strs(\"errors\", errors).Strs(\"warnings\", warnings).Msg(\"Health check failed\")\n\t\t\tmsg := fmt.Sprintf(\"ERR: %d errors and %d warnings\", len(errors), len(warnings))\n\t\t\twriteResult(w, http.StatusServiceUnavailable, msg)\n\t\t\treturn\n\t\t}\n\t\twriteResult(w, http.StatusOK, string(Ok))\n\t}\n}",
"func (sw *SdkWrapper) UpdateHealthChecks(project string, healthCheck *compute.HealthCheck) error {\n\tblog.V(3).Infof(\"UpdateHealthChecks input: project/%s, healthCheck/%v\", project, healthCheck)\n\n\tstartTime := time.Now()\n\n\tmf := func(ret string) {\n\t\tmetrics.ReportLibRequestMetric(\n\t\t\tSystemNameInMetric,\n\t\t\tHandlerNameInMetricSDK,\n\t\t\t\"UpdateHealthChecks\", ret, startTime)\n\t}\n\tsw.tryThrottle()\n\n\tresp, err := sw.computeService.HealthChecks.Update(project, healthCheck.Name, healthCheck).Do()\n\tif err != nil {\n\t\tmf(metrics.LibCallStatusErr)\n\t\terrMsg := fmt.Sprintf(\"UpdateHealthChecks failed, err %s\", err.Error())\n\t\tblog.Errorf(errMsg)\n\t\treturn fmt.Errorf(errMsg)\n\t}\n\t// add default timeout to rpc call\n\tctx, cancel := context.WithTimeout(context.Background(), defaultTimeout)\n\tdefer cancel()\n\tif inErr := sw.Wait(ctx, project, resp); inErr != nil {\n\t\tmf(metrics.LibCallStatusTimeout)\n\t\terrMsg := fmt.Sprintf(\"UpdateHealthChecks failed, err %s\", inErr.Error())\n\t\tblog.Errorf(errMsg)\n\t\treturn fmt.Errorf(errMsg)\n\t}\n\n\tblog.V(3).Infof(\"UpdateHealthChecks response: %s\", common.ToJsonString(resp))\n\tmf(metrics.LibCallStatusOK)\n\treturn nil\n}",
"func (g *GCEHttpHealthChecks) List(ctx context.Context, fl *filter.F) ([]*ga.HttpHealthCheck, error) {\n\tklog.V(5).Infof(\"GCEHttpHealthChecks.List(%v, %v) called\", ctx, fl)\n\tprojectID := g.s.ProjectRouter.ProjectID(ctx, \"ga\", \"HttpHealthChecks\")\n\trk := &RateLimitKey{\n\t\tProjectID: projectID,\n\t\tOperation: \"List\",\n\t\tVersion: meta.Version(\"ga\"),\n\t\tService: \"HttpHealthChecks\",\n\t}\n\tif err := g.s.RateLimiter.Accept(ctx, rk); err != nil {\n\t\treturn nil, err\n\t}\n\tklog.V(5).Infof(\"GCEHttpHealthChecks.List(%v, %v): projectID = %v, rk = %+v\", ctx, fl, projectID, rk)\n\tcall := g.s.GA.HttpHealthChecks.List(projectID)\n\tif fl != filter.None {\n\t\tcall.Filter(fl.String())\n\t}\n\tvar all []*ga.HttpHealthCheck\n\tf := func(l *ga.HttpHealthCheckList) error {\n\t\tklog.V(5).Infof(\"GCEHttpHealthChecks.List(%v, ..., %v): page %+v\", ctx, fl, l)\n\t\tall = append(all, l.Items...)\n\t\treturn nil\n\t}\n\tif err := call.Pages(ctx, f); err != nil {\n\t\tklog.V(4).Infof(\"GCEHttpHealthChecks.List(%v, ..., %v) = %v, %v\", ctx, fl, nil, err)\n\t\treturn nil, err\n\t}\n\n\tif klog.V(4).Enabled() {\n\t\tklog.V(4).Infof(\"GCEHttpHealthChecks.List(%v, ..., %v) = [%v items], %v\", ctx, fl, len(all), nil)\n\t} else if klog.V(5).Enabled() {\n\t\tvar asStr []string\n\t\tfor _, o := range all {\n\t\t\tasStr = append(asStr, fmt.Sprintf(\"%+v\", o))\n\t\t}\n\t\tklog.V(5).Infof(\"GCEHttpHealthChecks.List(%v, ..., %v) = %v, %v\", ctx, fl, asStr, nil)\n\t}\n\n\treturn all, nil\n}",
"func (h *HealthManager) performHealthChecks() bool {\n\tnumWorkers := int(atomic.LoadUint32(&h.concurrencyLimit))\n\tchecker := h.checker.Load().(health_checker.HealthChecker)\n\n\th.countLock.RLock()\n\tdefer h.countLock.RUnlock()\n\n\tchanged := uint32(0) // indicates change at least in single HostPort entry.\n\terr := concurrency.CompleteTasks(\n\t\th.ctx,\n\t\tnumWorkers,\n\t\tlen(h.state),\n\t\tfunc(numWorker int, numTask int) {\n\t\t\tcheckStatus := true\n\t\t\tenabled := h.state[numTask].Enabled\n\t\t\t// 1. perform check.\n\t\t\tif enabled {\n\t\t\t\terr := checker.Check(\n\t\t\t\t\th.state[numTask].HostPort.Address,\n\t\t\t\t\th.state[numTask].HostPort.Port)\n\t\t\t\tif err != nil {\n\t\t\t\t\tcheckStatus = false\n\t\t\t\t\t// report about the issue.\n\t\t\t\t\texclog.Report(\n\t\t\t\t\t\terrors.Wrapf(\n\t\t\t\t\t\t\terr,\n\t\t\t\t\t\t\t\"%s health manager failed to check %s entry: \",\n\t\t\t\t\t\t\th.params.Id,\n\t\t\t\t\t\t\th.state[numTask].HostPort.String()),\n\t\t\t\t\t\texclog.Operational, \"\")\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// do not run healthcheck (report host as down unconditionally) if host is marked\n\t\t\t\t// as disabled by Discovery service\n\t\t\t\tcheckStatus = false\n\t\t\t}\n\t\t\t// 2. update status.\n\t\t\tif h.state[numTask].Status.UpdateHealthCheckStatus(checkStatus, h.riseCount, h.fallCount) {\n\t\t\t\tdlog.Infof(\n\t\t\t\t\t\"%s health manager updated %s entry status to %v\",\n\t\t\t\t\th.params.Id,\n\t\t\t\t\th.state[numTask].HostPort,\n\t\t\t\t\th.state[numTask].Status.IsHealthy())\n\t\t\t\tatomic.StoreUint32(&changed, 1)\n\t\t\t}\n\t\t\t// 3. update realserver health status stats\n\t\t\tif checkStatus {\n\t\t\t\th.increasePassCounter(h.state[numTask].HostPort.Host)\n\t\t\t} else if enabled {\n\t\t\t\th.increaseFailCounter(h.state[numTask].HostPort.Host)\n\t\t\t}\n\t\t})\n\t//TODO(oleg) emit stats\n\tif err != nil {\n\t\texclog.Report(err, exclog.Operational, \"\")\n\t}\n\treturn atomic.LoadUint32(&changed) == 1\n}",
"func (sw *SdkWrapper) UpdateHealthChecks(project string, healthCheck *compute.HealthCheck) error {\n\tblog.V(3).Infof(\"UpdateHealthChecks input: project/%s, healthCheck/%v\", project, healthCheck)\n\n\tstartTime := time.Now()\n\n\tmf := func(ret string) {\n\t\tmetrics.ReportLibRequestMetric(\n\t\t\tSystemNameInMetric,\n\t\t\tHandlerNameInMetricSDK,\n\t\t\t\"UpdateHealthChecks\", ret, startTime)\n\t}\n\tsw.tryThrottle()\n\n\tresp, err := sw.computeService.HealthChecks.Update(project, healthCheck.Name, healthCheck).Do()\n\tif err != nil {\n\t\tmf(metrics.LibCallStatusErr)\n\t\terrMsg := fmt.Sprintf(\"UpdateHealthChecks failed, err %s\", err.Error())\n\t\tblog.Errorf(errMsg)\n\t\treturn fmt.Errorf(errMsg)\n\t}\n\tctx, cancel := context.WithTimeout(context.Background(), defaultTimeout)\n\tdefer cancel()\n\tif err := sw.Wait(ctx, project, resp); err != nil {\n\t\tmf(metrics.LibCallStatusTimeout)\n\t\terrMsg := fmt.Sprintf(\"UpdateHealthChecks failed, err %s\", err.Error())\n\t\tblog.Errorf(errMsg)\n\t\treturn fmt.Errorf(errMsg)\n\t}\n\n\tblog.V(3).Infof(\"UpdateHealthChecks response: %s\", common.ToJsonString(resp))\n\tmf(metrics.LibCallStatusOK)\n\treturn nil\n}",
"func (sw *SdkWrapper) GetHealthChecks(project, name string) (*compute.HealthCheck, error) {\n\tblog.V(3).Infof(\"GetHealthChecks input: project/%s, name/%s\", project, name)\n\n\tstartTime := time.Now()\n\n\tmf := func(ret string) {\n\t\tmetrics.ReportLibRequestMetric(\n\t\t\tSystemNameInMetric,\n\t\t\tHandlerNameInMetricSDK,\n\t\t\t\"GetHealthChecks\", ret, startTime)\n\t}\n\tsw.tryThrottle()\n\n\thc, err := sw.computeService.HealthChecks.Get(project, name).Do()\n\tif err != nil {\n\t\tmf(metrics.LibCallStatusErr)\n\t\terrMsg := fmt.Sprintf(\"GetHealthChecks failed, err %s\", err.Error())\n\t\tblog.Errorf(errMsg)\n\t\treturn nil, err\n\t}\n\tblog.V(3).Infof(\"GetHealthChecks response: %s\", common.ToJsonString(hc))\n\tmf(metrics.LibCallStatusOK)\n\treturn hc, nil\n}",
"func CheckHealth(checkers map[string]Checker) (map[string]error, bool) {\n\tcomponents := make(map[string]error, len(checkers))\n\thealthy := true\n\tfor name, hc := range checkers {\n\t\tif err := hc.HealthCheck(); err != nil {\n\t\t\thealthy = false\n\t\t\tcomponents[name] = err\n\t\t}\n\t}\n\treturn components, healthy\n}",
"func (a AuthorizationPolicyChecker) runChecks(authPolicy security_v1beta.AuthorizationPolicy) models.IstioValidations {\n\tpolicyName := authPolicy.Name\n\tkey, rrValidation := EmptyValidValidation(policyName, authPolicy.Namespace, AuthorizationPolicyCheckerType)\n\tserviceHosts := kubernetes.ServiceEntryHostnames(append(a.ServiceEntries, a.ExportedServiceEntries...))\n\tmatchLabels := make(map[string]string)\n\tif authPolicy.Spec.Selector != nil {\n\t\tmatchLabels = authPolicy.Spec.Selector.MatchLabels\n\t}\n\tenabledCheckers := []Checker{\n\t\tcommon.SelectorNoWorkloadFoundChecker(AuthorizationPolicyCheckerType, matchLabels, a.WorkloadList),\n\t\tauthorization.NamespaceMethodChecker{AuthorizationPolicy: authPolicy, Namespaces: a.Namespaces.GetNames()},\n\t\tauthorization.NoHostChecker{AuthorizationPolicy: authPolicy, Namespace: a.Namespace, Namespaces: a.Namespaces,\n\t\t\tServiceEntries: serviceHosts, ServiceList: a.ServiceList, VirtualServices: a.VirtualServices, RegistryServices: a.RegistryServices},\n\t}\n\n\tfor _, checker := range enabledCheckers {\n\t\tchecks, validChecker := checker.Check()\n\t\trrValidation.Checks = append(rrValidation.Checks, checks...)\n\t\trrValidation.Valid = rrValidation.Valid && validChecker\n\t}\n\n\treturn models.IstioValidations{key: rrValidation}\n}",
"func PerformHealthCheck(params []string) (string, error) {\n\tcli, err := client.NewClientWithOpts(client.FromEnv, client.WithAPIVersionNegotiation())\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tvar filter filters.Args\n\tvar containers []types.Container\n\tmsg := \"\"\n\t// checks two cases: passed in container ids or none\n\tif len(params[0]) > 0 {\n\t\t// specified container given in the parameter\n\t\tfilter = filters.NewArgs()\n\t\tcontainers, err = cli.ContainerList(ctx, types.ContainerListOptions{Filters: filter})\n\t\tif err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t\tfor _, container := range containers {\n\t\t\t// check if container is running on a port\n\t\t\tif len(container.Ports) > 0 {\n\t\t\t\tport := strconv.FormatUint(uint64(container.Ports[0].PublicPort), 10)\n\t\t\t\tkillContainer(container.ID[:10])\n\t\t\t\tcreateContainer(container.Image, container.Ports[0].IP, port)\n\t\t\t\tmsg += \"Successfully added health checks to the following container: \" + container.ID\n\t\t\t} else {\n\t\t\t\tmsg += \"The following container did not have a published port\" + container.ID\n\t\t\t}\n\t\t}\n\t\treturn msg, nil\n\t}\n\t// no containers specified so find the containers running through Docker API\n\tcontainers, err = cli.ContainerList(ctx, types.ContainerListOptions{})\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\tif len(containers) == 0 {\n\t\treturn \"\", errors.New(\"No running container detected\")\n\t}\n\tfor _, container := range containers {\n\t\t// check if container is running on a port\n\t\tif len(container.Ports) > 0 {\n\t\t\tport := strconv.FormatUint(uint64(container.Ports[0].PublicPort), 10)\n\t\t\tkillContainer(container.ID[:10])\n\t\t\tcreateContainer(container.Image, container.Ports[0].IP, port)\n\t\t\tmsg += \"Successfully added health checks to the following container: \" + container.Image\n\t\t} else {\n\t\t\tmsg += \"The following container did not have a published port\" + container.ID\n\t\t}\n\t}\n\treturn msg, nil\n}",
"func (s *computeHTTPHealthCheckLister) ComputeHTTPHealthChecks(namespace string) ComputeHTTPHealthCheckNamespaceLister {\n\treturn computeHTTPHealthCheckNamespaceLister{indexer: s.indexer, namespace: namespace}\n}",
"func performClusterHealthCheck(c client.Client, metricsClient metrics.Metrics, logger logr.Logger) (bool, error) {\n\talerts, err := metricsClient.Query(\"ALERTS{alertstate=\\\"firing\\\",severity=\\\"critical\\\",namespace=~\\\"^openshift.*|^kube.*|^default$\\\",namespace!=\\\"openshift-customer-monitoring\\\",alertname!=\\\"ClusterUpgradingSRE\\\",alertname!=\\\"DNSErrors05MinSRE\\\",alertname!=\\\"MetricsClientSendFailingSRE\\\"}\")\n\tif err != nil {\n\t\treturn false, fmt.Errorf(\"Unable to query critical alerts: %s\", err)\n\t}\n\n\tif len(alerts.Data.Result) > 0 {\n\t\tlogger.Info(\"There are critical alerts exists, cannot upgrade now\")\n\t\treturn false, fmt.Errorf(\"There are %d critical alerts\", len(alerts.Data.Result))\n\t}\n\n\t//check co status\n\n\toperatorList := &configv1.ClusterOperatorList{}\n\terr = c.List(context.TODO(), operatorList, []client.ListOption{}...)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\n\tdegradedOperators := []string{}\n\tfor _, co := range operatorList.Items {\n\t\tfor _, condition := range co.Status.Conditions {\n\t\t\tif (condition.Type == configv1.OperatorDegraded && condition.Status == configv1.ConditionTrue) || (condition.Type == configv1.OperatorAvailable && condition.Status == configv1.ConditionFalse) {\n\t\t\t\tdegradedOperators = append(degradedOperators, co.Name)\n\t\t\t}\n\t\t}\n\t}\n\n\tif len(degradedOperators) > 0 {\n\t\tlogger.Info(fmt.Sprintf(\"degraded operators :%s\", strings.Join(degradedOperators, \",\")))\n\t\t// Send the metrics for the cluster check failed if we have degraded operators\n\t\treturn false, fmt.Errorf(\"degraded operators :%s\", strings.Join(degradedOperators, \",\"))\n\t}\n\treturn true, nil\n\n}",
"func (ha HostAPI) HostExecuteActions(ctx *gin.Context) {\n\tlogger := log.WithFields(log.Fields{\"method\": \"HostExecuteActions\"})\n\n\thost := ctx.Param(\"host\")\n\tif err := validateHost(host); err != nil {\n\t\tlogger.Warn(err)\n\t\tmetrics.IncrCounter([]string{\"errors\", \"bmc\", \"user_request_invalid\"}, 1)\n\t\tctx.JSON(http.StatusBadRequest, newErrorResponse(err))\n\t\treturn\n\t}\n\tlogger = log.WithFields(log.Fields{\"ip\": host})\n\n\tha.executeActions(ctx, map[string]interface{}{\"host\": host}, logger)\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
TTS generates a URL to the MP3 file containing the sound
|
func TTS(text string, voice Voice) (string, error) {
var name string
if voice.Gender == Male {
name = voice.Language.MaleVoice()
} else {
name = voice.Language.FemaleVoice()
}
if name == "" {
desc := fmt.Sprintf("%s voice not supported for %s", voice.Gender, voice.Language)
return "", errors.New(desc)
}
text = strings.Replace(text, "\n", "\\n", -1)
params := fmt.Sprintf(ttsParams, voice.Pitch, name, voice.Speed, text)
data := fmt.Sprintf("%s%s", ttsHeader, params)
encData := base64.StdEncoding.EncodeToString([]byte(data))
body := fmt.Sprintf("data=%s", encData)
resp, err := http.Post(ttsURL, "text/plain", bytes.NewBuffer([]byte(body)))
if err != nil {
return "", err
}
bodyByte, err := ioutil.ReadAll(resp.Body)
if err != nil {
return "", err
}
res := make(map[string]interface{})
err = json.Unmarshal(bodyByte, &res)
if err != nil {
return "", err
}
ans, ok := res["id"].(string)
if !ok {
return "", errors.New("error decoding TTS type")
}
fileURL := strings.Replace(ttsURL, "makeID", ans, 1)
return fileURL, nil
}
|
[
"func (t *tts) createAudioPolly(text, filename string) error {\n\tout, err := t.polly.Speech(text)\n\tif err != nil {\n\t\tlogrus.WithFields(logrus.Fields{\n\t\t\t\"error\": err,\n\t\t\t\"text\": text,\n\t\t\t\"filename\": filename,\n\t\t}).Error(\"Failed to query polly to transform text to MP3\")\n\t\treturn err\n\t}\n\n\t// write speech to file\n\terr = ioutil.WriteFile(filename, out, 0644)\n\tif err != nil {\n\t\tlogrus.WithFields(logrus.Fields{\n\t\t\t\"error\": err,\n\t\t\t\"filename\": filename,\n\t\t}).Error(\"Failed to write temporary file\")\n\t\treturn err\n\t}\n\treturn nil\n}",
"func getFile(file string) string {\n\tres, err := http.Get(\"http://localhost:8888/file.php?id=\" + file)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfmt.Print(\"start play\")\n\tmusicFile := \"/Users/jea/www/music/client/cache/\" + file + \".mp3\"\n\tdefer res.Body.Close()\n\tf, err := os.Create(musicFile)\n\t_, err = io.Copy(f, res.Body)\n\n\tdefer f.Close()\n\treturn musicFile\n}",
"func (api *API) ServeAudio(w http.ResponseWriter, r *http.Request) {\n\tLogger(r)\n\n\ttrack := strings.TrimPrefix(r.URL.String(), \"/file\"+api.Library.Path)\n\ttrack1, err := url.QueryUnescape(track)\n\tif err != nil {\n\t\tJSONResponse(w, APIError{\"error\", err.Error()})\n\t}\n\n\thttp.ServeFile(w, r, api.Library.Path+track1)\n}",
"func (result *TranslationResult) GetSoundURLs() []string {\n\treturn []string{result.SoundURL}\n}",
"func (t *tts) createAudioFlite(text, filename string) error {\n\tcmd := exec.Command(\"flite\",\n\t\t\"-t\", text,\n\t\t\"-o\", filename,\n\t\t\"-voice\", \"awb\",\n\t)\n\n\tout, err := cmd.Output()\n\tif err != nil {\n\t\tlogrus.WithFields(logrus.Fields{\n\t\t\t\"error\": err,\n\t\t\t\"output\": out,\n\t\t\t\"tempFile\": filename,\n\t\t\t\"text\": text,\n\t\t}).Error(\"Failed to create speech from flite\")\n\t\treturn err\n\t}\n\treturn nil\n}",
"func downloadAudio(title string) (string, error) {\n\tresponse, err := findVideos(title, 5)\n\tif err != nil {\n\t\tfmt.Println(\"Error fiding the video.\")\n\t\treturn \"\", err\n\t}\n\tvideos := parseResponse(response)\n\tdownloadUrl := formatDownloadUrl(videos.Items[0].Id.VideoId)\n\tcmd := exec.Command(\"youtube-dl\", \"--config-location\", \"youtube-dl.conf\", downloadUrl)\n\terr = cmd.Run()\n\tif err != nil {\n\t\tfmt.Println(\"Error running the command\")\n\t\treturn \"\", err\n\t}\n\treturn videos.Items[0].Id.VideoId, nil\n}",
"func TextToSpeech(fname string, aud *audio.Audio) error {\n\taud.ResetPlayback()\n\tdata, err := ioutil.ReadFile(fname)\n\tif err != nil {\n\t\treturn err\n\t}\n\tl := len(data)\n\tfor i := 0; i < l; i += CHUNK_SZ {\n\t\tend := i + CHUNK_SZ\n\t\tif end > l {\n\t\t\tend = l\n\t\t}\n\t\tchunk := data[i:end]\n\t\tbuf := bytes.NewBuffer(chunk)\n\t\taud.Out <- *buf\n\t}\n\t<-aud.StatusCh\n\tglog.V(3).Info(\"Finished Text2Speech\")\n\treturn nil\n}",
"func play(musicFile string) {\n\tm, err := os.Open(musicFile)\n\tstreamer, format, err := mp3.Decode(m)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer streamer.Close()\n\terr = speaker.Init(format.SampleRate, format.SampleRate.N(time.Second/10))\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tdone := make(chan bool)\n\tspeaker.Play(beep.Seq(streamer, beep.Callback(func() {\n\t\tdone <- true\n\t})))\n\t<-done\n\tdefer speaker.Close()\n\tdefer speaker.Clear()\n}",
"func gen_xml_yt_playlist(plist_id string, list []string) string {\n\tplist_data := get_playlist_data(plist_id)\n\n\tfmt.Printf(\"Generating XML for playlist ID %s\\n\", plist_id)\n\n\t// Create podcast instance\n\tp := podcast.New(\n\t\tplist_data.Name,\n\t\t\"link\",\n\t\tplist_data.Description,\n\t\tnil,\n\t\tnil)\n\tp.IExplicit = \"no\"\n\n\tfor _, crt_entry := range list {\n\t\t// Get video metadata\n\t\tvideo_data := get_yt_video_data(crt_entry)\n\n\t\t// Generate the link\n\t\tlink := \"http://\" + get_podcast_addr() +\n\t\t\t\"/api/ytv/\" + video_data.ID\n\n\t\ttitle := strings.Replace(video_data.Title, \"%\", \"%%\", -1)\n\n\t\tdescription := video_data.Description\n\t\tif description == \"\" {\n\t\t\tdescription = \"No description\"\n\t\t}\n\t\tdescription = strings.Replace(description, \"%\", \"%%\", -1)\n\n\t\ttitle_escaped := bytes.NewBufferString(\"\")\n\t\tdescr_escaped := bytes.NewBufferString(\"\")\n\n\t\txml.EscapeText(title_escaped, []byte(title))\n\t\txml.EscapeText(descr_escaped, []byte(description))\n\n\t\titem := podcast.Item{\n\t\t\tTitle: title_escaped.String(),\n\t\t\tLink: link,\n\t\t\tDescription: descr_escaped.String(),\n\t\t\tPubDate: &video_data.UploadDate,\n\t\t}\n\n\t\titem.AddDuration(video_data.Duration)\n\t\titem.AddEnclosure(link, podcast.MP3, 1024)\n\n\t\t_, _ = p.AddItem(item)\n\t}\n\n\treturn string(p.Bytes())\n}",
"func (builder *SSMLBuilder) Audio(text string) {\n builder.SSML = append(builder.SSML, SSML{datatype: \"audio\", text: text})\n}",
"func NewAudio(title string, url string) (at *Attachment) {\n\taudType := path.Ext(url)\n\treturn &Attachment{\n\t\tTitle: title,\n\t\tURL: url,\n\t\tMimeType: \"audio/\" + audType[1:],\n\t}\n}",
"func playAudio(filepath string) {\n\tstreamer, _ := getStreamer(filepath)\n\t// play the sound\n\tspeaker.Play(streamer)\n}",
"func PlaySound(name string) {\n\t//https://github.com/faiface/beep\n\tf, err := os.Open(name)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\ts, format, _ := mp3.Decode(f)\n\tspeaker.Init(format.SampleRate, format.SampleRate.N(time.Second/10))\n\tplaying := make(chan struct{})\n\tspeaker.Play(beep.Seq(s, beep.Callback(func() {\n\t\tclose(playing)\n\t})))\n\t<-playing\n}",
"func TextToSpeech(message string, waitInSeconds int32) bool {\n\n\ttime.Sleep(time.Duration(waitInSeconds))\n\tfmt.Println(\"Speaking -> \", message)\n speech := htgotts.Speech{Folder: \"audio\", Language: \"en\"}\n\tspeech.Speak(message)\n\treturn true\n\n}",
"func SystemSound(fname string) error {\n\treturn nil\n}",
"func (a *MediaApiService) GetSubtitleWebVttById(ctx context.Context, mediaId string) (string, *http.Response, error) {\n\tvar (\n\t\tlocalVarHttpMethod = strings.ToUpper(\"Get\")\n\t\tlocalVarPostBody interface{}\n\t\tlocalVarFileName string\n\t\tlocalVarFileBytes []byte\n\t\tsuccessPayload string\n\t)\n\n\t// create path and map variables\n\tlocalVarPath := a.client.cfg.BasePath + \"/v3/media/{mediaId}/transcript/webvtt\"\n\tlocalVarPath = strings.Replace(localVarPath, \"{\"+\"mediaId\"+\"}\", fmt.Sprintf(\"%v\", mediaId), -1)\n\n\tlocalVarHeaderParams := make(map[string]string)\n\tlocalVarQueryParams := url.Values{}\n\tlocalVarFormParams := url.Values{}\n\n\t// to determine the Content-Type header\n\tlocalVarHttpContentTypes := []string{}\n\n\t// set Content-Type header\n\tlocalVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes)\n\tif localVarHttpContentType != \"\" {\n\t\tlocalVarHeaderParams[\"Content-Type\"] = localVarHttpContentType\n\t}\n\n\t// to determine the Accept header\n\tlocalVarHttpHeaderAccepts := []string{\n\t\t\"text/vtt\",\n\t}\n\n\t// set Accept header\n\tlocalVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts)\n\tif localVarHttpHeaderAccept != \"\" {\n\t\tlocalVarHeaderParams[\"Accept\"] = localVarHttpHeaderAccept\n\t}\n\tif ctx != nil {\n\t\t// API Key Authentication\n\t\tif auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok {\n\t\t\tvar key string\n\t\t\tif auth.Prefix != \"\" {\n\t\t\t\tkey = auth.Prefix + \" \" + auth.Key\n\t\t\t} else {\n\t\t\t\tkey = auth.Key\n\t\t\t}\n\t\t\tlocalVarHeaderParams[\"Authorization\"] = key\n\t\t}\n\t}\n\tr, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes)\n\tif err != nil {\n\t\treturn successPayload, nil, err\n\t}\n\n\tlocalVarHttpResponse, err := a.client.callAPI(r)\n\tif err != nil || localVarHttpResponse == nil {\n\t\treturn successPayload, localVarHttpResponse, err\n\t}\n\tdefer localVarHttpResponse.Body.Close()\n\tif localVarHttpResponse.StatusCode >= 300 {\n\t\tbodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body)\n\t\treturn successPayload, localVarHttpResponse, reportError(\"Status: %v, Body: %s\", localVarHttpResponse.Status, bodyBytes)\n\t}\n\n\tif err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil {\n\t\treturn successPayload, localVarHttpResponse, err\n\t}\n\n\treturn successPayload, localVarHttpResponse, err\n}",
"func SpeechKitProcess(text string, file string, iamToken string, folderId string) (error) {\n form := url.Values{}\n form.Add(\"text\", text)\n form.Add(\"lang\", \"ru-RU\")\n form.Add(\"emotion\", \"neutral\")\n form.Add(\"speed\", \"1.0\")\n form.Add(\"voice\", \"zahar\")\n form.Add(\"folderId\", folderId)\n\n // Create a new request using http\n req, err := http.NewRequest(\"POST\", speechkitPostApiUrl, strings.NewReader(form.Encode()))\n req.Header.Set(\"Content-Type\", \"application/x-www-form-urlencoded; param=value\")\n\n //add authorization header to the req\n req.Header.Add(\"Authorization\", fmt.Sprintf(\"Bearer %s\", iamToken))\n\n // Send req using http Client\n client := &http.Client{}\n resp, err := client.Do(req)\n if err != nil {\n return errors.Wrap(err, \"\")\n }\n\n if resp.StatusCode == http.StatusOK {\n log.Printf(\"[YandexCloud Speechkit]: Status OK\\n\")\n defer resp.Body.Close()\n\n // Create the file\n oggFile, _ := os.Create(file)\n defer oggFile.Close()\n\n _, err = io.Copy(oggFile, resp.Body)\n return nil\n } else {\n return errors.Wrap(err, \"[YandexCloud Speechkit]: Status is not OK\")\n }\n}",
"func (i *Instance) PlayItem(url string) {\n\tvc := i.VoiceConnection\n\tif vc == nil {\n\t\treturn\n\t}\n\n\t// Change these accordingly\n\toptions := dca.StdEncodeOptions\n\toptions.RawOutput = true\n\toptions.Bitrate = 96\n\toptions.Application = \"lowdelay\"\n\n\tvideoInfo, err := ytdl.GetVideoInfo(url)\n\tif err != nil {\n\t\t// Handle the error\n\t}\n\n\tformat := videoInfo.Formats.Extremes(ytdl.FormatAudioBitrateKey, true)[0]\n\tdownloadURL, err := videoInfo.GetDownloadURL(format)\n\tif err != nil {\n\t\t// Handle the error\n\t}\n\n\ti.EncodingSession, err = dca.EncodeFile(downloadURL.String(), options)\n\tif err != nil {\n\t\t// Handle the error\n\t}\n\tdefer i.EncodingSession.Cleanup()\n\n\tdone := make(chan error)\n\tsession := dca.NewStream(i.EncodingSession, vc, done)\n\ti.StreamingSession = session\n\terr = <-done\n\n\ti.EncodingSession = nil\n\ti.StreamingSession = nil\n\n\tif i.AutoPlay {\n\t\ti.TryToPlayNext()\n\t}\n\n\tif err != nil && err != io.EOF {\n\t\t// Handle the error\n\t}\n}",
"func GetDownloadAudioURL(q map[string]interface{}, high bool, audio bool) (string, error) {\n\n\tq = q[\"streamingData\"].(map[string]interface{})\n\n\th := q[\"adaptiveFormats\"].([]interface{})\n\n\tcheck := h[len(h)-1].(map[string]interface{})\n\n\tif _, ok := check[\"url\"]; !ok {\n\t\tfmt.Println(\"This audio cant be downloaded due to Copyright Infringment.This is generally the case with music videos\")\n\t\treturn \"nil\", errors.New(\"Error\")\n\t}\n\n\ts := h[len(h)-1].(map[string]interface{})\n\n\treturn s[\"url\"].(string), nil\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
DumpDeployments prints a bunch of Deployments to writer.
|
func DumpDeployments(writer io.Writer, ds Deployments) {
w := &tabwriter.Writer{}
w.Init(writer, 2, 4, 2, ' ', 0)
fmt.Fprintln(w, TabbedDeploymentHeaders())
for _, d := range ds.Snapshot() {
fmt.Fprintln(w, d.Tabbed())
}
w.Flush()
}
|
[
"func (i Instances) Deployments() []Instances {\n\tgrouped := map[string]Instances{}\n\tfor _, instance := range i {\n\t\tk := instance.Config().FQDN()\n\t\tgrouped[k] = append(grouped[k], instance)\n\t}\n\tvar out deployments\n\tfor _, deployment := range grouped {\n\t\tout = append(out, deployment)\n\t}\n\tsort.Stable(out)\n\treturn out\n}",
"func deploymentsHandler(c iris.Context) {\n\tc.JSON(iris.Map{\n\t\t\"deployments\": listDeployments(),\n\t})\n}",
"func (h *HTTPHandler) getAllDeployments(c echo.Context) error {\n\t//call driver adapter responsible for getting the deployments from the mongo database\n\tresponse, err := h.kubernetesServices.GetAllDeployments()\n\n\tif err != nil {\n\t\t//type assertion of custom Error to default error\n\t\tmongoError := err.(*pkg.Error)\n\n\t\t//return the error sent by the service\n\t\treturn c.JSON(mongoError.Code, mongoError)\n\t}\n\n\treturn c.JSONPretty(http.StatusOK, response, \" \")\n}",
"func updateDeployments(conn db.Conn, deploymentsClient appsclient.DeploymentInterface,\n\tsecretClient SecretClient) {\n\n\tcurrentDeployments, err := deploymentsClient.List(metav1.ListOptions{})\n\tif err != nil {\n\t\tlog.WithError(err).Error(\"Failed to list current deployments\")\n\t\treturn\n\t}\n\n\tdesiredDeployments, err := makeDesiredDeployments(conn, secretClient)\n\tif err != nil {\n\t\tif err == errNoBlueprint {\n\t\t\t// It's expected for there to not be a blueprint when the machine\n\t\t\t// first boots, and the foreman hasn't connected yet.\n\t\t\treturn\n\t\t}\n\t\tlog.WithError(err).Error(\"Failed to create desired deployments\")\n\t}\n\n\tkey := func(intf interface{}) interface{} {\n\t\treturn intf.(appsv1.Deployment).Name\n\t}\n\tpairs, toCreate, toDelete := join.HashJoin(\n\t\tdeploymentSlice(desiredDeployments),\n\t\tdeploymentSlice(currentDeployments.Items),\n\t\tkey, key)\n\n\tfor _, pair := range pairs {\n\t\t// Retry updating the deployment if the apiserver reports that there's\n\t\t// a conflict. Conflicts are benign -- for example, there might be a\n\t\t// conflict if Kubernetes updated the deployment to change the pod\n\t\t// status.\n\t\tdeployment := pair.L.(appsv1.Deployment)\n\t\tc.Inc(\"Update deployment\")\n\t\terr := retry.RetryOnConflict(retry.DefaultBackoff, func() error {\n\t\t\t_, err := deploymentsClient.Update(&deployment)\n\t\t\treturn err\n\t\t})\n\t\tif err != nil {\n\t\t\tlog.WithError(err).WithField(\"deployment\", deployment.Name).\n\t\t\t\tError(\"Failed to update deployment\")\n\t\t}\n\t}\n\n\tfor _, intf := range toCreate {\n\t\tdeployment := intf.(appsv1.Deployment)\n\t\tlog.WithField(\"deployment\", deployment.Name).Info(\"Creating deployment\")\n\t\tc.Inc(\"Create deployment\")\n\t\tif _, err := deploymentsClient.Create(&deployment); err != nil {\n\t\t\tlog.WithError(err).WithField(\"deployment\", deployment.Name).\n\t\t\t\tError(\"Failed to create deployment\")\n\t\t}\n\t}\n\n\tfor _, intf := range toDelete {\n\t\tdeployment := intf.(appsv1.Deployment)\n\t\tlog.WithField(\"deployment\", deployment.Name).Info(\"Deleting deployment\")\n\t\tc.Inc(\"Delete deployment\")\n\t\terr := deploymentsClient.Delete(deployment.Name, &metav1.DeleteOptions{})\n\t\tif err != nil {\n\t\t\tlog.WithError(err).WithField(\"deployment\", deployment.Name).\n\t\t\t\tError(\"Failed to delete deployment\")\n\t\t}\n\t}\n}",
"func (g *GitLab) GetDeployments(p *collector.Project, client *gl.Client, opt *gl.ListProjectDeploymentsOptions) ([]*collector.Deployment, error) {\n\n\td := []*collector.Deployment{}\n\n\tfor {\n\n\t\tdeployments, resp, err := client.Deployments.ListProjectDeployments(p.ID, opt)\n\t\tif err != nil {\n\t\t\tfmt.Printf(\"Error: %v\", err.Error())\n\t\t\treturn nil, err\n\t\t}\n\n\t\t// iterate over deployments and convert to metrix representation\n\t\tfor _, dep := range deployments {\n\n\t\t\tif dep.Environment.Name == \"production\" &&\n\t\t\t\t(dep.Status == \"success\" || dep.Status == \"failed\") {\n\n\t\t\t\td = append(d, &collector.Deployment{\n\t\t\t\t\tID: dep.ID,\n\t\t\t\t\tStatus: dep.Status,\n\t\t\t\t\tEnvironmentName: dep.Environment.Name,\n\t\t\t\t\tProjectID: p.ID,\n\t\t\t\t\tProjectName: p.Name,\n\t\t\t\t\tProjectPath: p.Path,\n\t\t\t\t\tProjectNamespace: p.Namespace,\n\t\t\t\t\tPipelineID: dep.Deployable.Pipeline.ID,\n\t\t\t\t\tFinishedAt: dep.Deployable.FinishedAt,\n\t\t\t\t\tDuration: dep.Deployable.Duration,\n\t\t\t\t})\n\t\t\t}\n\n\t\t}\n\n\t\t// Exit the loop when we've seen all pages.\n\t\tif resp.CurrentPage >= resp.TotalPages {\n\t\t\tbreak\n\t\t}\n\n\t\topt.Page = resp.NextPage\n\t}\n\n\treturn d, nil\n}",
"func (c *Client) DeploymentsCleaner(namespace string, dryRun bool, directories []string) error {\n\tvar left []string\n\n\tclusterDeployments, err := c.ListDeployments(namespace)\n\tif err != nil {\n\t\tfmt.Fprintln(os.Stderr, err)\n\t\tos.Exit(1)\n\t}\n\tfor _, value := range clusterDeployments.Items {\n\t\tleft = append(left, value.Name)\n\t}\n\n\tobjectsToDelete := Except(left, \"Deployment\", directories)\n\n\tfor _, item := range objectsToDelete {\n\t\tfor _, deployment := range clusterDeployments.Items {\n\t\t\tif item == deployment.Name {\n\t\t\t\tif dryRun {\n\t\t\t\t\tcolor.Yellow(\"******************************************************************************\")\n\t\t\t\t\tcolor.Yellow(\" Deleting Deployment %s [dry-run]\\n\", deployment.Name)\n\t\t\t\t\tcolor.Yellow(\"******************************************************************************\")\n\t\t\t\t} else {\n\t\t\t\t\tcolor.Red(\"******************************************************************************\")\n\t\t\t\t\tcolor.Red(\" Deleting Deployment %s\\n\", deployment.Name)\n\t\t\t\t\tcolor.Red(\"******************************************************************************\")\n\t\t\t\t\tif err := c.DeleteDeployment(deployment); err != nil {\n\t\t\t\t\t\tfmt.Fprintln(os.Stderr, err)\n\t\t\t\t\t\tos.Exit(1)\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn nil\n}",
"func (ts *Set) Dump(out string) {\n\tvar files []string\n\tfor file := range ts.files {\n\t\tfiles = append(files, file)\n\t}\n\tsort.Strings(files)\n\tfor _, file := range files {\n\t\tbuf := ts.files[file].Buf.Bytes()\n\t\tif err := os.WriteFile(filepath.Join(out, file), buf, 0o644); err != nil {\n\t\t\tts.files[file].Err = append(ts.files[file].Err, err)\n\t\t}\n\t}\n}",
"func (c *Client) GetAllDeployments() (*DeployomentCollection, error) {\n\tlist, err := c.CS.AppsV1().Deployments(c.NS).List(c.Options[ListOption].(*ListAction).Get())\n\tif err != nil {\n\t\treturn &DeployomentCollection{}, err\n\t}\n\tlist.SetGroupVersionKind(schema.GroupVersionKind{\n\t\tGroup: DeploymentAPIGroup,\n\t\tVersion: DeploymentAPIVersion,\n\t\tKind: DeploymentListKind,\n\t})\n\tfor i := 0; i < len(list.Items); i++ {\n\t\tlist.Items[i].SetGroupVersionKind(schema.GroupVersionKind{\n\t\t\tGroup: DeploymentAPIGroup,\n\t\t\tVersion: DeploymentAPIVersion,\n\t\t\tKind: DeploymentKind,\n\t\t})\n\t}\n\treturn &DeployomentCollection{\n\t\tlist.APIVersion,\n\t\tlist.Kind,\n\t\tlist,\n\t}, nil\n}",
"func (c *Client) ListDeployments() ([]string, error) {\n\tvar l []string\n\t_, err := c.Get(\"deployments\", &l)\n\treturn l, err\n}",
"func (r *pRepository) ListDeployments() ([]common.Deployment, error) {\n\tvar result []pDeployment\n\tif err := r.Deployments.Find(nil).All(&result); err != nil {\n\t\treturn nil, fmt.Errorf(\"cannot list deployments: %s\", err)\n\t}\n\n\tdeployments := []common.Deployment{}\n\tfor _, pd := range result {\n\t\tdeployments = append(deployments, pd.Deployment)\n\t}\n\n\treturn deployments, nil\n}",
"func (s *ApplicationDeployments) ListDeployments(appName string) (deploymentList []string) {\n\tfor _, k := range s.Applications[appName].Deployments {\n\t\tdeploymentList = append(deploymentList, k.Name)\n\t}\n\treturn\n}",
"func (d *Deployments) List(q *QueryOptions) ([]*Deployment, *QueryMeta, error) {\n\tvar resp []*Deployment\n\tqm, err := d.client.query(\"/v1/deployments\", &resp, q)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\tsort.Sort(DeploymentIndexSort(resp))\n\treturn resp, qm, nil\n}",
"func (r *Runner) Dump(ctx gocontext.Context, w io.Writer) error {\n\tenc := yaml.NewEncoder(w)\n\tdefer enc.Close()\n\topts := []schema.LoadOption{\n\t\tschema.WithInputConfig(r.rootDir, r.inputConfig),\n\t}\nFILE_LOOP:\n\tfor _, f := range r.scenarioFiles {\n\t\ttestName, err := filepath.Rel(r.rootDir, f)\n\t\tif err != nil {\n\t\t\ttestName = f\n\t\t}\n\t\tfor _, exclude := range r.inputConfig.Excludes {\n\t\t\tif exclude.MatchString(testName) {\n\t\t\t\tcontinue FILE_LOOP\n\t\t\t}\n\t\t}\n\t\tscns, err := schema.LoadScenarios(f, opts...)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"failed to load scenarios: %w\", err)\n\t\t}\n\t\tfor _, scn := range scns {\n\t\t\tif err := enc.EncodeContext(ctx, scn); err != nil {\n\t\t\t\treturn fmt.Errorf(\"failed to encode scenarios: %w\", err)\n\t\t\t}\n\t\t}\n\t}\n\treturn nil\n}",
"func (s *Deployment) List(c echo.Context) error {\n\tsrv := request.ServerFromContext(c)\n\tif srv == nil {\n\t\treturn echo.ErrNotFound.SetInternal(errors.New(\"server not found in context\"))\n\t}\n\n\tdeployments, err := s.deploymentRepo.FindByServer(context.Background(), srv.ID)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"list deployments\")\n\t}\n\n\treturn c.JSON(200, &ListDeploymentsResponse{\n\t\tDeployments: deployments,\n\t})\n}",
"func DumpPods(a Accessor, workDir, namespace string, dumpers ...podDumper) {\n\tif len(dumpers) == 0 {\n\t\tdumpers = []podDumper{\n\t\t\tDumpPodState,\n\t\t\tDumpPodEvents,\n\t\t\tDumpPodLogs,\n\t\t\tDumpPodProxies,\n\t\t}\n\t}\n\n\tpods, err := a.GetPods(namespace)\n\tif err != nil {\n\t\tscopes.Framework.Errorf(\"Error getting pods list via kubectl: %v\", err)\n\t\treturn\n\t}\n\n\tfor _, dump := range dumpers {\n\t\tdump(a, workDir, namespace, pods...)\n\t}\n}",
"func (p *Policy) dump() {\n\tfor account, policies := range p.AccountPolicies {\n\t\tfor k, p := range policies {\n\t\t\ts, err := json.MarshalIndent(p, \"\", \" \")\n\n\t\t\tif err != nil {\n\t\t\t\tpanic(err)\n\t\t\t}\n\n\t\t\tfmt.Printf(\"Account=%s, PolicyIdx=%d, PolicyJSON=%s\\n\", account, k, s)\n\t\t}\n\t}\n}",
"func All(client *kubernetes.Clientset, generatedConfig *generated.Config, forceDeploy, useDevOverwrite bool, log log.Logger) error {\n\tconfig := configutil.GetConfig()\n\n\tif config.DevSpace.Deployments != nil {\n\t\tfor _, deployConfig := range *config.DevSpace.Deployments {\n\t\t\tvar deployClient Interface\n\t\t\tvar err error\n\n\t\t\tif deployConfig.Kubectl != nil {\n\t\t\t\tlog.Info(\"Deploying \" + *deployConfig.Name + \" with kubectl\")\n\n\t\t\t\tdeployClient, err = kubectl.New(client, deployConfig, log)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn fmt.Errorf(\"Error deploying devspace: deployment %s error: %v\", *deployConfig.Name, err)\n\t\t\t\t}\n\t\t\t} else if deployConfig.Helm != nil {\n\t\t\t\tlog.Info(\"Deploying \" + *deployConfig.Name + \" with helm\")\n\n\t\t\t\tdeployClient, err = helm.New(client, deployConfig, useDevOverwrite, log)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn fmt.Errorf(\"Error deploying devspace: deployment %s error: %v\", *deployConfig.Name, err)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn fmt.Errorf(\"Error deploying devspace: deployment %s has no deployment method\", *deployConfig.Name)\n\t\t\t}\n\n\t\t\terr = deployClient.Deploy(generatedConfig, forceDeploy)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"Error deploying %s: %v\", *deployConfig.Name, err)\n\t\t\t}\n\n\t\t\tlog.Donef(\"Finished deploying %s\", *deployConfig.Name)\n\t\t}\n\t}\n\n\treturn nil\n}",
"func GetDeployments(list *apps.DeploymentList, getDeploymentApi string) error {\n\n\terr, resp := SendHttpRequest(http.MethodGet, getDeploymentApi)\n\tdefer resp.Body.Close()\n\tcontents, err := ioutil.ReadAll(resp.Body)\n\tif err != nil {\n\t\tFailf(\"HTTP Response reading has failed: %v\", err)\n\t\treturn err\n\t}\n\terr = json.Unmarshal(contents, &list)\n\tif err != nil {\n\t\tFailf(\"Unmarshal HTTP Response has failed: %v\", err)\n\t\treturn err\n\t}\n\treturn nil\n\n}",
"func getDeploymentsList(server *httptest.Server) (*http.Response, error) {\n\tclient := new(http.Client)\n\treq, _ := http.NewRequest(\"GET\", server.URL+\"/deployments\", nil)\n\treturn client.Do(req)\n}",
"func (d *Dumper) Dump(dbName string, tables ...string) error {\n\tvar err error\n\n\tif len(tables) == 0 {\n\t\treturn nil\n\t}\n\n\t// Get server version\n\tserverVer, err := getServerVersion(d.db)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif err = d.use(dbName); err != nil {\n\t\treturn err\n\t}\n\n\td.bin.WriteFileHeader(&binary.FileHeader{\n\t\tServerVersion: serverVer,\n\t\tDatabaseName: dbName,\n\t\tDumpStart: time.Now().UTC(),\n\t})\n\n\t// Write sql for each table\n\tfor _, t := range tables {\n\t\tif err := d.writeTable(t, dbName); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
DumpDeployStatuses prints a bunch of DeployStates to writer.
|
func DumpDeployStatuses(writer io.Writer, ds DeployStates) {
w := &tabwriter.Writer{}
w.Init(writer, 2, 4, 2, ' ', 0)
fmt.Fprintln(w, TabbedDeploymentHeaders())
for _, d := range ds.Snapshot() {
fmt.Fprintln(w, d.Tabbed())
}
w.Flush()
}
|
[
"func PrintStates(statesList []string, printAsBash bool) {\n\tswitch mode {\n\tcase jsonMode:\n\t\tlog.PrintAsJSON(statesList)\n\tcase bashMode:\n\t\tfallthrough\n\tcase quietMode:\n\t\tfor _, state := range statesList {\n\t\t\tPrintToBashComp(state)\n\t\t}\n\tdefault:\n\t\twriter := tablewriter.NewWriter(os.Stdout)\n\t\twriter.SetAutoFormatHeaders(false)\n\t\twriter.SetHeader([]string{\"Name\"})\n\n\t\tfor _, state := range statesList {\n\t\t\twriter.Append([]string{state})\n\t\t}\n\t\twriter.Render()\n\t}\n}",
"func (d *tidbClusterStatefulDumper) Dump(logPath string, resourceWriter io.Writer) error {\n\tlogFile, err := os.Create(filepath.Join(logPath, fmt.Sprintf(\"%s-%s-statefulsets-info.yaml\", d.tc.Name, d.tc.Namespace)))\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tdefer func() {\n\t\tcmdutil.CheckErr(logFile.Close())\n\t}()\n\n\tif _, err := resourceWriter.Write([]byte(\"----------------statefulset---------------\\n\")); err != nil {\n\t\treturn err\n\t}\n\n\tsts := apps.StatefulSetList{}\n\tfor _, sn := range []string{\n\t\tcontroller.TiDBMemberName(d.tc.Name),\n\t\tcontroller.TiKVMemberName(d.tc.Name),\n\t\tcontroller.PDMemberName(d.tc.Name),\n\t} {\n\t\tps, err := d.kubeCli.AppsV1().StatefulSets(d.tc.Namespace).Get(context.TODO(), sn, metav1.GetOptions{})\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tps.SetGroupVersionKind(appv1.SchemeGroupVersion.WithKind(\"StatefulSet\"))\n\n\t\tif err = writeString(logFile, \"#\"+sn+\"\\n\"); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tbody, err := yaml.Marshal(ps)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tif err = writeString(logFile, string(body)); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tif err = writeString(logFile, \"\\n\"); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\ts, err := convertToInternalObj(ps, \"apps\")\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tsts.Items = append(sts.Items, *(s.(*apps.StatefulSet)))\n\t}\n\n\treturn d.printer.PrintObj(&sts, resourceWriter)\n}",
"func DeploymentStatus_Values() []string {\n\treturn []string{\n\t\tDeploymentStatusPending,\n\t\tDeploymentStatusPreparing,\n\t\tDeploymentStatusInProgress,\n\t\tDeploymentStatusFailed,\n\t\tDeploymentStatusSucceeded,\n\t\tDeploymentStatusCanceled,\n\t}\n}",
"func printApplyStatus(applyStatus map[string]resourceApplyStatus) {\n\tchanged := false\n\tfor typ, ras := range applyStatus {\n\t\tn := len(ras.created)\n\t\tif n > 0 {\n\t\t\tchanged = true\n\t\t\tfmt.Printf(\"%v %v created: %v\\n\", n, pluralize(n, typ), strings.Join(metadataNames(ras.created), \", \"))\n\t\t}\n\t\tn = len(ras.updated)\n\t\tif n > 0 {\n\t\t\tchanged = true\n\t\t\tfmt.Printf(\"%v %v updated: %v\\n\", n, pluralize(n, typ), strings.Join(metadataNames(ras.updated), \", \"))\n\t\t}\n\t\tn = len(ras.deleted)\n\t\tif n > 0 {\n\t\t\tchanged = true\n\t\t\tfmt.Printf(\"%v %v deleted: %v\\n\", n, pluralize(n, typ), strings.Join(metadataNames(ras.deleted), \", \"))\n\t\t}\n\t}\n\n\tif !changed {\n\t\tfmt.Println(\"Everything up to date.\")\n\t}\n}",
"func (o DatabaseStatusOutput) DeploymentStatus() pulumi.MapOutput {\n\treturn o.ApplyT(func(v DatabaseStatus) map[string]interface{} { return v.DeploymentStatus }).(pulumi.MapOutput)\n}",
"func (cmd *deploymentsCmd) RunDeploymentsStatus(cobraCmd *cobra.Command, args []string) {\n\t// Set config root\n\tconfigExists, err := configutil.SetDevSpaceRoot()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tif !configExists {\n\t\tlog.Fatal(\"Couldn't find any devspace configuration. Please run `devspace init`\")\n\t}\n\n\tvar values [][]string\n\tvar headerValues = []string{\n\t\t\"NAME\",\n\t\t\"TYPE\",\n\t\t\"DEPLOY\",\n\t\t\"STATUS\",\n\t}\n\n\tconfig := configutil.GetConfig()\n\tkubectl, err := kubectl.NewClient(config)\n\tif err != nil {\n\t\tlog.Fatalf(\"Unable to create new kubectl client: %s\", err.Error())\n\t}\n\n\tif config.Deployments != nil {\n\t\tfor _, deployConfig := range *config.Deployments {\n\t\t\tvar deployClient deploy.Interface\n\n\t\t\t// Delete kubectl engine\n\t\t\tif deployConfig.Kubectl != nil {\n\t\t\t\tdeployClient, err = deployKubectl.New(config, kubectl, deployConfig, log.GetInstance())\n\t\t\t\tif err != nil {\n\t\t\t\t\tlog.Warnf(\"Unable to create kubectl deploy config for %s: %v\", *deployConfig.Name, err)\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t} else if deployConfig.Helm != nil {\n\t\t\t\tdeployClient, err = deployHelm.New(config, kubectl, deployConfig, log.GetInstance())\n\t\t\t\tif err != nil {\n\t\t\t\t\tlog.Warnf(\"Unable to create helm deploy config for %s: %v\", *deployConfig.Name, err)\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t} else if deployConfig.Component != nil {\n\t\t\t\tdeployClient, err = deployComponent.New(config, kubectl, deployConfig, log.GetInstance())\n\t\t\t\tif err != nil {\n\t\t\t\t\tlog.Warnf(\"Unable to create component deploy config for %s: %v\", *deployConfig.Name, err)\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tstatus, err := deployClient.Status()\n\t\t\tif err != nil {\n\t\t\t\tlog.Warnf(\"Error retrieving status for deployment %s: %v\", *deployConfig.Name, err)\n\t\t\t}\n\n\t\t\tvalues = append(values, []string{\n\t\t\t\tstatus.Name,\n\t\t\t\tstatus.Type,\n\t\t\t\tstatus.Target,\n\t\t\t\tstatus.Status,\n\t\t\t})\n\t\t}\n\t}\n\n\tlog.PrintTable(log.GetInstance(), headerValues, values)\n}",
"func DeployHandler() {\n\t// status - pending, failed, completed\n\tvar status = make(map[string]string)\n\n\tfor _, stk := range stacks {\n\n\t\tif _, ok := run.stacks[stk.name]; !ok && len(run.stacks) > 0 {\n\t\t\tcontinue\n\t\t}\n\n\t\t// Set deploy status & Check if stack exists\n\t\tif stk.stackExists() {\n\t\t\tif err := stk.cleanup(); err != nil {\n\t\t\t\tLog(fmt.Sprintf(\"Failed to remove stack: [%s] - %s\", stk.name, err.Error()), level.err)\n\t\t\t\tupdateState(status, stk.name, state.failed)\n\t\t\t}\n\n\t\t\tif stk.stackExists() {\n\t\t\t\tLog(fmt.Sprintf(\"stack [%s] already exists...\\n\", stk.name), level.info)\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t}\n\t\tupdateState(status, stk.name, state.pending)\n\n\t\tif len(stk.dependsOn) == 0 {\n\t\t\twg.Add(1)\n\t\t\tgo func(s stack) {\n\t\t\t\tdefer wg.Done()\n\n\t\t\t\t// Deploy 0 Depency Stacks first - each on their on go routine\n\t\t\t\tLog(fmt.Sprintf(\"deploying a template for [%s]\", s.name), level.info)\n\n\t\t\t\tif err := s.deploy(); err != nil {\n\t\t\t\t\thandleError(err)\n\t\t\t\t}\n\n\t\t\t\tupdateState(status, s.name, state.complete)\n\n\t\t\t\t// TODO: add deploy logic here\n\t\t\t\treturn\n\t\t\t}(*stk)\n\t\t\tcontinue\n\t\t}\n\n\t\twg.Add(1)\n\t\tgo func(s *stack) {\n\t\t\tLog(fmt.Sprintf(\"[%s] depends on: %s\", s.name, s.dependsOn), \"info\")\n\t\t\tdefer wg.Done()\n\n\t\t\tLog(fmt.Sprintf(\"Beginning Wait State for Depencies of [%s]\"+\"\\n\", s.name), level.debug)\n\t\t\tfor {\n\t\t\t\tdepts := []string{}\n\t\t\t\tfor _, dept := range s.dependsOn {\n\t\t\t\t\t// Dependency wait\n\t\t\t\t\tdp, ok := stacks[dept]\n\t\t\t\t\tif !ok {\n\t\t\t\t\t\tLog(fmt.Sprintf(\"Bad dependency: [%s]\", dept), level.err)\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\n\t\t\t\t\tchk, _ := dp.state()\n\n\t\t\t\t\tswitch chk {\n\t\t\t\t\tcase state.failed:\n\t\t\t\t\t\tupdateState(status, dp.name, state.failed)\n\t\t\t\t\tcase state.complete:\n\t\t\t\t\t\tupdateState(status, dp.name, state.complete)\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tupdateState(status, dp.name, state.pending)\n\t\t\t\t\t}\n\n\t\t\t\t\tmutex.Lock()\n\t\t\t\t\tdepts = append(depts, status[dept])\n\t\t\t\t\tmutex.Unlock()\n\t\t\t\t}\n\n\t\t\t\tif all(depts, state.complete) {\n\t\t\t\t\t// Deploy stack once dependencies clear\n\t\t\t\t\tLog(fmt.Sprintf(\"Deploying a template for [%s]\", s.name), \"info\")\n\n\t\t\t\t\tif err := s.deploy(); err != nil {\n\t\t\t\t\t\thandleError(err)\n\t\t\t\t\t}\n\t\t\t\t\treturn\n\t\t\t\t}\n\n\t\t\t\tfor _, v := range depts {\n\t\t\t\t\tif v == state.failed {\n\t\t\t\t\t\tLog(fmt.Sprintf(\"Deploy Cancelled for stack [%s] due to dependency failure!\", s.name), \"warn\")\n\t\t\t\t\t\treturn\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\ttime.Sleep(time.Second * 1)\n\t\t\t}\n\t\t}(stk)\n\n\t}\n\n\t// Wait for go routines to complete\n\twg.Wait()\n}",
"func ListDeploySetsPage(cli bce.Client, args *ListDeploySetsArgs) (*ListDeploySetsResult, error) {\n\t// Build the request\n\treq := &bce.BceRequest{}\n\treq.SetUri(getDeploySetUri())\n\treq.SetMethod(http.GET)\n\n\t// Optional arguments settings\n\tif args != nil {\n\t\tif len(args.Marker) != 0 {\n\t\t\treq.SetParam(\"marker\", args.Marker)\n\t\t}\n\t\tif args.MaxKeys != 0 {\n\t\t\treq.SetParam(\"maxKeys\", strconv.Itoa(args.MaxKeys))\n\t\t}\n\t\tif len(args.Strategy) != 0 {\n\t\t\treq.SetParam(\"strategy\", args.Strategy)\n\t\t}\n\t}\n\tif args == nil || args.MaxKeys == 0 {\n\t\treq.SetParam(\"maxKeys\", \"500\")\n\t}\n\n\t// Send request and get response\n\tresp := &bce.BceResponse{}\n\tif err := cli.SendRequest(req, resp); err != nil {\n\t\treturn nil, err\n\t}\n\tif resp.IsFail() {\n\t\treturn nil, resp.ServiceError()\n\t}\n\n\tjsonBody := &ListDeploySetsResult{}\n\tif err := resp.ParseJsonBody(jsonBody); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn jsonBody, nil\n}",
"func ListDeploySets(cli bce.Client) (*ListDeploySetsResult, error) {\n\t// Build the request\n\treq := &bce.BceRequest{}\n\treq.SetUri(getDeploySetUri())\n\treq.SetMethod(http.GET)\n\n\t// Send request and get response\n\tresp := &bce.BceResponse{}\n\tif err := cli.SendRequest(req, resp); err != nil {\n\t\treturn nil, err\n\t}\n\tif resp.IsFail() {\n\t\treturn nil, resp.ServiceError()\n\t}\n\n\tjsonBody := &ListDeploySetsResult{}\n\tif err := resp.ParseJsonBody(jsonBody); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn jsonBody, nil\n}",
"func (e *Eventer) filterDeploymentsWithoutStatuses(deployments []deployment) []deployment {\n\tmatches := []deployment{}\n\n\tfor _, deployment := range deployments {\n\t\t// If there are any statuses apart from pending, we consider the\n\t\t// deployment finished, and do not act on it.\n\t\tif len(deployment.Statuses) != 0 {\n\t\t\tcontinue\n\t\t}\n\n\t\tmatches = append(matches, deployment)\n\t}\n\n\treturn matches\n}",
"func DumpPodState(_ resource.Context, c cluster.Cluster, workDir string, namespace string, pods ...corev1.Pod) {\n\tpods = podsOrFetch(c, pods, namespace)\n\n\tmarshaler := jsonpb.Marshaler{\n\t\tIndent: \" \",\n\t}\n\n\tfor _, pod := range pods {\n\t\tstr, err := marshaler.MarshalToString(&pod)\n\t\tif err != nil {\n\t\t\tscopes.Framework.Warnf(\"Error marshaling pod state for output: %v\", err)\n\t\t\tcontinue\n\t\t}\n\n\t\toutPath := outputPath(workDir, c, pod, \"pod-state.yaml\")\n\t\tif err := ioutil.WriteFile(outPath, []byte(str), os.ModePerm); err != nil {\n\t\t\tscopes.Framework.Infof(\"Error writing out pod state to file: %v\", err)\n\t\t}\n\t}\n}",
"func (tr *TestMetricsRecorder) AssertObservedStatuses(t *testing.T, uuid string, expectedStatuses ...tasks.Status) {\n\tts, ok := tr.tasks[uuid]\n\tassert.True(t, ok, \"no statuses for tasks\")\n\tfor _, status := range expectedStatuses {\n\t\tassert.Contains(t, ts, status)\n\t}\n}",
"func deploysList(w http.ResponseWriter, r *http.Request, t auth.Token) error {\n\tctx := r.Context()\n\tcontexts := permission.ContextsForPermission(t, permission.PermAppReadDeploy)\n\tif len(contexts) == 0 {\n\t\tw.WriteHeader(http.StatusNoContent)\n\t\treturn nil\n\t}\n\tfilter := appFilterByContext(contexts, nil)\n\tfilter.Name = r.URL.Query().Get(\"app\")\n\tskip := r.URL.Query().Get(\"skip\")\n\tlimit := r.URL.Query().Get(\"limit\")\n\tskipInt, _ := strconv.Atoi(skip)\n\tlimitInt, _ := strconv.Atoi(limit)\n\tdeploys, err := app.ListDeploys(ctx, filter, skipInt, limitInt)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif len(deploys) == 0 {\n\t\tw.WriteHeader(http.StatusNoContent)\n\t\treturn nil\n\t}\n\tw.Header().Add(\"Content-Type\", \"application/json\")\n\treturn json.NewEncoder(w).Encode(deploys)\n}",
"func (m *Master) printMapStatus() {\n\tfmt.Println(\"===== MAP TASK STATUS =====\")\n\tfor _, task := range m.MapState {\n\t\tfmt.Println(task.Filename, task.Progress)\n\t}\n}",
"func deploymentsHandler(c iris.Context) {\n\tc.JSON(iris.Map{\n\t\t\"deployments\": listDeployments(),\n\t})\n}",
"func (cmd *deploymentsCmd) RunDeploymentsStatus(f factory.Factory, cobraCmd *cobra.Command, args []string) error {\n\t// Set config root\n\tlogger := f.GetLog()\n\tconfigLoader := f.NewConfigLoader(cmd.ToConfigOptions(), logger)\n\tconfigExists, err := configLoader.SetDevSpaceRoot()\n\tif err != nil {\n\t\treturn err\n\t}\n\tif !configExists {\n\t\treturn errors.New(message.ConfigNotFound)\n\t}\n\n\tvar values [][]string\n\tvar headerValues = []string{\n\t\t\"NAME\",\n\t\t\"TYPE\",\n\t\t\"DEPLOY\",\n\t\t\"STATUS\",\n\t}\n\n\t// Load generated\n\tgeneratedConfig, err := configLoader.Generated()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Use last context if specified\n\terr = cmd.UseLastContext(generatedConfig, logger)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Create new kube client\n\tclient, err := f.NewKubeClientFromContext(cmd.KubeContext, cmd.Namespace, cmd.SwitchContext)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Show warning if the old kube context was different\n\terr = client.PrintWarning(generatedConfig, cmd.NoWarn, false, logger)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Get config with adjusted cluster config\n\tconfig, err := configLoader.Load()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// Signal that we are working on the space if there is any\n\tresumer := f.NewSpaceResumer(client, logger)\n\terr = resumer.ResumeSpace(true)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif config.Deployments != nil {\n\t\thelmV2Clients := map[string]helmtypes.Client{}\n\n\t\tfor _, deployConfig := range config.Deployments {\n\t\t\tvar deployClient deployer.Interface\n\n\t\t\t// Delete kubectl engine\n\t\t\tif deployConfig.Kubectl != nil {\n\t\t\t\tdeployClient, err = deployKubectl.New(config, client, deployConfig, logger)\n\t\t\t\tif err != nil {\n\t\t\t\t\tlogger.Warnf(\"Unable to create kubectl deploy config for %s: %v\", deployConfig.Name, err)\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t} else if deployConfig.Helm != nil {\n\t\t\t\thelmClient, err := deploy.GetCachedHelmClient(config, deployConfig, client, helmV2Clients, false, logger)\n\t\t\t\tif err != nil {\n\t\t\t\t\tlogger.Warnf(\"Unable to create helm deploy config for %s: %v\", deployConfig.Name, err)\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\n\t\t\t\tdeployClient, err = deployHelm.New(config, helmClient, client, deployConfig, logger)\n\t\t\t\tif err != nil {\n\t\t\t\t\tlogger.Warnf(\"Unable to create helm deploy config for %s: %v\", deployConfig.Name, err)\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tlogger.Warnf(\"No deployment method defined for deployment %s\", deployConfig.Name)\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tstatus, err := deployClient.Status()\n\t\t\tif err != nil {\n\t\t\t\tlogger.Warnf(\"Error retrieving status for deployment %s: %v\", deployConfig.Name, err)\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tvalues = append(values, []string{\n\t\t\t\tstatus.Name,\n\t\t\t\tstatus.Type,\n\t\t\t\tstatus.Target,\n\t\t\t\tstatus.Status,\n\t\t\t})\n\t\t}\n\t}\n\n\tlogpkg.PrintTable(logger, headerValues, values)\n\treturn nil\n}",
"func printStatus(repos []string) {\n\tvar waitGroup sync.WaitGroup\n\tresults := [4]string{\n\t\t\"CLEAN \",\n\t\t\"UNCLEAN \",\n\t\t\"ERROR \",\n\t\t\"UNKNOWN \",\n\t}\n\tfor _, repoPath := range repos {\n\t\twaitGroup.Add(1)\n\t\tgo func(repoPath string) {\n\t\t\tdefer waitGroup.Done()\n\t\t\trepoPath, err := filepath.Abs(repoPath)\n\t\t\tif err != nil {\n\t\t\t\tfmt.Printf(\" %s%s: %v\\n\", results[3], repoPath, err)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tGitRepo, err := git.PlainOpen(repoPath)\n\t\t\tif err != nil {\n\t\t\t\tfmt.Printf(\" %s%s\\n\", results[2], repoPath)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tGitWorktree, err := GitRepo.Worktree()\n\t\t\tif err != nil {\n\t\t\t\tfmt.Printf(\" %s%s: %v\\n\", results[3], repoPath, err)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tGitStatus, err := GitWorktree.Status()\n\t\t\tif err != nil {\n\t\t\t\tfmt.Printf(\" %s%s: %v\\n\", results[3], repoPath, err)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tif GitStatus.IsClean() {\n\t\t\t\tfmt.Printf(\" %s%s\\n\", results[0], repoPath)\n\t\t\t} else {\n\t\t\t\tfmt.Printf(\" %s%s\\n\", results[1], repoPath)\n\t\t\t}\n\t\t}(repoPath)\n\t}\n\twaitGroup.Wait()\n}",
"func (in *DeployFlowStatus) DeepCopy() *DeployFlowStatus {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(DeployFlowStatus)\n\tin.DeepCopyInto(out)\n\treturn out\n}",
"func Status(db *sql.DB, dir string) error {\n\t// collect all migrations\n\tmigrations, err := CollectMigrations(dir, minVersion, maxVersion)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// must ensure that the version table exists if we're running on a pristine DB\n\tif _, err := EnsureDBVersion(db); err != nil {\n\t\treturn err\n\t}\n\n\tlog.Println(\" Applied At Migration\")\n\tlog.Println(\" =======================================\")\n\tfor _, migration := range migrations {\n\t\tprintMigrationStatus(db, migration.Version, filepath.Base(migration.Source))\n\t}\n\n\treturn nil\n}",
"func Index(c *gin.Context) {\n\tproj := controllers.CurrentProject(c)\n\n\tdb, err := dbconn.DB()\n\tif err != nil {\n\t\tcontrollers.InternalServerError(c, err)\n\t\treturn\n\t}\n\n\tdepls, err := deployment.CompletedDeployments(db, proj.ID, proj.MaxDeploysKept)\n\tif err != nil {\n\t\tcontrollers.InternalServerError(c, err)\n\t\treturn\n\t}\n\n\tvar deplsToJSON []interface{}\n\tfor _, depl := range depls {\n\t\tdeplJSON := depl.AsJSON()\n\t\tdeplJSON.Active = depl.ID == *proj.ActiveDeploymentID\n\t\tdeplsToJSON = append(deplsToJSON, deplJSON)\n\t}\n\n\tc.JSON(http.StatusOK, gin.H{\n\t\t\"deployments\": deplsToJSON,\n\t})\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
readAsync implements a nonblocking read.
|
func readAsync(r io.Reader, p []byte) <-chan ioResult {
resultCh := make(chan ioResult, 1)
go func() {
defer close(resultCh)
n, err := r.Read(p)
resultCh <- ioResult{n, err}
}()
return resultCh
}
|
[
"func (device *REDBrick) ReadFileAsync(fileId uint16, lengthToRead uint64) (err error) {\n\tvar buf bytes.Buffer\n\tbinary.Write(&buf, binary.LittleEndian, fileId)\n\tbinary.Write(&buf, binary.LittleEndian, lengthToRead)\n\n\tresultBytes, err := device.device.Set(uint8(FunctionReadFileAsync), buf.Bytes())\n\tif err != nil {\n\t\treturn err\n\t}\n\tif len(resultBytes) > 0 {\n\t\tvar header PacketHeader\n\n\t\theader.FillFromBytes(resultBytes)\n\n\t\tif header.Length != 8 {\n\t\t\treturn fmt.Errorf(\"Received packet of unexpected size %d, instead of %d\", header.Length, 8)\n\t\t}\n\n\t\tif header.ErrorCode != 0 {\n\t\t\treturn DeviceError(header.ErrorCode)\n\t\t}\n\n\t\tbytes.NewBuffer(resultBytes[8:])\n\n\t}\n\n\treturn nil\n}",
"func read_blocking(id string, t int) (v int32, err error) {\n\tfor {\n\t\tv, err = read(id)\n\t\tif err == nil {\n\t\t\tbreak\n\t\t}\n\t\tif err.Error() == \"empty\" {\n\t\t\tlog.Println(\"Empty stream. Retry in\", t, \"seconds...\")\n\t\t\ttime.Sleep(time.Duration(t) * time.Second)\n\t\t} else {\n\t\t\treturn\n\t\t}\n\t}\n\treturn\n}",
"func (c *streamChannel) SyncRead() ([]byte, error) {\n\tc.srMu.Lock()\n\tdefer c.srMu.Unlock()\n\n\tn, err := c.stream.Read(c.syncBuff)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn c.syncBuff[:n], nil\n}",
"func UA_Client_AsyncService_read(client []UA_Client, request []UA_ReadRequest, callback UA_ClientAsyncServiceCallback, userdata interface{}, requestId []UA_UInt32) UA_StatusCode {\n\treturn __UA_Client_AsyncService(client, request, (*[100000000]UA_DataType)(unsafe.Pointer(&UA_TYPES[163]))[:], UA_ClientAsyncServiceCallback(callback), (*[100000000]UA_DataType)(unsafe.Pointer(&UA_TYPES[161]))[:], userdata, requestId)\n}",
"func libc_read(fd int32, buf *byte, count uint) int",
"func (c *Client) GetAsync(key []byte) ([]byte, error) {\n\n\terr := c.send(msgGetAsync, key)\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tresponse, err := c.readResponse(msgResponse, 1)\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn response[0], err\n}",
"func (c *ClientImpl) Read(ctx context.Context, filename string) (*bytes.Reader, error) {\n\tc.mu.Lock()\n\tdefer c.mu.Unlock()\n\tt := c.newTransfer(opRrq, filename)\n\tattempts := 0\n\ttransferStarted := false\n\tfor {\n\t\tif !transferStarted {\n\t\t\t// Send the request to read the file.\n\t\t\terr := t.request()\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t}\n\t\trecv, err := t.wait(ctx, expectAny)\n\t\ttransferStarted = transferStarted || recv == opOack || recv == opData\n\t\tif err != nil {\n\t\t\tif err, ok := err.(net.Error); ok && err.Timeout() {\n\t\t\t\tattempts++\n\t\t\t\tif attempts < retries {\n\t\t\t\t\tif !transferStarted {\n\t\t\t\t\t\tt.cancel(errorUndefined, err)\n\t\t\t\t\t}\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tif err == io.EOF {\n\t\t\t\treturn bytes.NewReader(t.buffer.Bytes()), nil\n\t\t\t}\n\t\t\tt.cancel(errorUndefined, err)\n\t\t\treturn nil, err\n\t\t}\n\t\tif ctx.Err() != nil {\n\t\t\tt.cancel(errorUndefined, ctx.Err())\n\t\t\treturn nil, ctx.Err()\n\t\t}\n\t}\n}",
"func NewAsyncReader() *AsyncReader {\n\treturn &AsyncReader{\n\t\tmake(chan []byte),\n\t\tmake(chan int),\n\t\tmake(chan error),\n\t}\n}",
"func (t *timeoutReader) Read(p []byte) (int, error) {\n\t// FIXME limit the amount of data read in one chunk so as to not exceed the timeout?\n\t// Do the read in the background\n\ttype result struct {\n\t\tn int\n\t\terr error\n\t}\n\tdone := make(chan result, 1)\n\tgo func() {\n\t\tn, err := t.reader.Read(p)\n\t\tdone <- result{n, err}\n\t}()\n\t// Wait for the read or the timeout\n\ttimer := time.NewTimer(t.timeout)\n\tdefer timer.Stop()\n\tselect {\n\tcase r := <-done:\n\t\treturn r.n, r.err\n\tcase <-timer.C:\n\t\tt.cancel()\n\t\treturn 0, TimeoutError\n\t}\n\tpanic(\"unreachable\") // for Go 1.0\n}",
"func Read(c Consumer, done <-chan struct{}, fn func([]byte, error)) {\n\tif fn == nil {\n\t\tfn = defaultFn\n\t}\n\tc.Open()\n\tread(c, done, fn)\n\tc.Close()\n}",
"func (p *peer) read() {\n\tdefer p.close() // close after function (after loop break)\n\tfor {\n\t\tvar m Message\n\t\terr := p.conn.ReadJSON(&m) // blocks until message comes\n\t\tif err != nil {\n\t\t\tbreak\n\t\t}\n\t\thandleMessage(&m, p)\n\t}\n}",
"func (c *Client) listenRead() {\n\tlog.Println(\"Listening read from client\")\n\tfor {\n\t\tselect {\n\n\t\t// receive done request\n\t\tcase <-c.doneCh:\n\t\t\tc.server.Del(c)\n\t\t\tc.doneCh <- true // for listenWrite method\n\t\t\treturn\n\n\t\t// read data from net connection\n\t\tdefault:\n\t\t\tb := make([]byte, 10)\n\t\t\tlength, err := c.conn.Read(b)\n\t\t\tif err == io.EOF {\n\t\t\t\tc.doneCh <- true\n\t\t\t\tc.manager.Handler.OnDisconnected(c.id)\n\t\t\t} else if err != nil {\n\t\t\t\tc.server.Err(err)\n\t\t\t} else {\n\t\t\t\t//log.Printf(\"Client(%d) recv raw: % x\\n\", c.id, b)\n\t\t\t\tc.buf.Write(b[0:length])\n\n\t\t\t\tpayload := &Payload{}\n\t\t\t\terr, more, left := payload.Decode(c.buf.Bytes())\n\t\t\t\tif err != nil {\n\t\t\t\t\tlog.Printf(\"Client(%d) payload.Decode err: %s\", c.id, err.Error())\n\t\t\t\t\tc.doneCh <- true\n\t\t\t\t\treturn\n\t\t\t\t}\n\n\t\t\t\tif more {\n\t\t\t\t\tcontinue\n\t\t\t\t} else {\n\t\t\t\t\tc.buf.Reset()\n\t\t\t\t\tif len(left) > 0 {\n\t\t\t\t\t\tc.buf.Write(left)\n\t\t\t\t\t}\n\n\t\t\t\t\tc.manager.Handler.OnRecievePayload(c.id, payload)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}",
"func (mock ReadCloserMock) Read(p []byte) (n int, err error) {\n\tmethodName := \"Read\" // nolint: goconst\n\tif mock.impl.Read != nil {\n\t\treturn mock.impl.Read(p)\n\t}\n\tif mock.callbackNotImplemented != nil {\n\t\tmock.callbackNotImplemented(mock.t, mock.name, methodName)\n\t} else {\n\t\tgomic.DefaultCallbackNotImplemented(mock.t, mock.name, methodName)\n\t}\n\treturn mock.fakeZeroRead(p)\n}",
"func (fd *FD) RawRead(f func(uintptr) bool) error {\n\treturn errors.New(\"not implemented\")\n}",
"func (r *AsyncReader) Fetch() []byte {\n\treturn <-r.bufChannel\n}",
"func (s *Script) RunAsync(ctx context.Context, c <-chan reader.LogEvent) {\n\tfor {\n\t\tselect {\n\t\tcase <-ctx.Done():\n\t\t\treturn\n\t\tcase event := <-c:\n\t\t\ts.logger.Debug().Msgf(\"log event received from reader : %s\", event.Source)\n\t\t\ts.Run(ctx, event)\n\t\t}\n\t}\n}",
"func (srwc secureReadWriteCloser) Read(p []byte) (int, error) {\n\treturn srwc.r.Read(p)\n}",
"func (i *Inotify) Read() ([]InotifyEvent, error) {\n\tfor {\n\t\tevts, err := i.ReadDeadline(time.Now().Add(time.Millisecond * 200))\n\t\tif err != nil {\n\t\t\tif err == TimeoutError {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\treturn evts, err\n\t\t}\n\t\tif len(evts) > 0 {\n\t\t\treturn evts, nil\n\t\t}\n\t}\n}",
"func TestReadWithoutDeadline(t *testing.T) {\n\ttestCtx, testCtxCancel := context.WithCancel(context.Background())\n\tdefer testCtxCancel()\n\n\t_, _, conn := buildTestChannels(testCtx, nil)\n\texpectToBlock(t, func() error {\n\t\tbuf := make([]byte, 10)\n\t\t_, _, err := conn.ReadFrom(buf)\n\t\treturn err\n\t})\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
copyAsync performs a nonblocking copy from src to dst.
|
func copyAsync(dst io.Writer, src io.Reader, stopCh <-chan struct{}) <-chan ioResult {
resultCh := make(chan ioResult, 1)
go func() {
defer close(resultCh)
buf := make([]byte, 1024)
result := ioResult{}
readCh := readAsync(src, buf)
stopped := false
done := false
timer := time.NewTimer(time.Duration(math.MaxInt64))
defer timer.Stop()
for !done {
// If the stop channel is signalled, continue the loop to read the rest of the available
// data with a short timeout instead of a non-blocking read to mitigate the race between
// this loop and Read() running in another goroutine.
if stopped {
if !timer.Stop() {
<-timer.C
}
timer.Reset(100 * time.Millisecond)
}
select {
case r := <-readCh:
if r.numBytes != 0 {
nw, err := dst.Write(buf[:r.numBytes])
result.numBytes += nw
if err != nil {
result.err = err
done = true
} else if nw < r.numBytes {
result.err = io.ErrShortWrite
done = true
}
}
if r.err != nil {
if !errors.Is(r.err, io.EOF) {
result.err = r.err
}
done = true
}
if !done {
readCh = readAsync(src, buf)
}
case <-stopCh:
stopped = true
stopCh = nil
case <-timer.C:
done = true
}
}
resultCh <- result
}()
return resultCh
}
|
[
"func (_m *Mockec2clientstub) CopyImageAsync(ctx internal.Context, input *ec2.CopyImageInput) (_result_0 *ec2stub.CopyImageFuture) {\n\tret := _m.Called(ctx, input)\n\n\tvar r0 *ec2stub.CopyImageFuture\n\tif rf, ok := ret.Get(0).(func(internal.Context, *ec2.CopyImageInput) *ec2stub.CopyImageFuture); ok {\n\t\tr0 = rf(ctx, input)\n\t} else {\n\t\tif ret.Get(0) != nil {\n\t\t\tr0 = ret.Get(0).(*ec2stub.CopyImageFuture)\n\t\t}\n\t}\n\n\treturn r0\n}",
"func (c *Client) copy(src io.Reader, dstpath, perms string, sz int64) error {\n\tsess, err := c.NewSession()\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer sess.Close()\n\n\tfile := path.Base(dstpath)\n\tdirp := path.Dir(dstpath)\n\n\tgo func() {\n\t\tdst, err := sess.StdinPipe()\n\t\tif err != nil {\n\t\t\treturn\n\t\t}\n\t\tdefer dst.Close()\n\n\t\t// TODO: We should probably only copy `sz` number of bytes here.\n\t\tfmt.Fprintf(dst, \"C%s %d %s\\n\", perms, sz, file)\n\t\tio.Copy(dst, src)\n\t\tfmt.Fprintf(dst, \"\\x00\")\n\t}()\n\n\treturn sess.Run(\"/usr/bin/scp -qt \" + dirp)\n}",
"func (_m *Mockec2clientstub) CopySnapshotAsync(ctx internal.Context, input *ec2.CopySnapshotInput) (_result_0 *ec2stub.CopySnapshotFuture) {\n\tret := _m.Called(ctx, input)\n\n\tvar r0 *ec2stub.CopySnapshotFuture\n\tif rf, ok := ret.Get(0).(func(internal.Context, *ec2.CopySnapshotInput) *ec2stub.CopySnapshotFuture); ok {\n\t\tr0 = rf(ctx, input)\n\t} else {\n\t\tif ret.Get(0) != nil {\n\t\t\tr0 = ret.Get(0).(*ec2stub.CopySnapshotFuture)\n\t\t}\n\t}\n\n\treturn r0\n}",
"func (d *Destination) SendAsync(payload []byte) {\n\td.once.Do(func() {\n\t\tpayloadChan := make(chan []byte, config.ChanSize)\n\t\td.sendInBackground(payloadChan)\n\t\td.payloadChan = payloadChan\n\t})\n\td.payloadChan <- payload\n}",
"func (client *Client) CopySnapshotWithCallback(request *CopySnapshotRequest, callback func(response *CopySnapshotResponse, err error)) <-chan int {\n\tresult := make(chan int, 1)\n\terr := client.AddAsyncTask(func() {\n\t\tvar response *CopySnapshotResponse\n\t\tvar err error\n\t\tdefer close(result)\n\t\tresponse, err = client.CopySnapshot(request)\n\t\tcallback(response, err)\n\t\tresult <- 1\n\t})\n\tif err != nil {\n\t\tdefer close(result)\n\t\tcallback(nil, err)\n\t\tresult <- 0\n\t}\n\treturn result\n}",
"func Copy(src, dst string, opt ...Option) error {\n\to := makeOptions(opt...)\n\tsrcRef, err := name.ParseReference(src, o.Name...)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"parsing reference %q: %w\", src, err)\n\t}\n\n\tdstRef, err := name.ParseReference(dst, o.Name...)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"parsing reference for %q: %w\", dst, err)\n\t}\n\n\tpuller, err := remote.NewPuller(o.Remote...)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif tag, ok := dstRef.(name.Tag); ok {\n\t\tif o.noclobber {\n\t\t\tlogs.Progress.Printf(\"Checking existing tag %v\", tag)\n\t\t\thead, err := puller.Head(o.ctx, tag)\n\t\t\tvar terr *transport.Error\n\t\t\tif errors.As(err, &terr) {\n\t\t\t\tif terr.StatusCode != http.StatusNotFound && terr.StatusCode != http.StatusForbidden {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t} else if err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tif head != nil {\n\t\t\t\treturn fmt.Errorf(\"refusing to clobber existing tag %s@%s\", tag, head.Digest)\n\t\t\t}\n\t\t}\n\t}\n\n\tpusher, err := remote.NewPusher(o.Remote...)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tlogs.Progress.Printf(\"Copying from %v to %v\", srcRef, dstRef)\n\tdesc, err := puller.Get(o.ctx, srcRef)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"fetching %q: %w\", src, err)\n\t}\n\n\tif o.Platform == nil {\n\t\treturn pusher.Push(o.ctx, dstRef, desc)\n\t}\n\n\t// If platform is explicitly set, don't copy the whole index, just the appropriate image.\n\timg, err := desc.Image()\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn pusher.Push(o.ctx, dstRef, img)\n}",
"func proxyCopy(\n\tctx context.Context, errc chan error,\n\tdst, src net.Conn,\n) {\n\tnl := zlg.Logger.With(\n\t\tzap.String(\"component\", \"proxyCopy\"),\n\t\tzap.String(\"src\", hashConn(src)),\n\t\tzap.String(\"dst\", hashConn(dst)),\n\t)\n\tnl.Debug(\"Start copying ...\")\n\tdefer func() {\n\t\tnl.Debug(\"Done copying\")\n\t}()\n\t// Before we unwrap src and/or dst, copy any buffered data.\n\tif wc, ok := src.(*Conn); ok && len(wc.Peeked) > 0 {\n\t\tif _, err := dst.Write(wc.Peeked); err != nil {\n\t\t\tnl.Error(err.Error() + \"Failed to write to connection\")\n\t\t\terrc <- err\n\t\t\treturn\n\t\t}\n\t\twc.Peeked = nil\n\t}\n\n\t// Unwrap the src and dst from *Conn to *net.TCPConn so Go\n\t// 1.11's splice optimization kicks in.\n\tsrc = UnderlyingConn(src)\n\tdst = UnderlyingConn(dst)\n\t_, err := io.Copy(dst, src)\n\terrc <- err\n}",
"func (_m *Mockec2clientstub) CopyFpgaImageAsync(ctx internal.Context, input *ec2.CopyFpgaImageInput) (_result_0 *ec2stub.CopyFpgaImageFuture) {\n\tret := _m.Called(ctx, input)\n\n\tvar r0 *ec2stub.CopyFpgaImageFuture\n\tif rf, ok := ret.Get(0).(func(internal.Context, *ec2.CopyFpgaImageInput) *ec2stub.CopyFpgaImageFuture); ok {\n\t\tr0 = rf(ctx, input)\n\t} else {\n\t\tif ret.Get(0) != nil {\n\t\t\tr0 = ret.Get(0).(*ec2stub.CopyFpgaImageFuture)\n\t\t}\n\t}\n\n\treturn r0\n}",
"func (client Client) CopyAndWait(ctx context.Context, accountName, containerName, blobName string, input CopyInput, pollingInterval time.Duration) error {\n\tif _, err := client.Copy(ctx, accountName, containerName, blobName, input); err != nil {\n\t\treturn fmt.Errorf(\"Error copying: %s\", err)\n\t}\n\n\tfor true {\n\t\tgetInput := GetPropertiesInput{\n\t\t\tLeaseID: input.LeaseID,\n\t\t}\n\t\tgetResult, err := client.GetProperties(ctx, accountName, containerName, blobName, getInput)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"\")\n\t\t}\n\n\t\tswitch getResult.CopyStatus {\n\t\tcase Aborted:\n\t\t\treturn fmt.Errorf(\"Copy was aborted: %s\", getResult.CopyStatusDescription)\n\n\t\tcase Failed:\n\t\t\treturn fmt.Errorf(\"Copy failed: %s\", getResult.CopyStatusDescription)\n\n\t\tcase Success:\n\t\t\treturn nil\n\n\t\tcase Pending:\n\t\t\ttime.Sleep(pollingInterval)\n\t\t\tcontinue\n\t\t}\n\t}\n\n\treturn fmt.Errorf(\"Unexpected error waiting for the copy to complete\")\n}",
"func Copy(dst interface{}, src interface{}) error {\n\tif dst == nil {\n\t\treturn fmt.Errorf(\"dst cannot be nil\")\n\t}\n\tif src == nil {\n\t\treturn fmt.Errorf(\"src cannot be nil\")\n\t}\n\tbytes, err := json.Marshal(src)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Unable to marshal src: %s\", err)\n\t}\n\terr = json.Unmarshal(bytes, dst)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Unable to unmarshal into dst: %s\", err)\n\t}\n\treturn nil\n}",
"func (s *Sender) SendAsync(destAddr string, coins int64, opt *SendOption) (<-chan interface{}, error) {\n\trspC := make(chan interface{}, 1)\n\treq := Request{\n\t\tAddress: destAddr,\n\t\tCoins: coins,\n\t\tRspC: rspC,\n\t}\n\n\ttimeout := time.Minute\n\tif opt != nil {\n\t\ttimeout = opt.Timeout\n\t}\n\n\tselect {\n\tcase s.s.reqChan <- req:\n\tcase <-time.After(timeout):\n\t\treturn rspC, ErrSendBufferFull\n\t}\n\treturn rspC, nil\n}",
"func (client *Client) CopySnapshotWithChan(request *CopySnapshotRequest) (<-chan *CopySnapshotResponse, <-chan error) {\n\tresponseChan := make(chan *CopySnapshotResponse, 1)\n\terrChan := make(chan error, 1)\n\terr := client.AddAsyncTask(func() {\n\t\tdefer close(responseChan)\n\t\tdefer close(errChan)\n\t\tresponse, err := client.CopySnapshot(request)\n\t\tif err != nil {\n\t\t\terrChan <- err\n\t\t} else {\n\t\t\tresponseChan <- response\n\t\t}\n\t})\n\tif err != nil {\n\t\terrChan <- err\n\t\tclose(responseChan)\n\t\tclose(errChan)\n\t}\n\treturn responseChan, errChan\n}",
"func copyFile(src, dst string, isFailIfExists bool) error {\n\t_src, err := windows.UTF16PtrFromString(src)\n\tif err != nil {\n\t\treturn err\n\t}\n\t_dst, err := windows.UTF16PtrFromString(dst)\n\tif err != nil {\n\t\treturn err\n\t}\n\tvar flag uintptr\n\tif isFailIfExists {\n\t\tflag |= 1\n\t}\n\tvar progressCopy1 progressCopy\n\tprogressCopy1.last = time.Now()\n\n\tvar cancel uintptr\n\tvar rc uintptr\n\n\trc, _, err = procCopyFileW.Call(\n\t\tuintptr(unsafe.Pointer(_src)),\n\t\tuintptr(unsafe.Pointer(_dst)),\n\t\twindows.NewCallbackCDecl(progressPrintCallBack),\n\t\tuintptr(unsafe.Pointer(&progressCopy1)),\n\t\tuintptr(unsafe.Pointer(&cancel)),\n\t\tflag)\n\n\tif progressCopy1.run {\n\t\tfmt.Printf(\"%*s\\r\", progressCopy1.n, \"\")\n\t}\n\tif rc == 0 {\n\t\treturn err\n\t}\n\treturn nil\n}",
"func copyWithTimeout(dst io.Writer, src io.Reader, size int64, timeoutSeconds int, context string) (int64, error) {\n\tlogrus.Debugf(\"opengcs: copywithtimeout: size %d: timeout %d: (%s)\", size, timeoutSeconds, context)\n\n\ttype resultType struct {\n\t\terr error\n\t\tbytes int64\n\t}\n\n\tdone := make(chan resultType, 1)\n\tgo func() {\n\t\tresult := resultType{}\n\t\tif logrus.GetLevel() < logrus.DebugLevel || logDataFromUVM == 0 {\n\t\t\tresult.bytes, result.err = io.Copy(dst, src)\n\t\t} else {\n\t\t\t// In advanced debug mode where we log (hexdump format) what is copied\n\t\t\t// up to the number of bytes defined by environment variable\n\t\t\t// OPENGCS_LOG_DATA_FROM_UVM\n\t\t\tvar buf bytes.Buffer\n\t\t\ttee := io.TeeReader(src, &buf)\n\t\t\tresult.bytes, result.err = io.Copy(dst, tee)\n\t\t\tif result.err == nil {\n\t\t\t\tsize := result.bytes\n\t\t\t\tif size > logDataFromUVM {\n\t\t\t\t\tsize = logDataFromUVM\n\t\t\t\t}\n\t\t\t\tif size > 0 {\n\t\t\t\t\tbytes := make([]byte, size)\n\t\t\t\t\tif _, err := buf.Read(bytes); err == nil {\n\t\t\t\t\t\tlogrus.Debugf(fmt.Sprintf(\"opengcs: copyWithTimeout\\n%s\", hex.Dump(bytes)))\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tdone <- result\n\t}()\n\n\tvar result resultType\n\ttimedout := time.After(time.Duration(timeoutSeconds) * time.Second)\n\n\tselect {\n\tcase <-timedout:\n\t\treturn 0, fmt.Errorf(\"opengcs: copyWithTimeout: timed out (%s)\", context)\n\tcase result = <-done:\n\t\tif result.err != nil && result.err != io.EOF {\n\t\t\t// See https://github.com/golang/go/blob/f3f29d1dea525f48995c1693c609f5e67c046893/src/os/exec/exec_windows.go for a clue as to why we are doing this :)\n\t\t\tif se, ok := result.err.(syscall.Errno); ok {\n\t\t\t\tconst (\n\t\t\t\t\terrNoData = syscall.Errno(232)\n\t\t\t\t\terrBrokenPipe = syscall.Errno(109)\n\t\t\t\t)\n\t\t\t\tif se == errNoData || se == errBrokenPipe {\n\t\t\t\t\tlogrus.Debugf(\"opengcs: copyWithTimeout: hit NoData or BrokenPipe: %d: %s\", se, context)\n\t\t\t\t\treturn result.bytes, nil\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn 0, fmt.Errorf(\"opengcs: copyWithTimeout: error reading: '%s' after %d bytes (%s)\", result.err, result.bytes, context)\n\t\t}\n\t}\n\tlogrus.Debugf(\"opengcs: copyWithTimeout: success - copied %d bytes (%s)\", result.bytes, context)\n\treturn result.bytes, nil\n}",
"func copyFromURL(dstFile, srcURL string) (err error) {\n\tf, err := os.Create(dstFile)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer func() {\n\t\tif err != nil {\n\t\t\tf.Close()\n\t\t\tos.Remove(dstFile)\n\t\t}\n\t}()\n\tc := &http.Client{\n\t\tTransport: &userAgentTransport{&http.Transport{\n\t\t\t// It's already compressed. Prefer accurate ContentLength.\n\t\t\t// (Not that GCS would try to compress it, though)\n\t\t\tDisableCompression: true,\n\t\t\tDisableKeepAlives: true,\n\t\t\tProxy: http.ProxyFromEnvironment,\n\t\t}},\n\t}\n\tres, err := c.Get(srcURL)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer res.Body.Close()\n\tif res.StatusCode != http.StatusOK {\n\t\treturn errors.New(res.Status)\n\t}\n\tpw := &progressWriter{w: f, total: res.ContentLength}\n\tn, err := io.Copy(pw, res.Body)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif res.ContentLength != -1 && res.ContentLength != n {\n\t\treturn fmt.Errorf(\"copied %v bytes; expected %v\", n, res.ContentLength)\n\t}\n\tpw.update() // 100%\n\treturn f.Close()\n}",
"func lazyCopy(dst io.Writer, src io.Reader) error {\n\n\tbuffer := make([]byte, 4096)\n\n\tbackOffDelay := BackOffReadInitialSleepDuration\n\n\tfor {\n\t\tsize, err := src.Read(buffer)\n\t\tif size > 0 {\n\t\t\tif _, err := dst.Write(buffer[:size]); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tbackOffDelay = BackOffReadInitialSleepDuration\n\t\t}\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif size == 0 {\n\t\t\t// if there was no data to read, wait a little while before trying again\n\t\t\ttime.Sleep(backOffDelay)\n\t\t\tbackOffDelay = backOffDelay * 2\n\t\t\tif backOffDelay > BackOffReadMaxSleepDuration {\n\t\t\t\tbackOffDelay = BackOffReadMaxSleepDuration\n\t\t\t}\n\t\t}\n\t}\n}",
"func cp(src string, dest string) error {\n\tsrcHandle, err := os.Open(src)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer srcHandle.Close()\n\tdestHandle, err := os.Create(dest)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif _, err := io.Copy(destHandle, srcHandle); err != nil {\n\t\tdestHandle.Close()\n\t\treturn err\n\t}\n\treturn destHandle.Close()\n}",
"func (a Artifactory) Copy(args CopyArgs) error {\n\tparams := services.NewMoveCopyParams()\n\tparams.ArtifactoryCommonParams = &utils.ArtifactoryCommonParams{\n\t\tPattern: args.Source,\n\t\tRecursive: args.Recursive,\n\t\tTarget: args.Target,\n\t}\n\tparams.Flat = args.Flat\n\n\tlogrus.WithFields(logrus.Fields{\n\t\t\"action\": \"copy\",\n\t\t\"args\": args,\n\t}).Debug()\n\n\tlogrus.Infof(\"Copy %s to %s\", args.Source, args.Target)\n\t_, _, err := a.client.Copy(params)\n\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}",
"func CopyWorker(source <-chan string, destpath string, downloader *s3manager.Downloader, bucket string, ignoreFiles map[string]bool, wg *sync.WaitGroup) {\n\t//func (d Downloader) Download(w io.WriterAt, input *s3.GetObjectInput, options ...func(*Downloader)) (n int64, err error)\n\twg.Add(1)\n\tdefer log.Debugf(\"Copy worker returning\")\n\tdefer wg.Done()\n\tfor filename := range source {\n\t\tignore, ok := ignoreFiles[filename]\n\t\tif !ok || (ok && !ignore) {\n\t\t\toutfile, err := os.OpenFile(filepath.Join(destpath, filename), os.O_WRONLY|os.O_CREATE, 0755)\n\t\t\tif err != nil {\n\t\t\t\tlog.Fatalf(\"Copy worker %v\", err)\n\t\t\t} else {\n\t\t\t\tdefer outfile.Close()\n\t\t\t\t_, err = downloader.Download(outfile,\n\t\t\t\t\t&s3.GetObjectInput{\n\t\t\t\t\t\tBucket: aws.String(bucket),\n\t\t\t\t\t\tKey: aws.String(filename),\n\t\t\t\t\t})\n\t\t\t\tif err != nil {\n\t\t\t\t\tlog.Fatalf(\"Copy worker %v\", err)\n\t\t\t\t}\n\t\t\t\tlog.Infof(\"Copy worker copied %s!\", filename)\n\t\t\t}\n\t\t}\n\t}\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
Open is a helper function that takes as input a connection string for a DB, and returns either a sqlx.DB instance or an error. This function is separated out to help with CLI tasks for managing migrations.
|
func Open(connStr string) (*sqlx.DB, error) {
return sqlx.Open("postgres", connStr)
}
|
[
"func Open(flavor string, args ...interface{}) (db *sqlx.DB, err error) {\n\n\tif len(args) != 1 {\n\t\treturn nil, fmt.Errorf(\"incorrect number of args detected in Open()\")\n\t}\n\tdb, err = sqlx.Connect(flavor, args[0].(string))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn db, nil\n}",
"func Open(driverName, dataSourceName string) (*DB, error) {\n\tvar sqldb, err = sql.Open(driverName, dataSourceName)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn Wrap(sqldb), nil\n}",
"func (conn *Connection) Open() (*sql.DB, error) {\n\tcxn, err := conn.String()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn sql.Open(conn.DriverPackage, cxn)\n}",
"func (s *appDB) Open() error {\n\tvar err error\n\tif s.Path == \"\" {\n\t\treturn fmt.Errorf(\"database not configured, run init command\")\n\t}\n\tif s.db == nil {\n\t\ts.db, err = appdb.Open(s.Path, s.AppName, schemaVersion)\n\t}\n\treturn err\n}",
"func OpenDB(ctx context.Context, socket string, conf *DBConfig, rootDB bool) (*sql.DB, error) {\n\tif conf.openDBMock != nil {\n\t\treturn conf.openDBMock()\n\t}\n\n\tlogging.Infof(ctx, \"Connecting to %s DB (%q at %s) as %q...\", conf.ID, conf.DB, conf.CloudSQLInstance, conf.User)\n\n\tdbName := conf.DB\n\tif rootDB {\n\t\tdbName = \"\"\n\t}\n\n\tpassword := \"\"\n\tif conf.RequirePassword {\n\t\tvar err error\n\t\tpassword, err = ReadPassword(\n\t\t\tfmt.Sprintf(\"Enter password for user %q on %s (for %s DB):\", conf.User, conf.CloudSQLInstance, conf.ID))\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\t// Note: multiStatements is needed by 'migrate' library.\n\treturn sql.Open(\"mysql\", fmt.Sprintf(\"%s:%s@unix(%s)/%s?multiStatements=true\", conf.User, password, socket, dbName))\n}",
"func Open() error {\n\tconfig := config.GetConfig()\n\n\tdsn := \"user=\" + config.Database.User + \" host=\" + config.Database.Host + \" password=\" + config.Database.Password + \" port=\" + config.Database.Port + \" dbname=\" + config.Database.Name + \" sslmode=disable\"\n\n\tsqlDB, err := sql.Open(\"postgres\", dsn)\n\n\tif err != nil {\n\t\tlog.Println(err.Error())\n\t\treturn err\n\t}\n\n\tlog.Println(\"Connection stabilished\")\n\n\tdb, err = gorm.Open(postgres.New(postgres.Config{\n\t\tConn: sqlDB,\n\t}), &gorm.Config{\n\t\tSkipDefaultTransaction: true,\n\t})\n\n\tif err != nil {\n\t\tlog.Println(\"GORM failed to initialize database with current connection\")\n\t\treturn err\n\t}\n\n\treturn nil\n}",
"func Open(username, password, db string) (*gorm.DB, error) {\n\t// Connect to the given database\n\tdatabaseHandle, err := gorm.Open(\"mysql\", fmt.Sprintf(\n\t\t\"%v:%v@/%v?charset=utf8&parseTime=True&loc=Local\",\n\t\tusername,\n\t\tpassword,\n\t\tdb,\n\t))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn databaseHandle, nil\n}",
"func Open(ctx context.Context, connectionString string, database string) (*mongo.Database, error) {\n\tctx, cancel := context.WithTimeout(ctx, 5*time.Second)\n\tdefer cancel()\n\n\tclient, err := mongo.Connect(ctx, options.Client().ApplyURI(\"mongodb://localhost:27017\"))\n\n\treturn client.Database(database), errors.Wrap(err, \"connecting to database\")\n}",
"func Open(path, key string, mc ...MigrationConfig) (*sql.DB, error) {\n\treturn open(path, key, reducedKdfIterationsNumber, mc)\n}",
"func OpenDb(conString string) {\n\n\tfmt.Println(conString)\n\tvar err error\n\tDb, err = gorm.Open(utils.DatabaseName, conString)\n\tif err != nil {\n\t\tfmt.Print(\"failed to connect database\")\n\t\tpanic(\"failed to connect database\")\n\t}\n}",
"func Open(driverName, dataSourceName string) (*DB, error) {\n\tdriversMu.RLock()\n\tdriveri, ok := drivers[driverName]\n\tdriversMu.RUnlock()\n\tif !ok {\n\t\treturn nil, fmt.Errorf(\"sql: unknown driver %q (forgotten import?)\", driverName)\n\t}\n\n\tif driverCtx, ok := driveri.(driver.DriverContext); ok {\n\t\tconnector, err := driverCtx.OpenConnector(dataSourceName)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\treturn OpenDB(connector), nil\n\t}\n\n\treturn OpenDB(dsnConnector{dsn: dataSourceName, driver: driveri}), nil\n}",
"func OPEN() *sql.DB {\n\tdatasource := fmt.Sprintf(\"host=%s port=%d user=%s password=%s dbname=%s sslmode=disable\",\n\t\t\"localhost\", 5432, \"postgres\", \"postgres\", \"postgres\")\n\tdb, err := sql.Open(\"postgres\", datasource)\n\t//defer db.Close()\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\treturn db\n}",
"func OpenDB(ctx context.Context, dbPath, engineName string, opts DBOptions) (*genji.DB, error) {\n\tvar (\n\t\tng engine.Engine\n\t\terr error\n\t)\n\n\tswitch engineName {\n\tcase \"memory\":\n\t\tng = memoryengine.NewEngine()\n\tcase \"bolt\":\n\t\tng, err = boltengine.NewEngine(dbPath, 0660, &bbolt.Options{\n\t\t\tTimeout: 100 * time.Millisecond,\n\t\t})\n\t\tif errors.Is(err, bbolt.ErrTimeout) {\n\t\t\treturn nil, errors.New(\"database is locked\")\n\t\t}\n\tcase \"badger\":\n\t\topt := badger.DefaultOptions(dbPath).WithLogger(nil)\n\t\tif opts.EncryptionKey != \"\" {\n\t\t\topt.EncryptionKey = []byte(opts.EncryptionKey)\n\t\t\topt.IndexCacheSize = 100 << 20\n\t\t}\n\n\t\tng, err = badgerengine.NewEngine(opt)\n\t\tif err != nil && strings.HasPrefix(err.Error(), \"Cannot acquire directory lock\") {\n\t\t\treturn nil, errors.New(\"database is locked\")\n\t\t}\n\tdefault:\n\t\treturn nil, fmt.Errorf(`engine should be \"bolt\" or \"badger\", got %q`, engineName)\n\t}\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn genji.New(ctx, ng)\n}",
"func (opener) Open(configURL string) (evdb.DB, error) {\n\toptions, err := ParseURL(configURL)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn Open(options)\n\n}",
"func Open(name string) (*DB, error) {\n\tstorage, err := openStorageConn(name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdb := &DB{\n\t\tstorage: storage,\n\t}\n\terr = db.getExistingTables()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn db, nil\n}",
"func Open(path string) (*DB, error) {\n\tdata, err := ioutil.ReadFile(path)\n\tif err != nil || len(data) == 0 {\n\t\tif err == nil {\n\t\t\terr = fmt.Errorf(\"%s is empty or not redable\", path)\n\t\t}\n\t\treturn nil, errors.Annotate(err, \"cannot open/read db file\")\n\t}\n\treturn FromBytes(data)\n}",
"func (driver *Redshift) Open(dsn string) (database.Driver, error) {\n\tparsed, err := url.Parse(dsn)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tparsed.Scheme = \"postgres\"\n\tpsql, err := driver.Driver.Open(parsed.String())\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &Redshift{Driver: psql}, nil\n}",
"func openDB(driver, config string) *sql.DB {\n\tdb, err := sql.Open(driver, config)\n\tif err != nil {\n\t\tlog.Fatalln(\"database connection failed:\", err)\n\t}\n\tif driver == \"mysql\" {\n\t\t// per issue https://github.com/go-sql-driver/mysql/issues/257\n\t\tdb.SetMaxIdleConns(0)\n\t}\n\tif err := pingDatabase(db); err != nil {\n\t\tlog.Fatalln(\"database ping attempts failed:\", err)\n\t}\n\treturn db\n}",
"func (h *DbHandle) Open(driverName string, maxConn, maxIdle int, maxLife int64, configs ...string) error {\n\tif driverName == \"\" {\n\t\treturn errors.New(\"db: Driver Name is empty\")\n\t} else if len(configs) == 0 {\n\t\treturn errors.New(\"db: Config is empty\")\n\t}\n\n\tif maxConn < 0 {\n\t\tmaxConn = 0\n\t}\n\n\tvar err error\n\n\t// master database\n\th.master, err = sql.Open(driverName, configs[0])\n\tif err != nil {\n\t\treturn err\n\t}\n\th.master.SetMaxOpenConns(maxConn)\n\tif maxIdle >= 0 {\n\t\th.master.SetMaxIdleConns(maxIdle)\n\t}\n\th.master.SetConnMaxLifetime(time.Duration(maxLife) * time.Second)\n\n\t// slave database\n\th.slaverCnt = len(configs) - 1\n\tif h.slaverCnt > 0 {\n\t\tfor i := 1; i <= h.slaverCnt; i++ {\n\t\t\tt, err1 := sql.Open(driverName, configs[i])\n\t\t\tif err1 != nil {\n\t\t\t\treturn err1\n\t\t\t}\n\t\t\tt.SetMaxOpenConns(maxConn)\n\t\t\tt.SetMaxIdleConns(maxIdle)\n\t\t\tt.SetConnMaxLifetime(time.Duration(maxLife) * time.Second)\n\n\t\t\th.slavers = append(h.slavers, t)\n\t\t}\n\t}\n\n\treturn nil\n}",
"func Open(configURL string, options ...Option) (DB, error) {\n\tu, err := url.Parse(configURL)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tscheme := u.Scheme\n\topenerMu.Lock()\n\topener := openers[scheme]\n\topenerMu.Unlock()\n\tif opener == nil {\n\t\treturn nil, fmt.Errorf(\"Scheme %q not registered\", scheme)\n\t}\n\tdb, err := opener.Open(configURL)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tfor _, option := range options {\n\t\tdb, err = option.apply(db)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\treturn db, nil\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
NewDB creates a new DB instance with the given connection string. We also pass in a logger.
|
func NewDB(config *Config, logger kitlog.Logger) DB {
logger = kitlog.With(logger, "module", "postgres")
logger.Log("msg", "creating DB instance")
return &db{
connStr: config.ConnStr,
encryptionPassword: []byte(config.EncryptionPassword),
logger: logger,
}
}
|
[
"func NewDB(conf configuration.Ledger, opts *badger.Options) (*DB, error) {\n\topts = setOptions(opts)\n\tdir, err := filepath.Abs(conf.Storage.DataDirectory)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\topts.Dir = dir\n\topts.ValueDir = dir\n\n\tbdb, err := badger.Open(*opts)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"local database open failed\")\n\t}\n\n\tdb := &DB{\n\t\tdb: bdb,\n\t\ttxretiries: conf.Storage.TxRetriesOnConflict,\n\t}\n\treturn db, nil\n}",
"func NewDB(db *client.DB) *DB {\n\treturn &DB{\n\t\tdb: db,\n\t}\n}",
"func (b *LocalCluster) NewDB(ctx context.Context, i int) (*gosql.DB, error) {\n\treturn gosql.Open(\"postgres\", b.PGUrl(ctx, i))\n}",
"func NewDb() (*Db, error) {\n\t// Get config\n\tconfig, err := config.GetConfig()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"error loading app config: %s\", err.Error())\n\t}\n\n\t// Connect\n\tconnStr := fmt.Sprintf(\"host=%s, user=%s, dbname=%s, sslmode=disable, password=%s\",\n\t\tconfig.Db.Host,\n\t\tconfig.Db.User,\n\t\tconfig.Db.Db,\n\t\tconfig.Db.Password)\n\n\tdb, err := gorm.Open(\"postgres\", connStr)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error connecting to db: %s\", err.Error())\n\t}\n\n\t// Make Db struct\n\tdbStruct = Db{db}\n\n\treturn dbStruct\n}",
"func NewDB() (*gorm.DB, error) {\n\thostName := os.Getenv(\"POSTGRES_HOST\")\n\tif hostName != \"\" {\n\t\treturn newPostgres(hostName)\n\t}\n\treturn gorm.Open(sqlite.Open(\"fair.db\"), &gorm.Config{})\n}",
"func NewDB(path string) (*DB, error) {\n\tf, err := os.Open(path)\n\tif os.IsNotExist(err) {\n\t\tf, err := os.Create(path)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"could not create file for db, %v\", err)\n\t\t}\n\t\treturn CreateDB(f)\n\t}\n\n\treturn LoadDB(f)\n}",
"func NewDatabase(driver string) Database {\r\n\tif db, ok := dbDriverMap[driver]; ok {\r\n\t\treturn db\r\n\t}\r\n\r\n\tpanic(\"Unknown database driver\" + driver)\r\n}",
"func NewDB(server string, database string) (*DB, error) {\n\tclient, err := mongo.Connect(context.Background(), server, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tdb := client.Database(database)\n\treturn &DB{db}, nil\n}",
"func NewDB(db *sqlx.DB) *DB {\n\treturn &DB{db}\n}",
"func newDB(mode string) *DataBase {\n\treturn &DataBase{\n\t\tmode: mode,\n\t\tm: map[string]string{},\n\t}\n}",
"func newDB() *gorm.DB {\n\tdsn := envvar.MySQLDSN()\n\tlogrus.Debug(dsn)\n\tdb, err := gorm.Open(mysql.Open(dsn), &gorm.Config{})\n\tif err != nil {\n\t\tlogrus.Panic(\"error when trying to connect Database\")\n\t\treturn nil\n\t}\n\tsqlDB, err := db.DB()\n\tif err != nil {\n\t\tlogrus.Panic(\"error when trying to connect SQL Database\")\n\t\treturn nil\n\t}\n\tsqlDB.SetMaxIdleConns(3)\n\n\treturn db\n}",
"func NewDatabase(config *config.Configuration) *Database {\n\tif config == nil {\n\t\tlog.Fatal(\"Configuration may not be null!\")\n\t}\n\n\treturn &Database{\n\t\tconfig: config,\n\t}\n}",
"func NewDB(chunkSize uint64, expiry time.Duration, dir string) (*DB, error) {\n\tif err := os.Mkdir(dir, 0700); err != nil {\n\t\tif os.IsExist(err) {\n\t\t\treturn nil, ErrDBDirExists\n\t\t}\n\t\treturn nil, err\n\t}\n\tdb, err := newDB(chunkSize, expiry, dir)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif err := db.addFlock(); err != nil {\n\t\treturn nil, err\n\t}\n\twchunk, err := NewWriteChunk(db.logName(db.seq), db.chunkSize)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdb.wchunk = wchunk\n\treturn db, nil\n}",
"func New(filename string) (*DB, error) {\n\tdb := &DB{}\n\treturn db, db.open(filename)\n}",
"func NewDb(config *Config) *Db {\n\tvar db Db\n\n\tconnection, err := gorm.Open(\"sqlite3\", config.Db)\n\tif err != nil {\n\t\tlog.Panicf(\"Unable to open sqlitedb: %s\", config.Db, err)\n\t}\n\n\tdb = Db{connection: &connection}\n\tdb.setup()\n\n\treturn &db\n}",
"func New(path string) (Database, error) {\n\tb := boltDB{\n\t\tfilePath: path,\n\t}\n\n\terr := setupDatabase(&b)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &b, nil\n}",
"func NewDB(ociURL string) (*sql.DB, error) {\n\t// NLS_LANG is set to American format. At least NLS_NUMERIC_CHARACTERS has to be \".,\".\n\tos.Setenv(\"NLS_LANG\", \"AMERICAN_AMERICA.AL32UTF8\")\n\tos.Setenv(\"NLS_DATE_FORMAT\", \"YYYY-MM-DD\\\"T\\\"HH24:MI:SS\")\n\n\t// Open DB connection\n\toConn, err := sql.Open(\"oci8\", ociURL)\n\tif err != nil {\n\t\treturn oConn, errors.Wrap(err, \"sql open failed\")\n\t}\n\n\treturn oConn, nil\n}",
"func CreateNewDB(name string) *DB {\n\treturn &DB{name, -1, false, true, 0, ds.NewDict()}\n}",
"func New(username string, password string, host string, port string, database string) (*ConnectionHandler, error) {\n\tconnection, err := gorm.Open(\n\t\t\"mysql\",\n\t\tfmt.Sprintf(\n\t\t\t\"%s:%s@(%s:%s)/%s?parseTime=true\",\n\t\t\tusername,\n\t\t\tpassword,\n\t\t\thost,\n\t\t\tport,\n\t\t\tdatabase,\n\t\t),\n\t)\n\tif err != nil {\n\t\treturn &ConnectionHandler{}, err\n\t}\n\n\treturn &ConnectionHandler{connection: connection}, nil\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
CreateStream now attempts to insert to the streams table the stream id we received back from the encoder.
|
func (d *db) CreateStream(tx *sqlx.Tx, deviceID int, streamUID string) error {
sql := `INSERT INTO streams (device_id, uid) VALUES
(:device_id, :uid)`
mapArgs := map[string]interface{}{
"device_id": deviceID,
"uid": streamUID,
}
_, err := tx.NamedExec(sql, mapArgs)
if err != nil {
return errors.Wrap(err, "failed to insert stream")
}
return nil
}
|
[
"func (lapi *API) CreateStream(csr CreateStreamReq) (*CreateStreamResp, error) {\n\tif csr.Name == \"\" {\n\t\treturn nil, errors.New(\"stream must have a name\")\n\t}\n\tif len(csr.Presets) == 0 && len(csr.Profiles) == 0 {\n\t\tcsr.Profiles = StandardProfiles\n\t}\n\tglog.Infof(\"Creating Livepeer stream '%s' with presets '%v' and profiles %+v\", csr.Name, csr.Presets, csr.Profiles)\n\tb, err := json.Marshal(csr)\n\tif err != nil {\n\t\tglog.V(model.SHORT).Infof(\"Error marshalling create stream request %v\", err)\n\t\treturn nil, err\n\t}\n\tglog.Infof(\"Sending: %s\", b)\n\tu := fmt.Sprintf(\"%s/api/stream\", lapi.choosenServer)\n\tif csr.ParentID != \"\" {\n\t\tu = fmt.Sprintf(\"%s/api/stream/%s/stream\", lapi.choosenServer, csr.ParentID)\n\t}\n\treq, err := uhttp.NewRequest(\"POST\", u, bytes.NewBuffer(b))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treq.Header.Add(\"Authorization\", \"Bearer \"+lapi.accessToken)\n\treq.Header.Add(\"Content-Type\", \"application/json\")\n\tresp, err := lapi.httpClient.Do(req)\n\tif err != nil {\n\t\tglog.Errorf(\"Error creating Livepeer stream %v\", err)\n\t\treturn nil, err\n\t}\n\tdefer resp.Body.Close()\n\tb, err = ioutil.ReadAll(resp.Body)\n\tif err != nil {\n\t\tglog.Errorf(\"Error creating Livepeer stream (body) %v\", err)\n\t\treturn nil, err\n\t}\n\tglog.Info(string(b))\n\tr := &CreateStreamResp{}\n\terr = json.Unmarshal(b, r)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif len(r.Errors) > 0 {\n\t\treturn nil, fmt.Errorf(\"Error creating stream: %+v\", r.Errors)\n\t}\n\tglog.Infof(\"Stream %s created with id %s\", csr.Name, r.ID)\n\treturn r, nil\n}",
"func createStream(req *encoder.CreateStreamRequest, brokerAddr string) (*postgres.Stream, error) {\n\toperations := []*postgres.Operation{}\n\n\tfor _, o := range req.Operations {\n\t\toperation, err := createOperation(o)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\toperations = append(operations, operation)\n\t}\n\n\treturn &postgres.Stream{\n\t\tCommunityID: req.CommunityId,\n\t\tPublicKey: req.RecipientPublicKey,\n\t\tOperations: operations,\n\t\tDevice: &postgres.Device{\n\t\t\tDeviceToken: req.DeviceToken,\n\t\t\tLabel: req.DeviceLabel,\n\t\t\tLongitude: req.Location.Longitude,\n\t\t\tLatitude: req.Location.Latitude,\n\t\t\tExposure: strings.ToLower(req.Exposure.String()),\n\t\t},\n\t}, nil\n}",
"func (e *encoderImpl) CreateStream(ctx context.Context, req *encoder.CreateStreamRequest) (*encoder.CreateStreamResponse, error) {\n\terr := validateCreateRequest(req)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tstream, err := createStream(req, e.brokerAddr)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tstream, err = e.db.CreateStream(stream)\n\tif err != nil {\n\t\traven.CaptureError(err, map[string]string{\"operation\": \"createStream\"})\n\t\treturn nil, twirp.InternalErrorWith(err)\n\t}\n\n\terr = e.mqtt.Subscribe(\n\t\te.brokerAddr,\n\t\te.brokerUsername,\n\t\treq.DeviceToken,\n\t\tfunc(topic string, payload []byte) {\n\t\t\te.handleCallback(topic, payload)\n\t\t})\n\n\tif err != nil {\n\t\traven.CaptureError(err, map[string]string{\"operation\": \"createStream\"})\n\t\treturn nil, twirp.InternalErrorWith(err)\n\t}\n\n\treturn &encoder.CreateStreamResponse{\n\t\tStreamUid: stream.StreamID,\n\t\tToken: stream.Token,\n\t}, nil\n}",
"func (sp *FileStorageProvider) CreateStream(uuid []byte, collection string, tags map[string]string, annotation []byte) bte.BTE {\n\tpanic(\"yo not supported bro\")\n}",
"func newStream(session *Session, id uint32) *Stream {\n\ts := &Stream{\n\t\tid: id,\n\t\tsession: session,\n\t\tstate: streamEstablished,\n\t\tsendErr: make(chan error, 1),\n\t\t//recvWindow: initialStreamWindow,\n\t\tsendWindow: initialStreamWindow,\n\t\trecvNotifyCh: make(chan struct{}, 3),\n\t\tsendNotifyCh: make(chan struct{}, 3),\n\t\tinitTime: time.Now(),\n\t}\n\treturn s\n}",
"func (handler *OBController) OnStreamCreated(conn rtmp.OutboundConn, stream rtmp.OutboundStream) {\n\tfmt.Printf(\"Stream created: %d\\n\", stream.ID())\n\tcreateStreamChan <- stream\n}",
"func (a *Association) createStream(streamIdentifier uint16, accept bool) *Stream {\n\ts := &Stream{\n\t\tassociation: a,\n\t\tstreamIdentifier: streamIdentifier,\n\t\treassemblyQueue: newReassemblyQueue(streamIdentifier),\n\t\tlog: a.log,\n\t\tname: fmt.Sprintf(\"%d:%s\", streamIdentifier, a.name),\n\t}\n\n\ts.readNotifier = sync.NewCond(&s.lock)\n\n\tif accept {\n\t\tselect {\n\t\tcase a.acceptCh <- s:\n\t\t\ta.streams[streamIdentifier] = s\n\t\t\ta.log.Debugf(\"[%s] accepted a new stream (streamIdentifier: %d)\",\n\t\t\t\ta.name, streamIdentifier)\n\t\tdefault:\n\t\t\ta.log.Debugf(\"[%s] dropped a new stream (acceptCh size: %d)\",\n\t\t\t\ta.name, len(a.acceptCh))\n\t\t\treturn nil\n\t\t}\n\t} else {\n\t\ta.streams[streamIdentifier] = s\n\t}\n\n\treturn s\n}",
"func (c *ApplicationContext) AddStream(w http.ResponseWriter, r *http.Request) {\n\tstream := &models.Stream{}\n\tif err := json.NewDecoder(r.Body).Decode(stream); err != nil {\n\t\tc.NewResponse(w).Status(400).SendJSON(Response{\n\t\t\tError: true,\n\t\t\tMessage: \"Unable to parse request\",\n\t\t})\n\t\treturn\n\t}\n\n\tstream.Key = uuid.New().String()\n\tstream.UserID = int(r.Context().Value(\"id\").(float64))\n\n\tc.DB.Save(stream)\n\n\tc.NewResponse(w).Status(200).SendJSON(Response{\n\t\tMessage: \"Stream created successfully\",\n\t})\n}",
"func CreateStream(serverAddr, subject, name string) error {\n\n\t// connect to liftbridge server\n\tlbClient, err := liftbridge.Connect([]string{serverAddr})\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif err := lbClient.CreateStream(context.Background(), subject, name); err != nil {\n\t\tif err != nil && err != liftbridge.ErrStreamExists {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n\n}",
"func (s *streamMap) create(id uint64, isClient bool) (*Stream, error) {\n\tlocal := isStreamLocal(id, isClient)\n\tbidi := isStreamBidi(id)\n\tif local {\n\t\tif bidi {\n\t\t\tif s.openedStreams.localBidi >= s.maxStreams.peerBidi || id > s.maxStreams.peerBidi*4 {\n\t\t\t\treturn nil, newError(StreamLimitError, sprint(\"local bidirectional streams exceeded \", s.maxStreams.peerBidi))\n\t\t\t}\n\t\t\ts.openedStreams.localBidi++\n\t\t} else {\n\t\t\tif s.openedStreams.localUni >= s.maxStreams.peerUni || id > s.maxStreams.peerUni*4 {\n\t\t\t\treturn nil, newError(StreamLimitError, sprint(\"local unidirectional streams exceeded \", s.maxStreams.peerUni))\n\t\t\t}\n\t\t\ts.openedStreams.localUni++\n\t\t}\n\t} else {\n\t\tif bidi {\n\t\t\tif s.openedStreams.peerBidi >= s.maxStreams.localBidi || id > s.maxStreams.localBidi*4 {\n\t\t\t\treturn nil, newError(StreamLimitError, sprint(\"peer bidirectional streams exceeded \", s.maxStreams.localBidi))\n\t\t\t}\n\t\t\ts.openedStreams.peerBidi++\n\t\t} else {\n\t\t\tif s.openedStreams.peerUni >= s.maxStreams.localUni || id > s.maxStreams.localUni*4 {\n\t\t\t\treturn nil, newError(StreamLimitError, sprint(\"peer unidirectional streams exceeded \", s.maxStreams.localUni))\n\t\t\t}\n\t\t\ts.openedStreams.peerUni++\n\t\t}\n\t}\n\tst := &Stream{}\n\tst.init(local, bidi)\n\ts.streams[id] = st\n\treturn st, nil\n}",
"func (s *VideoDB) AddStream(strmID StreamID, strm stream.VideoStream) (err error) {\n\tif _, ok := s.streams[strmID]; ok {\n\t\treturn ErrVideoDB\n\t}\n\n\tglog.V(common.VERBOSE).Infof(\"Adding stream: %v\", strmID)\n\ts.streams[strmID] = strm\n\tlpmon.Instance().LogStream(strmID.String(), 0, 0)\n\treturn nil\n}",
"func (c *Connection) CreateSendStream() SendStream {\n\tc.log(logTypeStream, \"Creating new SendStream\")\n\ts := c.localUniStreams.create(func(id uint64) hasIdentity {\n\t\trecvMax := uint64(c.tpHandler.peerParams.maxStreamDataUni)\n\t\treturn newSendStream(c, id, recvMax)\n\t})\n\tif s != nil {\n\t\tc.log(logTypeStream, \"Created SendStream %v\", s.Id())\n\t\treturn s.(SendStream)\n\t}\n\treturn nil\n}",
"func NewStreamToken(sessionToken SessionToken) (StreamToken, error) {\n\tsession, err := sessionToken.GetSession()\n\tif err != nil {\n\t\treturn StreamToken(\"\"), err\n\t}\n\n\tif session == nil {\n\t\treturn StreamToken(\"\"), errors.New(\"Not authorized.\")\n\t}\n\n\tLoadDb()\n\tlog.Printf(\"NewStreamToken\")\n\tstmt, err := db.Prepare(\"insert into stream_token (token, username, created) values (?, ?, ?)\")\n\tif err != nil {\n\t\treturn StreamToken(\"\"), err\n\t}\n\n\tstreamToken := StreamToken(uuid())\n\tcreated := time.Now()\n\tstmt.Bind(streamToken, session.User.Name, created)\n\t_, err = stmt.Run()\n\tif err != nil {\n\t\treturn StreamToken(\"\"), err\n\t}\n\n\treturn streamToken, nil\n}",
"func (lapi *API) CreateStreamEx(name string, record bool, presets []string, profiles ...Profile) (*CreateStreamResp, error) {\n\treturn lapi.CreateStream(CreateStreamReq{Name: name, Record: record, Presets: presets, Profiles: profiles})\n}",
"func (db *Database) InsertStreamByID(streamID int64, substream string, data datastream.DatapointArray, restamp bool) error {\n\tstrm, err := db.ReadStreamByID(streamID)\n\tif err != nil {\n\t\treturn err\n\t}\n\tdata.SetZeroTime()\n\t//Now check that everything is okay\n\tif !strm.Validate(data) {\n\t\treturn datastream.ErrInvalidDatapoint\n\t}\n\tif !data.IsTimestampOrdered() {\n\t\treturn ErrTimestampOrder\n\t}\n\n\tu, _, streampath, err := db.getStreamPath(strm)\n\tif substream != \"\" {\n\t\tstreampath = streampath + \"/\" + substream\n\t}\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif !strm.Ephemeral {\n\n\t\tr := permissions.GetUserRole(pconfig.Get(), u)\n\t\t_, err = db.DataStream.Insert(strm.DeviceID, strm.StreamID, substream, data, restamp, r.MaxDeviceSize, r.MaxStreamSize)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn db.Messenger.Publish(streampath, messenger.Message{streampath, \"\", data})\n}",
"func (bdb *btrdbClient) getStream(extracted types.ExtractedTimeseries) (stream *btrdb.Stream, err error) {\n\t// first check cache\n\tstreamuuid := extracted.UUID\n\tbdb.streamCacheLock.RLock()\n\tstream, found := bdb.streamCache[streamuuid.String()]\n\tbdb.streamCacheLock.RUnlock()\n\tif found {\n\t\treturn // from cache\n\t}\n\t// then check BtrDB for existing stream\n\tctx := context.Background()\n\tctx, cancel := context.WithTimeout(ctx, TimeseriesOperationTimeout)\n\tdefer cancel()\n\tstream = bdb.conn.StreamFromUUID(streamuuid)\n\n\texists, existsErr := stream.Exists(ctx)\n\tif existsErr != nil {\n\t\tlogrus.Error(\"problem checking stream exists\", streamuuid.String(), stream.UUID().String(), extracted.Collection, existsErr, exists)\n\t\te := btrdb.ToCodedError(existsErr)\n\t\tif e.Code != 404 && e.Code != 501 { // if error is NOT unfound or permission denied, then return it\n\t\t\terr = errors.Wrap(existsErr, \"Could not fetch stream\")\n\t\t\treturn\n\t\t}\n\t}\n\tif exists {\n\t\t//logrus.Info(\"exists already\", streamuuid.String())\n\t\t// if stream exists, add to cache\n\t\tbdb.streamCacheLock.Lock()\n\t\tbdb.streamCache[streamuuid.String()] = stream\n\t\tbdb.streamCacheLock.Unlock()\n\t\treturn\n\t}\n\n\tlogrus.Info(\"Initializing stream with uuid: \", extracted.UUID.String(), extracted.Collection)\n\tstream, err = bdb.conn.Create(ctx, extracted.UUID, extracted.Collection, extracted.Tags, extracted.Annotations)\n\tif err == nil {\n\t\tlogrus.Info(\"Created stream\", extracted.Collection, stream)\n\t\tbdb.streamCacheLock.Lock()\n\t\tbdb.streamCache[streamuuid.String()] = stream\n\t\tbdb.streamCacheLock.Unlock()\n\t} else {\n\t\te := btrdb.ToCodedError(err)\n\t\tlogrus.Info(\"Error\", e.Code)\n\n\t}\n\n\treturn\n}",
"func (client *Client) CreateMessageStream(ctx context.Context, req CreateMessageStreamRequest) (MessageStream, error) {\n\tvar res MessageStream\n\terr := client.doRequest(ctx, parameters{\n\t\tMethod: http.MethodPost,\n\t\tPath: \"message-streams\",\n\t\tTokenType: serverToken,\n\t\tPayload: req,\n\t}, &res)\n\treturn res, err\n}",
"func (c *Logs) CreateLogStream(req *CreateLogStreamRequest) (err error) {\n\t// NRE\n\terr = c.client.Do(\"CreateLogStream\", \"POST\", \"/\", req, nil)\n\treturn\n}",
"func (mgr *singleTypeChannelsMgr) createMsgStream(collectionID UniqueID) (msgstream.MsgStream, error) {\n\tmgr.mu.RLock()\n\tinfos, ok := mgr.infos[collectionID]\n\tif ok && infos.stream != nil {\n\t\t// already exist.\n\t\tmgr.mu.RUnlock()\n\t\treturn infos.stream, nil\n\t}\n\tmgr.mu.RUnlock()\n\n\tchannelInfos, err := mgr.getChannelsFunc(collectionID)\n\tif err != nil {\n\t\t// What if stream created by other goroutines?\n\t\tlog.Error(\"failed to get channels\", zap.Error(err), zap.Int64(\"collection\", collectionID))\n\t\treturn nil, err\n\t}\n\n\tstream, err := createStream(mgr.msgStreamFactory, channelInfos.pchans, mgr.repackFunc)\n\tif err != nil {\n\t\t// What if stream created by other goroutines?\n\t\tlog.Error(\"failed to create message stream\", zap.Error(err), zap.Int64(\"collection\", collectionID))\n\t\treturn nil, err\n\t}\n\n\tmgr.mu.Lock()\n\tdefer mgr.mu.Unlock()\n\tif !mgr.streamExistPrivate(collectionID) {\n\t\tlog.Info(\"create message stream\", zap.Int64(\"collection\", collectionID),\n\t\t\tzap.Strings(\"virtual_channels\", channelInfos.vchans),\n\t\t\tzap.Strings(\"physical_channels\", channelInfos.pchans))\n\t\tmgr.infos[collectionID] = streamInfos{channelInfos: channelInfos, stream: stream}\n\t\tincPChansMetrics(channelInfos.pchans)\n\t}\n\n\treturn mgr.infos[collectionID].stream, nil\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
MigrateDownAll is a convenience function to run all down migrations in the context of an instantiated DB instance.
|
func (d *db) MigrateDownAll() error {
return MigrateDownAll(d.DB.DB, d.logger)
}
|
[
"func (s *MigrationService) ApplyAllMigrationsDown() ([]string, error) {\n\tmigrations, err := s.repo.GetMigrations()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar rollback []string\n\n\tvar backMigrations []*entity.MigrationEntity\n\n\tfor _, m := range migrations {\n\t\tfilePath := strings.Replace(m.Migration, \"-up.sql\", \"-down.sql\", 1)\n\t\tdata, err := ioutil.ReadFile(filePath)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\trollback = append(rollback, fmt.Sprintf(\"rolled back: %s\", filePath))\n\t\tbackMigrations = append(backMigrations, entity.NewMigrationEntity(m.Migration, string(data), m.Version))\n\t}\n\n\tif err := s.repo.ApplyMigrationsDown(backMigrations); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn rollback, err\n}",
"func (dbm *DBMigrationImplementation) MigrateDown() error {\n\tschemasT0Migrate, err1 := dbm.Src.GetSchemaList()\n\tif err1 != nil {\n\t\treturn err1\n\t}\n\tfor _, schema := range schemasT0Migrate {\n\t\terr2 := dbm.MigrateSchemaDown(schema)\n\t\tif err2 != nil {\n\t\t\treturn err2\n\t\t}\n\t}\n\treturn nil\n}",
"func (m *Migrator) DoDownMigrations() error {\n\n\treturn transactions.WithTransactionx(db.GetSQLXFromSQLConnector(db.GetConnection()), func(tx db.SQLConnector) error {\n\n\t\texist := db.TableExists(table.MigrationsTableName)\n\n\t\tif !exist {\n\t\t\treturn nil\n\t\t}\n\n\t\tif err := m.execDownMigrations(tx); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\treturn nil\n\t})\n}",
"func (m *Migrator) execDownMigrations(db db.SQLConnector) error {\n\n\tfor i := len(m.migrationsList) - 1; i >= 0; i-- {\n\n\t\tmigration := table.NewMigration(db)\n\n\t\terr := table.LoadMigrationByName(m.migrationsList[i].GetMigrationName(), migration)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tif migration.GetTableRecord().IsLoaded() && migration.Status == 1 {\n\n\t\t\t_, err = db.Exec(m.migrationsList[i].Down())\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tmigration.Status = 0\n\t\t\terr = record.Save(migration)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\treturn nil\n}",
"func MigrateDown(db *sqlx.DB) error {\n\tlog.Info(\"integration/postgresql: reverting PostgreSQL schema migrations\")\n\n\tdriver, err := postgres.WithInstance(db.DB, &postgres.Config{})\n\tif err != nil {\n\t\treturn fmt.Errorf(\"integration/postgresql: migrate postgres driver error: %w\", err)\n\t}\n\n\tsrc, err := httpfs.New(http.FS(migrations), \"/migrations\")\n\tif err != nil {\n\t\treturn fmt.Errorf(\"new httpfs error: %w\", err)\n\t}\n\n\tm, err := migrate.NewWithInstance(\"httpfs\", src, \"postgres\", driver)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"integration/postgresql: new migrate instance error: %w\", err)\n\t}\n\n\toldVersion, _, _ := m.Version()\n\n\tif err := m.Down(); err != nil && err != migrate.ErrNoChange {\n\t\treturn fmt.Errorf(\"integration/postgresql: migrate down error: %w\", err)\n\t}\n\n\tnewVersion, _, _ := m.Version()\n\n\tif oldVersion != newVersion {\n\t\tlog.WithFields(log.Fields{\n\t\t\t\"from_version\": oldVersion,\n\t\t\t\"to_version\": newVersion,\n\t\t}).Info(\"integration/postgresql: applied database migrations\")\n\t}\n\n\treturn nil\n}",
"func Down(db *sql.DB) {\n\tdir := os.Getenv(\"APP_DIR\")\n\n\tif dir == \"\" {\n\t\tdir = \"/app\"\n\t}\n\n\tfile := fmt.Sprintf(\"%s/resources/schema/down.sql\", dir)\n\n\tvar err error\n\t// disable foreign keys\n\t_, err = db.Exec(\"SET FOREIGN_KEY_CHECKS=0\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\trunSQLFromFile(db, file)\n\t// enable the foreign keys back\n\t_, err = db.Exec(\"SET FOREIGN_KEY_CHECKS=1\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n}",
"func (s *MigrationService) ApplyMigrationsDown() ([]string, error) {\n\tversion, err := s.repo.GetLatestVersionNumber()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tmigrations, err := s.repo.GetMigrationsByVersion(version)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar rollback []string\n\tvar backMigrations []*entity.MigrationEntity\n\n\tfor _, m := range migrations {\n\t\tfilePath := strings.Replace(m.Migration, \"-up.sql\", \"-down.sql\", 1)\n\t\tdata, err := ioutil.ReadFile(filePath)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\trollback = append(rollback, fmt.Sprintf(\"rolled back: %s\", filePath))\n\t\tbackMigrations = append(backMigrations, entity.NewMigrationEntity(m.Migration, string(data), m.Version))\n\t}\n\n\terr = s.repo.ApplyMigrationsDown(backMigrations)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn rollback, err\n}",
"func (db *FakeDbWithSpy) ApplyAllUpMigrations(pw progress.Writer) error {\n\tdb.applyAllUpMigrationsCalls = append(db.applyAllUpMigrationsCalls, true)\n\treturn nil\n}",
"func (link *Link) MigrateDown(ctx context.Context, exec sqlx.ExecerContext) (errExec error) {\n\t_, errExec = exec.ExecContext(ctx,\n\t\t`\n DROP TABLE IF EXISTS entityone_lateststatus;\n DROP TABLE IF EXISTS entityone_status;\n DROP TABLE IF EXISTS entityone;\n `)\n\treturn errExec\n}",
"func mig20230526152150GormDown(tx *gorm.DB) error {\n\n\t// IDGenerators : ID生成器\n\ttype IDGenerators struct {\n\t\tID uint `gorm:\"type:bigint(1) unsigned not null;primaryKey\"`\n\t\tResource string `gorm:\"type:varchar(50) not null;uniqueIndex:idx_resource\"`\n\t\tMaxID uint `gorm:\"type:bigint(1) unsigned not null\"`\n\t\tUpdatedAt time.Time `gorm:\"type:datetime(6) not null\"`\n\t}\n\n\tif err := tx.Migrator().\n\t\tDropTable(\"hooks\", \"hook_revisions\", \"released_hooks\"); err != nil {\n\t\treturn err\n\t}\n\n\tvar resources = []string{\n\t\t\"hooks\",\n\t\t\"hook_revisions\",\n\t\t\"released_hooks\",\n\t}\n\tif result := tx.Where(\"resource IN ?\", resources).Delete(&IDGenerators{}); result.Error != nil {\n\t\treturn result.Error\n\t}\n\n\treturn nil\n}",
"func (m *Category_20200515_133557) Down() {\n\t// use m.SQL(\"DROP TABLE ...\") to reverse schema update\n\tm.SQL(\"DROP TABLE category\")\n\tm.SQL(\"DELETE FROM migrations WHERE name = 'Category_20200515_133557'\")\n}",
"func Reset() {\n\tdb, err := database.DBConn()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tversion, err := migrations.Version(db)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\terr = db.RunInTransaction(func(tx *pg.Tx) error {\n\t\tfor version != 0 {\n\t\t\toldVersion, newVersion, err := migrations.Run(tx, \"down\")\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tlog.WithFields(log.Fields{\n\t\t\t\t\"old\": oldVersion,\n\t\t\t\t\"new\": newVersion,\n\t\t\t}).Info(\"migration from old to new\")\n\t\t\tversion = newVersion\n\t\t}\n\t\treturn nil\n\t})\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n}",
"func RunMigrations(db *gorm.DB) (nil, err error) {\n\tif !db.HasTable(&models.Migration{}) { // Create table\n\t\tdb.CreateTable(&models.Migration{})\n\t}\n\tdbMigrations := []models.Migration{}\n\tdb.Find(&dbMigrations)\n\tfor _, migration := range AllMigrations {\n\t\tfound := false\n\t\tfor _, dbMigration := range dbMigrations {\n\t\t\tif dbMigration.Name == migration.Name {\n\t\t\t\tfound = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif !found {\n\t\t\tlog.Printf(\"Migrating %s\\n\", migration.Name)\n\t\t\trecord := models.Migration{\n\t\t\t\tName: migration.Name,\n\t\t\t}\n\t\t\tmigration.Up(db)\n\t\t\tdb.Create(&record)\n\t\t\tlog.Printf(\"Migrated %s\\n\", migration.Name)\n\t\t}\n\t}\n\treturn nil, nil\n}",
"func SetMigrations(t testing.TB, db DB, cfg config.Config, up int) {\n\t// Ensure all migrations are up first\n\t_, err := glsql.Migrate(db.DB, true)\n\trequire.NoError(t, err)\n\n\tmigrationCt := len(migrations.All())\n\n\tif up < migrationCt {\n\t\tdown := migrationCt - up\n\n\t\tmigrationSet := migrate.MigrationSet{\n\t\t\tTableName: migrations.MigrationTableName,\n\t\t}\n\t\tms := &migrate.MemoryMigrationSource{Migrations: migrations.All()}\n\n\t\t// It would be preferable to use migrate.MigrateDown() here, but that introduces\n\t\t// a circular dependency between testdb and datastore.\n\t\tn, err := migrationSet.ExecMax(db.DB, \"postgres\", ms, migrate.Down, down)\n\t\trequire.NoError(t, err)\n\t\trequire.Equal(t, down, n)\n\t}\n}",
"func MigrateBackwardTo(name string, db *sql.DB, allMigrations []Migration, confirm bool) error {\n\tif len(allMigrations) == 0 {\n\t\treturn errors.New(\"no migrations provided\")\n\t}\n\tstate, err := GetMigrationState(db)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"could not get migration state: %v\", err)\n\t}\n\t// if nothing in state, nothing to do. error\n\tif len(state) == 0 {\n\t\treturn errors.New(\"state is empty. cannot migrate back\")\n\t}\n\ttoRun, err := getMigrationsToReverse(name, state, allMigrations)\n\tif err != nil {\n\t\treturn err\n\t}\n\t// get confirmation on the list of backward migrations we're going to run\n\tif confirm {\n\t\tif err := getConfirm(toRun, \"Backward\", os.Stdin); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\t// run the migrations\n\tfor _, mig := range toRun {\n\t\terr = runMigrationSQL(db, mig.Name, mig.BackwardSQL)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}",
"func RunMigrationsOnDb(conf *DBConf, migrationsDir string, target int64, db *sql.DB) (err error) {\n\tcurrent, err := EnsureDBVersion(conf, db)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tmigrations, err := CollectMigrations(migrationsDir, current, target)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif len(migrations) == 0 {\n\t\tfmt.Printf(\"goose: no migrations to run. current version: %d\\n\", current)\n\t\treturn nil\n\t}\n\n\tms := migrationSorter(migrations)\n\tdirection := current < target\n\tms.Sort(direction)\n\n\tfmt.Printf(\"goose: migrating db environment '%v', current version: %d, target: %d\\n\",\n\t\tconf.Env, current, target)\n\n\tfor _, m := range ms {\n\n\t\tswitch filepath.Ext(m.Source) {\n\t\tcase \".go\":\n\t\t\terr = runGoMigration(conf, m.Source, m.Version, direction)\n\t\tcase \".sql\":\n\t\t\terr = runSQLMigration(conf, db, m.Source, m.Version, direction)\n\t\t}\n\n\t\tif err != nil {\n\t\t\treturn errors.New(fmt.Sprintf(\"FAIL %v, quitting migration\", err))\n\t\t}\n\n\t\tfmt.Println(\"OK \", filepath.Base(m.Source))\n\t}\n\n\treturn nil\n}",
"func runMigrations(driver string, db *sql.DB) error {\n\tlogrus.Debug(\"running DB migration\")\n\treturn ddl.Migrate(driver, db)\n}",
"func (d createDBAuthority) Down(ctx context.Context, b backend.Backend) error {\n\ttracer := tracing.NewTracer(\"migrations\")\n\t_, span := tracer.Start(ctx, \"migrations/CreateDBAuthorityDown\")\n\tdefer span.End()\n\n\tif d.trustServiceFn == nil {\n\t\td.trustServiceFn = func(b backend.Backend) services.Trust {\n\t\t\treturn local.NewCAService(b)\n\t\t}\n\t}\n\n\ttrustSvc := d.trustServiceFn(b)\n\treturn trace.Wrap(trustSvc.DeleteAllCertAuthorities(types.DatabaseCA))\n}",
"func (m *Migrator) DoUpMigrations() error {\n\n\treturn transactions.WithTransactionx(db.GetSQLXFromSQLConnector(db.GetConnection()), func(tx db.SQLConnector) error {\n\n\t\texist := db.TableExists(table.MigrationsTableName)\n\n\t\tif !exist {\n\n\t\t\tif err := createMigrationsTable(tx); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t\tif err := m.execUpMigrations(tx); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\treturn nil\n\t})\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
BeginTX simply wraps the BeginTX function in the context of the current DB instance.
|
func (d *db) BeginTX() (*sqlx.Tx, error) {
return d.DB.Beginx()
}
|
[
"func (db *DB) BeginTX() (*TX, error) {\n\ttx, err := db.Beginx()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &TX{tx}, nil\n}",
"func (db *BaseDB) BeginTx() (TxKV, error) {\r\n\tpanic(\"BeginTx not impl\")\r\n}",
"func (db DB) Begin(t testing.TB) *TxWrapper {\n\tt.Helper()\n\ttx, err := db.DB.Begin()\n\trequire.NoError(t, err)\n\treturn &TxWrapper{Tx: tx}\n}",
"func (sqld *SQLDatabase) TxBegin() (*sql.Tx, error) {\n\treturn sqld.db.Begin()\n}",
"func (s *Server) Begin() (influxql.Tx, error) { return newTx(s), nil }",
"func (s *Server) BeginTransaction(req *BeginTransactionRequest, resp *BeginTransactionResponse) error {\n\tc := s.newContext(nil)\n\n\ttx, err := s.db.Begin(req.Writable)\n\tc.tx = tx\n\tc.parent = tx\n\tresp.ContextID = c.id\n\tif err != nil {\n\t\ts.closeContext(c)\n\t}\n\n\tlogrus.WithFields(logrus.Fields{\n\t\t\"writeable\": req.Writable,\n\t\t\"context_id\": c.id,\n\t}).Info(\"Starting transaction\")\n\n\treturn err\n}",
"func (db *BaseDB) BeginTx(ctx context.Context,\n\topts TxOptions) (*sql.Tx, error) {\n\n\tsqlOptions := sql.TxOptions{\n\t\tReadOnly: opts.ReadOnly(),\n\t}\n\treturn db.DB.BeginTx(ctx, &sqlOptions)\n}",
"func (s *Session) BeginTx() error {\n\ttx, err := s.db.Begin()\n\tif err != nil {\n\t\treturn err\n\t}\n\ts.tx = tx\n\treturn nil\n}",
"func (c *connPool) Begin(ctx context.Context) (adapter.Tx, error) {\n\ttx, err := c.db.BeginContext(ctx)\n\treturn NewTx(tx), err\n}",
"func (db *DB) Begin(writable bool) (*Tx, error) {\n\ttx := &Tx{\n\t\tdb: db,\n\t\twritable: writable,\n\t}\n\ttx.lock()\n\tif db.closer == nil {\n\t\ttx.unlock()\n\t\treturn nil, ErrDatabaseClosed\n\t}\n\tif writable {\n\t\t// writable transactions have a writeContext object that\n\t\t// contains information about changes to the database.\n\t\ttx.wc = &txWriteContext{}\n\t\ttx.wc.rollbackItems = make(map[string]*DbItem)\n\t\ttx.wc.rollbackIndexes = make(map[string]*Index)\n\t\tif db.persist {\n\t\t\ttx.wc.commitItems = make(map[string]*DbItem)\n\t\t}\n\t}\n\treturn tx, nil\n}",
"func (db *DB) BeginTransaction(update bool) *TransactionManager {\n\tif update {\n\t\tdb.dropWG.Add(1)\n\t}\n\treturn &TransactionManager{\n\t\tdb: db,\n\t\ttxn: db.db.NewTransaction(update),\n\t\tupdate: update,\n\t}\n}",
"func TxBegin() (status uint32)",
"func (p *Pool) Begin(ctx context.Context) (pgx.Tx, error) {\n\treturn p.BeginTx(ctx, pgx.TxOptions{})\n}",
"func (conn *recordingConnWithBeginTx) BeginTx(ctx context.Context, opts driver.TxOptions) (driver.Tx, error) {\n\tif connBeginTx, ok := conn.Conn.(driver.ConnBeginTx); ok {\n\t\treturn connBeginTx.BeginTx(ctx, opts)\n\t}\n\n\treturn nil, errors.New(\"ConnBeginTx not implemented\")\n}",
"func (c *Client) BeginTx(ctx context.Context, opts *sql.TxOptions) (*Tx, error) {\n\tif _, ok := c.driver.(*txDriver); ok {\n\t\treturn nil, fmt.Errorf(\"ent: cannot start a transaction within a transaction\")\n\t}\n\ttx, err := c.driver.(*sql.Driver).BeginTx(ctx, opts)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"ent: starting a transaction: %v\", err)\n\t}\n\tcfg := config{driver: &txDriver{tx: tx, drv: c.driver}, log: c.log, debug: c.debug, hooks: c.hooks}\n\treturn &Tx{\n\t\tconfig: cfg,\n\t\tAntenatalinformation: NewAntenatalinformationClient(cfg),\n\t\tBonedisease: NewBonediseaseClient(cfg),\n\t\tChecksymptom: NewChecksymptomClient(cfg),\n\t\tDentalappointment: NewDentalappointmentClient(cfg),\n\t\tDentalkind: NewDentalkindClient(cfg),\n\t\tDepartment: NewDepartmentClient(cfg),\n\t\tDisease: NewDiseaseClient(cfg),\n\t\tDoctorordersheet: NewDoctorordersheetClient(cfg),\n\t\tGender: NewGenderClient(cfg),\n\t\tPatient: NewPatientClient(cfg),\n\t\tPersonnel: NewPersonnelClient(cfg),\n\t\tPhysicaltherapyrecord: NewPhysicaltherapyrecordClient(cfg),\n\t\tPhysicaltherapyroom: NewPhysicaltherapyroomClient(cfg),\n\t\tPregnancystatus: NewPregnancystatusClient(cfg),\n\t\tRemedy: NewRemedyClient(cfg),\n\t\tRisks: NewRisksClient(cfg),\n\t\tStatus: NewStatusClient(cfg),\n\t\tSurgeryappointment: NewSurgeryappointmentClient(cfg),\n\t\tSurgerytype: NewSurgerytypeClient(cfg),\n\t}, nil\n}",
"func (c *Client) BeginTx(ctx context.Context, opts *sql.TxOptions) (*Tx, error) {\n\tif _, ok := c.driver.(*txDriver); ok {\n\t\treturn nil, fmt.Errorf(\"ent: cannot start a transaction within a transaction\")\n\t}\n\ttx, err := c.driver.(interface {\n\t\tBeginTx(context.Context, *sql.TxOptions) (dialect.Tx, error)\n\t}).BeginTx(ctx, opts)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"ent: starting a transaction: %w\", err)\n\t}\n\tcfg := c.config\n\tcfg.driver = &txDriver{tx: tx, drv: c.driver}\n\treturn &Tx{\n\t\tconfig: cfg,\n\t\tManufacturer: NewManufacturerClient(cfg),\n\t\tOperatingSystem: NewOperatingSystemClient(cfg),\n\t\tPhone: NewPhoneClient(cfg),\n\t}, nil\n}",
"func (_e *GdbcTemplate_Expecter) BeginTx() *GdbcTemplate_BeginTx_Call {\n\treturn &GdbcTemplate_BeginTx_Call{Call: _e.mock.On(\"BeginTx\")}\n}",
"func (d *Dao) BeginTran(c context.Context) (*sql.Tx, error) {\n\treturn d.DB.Begin(c)\n}",
"func (d *DB) BeginTransaction(ctx context.Context) (connection.DB, error) {\n\tif d.tx != nil {\n\t\treturn nil, gaumErrors.AlreadyInTX\n\t}\n\ttx, err := d.conn.Begin(ctx)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"trying to begin a transaction\")\n\t}\n\treturn &DB{\n\t\ttx: tx,\n\t\tlogger: d.logger,\n\t}, nil\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
Validate recursively validates the value of the given data tree struct against the given schema.
|
func Validate(schema *yang.Entry, value interface{}) (errors Errors) {
// Nil value means the field is unset.
if isNil(value) {
return nil
}
if schema == nil {
return appendErr(errors, fmt.Errorf("nil schema for type %T, value %v", value, value))
}
dbgPrint("Validate with value %v, type %T, schema name %s", valueStr(value), value, schema.Name)
switch {
case schema.IsLeaf():
return validateLeaf(schema, value)
case schema.IsContainer():
gsv, ok := value.(ygot.GoStruct)
if !ok {
return appendErr(errors, fmt.Errorf("type %T is not a GoStruct for schema %s", value, schema.Name))
}
errors = validateContainer(schema, gsv)
case schema.IsLeafList():
return validateLeafList(schema, value)
case schema.IsList():
return validateList(schema, value)
case schema.IsChoice():
return appendErr(errors, fmt.Errorf("cannot pass choice schema %s to Validate", schema.Name))
default:
errors = appendErr(errors, fmt.Errorf("unknown schema type for type %T, value %v", value, value))
}
return errors
}
|
[
"func validateStructElems(schema *yang.Entry, value interface{}) (errors []error) {\n\tstructElems := reflect.ValueOf(value).Elem()\n\tstructTypes := structElems.Type()\n\n\tif structElems.Kind() != reflect.Struct {\n\t\treturn appendErr(errors, fmt.Errorf(\"expected a struct type for %s: got %s\", schema.Name, valueStr(value)))\n\t}\n\t// Verify each elements's fields.\n\tfor i := 0; i < structElems.NumField(); i++ {\n\t\tfieldName := structElems.Type().Field(i).Name\n\t\tfieldValue := structElems.Field(i).Interface()\n\n\t\tcschema, err := childSchema(schema, structTypes.Field(i))\n\t\tif err != nil {\n\t\t\terrors = appendErr(errors, err)\n\t\t\tcontinue\n\t\t}\n\t\tif cschema == nil {\n\t\t\terrors = appendErr(errors, fmt.Errorf(\"child schema not found for struct %s field %s\", schema.Name, fieldName))\n\t\t} else {\n\t\t\terrors = appendErrs(errors, Validate(cschema, fieldValue))\n\t\t}\n\t}\n\treturn\n}",
"func (f *fig) validateStruct(fieldVal reflect.Value, errs fieldErrors, parentName string) {\n\tkind := fieldVal.Kind()\n\tif (kind == reflect.Ptr || kind == reflect.Interface) && !fieldVal.IsNil() {\n\t\tf.validateStruct(fieldVal.Elem(), errs, parentName)\n\t\treturn\n\t}\n\n\tfieldType := fieldVal.Type()\n\tfor i := 0; i < fieldType.NumField(); i++ {\n\t\tf.validateField(fieldVal.Field(i), fieldType.Field(i), errs, parentName)\n\t}\n}",
"func validAgainstSchema(ctx *hcontext, label string, schema *schema.Schema, data []byte) bool {\n\tdefer func() {\n\t\t// Catch panics from the `gojsonschema` library.\n\t\tif err := recover(); err != nil {\n\t\t\tctx.AddError(&ErrorDetail{\n\t\t\t\tMessage: fmt.Errorf(\"unable to validate against schema: %w\", err.(error)).Error(),\n\t\t\t\tLocation: label,\n\t\t\t\tValue: string(data),\n\t\t\t})\n\n\t\t\t// TODO: log error?\n\t\t}\n\t}()\n\n\t// TODO: load and pre-cache schemas once per operation\n\tloader := gojsonschema.NewGoLoader(schema)\n\tdoc := gojsonschema.NewBytesLoader(data)\n\ts, err := gojsonschema.NewSchema(loader)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tresult, err := s.Validate(doc)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tif !result.Valid() {\n\t\tfor _, desc := range result.Errors() {\n\t\t\t// Note: some descriptions start with the context location so we trim\n\t\t\t// those off to prevent duplicating data. (e.g. see the enum error)\n\t\t\tctx.AddError(&ErrorDetail{\n\t\t\t\tMessage: strings.TrimPrefix(desc.Description(), desc.Context().String()+\" \"),\n\t\t\t\tLocation: label + strings.TrimPrefix(desc.Field(), \"(root)\"),\n\t\t\t\tValue: desc.Value(),\n\t\t\t})\n\t\t}\n\t\treturn false\n\t}\n\n\treturn true\n}",
"func validateList(schema *yang.Entry, value interface{}) (errors []error) {\n\tif isNil(value) {\n\t\treturn nil\n\t}\n\n\t// Check that the schema itself is valid.\n\tif err := validateListSchema(schema); err != nil {\n\t\treturn appendErr(errors, err)\n\t}\n\n\tdbgPrint(\"validateList with value %v, type %T, schema name %s\", value, value, schema.Name)\n\n\tkind := reflect.TypeOf(value).Kind()\n\tif kind == reflect.Slice || kind == reflect.Map {\n\t\t// Check list attributes: size constraints etc.\n\t\t// Skip this check if not a list type - in this case value may be a list\n\t\t// element which shares the list schema (excluding ListAttr).\n\t\terrors = appendErrs(errors, validateListAttr(schema, value))\n\t}\n\n\tswitch kind {\n\tcase reflect.Slice:\n\t\t// List without key is a slice in the data tree.\n\t\tsv := reflect.ValueOf(value)\n\t\tfor i := 0; i < sv.Len(); i++ {\n\t\t\terrors = appendErrs(errors, validateStructElems(schema, sv.Index(i).Interface()))\n\t\t}\n\tcase reflect.Map:\n\t\t// List with key is a map in the data tree, with the key being the value\n\t\t// of the key field(s) in the elements.\n\t\tfor _, key := range reflect.ValueOf(value).MapKeys() {\n\t\t\tcv := reflect.ValueOf(value).MapIndex(key).Interface()\n\t\t\tstructElems := reflect.ValueOf(cv).Elem()\n\t\t\t// Check that keys are present and have correct values.\n\t\t\terrors = appendErrs(errors, checkKeys(schema, structElems, key))\n\n\t\t\t// Verify each elements's fields.\n\t\t\terrors = appendErrs(errors, validateStructElems(schema, cv))\n\t\t}\n\tcase reflect.Ptr:\n\t\t// Validate was called on a list element rather than the whole list, or\n\t\t// on a completely bogus struct. In either case, evaluate just the\n\t\t// element against the list schema without considering list attributes.\n\t\terrors = appendErrs(errors, validateStructElems(schema, value))\n\n\tdefault:\n\t\terrors = appendErr(errors, fmt.Errorf(\"validateList expected map/slice type for %s, got %T\", schema.Name, value))\n\t}\n\treturn\n}",
"func validateStruct(value reflect.Value) error {\n\ttyp := value.Type()\n\n\t// Iterate over struct fields\n\tfor i := 0; i < typ.NumField(); i++ {\n\t\tvalidators := getValidators(typ.Field(i).Tag)\n\t\tfieldName := typ.Field(i).Name\n\t\tif err := validateField(value.Field(i), fieldName, validators); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}",
"func TestValidationExpressionsAtSchemaLevels(t *testing.T) {\n\ttests := []struct {\n\t\tname string\n\t\tschema *schema.Structural\n\t\tobj interface{}\n\t\toldObj interface{}\n\t\terrors []string // strings that error message must contain\n\t}{\n\t\t{name: \"invalid rule under array items\",\n\t\t\tobj: map[string]interface{}{\n\t\t\t\t\"f\": []interface{}{1},\n\t\t\t},\n\t\t\tschema: objectTypePtr(map[string]schema.Structural{\n\t\t\t\t\"f\": listType(cloneWithRule(&integerType, \"self == 'abc'\")),\n\t\t\t}),\n\t\t\terrors: []string{\"found no matching overload for '_==_' applied to '(int, string)\"},\n\t\t},\n\t\t{name: \"invalid rule under array items, parent has rule\",\n\t\t\tobj: map[string]interface{}{\n\t\t\t\t\"f\": []interface{}{1},\n\t\t\t},\n\t\t\tschema: objectTypePtr(map[string]schema.Structural{\n\t\t\t\t\"f\": withRule(listType(cloneWithRule(&integerType, \"self == 'abc'\")), \"1 == 1\"),\n\t\t\t}),\n\t\t\terrors: []string{\"found no matching overload for '_==_' applied to '(int, string)\"},\n\t\t},\n\t\t{name: \"invalid rule under additionalProperties\",\n\t\t\tobj: map[string]interface{}{\n\t\t\t\t\"f\": map[string]interface{}{\"k\": 1},\n\t\t\t},\n\t\t\tschema: objectTypePtr(map[string]schema.Structural{\n\t\t\t\t\"f\": mapType(cloneWithRule(&integerType, \"self == 'abc'\")),\n\t\t\t}),\n\t\t\terrors: []string{\"found no matching overload for '_==_' applied to '(int, string)\"},\n\t\t},\n\t\t{name: \"invalid rule under additionalProperties, parent has rule\",\n\t\t\tobj: map[string]interface{}{\n\t\t\t\t\"f\": map[string]interface{}{\"k\": 1},\n\t\t\t},\n\t\t\tschema: objectTypePtr(map[string]schema.Structural{\n\t\t\t\t\"f\": withRule(mapType(cloneWithRule(&integerType, \"self == 'abc'\")), \"1 == 1\"),\n\t\t\t}),\n\t\t\terrors: []string{\"found no matching overload for '_==_' applied to '(int, string)\"},\n\t\t},\n\t\t{name: \"invalid rule under unescaped field name\",\n\t\t\tobj: map[string]interface{}{\n\t\t\t\t\"f\": map[string]interface{}{\n\t\t\t\t\t\"m\": 1,\n\t\t\t\t},\n\t\t\t},\n\t\t\tschema: objectTypePtr(map[string]schema.Structural{\n\t\t\t\t\"f\": withRule(objectType(map[string]schema.Structural{\"m\": integerType}), \"self.m == 'abc'\"),\n\t\t\t}),\n\t\t\terrors: []string{\"found no matching overload for '_==_' applied to '(int, string)\"},\n\t\t},\n\t\t{name: \"invalid rule under unescaped field name, parent has rule\",\n\t\t\tobj: map[string]interface{}{\n\t\t\t\t\"f\": map[string]interface{}{\n\t\t\t\t\t\"m\": 1,\n\t\t\t\t},\n\t\t\t},\n\t\t\tschema: withRulePtr(objectTypePtr(map[string]schema.Structural{\n\t\t\t\t\"f\": withRule(objectType(map[string]schema.Structural{\"m\": integerType}), \"self.m == 'abc'\"),\n\t\t\t}), \"1 == 1\"),\n\t\t\terrors: []string{\"found no matching overload for '_==_' applied to '(int, string)\"},\n\t\t},\n\t\t// check that escaped field names do not impact CEL rule validation\n\t\t{name: \"invalid rule under escaped field name\",\n\t\t\tobj: map[string]interface{}{\n\t\t\t\t\"f/2\": map[string]interface{}{\n\t\t\t\t\t\"m\": 1,\n\t\t\t\t},\n\t\t\t},\n\t\t\tschema: objectTypePtr(map[string]schema.Structural{\n\t\t\t\t\"f/2\": withRule(objectType(map[string]schema.Structural{\"m\": integerType}), \"self.m == 'abc'\"),\n\t\t\t}),\n\t\t\terrors: []string{\"found no matching overload for '_==_' applied to '(int, string)\"},\n\t\t},\n\t\t{name: \"invalid rule under escaped field name, parent has rule\",\n\t\t\tobj: map[string]interface{}{\n\t\t\t\t\"f/2\": map[string]interface{}{\n\t\t\t\t\t\"m\": 1,\n\t\t\t\t},\n\t\t\t},\n\t\t\tschema: withRulePtr(objectTypePtr(map[string]schema.Structural{\n\t\t\t\t\"f/2\": withRule(objectType(map[string]schema.Structural{\"m\": integerType}), \"self.m == 'abc'\"),\n\t\t\t}), \"1 == 1\"),\n\t\t\terrors: []string{\"found no matching overload for '_==_' applied to '(int, string)\"},\n\t\t},\n\t\t{name: \"failing rule under escaped field name\",\n\t\t\tobj: map[string]interface{}{\n\t\t\t\t\"f/2\": map[string]interface{}{\n\t\t\t\t\t\"m\": 1,\n\t\t\t\t},\n\t\t\t},\n\t\t\tschema: objectTypePtr(map[string]schema.Structural{\n\t\t\t\t\"f/2\": withRule(objectType(map[string]schema.Structural{\"m\": integerType}), \"self.m == 2\"),\n\t\t\t}),\n\t\t\terrors: []string{\"Invalid value: \\\"object\\\": failed rule: self.m == 2\"},\n\t\t},\n\t\t// unescapable field names that are not accessed by the CEL rule are allowed and should not impact CEL rule validation\n\t\t{name: \"invalid rule under unescapable field name\",\n\t\t\tobj: map[string]interface{}{\n\t\t\t\t\"a@b\": map[string]interface{}{\n\t\t\t\t\t\"m\": 1,\n\t\t\t\t},\n\t\t\t},\n\t\t\tschema: objectTypePtr(map[string]schema.Structural{\n\t\t\t\t\"a@b\": withRule(objectType(map[string]schema.Structural{\"m\": integerType}), \"self.m == 'abc'\"),\n\t\t\t}),\n\t\t\terrors: []string{\"found no matching overload for '_==_' applied to '(int, string)\"},\n\t\t},\n\t\t{name: \"invalid rule under unescapable field name, parent has rule\",\n\t\t\tobj: map[string]interface{}{\n\t\t\t\t\"f@2\": map[string]interface{}{\n\t\t\t\t\t\"m\": 1,\n\t\t\t\t},\n\t\t\t},\n\t\t\tschema: withRulePtr(objectTypePtr(map[string]schema.Structural{\n\t\t\t\t\"f@2\": withRule(objectType(map[string]schema.Structural{\"m\": integerType}), \"self.m == 'abc'\"),\n\t\t\t}), \"1 == 1\"),\n\t\t\terrors: []string{\"found no matching overload for '_==_' applied to '(int, string)\"},\n\t\t},\n\t\t{name: \"failing rule under unescapable field name\",\n\t\t\tobj: map[string]interface{}{\n\t\t\t\t\"a@b\": map[string]interface{}{\n\t\t\t\t\t\"m\": 1,\n\t\t\t\t},\n\t\t\t},\n\t\t\tschema: objectTypePtr(map[string]schema.Structural{\n\t\t\t\t\"a@b\": withRule(objectType(map[string]schema.Structural{\"m\": integerType}), \"self.m == 2\"),\n\t\t\t}),\n\t\t\terrors: []string{\"Invalid value: \\\"object\\\": failed rule: self.m == 2\"},\n\t\t},\n\t\t{name: \"matchExpressions - 'values' must be specified when 'operator' is 'In' or 'NotIn'\",\n\t\t\tobj: map[string]interface{}{\n\t\t\t\t\"matchExpressions\": []interface{}{\n\t\t\t\t\tmap[string]interface{}{\n\t\t\t\t\t\t\"key\": \"tier\",\n\t\t\t\t\t\t\"operator\": \"In\",\n\t\t\t\t\t\t\"values\": []interface{}{},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\tschema: genMatchSelectorSchema(`self.matchExpressions.all(rule, (rule.operator != \"In\" && rule.operator != \"NotIn\") || ((has(rule.values) && size(rule.values) > 0)))`),\n\t\t\terrors: []string{\"failed rule\"},\n\t\t},\n\t\t{name: \"matchExpressions - 'values' may not be specified when 'operator' is 'Exists' or 'DoesNotExist'\",\n\t\t\tobj: map[string]interface{}{\n\t\t\t\t\"matchExpressions\": []interface{}{\n\t\t\t\t\tmap[string]interface{}{\n\t\t\t\t\t\t\"key\": \"tier\",\n\t\t\t\t\t\t\"operator\": \"Exists\",\n\t\t\t\t\t\t\"values\": []interface{}{\"somevalue\"},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\tschema: genMatchSelectorSchema(`self.matchExpressions.all(rule, (rule.operator != \"Exists\" && rule.operator != \"DoesNotExist\") || ((!has(rule.values) || size(rule.values) == 0)))`),\n\t\t\terrors: []string{\"failed rule\"},\n\t\t},\n\t\t{name: \"matchExpressions - invalid selector operator\",\n\t\t\tobj: map[string]interface{}{\n\t\t\t\t\"matchExpressions\": []interface{}{\n\t\t\t\t\tmap[string]interface{}{\n\t\t\t\t\t\t\"key\": \"tier\",\n\t\t\t\t\t\t\"operator\": \"badop\",\n\t\t\t\t\t\t\"values\": []interface{}{},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\tschema: genMatchSelectorSchema(`self.matchExpressions.all(rule, rule.operator == \"In\" || rule.operator == \"NotIn\" || rule.operator == \"DoesNotExist\")`),\n\t\t\terrors: []string{\"failed rule\"},\n\t\t},\n\t\t{name: \"matchExpressions - invalid label value\",\n\t\t\tobj: map[string]interface{}{\n\t\t\t\t\"matchExpressions\": []interface{}{\n\t\t\t\t\tmap[string]interface{}{\n\t\t\t\t\t\t\"key\": \"badkey!\",\n\t\t\t\t\t\t\"operator\": \"Exists\",\n\t\t\t\t\t\t\"values\": []interface{}{},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\tschema: genMatchSelectorSchema(`self.matchExpressions.all(rule, size(rule.key) <= 63 && rule.key.matches(\"^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?$\"))`),\n\t\t\terrors: []string{\"failed rule\"},\n\t\t},\n\t}\n\n\tfor _, tt := range tests {\n\t\ttt := tt\n\t\tt.Run(tt.name, func(t *testing.T) {\n\t\t\tt.Parallel()\n\t\t\tctx := context.TODO()\n\t\t\tcelValidator := validator(tt.schema, true, model.SchemaDeclType(tt.schema, true), celconfig.PerCallLimit)\n\t\t\tif celValidator == nil {\n\t\t\t\tt.Fatal(\"expected non nil validator\")\n\t\t\t}\n\t\t\terrs, _ := celValidator.Validate(ctx, field.NewPath(\"root\"), tt.schema, tt.obj, tt.oldObj, math.MaxInt)\n\t\t\tunmatched := map[string]struct{}{}\n\t\t\tfor _, e := range tt.errors {\n\t\t\t\tunmatched[e] = struct{}{}\n\t\t\t}\n\t\t\tfor _, err := range errs {\n\t\t\t\tif err.Type != field.ErrorTypeInvalid {\n\t\t\t\t\tt.Errorf(\"expected only ErrorTypeInvalid errors, but got: %v\", err)\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tmatched := false\n\t\t\t\tfor expected := range unmatched {\n\t\t\t\t\tif strings.Contains(err.Error(), expected) {\n\t\t\t\t\t\tdelete(unmatched, expected)\n\t\t\t\t\t\tmatched = true\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif !matched {\n\t\t\t\t\tt.Errorf(\"expected error to contain one of %v, but got: %v\", unmatched, err)\n\t\t\t\t}\n\t\t\t}\n\t\t\tif len(unmatched) > 0 {\n\t\t\t\tt.Errorf(\"expected errors %v\", unmatched)\n\t\t\t}\n\t\t})\n\t}\n}",
"func (s *AnySchema) Validate(value interface{}) error {\n\t// Validate PRE Transform\n\tif err := s.runTransform(TransformStagePRE, &value); err != nil {\n\t\treturn err\n\t}\n\t// Validate Forbidden\n\tif IsSet(s.forbidden) && *s.forbidden == true && value != nil {\n\t\treturn ErrAnyForbidden\n\t}\n\t// Validate Required\n\tif IsSet(s.required) && *s.required == true && value == nil {\n\t\treturn ErrAnyRequired\n\t}\n\t// Validate Zero\n\tif IsSet(s.zero) && *s.zero == true {\n\t\tif value != nil {\n\t\t\tif v := reflect.Zero(reflect.TypeOf(value)).Interface(); v != value {\n\t\t\t\treturn ErrAnyZero\n\t\t\t}\n\t\t}\n\t}\n\t// Validate NonZero\n\tif IsSet(s.nonzero) && *s.nonzero == true {\n\t\tif v := reflect.Zero(reflect.TypeOf(value)).Interface(); v == value {\n\t\t\treturn ErrAnyNonZero\n\t\t}\n\t}\n\t// Validate Allow\n\tif IsSet(s.allow) {\n\t\tmatch := false\n\t\tfor _, a := range *s.allow {\n\t\t\tif value == a {\n\t\t\t\tmatch = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif !match {\n\t\t\treturn ErrAnyAllow\n\t\t}\n\t}\n\t// Validate Disallow\n\tif IsSet(s.disallow) {\n\t\tfor _, a := range *s.disallow {\n\t\t\tif value == a {\n\t\t\t\treturn ErrAnyDisallow\n\t\t\t}\n\t\t}\n\t}\n\t// Validate POST Transform\n\tif err := s.runTransform(TransformStagePOST, &value); err != nil {\n\t\treturn err\n\t}\n\n\t// All ok\n\treturn nil\n}",
"func validAllOf(stack_id string, mem *JSONNode, schema *JSONNode, parent *JSONNode, errs *SchemaErrors) bool {\n\tTrace.Println(stack_id, \"allOf\")\n\t\n\tvalid := false\n\tschema.ResetIterate()\n\tindex := 1\n\tsuppress = true\n\tfor {\n\t\titem := schema.GetNext()\n\t\tif item == nil {\n\t\t\tbreak\n\t\t}\n\n\t\tof := item\n\t\tif of.GetValueType () == V_OBJECT {\n\t\t\tof.ResetIterate()\n\t\t\tof = of.GetNext()\n\t\t}\n\n\t\tnew_stack_id := stack_id + \".\" + strconv.Itoa(index)\n\t\tindex++\n\t\tvalid = validMember(new_stack_id, \"allOf\", mem, of)\n\n\t\tTrace.Println(\" allOf valid\", valid)\n\t\tif !valid {\n\t\t\tbreak\n\t\t}\n\t}\n\tsuppress = false\n\n\tif !valid {\n\t\terrs.Add(mem, \"Did not match all the allOf constraints\", JP_ERROR)\n\t\tfor i := range suppressErrors.errorList {\n\t\t\tsuppressErrors.errorList[i].level = JP_INFO\n\t\t\tschemaErrors.errorList = append(schemaErrors.errorList, suppressErrors.errorList[i])\n\t\t}\n\t}\n\n\tsuppressErrors = NewSchemaErrors()\n\n\tTrace.Println(stack_id, \"allOf\", valid)\n\treturn valid\n}",
"func ValidateStruct(s interface{}) bool {\n\tif s == nil {\n\t\treturn true\n\t}\n\tresult := true\n\tif reflect.ValueOf(s).Kind() == reflect.Interface || reflect.ValueOf(s).Kind() == reflect.Ptr {\n\t\tval := reflect.ValueOf(s).Elem()\n\n\t\tfor i := 0; i < val.NumField(); i++ {\n\t\t\tvalueField := val.Field(i)\n\t\t\ttypeField := val.Type().Field(i)\n\t\t\ttag := typeField.Tag.Get(\"regex\")\n\t\t\ttagStr := fmt.Sprint(tag)\n\t\t\tif len(tagStr) > 0 && valueField.Kind() == reflect.String {\n\t\t\t\tfield := fmt.Sprint(valueField)\n\t\t\t\tresult = result && Matches(field, tagStr)\n\t\t\t} else if valueField.Kind() == reflect.Struct || valueField.Kind() == reflect.Ptr {\n\t\t\t\tresult = result && ValidateStruct(valueField.Interface())\n\t\t\t}\n\t\t}\n\t}\n\treturn result\n}",
"func childSchema(schema *yang.Entry, f reflect.StructField) (*yang.Entry, error) {\n\tpathTag, _ := f.Tag.Lookup(\"path\")\n\tutil.DbgSchema(\"childSchema for schema %s, field %s, tag %s\\n\", schema.Name, f.Name, pathTag)\n\tp, err := pathToSchema(f)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Containers have the container schema name as the first element in the\n\t// path tag for each field e.g. System { Dns ... path: \"system/dns\"\n\t// Strip this off since the supplied schema already refers to the struct\n\t// schema element.\n\tif schema.IsContainer() && len(p) > 1 && p[0] == schema.Name {\n\t\tp = p[1:]\n\t}\n\tutil.DbgSchema(\"pathToSchema yields %v\\n\", p)\n\t// For empty path, return the parent schema.\n\tchildSchema := schema\n\tfoundSchema := true\n\t// Traverse the returned schema path to get the child schema.\n\tutil.DbgSchema(\"traversing schema Dirs...\")\n\tfor ; len(p) > 0; p = p[1:] {\n\t\tutil.DbgSchema(\"/%s\", p[0])\n\t\tns, ok := childSchema.Dir[util.StripModulePrefix(p[0])]\n\t\tif !ok {\n\t\t\tfoundSchema = false\n\t\t\tbreak\n\t\t}\n\t\tchildSchema = ns\n\t}\n\tif foundSchema {\n\t\tutil.DbgSchema(\" - found\\n\")\n\t\treturn childSchema, nil\n\t}\n\tutil.DbgSchema(\" - not found\\n\")\n\n\t// Path is not null and was not found in the schema. It could be inside a\n\t// choice/case schema element which is not represented in the path tags.\n\t// e.g. choice1/case1/leaf1 could have abbreviated tag `path: \"leaf1\"`.\n\t// In this case, try to match against any named elements within any choice/\n\t// case subtrees. These are guaranteed to be unique within the current\n\t// level namespace so a path tag name match will be unique if one is found.\n\tif len(p) != 1 {\n\t\t// Nodes within choice/case have a path tag with only the last schema\n\t\t// path element i.e. choice1/case1/leaf1 path in the schema will have\n\t\t// struct tag `path:\"leaf1\"`. This implies that only paths with length\n\t\t// 1 are eligible for this matching.\n\t\treturn nil, nil\n\t}\n\tentries := util.FindFirstNonChoiceOrCase(schema)\n\n\tutil.DbgSchema(\"checking for %s against non choice/case entries: %v\\n\", p[0], stringMapKeys(entries))\n\tfor name, entry := range entries {\n\t\tutil.DbgSchema(\"%s ? \", name)\n\n\t\tif util.StripModulePrefix(name) == p[0] {\n\t\t\tutil.DbgSchema(\" - match\\n\")\n\t\t\treturn entry, nil\n\t\t}\n\t}\n\n\tutil.DbgSchema(\" - no matches\\n\")\n\treturn nil, nil\n}",
"func (f *folderYAML) validate() error {\n\tif f.Spec.Id == \"\" {\n\t\treturn errMissingRequiredField\n\t}\n\tswitch f.Spec.ParentRef.TargetTypeStr { // Validate Supported Parents\n\tcase Organization.String(), Folder.String():\n\tdefault:\n\t\tlog.Printf(\"fatal: unsupported parent '%s' type for Folder\\n\", f.Spec.ParentRef.TargetTypeStr)\n\t\treturn errInvalidParent\n\t}\n\n\tif !tfNameRegex.MatchString(f.Spec.Id) {\n\t\tlog.Printf(\"GCP Folder [%s] ID does not conform to Terraform standard\", f.Spec.Id)\n\t\treturn errValidationFailed\n\t}\n\n\tif len(f.Spec.DisplayName) < folderNameMin || len(f.Spec.DisplayName) > folderNameMax {\n\t\tlog.Printf(\"GCP Folder Name [%s] needs to be between %d and %d\", f.Spec.DisplayName, folderNameMin, folderNameMax)\n\t\treturn errValidationFailed\n\t}\n\n\tf.subFolders = newSubFoldersBySpecs(f.Spec.SubFolderSpecs, Folder, f.Spec.Id)\n\tfor _, f := range f.subFolders { // triggers subfolder validation to validate and add nested folders\n\t\tif err := f.validate(); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}",
"func FnValidationCheckStruct(t interface{}) error {\n\tv := validator.New()\n\terr := v.Struct(t)\n\tif err != nil {\n\t\tfor _, e := range err.(validator.ValidationErrors) {\n\t\t\treturn errors.Errorf(\"Excepting Particular feild but seems to empty %s\", e.Field())\n\t\t}\n\t}\n\treturn nil\n}",
"func validateJSONSchema(schema string, jsonObj string) error {\n\tmethodName := \"[validateJSONSchema]\"\n\tloaderSchema := gojsonschema.NewStringLoader(schema)\n\tloaderObj := gojsonschema.NewStringLoader(jsonObj)\n\tresult, _ := gojsonschema.Validate(loaderSchema, loaderObj)\n\tif !result.Valid() {\n\t\tlogger.Errorf(methodName + \" The document is not valid. see errors :\")\n\t\terrMsg := \"\"\n\t\tfor _, err := range result.Errors() {\n\t\t\terrMsg = errMsg + \" \" + err.String()\n\t\t}\n\t\treturn errors.New(methodName + \" Can't be Validate JSON Schema. Error: \" + errMsg)\n\t}\n\treturn nil\n}",
"func (m *Schema) Validate() error {\n\tif m == nil {\n\t\treturn nil\n\t}\n\n\t// no validation rules for TypeUrl\n\n\tif v, ok := interface{}(m.GetMetadata()).(interface{ Validate() error }); ok {\n\t\tif err := v.Validate(); err != nil {\n\t\t\treturn SchemaValidationError{\n\t\t\t\tfield: \"Metadata\",\n\t\t\t\treason: \"embedded message failed validation\",\n\t\t\t\tcause: err,\n\t\t\t}\n\t\t}\n\t}\n\n\tfor idx, item := range m.GetFields() {\n\t\t_, _ = idx, item\n\n\t\tif v, ok := interface{}(item).(interface{ Validate() error }); ok {\n\t\t\tif err := v.Validate(); err != nil {\n\t\t\t\treturn SchemaValidationError{\n\t\t\t\t\tfield: fmt.Sprintf(\"Fields[%v]\", idx),\n\t\t\t\t\treason: \"embedded message failed validation\",\n\t\t\t\t\tcause: err,\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t}\n\n\tif v, ok := interface{}(m.GetError()).(interface{ Validate() error }); ok {\n\t\tif err := v.Validate(); err != nil {\n\t\t\treturn SchemaValidationError{\n\t\t\t\tfield: \"Error\",\n\t\t\t\treason: \"embedded message failed validation\",\n\t\t\t\tcause: err,\n\t\t\t}\n\t\t}\n\t}\n\n\treturn nil\n}",
"func (rs *RootSchema) UnmarshalJSON(data []byte) error {\n\tsch := &Schema{}\n\tif err := json.Unmarshal(data, sch); err != nil {\n\t\treturn err\n\t}\n\n\tif sch.schemaType == schemaTypeFalse || sch.schemaType == schemaTypeTrue {\n\t\t*rs = RootSchema{Schema: *sch}\n\t\treturn nil\n\t}\n\n\tsuri := struct {\n\t\tSchemaURI string `json:\"$schema\"`\n\t}{}\n\tif err := json.Unmarshal(data, &suri); err != nil {\n\t\treturn err\n\t}\n\n\troot := &RootSchema{\n\t\tSchema: *sch,\n\t\tSchemaURI: suri.SchemaURI,\n\t}\n\n\t// collect IDs for internal referencing:\n\tids := map[string]*Schema{}\n\tif err := walkJSON(sch, func(elem JSONPather) error {\n\t\tif sch, ok := elem.(*Schema); ok {\n\t\t\tif sch.ID != \"\" {\n\t\t\t\tids[sch.ID] = sch\n\n\t\t\t\t// For the record, I think this is rediculous.\n\t\t\t\tif u, err := url.Parse(sch.ID); err == nil {\n\t\t\t\t\tids[u.Path[1:]] = sch\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn nil\n\t}); err != nil {\n\t\treturn err\n\t}\n\n\t// pass a pointer to the schema component in here (instead of the\n\t// RootSchema struct) to ensure root is evaluated for references\n\tif err := walkJSON(sch, func(elem JSONPather) error {\n\t\tif sch, ok := elem.(*Schema); ok {\n\t\t\tif sch.Ref != \"\" {\n\t\t\t\tif ids[sch.Ref] != nil {\n\t\t\t\t\tsch.ref = ids[sch.Ref]\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\n\t\t\t\tptr, err := jsonpointer.Parse(sch.Ref)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn fmt.Errorf(\"error evaluating json pointer: %s: %s\", err.Error(), sch.Ref)\n\t\t\t\t}\n\t\t\t\tres, err := root.evalJSONValidatorPointer(ptr)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t\tif val, ok := res.(Validator); ok {\n\t\t\t\t\tsch.ref = val\n\t\t\t\t} else {\n\t\t\t\t\treturn fmt.Errorf(\"%s : %s, %v is not a json pointer to a json schema\", sch.Ref, ptr.String(), ptr)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn nil\n\t}); err != nil {\n\t\treturn err\n\t}\n\n\t*rs = RootSchema{\n\t\tSchema: *sch,\n\t\tSchemaURI: suri.SchemaURI,\n\t}\n\treturn nil\n}",
"func ValidateSchema(schema, record []byte) ([]byte, error) {\n\tschemaLoader := gojsonschema.NewBytesLoader(schema)\n\trecordLoader := gojsonschema.NewBytesLoader(record)\n\tresult, err := gojsonschema.Validate(schemaLoader, recordLoader)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif result.Valid() {\n\t\treturn []byte{}, nil\n\t}\n\toutput := make(map[string][]string)\n\tfor _, r := range result.Errors() {\n\t\tfield := r.Field()\n\t\tmsg := r.Description()\n\t\toutput[field] = append(output[field], msg)\n\t}\n\tfn, err := endec.Encoders.Get(defaultFormat)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tencoder := fn()\n\treturn encoder(output)\n}",
"func main() {\n\tvar tree = &TreeNode{\n\t\tVal: 10,\n\t\tLeft: &TreeNode{\n\t\t\tVal: 5,\n\t\t},\n\t\tRight: &TreeNode{\n\t\t\tVal: 15,\n\t\t\tLeft: &TreeNode{\n\t\t\t\tVal: 6,\n\t\t\t},\n\t\t\tRight: &TreeNode{\n\t\t\t\tVal: 20,\n\t\t\t},\n\t\t},\n\t}\n\n\tfmt.Printf(\"%v\", isValidBST(tree))\n}",
"func validateListAttr(schema *yang.Entry, value interface{}) util.Errors {\n\tvar errors []error\n\tif schema == nil {\n\t\treturn util.NewErrs(fmt.Errorf(\"schema is nil\"))\n\t}\n\tif schema.ListAttr == nil {\n\t\treturn util.NewErrs(fmt.Errorf(\"schema %s ListAttr is nil\", schema.Name))\n\t}\n\n\tvar size int\n\tif value == nil {\n\t\tsize = 0\n\t} else {\n\t\tswitch reflect.TypeOf(value).Kind() {\n\t\tcase reflect.Slice, reflect.Map:\n\t\t\tsize = reflect.ValueOf(value).Len()\n\t\tdefault:\n\t\t\treturn util.NewErrs(fmt.Errorf(\"value %v type %T must be map or slice type for schema %s\", value, value, schema.Name))\n\t\t}\n\t}\n\n\t// If min/max element attr is present in the schema, this must be a list or\n\t// leaf-list. Check that the data tree falls within the required size\n\t// bounds.\n\tif v := schema.ListAttr.MinElements; v != nil {\n\t\tif minN, err := yang.ParseNumber(v.Name); err != nil {\n\t\t\terrors = util.AppendErr(errors, err)\n\t\t} else if min, err := minN.Int(); err != nil {\n\t\t\terrors = util.AppendErr(errors, err)\n\t\t} else if min < 0 {\n\t\t\terrors = util.AppendErr(errors, fmt.Errorf(\"list %s has negative min required elements\", schema.Name))\n\t\t} else if int64(size) < min {\n\t\t\terrors = util.AppendErr(errors, fmt.Errorf(\"list %s contains fewer than min required elements: %d < %d\", schema.Name, size, min))\n\t\t}\n\t}\n\tif v := schema.ListAttr.MaxElements; v != nil {\n\t\tif maxN, err := yang.ParseNumber(v.Name); err != nil {\n\t\t\terrors = util.AppendErr(errors, err)\n\t\t} else if max, err := maxN.Int(); err != nil {\n\t\t\terrors = util.AppendErr(errors, err)\n\t\t} else if max < 0 {\n\t\t\terrors = util.AppendErr(errors, fmt.Errorf(\"list %s has negative max required elements\", schema.Name))\n\t\t} else if int64(size) > max {\n\t\t\terrors = util.AppendErr(errors, fmt.Errorf(\"list %s contains more than max allowed elements: %d > %d\", schema.Name, size, max))\n\t\t}\n\t}\n\n\treturn errors\n}",
"func (n *Node) Validate() error {\n\tif n.IsDir() {\n\t\tif n.Revision != 0 {\n\t\t\treturn pb.NewValidationError(\"unexpected Revision (%d)\", n.Revision)\n\t\t} else if len(n.Children) == 0 {\n\t\t\treturn pb.NewValidationError(\"expected one or more Children\")\n\t\t}\n\n\t\tfor i, child := range n.Children {\n\t\t\tif !strings.HasPrefix(child.Spec.Name.String(), n.Spec.Name.String()) {\n\t\t\t\treturn pb.NewValidationError(\"expected parent Name to prefix child (%s vs %s)\",\n\t\t\t\t\tn.Spec.Name, child.Spec.Name)\n\t\t\t} else if i != 0 && n.Children[i-1].Spec.Name >= child.Spec.Name {\n\t\t\t\treturn pb.NewValidationError(\"expected Children to be ordered (ind %d; %s vs %s)\",\n\t\t\t\t\ti, n.Children[i-1].Spec.Name, child.Spec.Name)\n\t\t\t} else if err := child.Validate(); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t\treturn nil\n\t}\n\n\tif err := pb.Journal(n.Spec.Name).Validate(); err != nil {\n\t\treturn pb.ExtendContext(err, \"Name\")\n\t} else if len(n.Children) != 0 {\n\t\treturn pb.NewValidationError(\"expected no Children with non-directory Node (%s)\", n.Spec.Name)\n\t}\n\treturn nil\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
IsNumChar returns true if the given character is a numeric, otherwise false.
|
func IsNumChar(c byte) bool { return c >= '0' && c <= '9' }
|
[
"func isNumeric(ch rune) bool {\n\treturn ch >= '0' && ch <= '9'\n}",
"func IsNumeric(r rune) bool {\n\treturn '0' <= r && r <= '9'\n}",
"func isNumber(ch rune) bool {\n\treturn isDigit(ch) || ch == '-' || ch == '+' || ch == '.'\n}",
"func (*DuduRune) IsNumOrLetter(r rune) bool {\n\treturn ('0' <= r && '9' >= r) || Rune.IsLetter(r)\n}",
"func (c Code) IsNumeric() bool {\n\treturn c == Int8 || c == Int32 || c == Float || c == SmallBig || c == LargeBig\n}",
"func isNumeric(text string) bool {\n\tif _, err := strconv.Atoi(text); err != nil {\n\t\treturn false\n\t}\n\treturn true\n}",
"func ValidateNumeric(str string) bool {\n\tvar num, symbol int\n\tfor _, r := range str {\n\t\tif r >= 48 && r <= 57 { //code ascii for [0-9]\n\t\t\tnum = +1\n\t\t} else {\n\t\t\tsymbol = +1\n\t\t}\n\t}\n\n\tif symbol > 0 {\n\t\treturn false\n\t}\n\n\treturn num >= 1\n}",
"func IsAlphaNumeric(c byte) bool {\n\treturn c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z' || c >= '0' && c <= '9'\n}",
"func IsDigit(s string) bool {\n\tif s == \"\" {\n\t\treturn false\n\t}\n\tfor _, r := range s {\n\t\tif r < '0' || r > '9' {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}",
"func (gdt *String) IsNumeric() bool {\n\n\t/* go_godot_string_is_numeric(API_STRUCT) ->godot_bool */\n\n\tapi := CoreApi\n\trcv := (*C.godot_string)(unsafe.Pointer(gdt))\n\n\tret := C.go_godot_string_is_numeric(\n\t\tapi,\n\t\trcv,\n\t)\n\n\treturn *(*bool)(unsafe.Pointer(&ret))\n}",
"func IsNumber(r rune) bool {\n\tif uint32(r) <= MaxLatin1 {\n\t\treturn properties[uint8(r)]&pN != 0\n\t}\n\treturn isExcludingLatin(Number, r)\n}",
"func IsNumeric(val interface{}) bool {\n\tswitch val.(type) {\n\tcase int, int8, int16, int32, int64, uint, uint8, uint16, uint32, uint64:\n\t\treturn true\n\tcase float32, float64, complex64, complex128:\n\t\treturn true\n\tcase string:\n\t\tstr := val.(string)\n\t\tif str == \"\" {\n\t\t\treturn false\n\t\t}\n\t\t// Trim any whitespace\n\t\tstr = strings.TrimSpace(str)\n\t\tif str[0] == '-' || str[0] == '+' {\n\t\t\tif len(str) == 1 {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tstr = str[1:]\n\t\t}\n\t\t// hex\n\t\tif len(str) > 2 && str[0] == '0' && (str[1] == 'x' || str[1] == 'X') {\n\t\t\tfor _, h := range str[2:] {\n\t\t\t\tif !((h >= '0' && h <= '9') || (h >= 'a' && h <= 'f') || (h >= 'A' && h <= 'F')) {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true\n\t\t}\n\t\t// 0-9,Point,Scientific\n\t\tp, s, l := 0, 0, len(str)\n\t\tfor i, v := range str {\n\t\t\tif v == '.' { // Point\n\t\t\t\tif p > 0 || s > 0 || i+1 == l {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t\tp = i\n\t\t\t} else if v == 'e' || v == 'E' { // Scientific\n\t\t\t\tif i == 0 || s > 0 || i+1 == l {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t\ts = i\n\t\t\t} else if v < '0' || v > '9' {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t\treturn true\n\t}\n\n\treturn false\n}",
"func IsAlphaNum(c byte) bool {\n\treturn c == '_' || 'a' <= c && c <= 'z' || 'A' <= c && c <= 'Z' || '0' <= c && c <= '9'\n}",
"func isAlphanum(ch rune) bool {\n\treturn isLetter(ch) || isNumeric(ch) || ch == '_'\n}",
"func (c *column) IsNumeric() bool {\n\treturn (c.kind & typeNumeric) == typeNumeric\n}",
"func IsDigitSingleOP(c byte) bool {\n\treturn c >= '0' && c <= '9'\n}",
"func containsNum(s string) bool {\n\tfor _, i := range s {\n\t\tif unicode.IsNumber(i) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}",
"func IsAlphaNumeric(s string, extra string) bool {\n\treturn regexp.MustCompile(`^[a-zA-Z0-9` + extra + `]+$`).MatchString(s)\n}",
"func NumberIsAlphaNumeric(vm *VM, target, locals Interface, msg *Message) Interface {\n\tx := rune(target.(*Number).Value)\n\treturn vm.IoBool(unicode.IsLetter(x) || unicode.IsNumber(x))\n}",
"func IsTokenChar(rune int) bool {\n\t// token := 1*<any (US-ASCII) CHAR except SPACE, CTLs,\n\t// or tspecials>\n\treturn rune > 0x20 && rune < 0x7f && !isTSpecial(rune)\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
JournalRemoteCmdPath searches for the systemdjournalremote command in wellknown paths and the directories named in the $PATH environment variable.
|
func JournalRemoteCmdPath() (string, error) {
for _, p := range cmdPaths {
if path, err := exec.LookPath(p); err == nil {
return path, nil
}
}
return "", ErrCommandNotFound
}
|
[
"func LookPath(cmd string) string {\n\tif runtime.GOOS == \"windows\" {\n\t\tcmd = cmd + \".exe\"\n\t}\n\n\tif path, err := exec.LookPath(cmd); err == nil {\n\t\treturn path\n\t}\n\n\treturn filepath.Join(vmwareDir, cmd) // vmwareDir is OS specific variable.\n}",
"func (ts *testScript) lookPath(command string) (string, error) {\n\tvar strEqual func(string, string) bool\n\tif runtime.GOOS == \"windows\" || runtime.GOOS == \"darwin\" {\n\t\t// Using GOOS as a proxy for case-insensitive file system.\n\t\tstrEqual = strings.EqualFold\n\t} else {\n\t\tstrEqual = func(a, b string) bool { return a == b }\n\t}\n\n\tvar pathExt []string\n\tvar searchExt bool\n\tvar isExecutable func(os.FileInfo) bool\n\tif runtime.GOOS == \"windows\" {\n\t\t// Use the test process's PathExt instead of the script's.\n\t\t// If PathExt is set in the command's environment, cmd.Start fails with\n\t\t// \"parameter is invalid\". Not sure why.\n\t\t// If the command already has an extension in PathExt (like \"cmd.exe\")\n\t\t// don't search for other extensions (not \"cmd.bat.exe\").\n\t\tpathExt = strings.Split(os.Getenv(\"PathExt\"), string(filepath.ListSeparator))\n\t\tsearchExt = true\n\t\tcmdExt := filepath.Ext(command)\n\t\tfor _, ext := range pathExt {\n\t\t\tif strEqual(cmdExt, ext) {\n\t\t\t\tsearchExt = false\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tisExecutable = func(fi os.FileInfo) bool {\n\t\t\treturn fi.Mode().IsRegular()\n\t\t}\n\t} else {\n\t\tisExecutable = func(fi os.FileInfo) bool {\n\t\t\treturn fi.Mode().IsRegular() && fi.Mode().Perm()&0111 != 0\n\t\t}\n\t}\n\n\tpathName := \"PATH\"\n\tif runtime.GOOS == \"plan9\" {\n\t\tpathName = \"path\"\n\t}\n\n\tfor _, dir := range strings.Split(ts.envMap[pathName], string(filepath.ListSeparator)) {\n\t\tif searchExt {\n\t\t\tents, err := os.ReadDir(dir)\n\t\t\tif err != nil {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tfor _, ent := range ents {\n\t\t\t\tfor _, ext := range pathExt {\n\t\t\t\t\tif !ent.IsDir() && strEqual(ent.Name(), command+ext) {\n\t\t\t\t\t\treturn dir + string(filepath.Separator) + ent.Name(), nil\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tpath := dir + string(filepath.Separator) + command\n\t\t\tif fi, err := os.Stat(path); err == nil && isExecutable(fi) {\n\t\t\t\treturn path, nil\n\t\t\t}\n\t\t}\n\t}\n\treturn \"\", &exec.Error{Name: command, Err: exec.ErrNotFound}\n}",
"func runLookupPath(g *generate.Generator, command []string) []string {\n\t// Look for the configured $PATH.\n\tspec := g.Config\n\tenvPath := \"\"\n\tfor i := range spec.Process.Env {\n\t\tif strings.HasPrefix(spec.Process.Env[i], \"PATH=\") {\n\t\t\tenvPath = spec.Process.Env[i]\n\t\t}\n\t}\n\t// If there is no configured $PATH, supply one.\n\tif envPath == \"\" {\n\t\tdefaultPath := \"/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin\"\n\t\tenvPath = \"PATH=\" + defaultPath\n\t\tg.AddProcessEnv(\"PATH\", defaultPath)\n\t}\n\t// No command, nothing to do.\n\tif len(command) == 0 {\n\t\treturn command\n\t}\n\t// Command is already an absolute path, use it as-is.\n\tif filepath.IsAbs(command[0]) {\n\t\treturn command\n\t}\n\t// For each element in the PATH,\n\tfor _, pathEntry := range filepath.SplitList(envPath[5:]) {\n\t\t// if it's the empty string, it's \".\", which is the Cwd,\n\t\tif pathEntry == \"\" {\n\t\t\tpathEntry = spec.Process.Cwd\n\t\t}\n\t\t// build the absolute path which it might be,\n\t\tcandidate := filepath.Join(pathEntry, command[0])\n\t\t// check if it's there,\n\t\tif fi, err := os.Lstat(filepath.Join(spec.Root.Path, candidate)); fi != nil && err == nil {\n\t\t\t// and if it's not a directory, and either a symlink or executable,\n\t\t\tif !fi.IsDir() && ((fi.Mode()&os.ModeSymlink != 0) || (fi.Mode()&0111 != 0)) {\n\t\t\t\t// use that.\n\t\t\t\treturn append([]string{candidate}, command[1:]...)\n\t\t\t}\n\t\t}\n\t}\n\treturn command\n}",
"func LogPath(path ...string) string {\n\tvarDir := os.Getenv(\"LXD_DIR\")\n\tlogDir := \"/var/log/lxd\"\n\tif varDir != \"\" {\n\t\tlogDir = filepath.Join(varDir, \"logs\")\n\t}\n\titems := []string{logDir}\n\titems = append(items, path...)\n\treturn filepath.Join(items...)\n}",
"func LookPath(xBin string) (string, error) {\n\tsuffix := getExeSuffix()\n\tif len(suffix) > 0 && !strings.HasSuffix(xBin, suffix) {\n\t\txBin = xBin + suffix\n\t}\n\n\tbin, err := exec.LookPath(xBin)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\treturn bin, nil\n}",
"func FindBinPath(p *stage1commontypes.Pod, ra *schema.RuntimeApp) (string, error) {\n\tif len(ra.App.Exec) == 0 {\n\t\treturn \"\", errors.New(\"app has no executable\")\n\t}\n\n\tbin := ra.App.Exec[0]\n\n\tvar binPath string\n\tswitch {\n\t// absolute path, just use it\n\tcase filepath.IsAbs(bin):\n\t\tbinPath = bin\n\t// non-absolute path containing a slash, look in the working dir\n\tcase strings.Contains(bin, \"/\"):\n\t\tbinPath = filepath.Join(ra.App.WorkingDirectory, bin)\n\t// filename, search in the app's $PATH\n\tdefault:\n\t\tabsRoot, err := filepath.Abs(p.Root)\n\t\tif err != nil {\n\t\t\treturn \"\", errwrap.Wrap(errors.New(\"could not get pod's root absolute path\"), err)\n\t\t}\n\t\tappRootfs := common.AppRootfsPath(absRoot, ra.Name)\n\t\tappPathDirs := appSearchPaths(p, ra.App.WorkingDirectory, *ra.App)\n\t\tappPath := strings.Join(appPathDirs, \":\")\n\n\t\tbinPath, err = lookupPathInsideApp(bin, appPath, appRootfs, ra.App.WorkingDirectory)\n\t\tif err != nil {\n\t\t\treturn \"\", errwrap.Wrap(fmt.Errorf(\"error looking up %q\", bin), err)\n\t\t}\n\t}\n\n\treturn binPath, nil\n}",
"func LookPath(binaryName string) string {\n\tif strings.Contains(binaryName, \"/\") {\n\t\tpanic(\"binary name should not contain any slash\")\n\t}\n\ts, err := safeexec.LookPath(binaryName)\n\tif err != nil {\n\t\treturn \"\"\n\t}\n\treturn s\n}",
"func hshappendPath(L *lua.LState) int {\n\tdir := L.CheckString(1)\n\tdir = strings.Replace(dir, \"~\", curuser.HomeDir, 1)\n\tpathenv := os.Getenv(\"PATH\")\n\n\t// if dir isnt already in $PATH, add it\n\tif !strings.Contains(pathenv, dir) {\n\t\tos.Setenv(\"PATH\", pathenv + \":\" + dir)\n\t}\n\n\treturn 0\n}",
"func VarPath(path ...string) string {\n\tvarDir := os.Getenv(\"LXD_DIR\")\n\tif varDir == \"\" {\n\t\tvarDir = \"/var/lib/lxd\"\n\t}\n\n\titems := []string{varDir}\n\titems = append(items, path...)\n\treturn filepath.Join(items...)\n}",
"func (ms *Mounts) RemotePath(path string) (ids mount.IDSlice, err error) {\n\tms.mu.RLock()\n\tdefer ms.mu.RUnlock()\n\n\tfor _, mb := range ms.m {\n\t\tif mids, err := mb.RemotePath(path); err == nil {\n\t\t\tids = append(ids, mids...)\n\t\t}\n\t}\n\n\tif len(ids) == 0 {\n\t\treturn nil, mount.ErrMountNotFound\n\t}\n\n\treturn ids, nil\n}",
"func LookPath(fs afero.Fs, file string) (string, error) {\n\t// NOTE(rsc): I wish we could use the Plan 9 behavior here\n\t// (only bypass the path if file begins with / or ./ or ../)\n\t// but that would not match all the Unix shells.\n\n\tif strings.Contains(file, \"/\") {\n\t\tif err := findExecutable(fs, file); err != nil {\n\t\t\treturn \"\", err\n\t\t}\n\t\treturn file, nil\n\t}\n\tpath := os.Getenv(\"PATH\")\n\tfor _, dir := range filepath.SplitList(path) {\n\t\tif dir == \"\" {\n\t\t\t// Unix shell semantics: path element \"\" means \".\"\n\t\t\tdir = \".\"\n\t\t}\n\t\tpath := filepath.Join(dir, file)\n\t\tif err := findExecutable(fs, path); err == nil {\n\t\t\treturn path, nil\n\t\t}\n\t}\n\treturn \"\", ErrExecutableNotFound\n}",
"func (c Linux) ServiceScriptPath(h Host, s string) (string, error) {\n\tis, err := c.is(h)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\treturn is.ServiceScriptPath(h, s)\n}",
"func (c *Config) SetCommandPath(env string) error {\n\tenv = c.envPrefix + env\n\n\tval, _, err := shared.LookupEnvValue(env)\n\tif err != nil {\n\t\treturn err //nolint: wrapcheck // error string formed in external package is styled correctly\n\t}\n\n\tif err := validate.Executable(val); err != nil {\n\t\treturn fmt.Errorf(\"%s: %w\", env, err)\n\t}\n\n\tc.commandPath = val\n\n\treturn nil\n}",
"func lookupTaskBin(command *ExecCommand) (string, string, error) {\n\ttaskDir := command.TaskDir\n\tbin := command.Cmd\n\n\t// Check in the local directory\n\tlocalDir := filepath.Join(taskDir, allocdir.TaskLocal)\n\ttaskPath, hostPath, err := getPathInTaskDir(command.TaskDir, localDir, bin)\n\tif err == nil {\n\t\treturn taskPath, hostPath, nil\n\t}\n\n\t// Check at the root of the task's directory\n\ttaskPath, hostPath, err = getPathInTaskDir(command.TaskDir, command.TaskDir, bin)\n\tif err == nil {\n\t\treturn taskPath, hostPath, nil\n\t}\n\n\t// Check in our mounts\n\tfor _, mount := range command.Mounts {\n\t\ttaskPath, hostPath, err = getPathInMount(mount.HostPath, mount.TaskPath, bin)\n\t\tif err == nil {\n\t\t\treturn taskPath, hostPath, nil\n\t\t}\n\t}\n\n\t// If there's a / in the binary's path, we can't fallback to a PATH search\n\tif strings.Contains(bin, \"/\") {\n\t\treturn \"\", \"\", fmt.Errorf(\"file %s not found under path %s\", bin, taskDir)\n\t}\n\n\t// look for a file using a PATH-style lookup inside the directory\n\t// root. Similar to the stdlib's exec.LookPath except:\n\t// - uses a restricted lookup PATH rather than the agent process's PATH env var.\n\t// - does not require that the file is already executable (this will be ensured\n\t// by the caller)\n\t// - does not prevent using relative path as added to exec.LookPath in go1.19\n\t// (this gets fixed-up in the caller)\n\n\t// This is a fake PATH so that we're not using the agent's PATH\n\trestrictedPaths := []string{\"/usr/local/bin\", \"/usr/bin\", \"/bin\"}\n\n\tfor _, dir := range restrictedPaths {\n\t\tpathDir := filepath.Join(command.TaskDir, dir)\n\t\ttaskPath, hostPath, err = getPathInTaskDir(command.TaskDir, pathDir, bin)\n\t\tif err == nil {\n\t\t\treturn taskPath, hostPath, nil\n\t\t}\n\t}\n\n\treturn \"\", \"\", fmt.Errorf(\"file %s not found under path\", bin)\n}",
"func FindPath(pid int32) (string, error) {\n\tnps, err := process.NewProcess(pid)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tf, err := nps.Exe()\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\treturn f, err\n}",
"func (d *DockerCLIDriver) Path() string {\n\treturn d.dockerBinary\n}",
"func Path(command *kingpin.CmdClause, c *cmd.OptionalString) {\n\tcommand.Flag(\"path\", \"The path to upload logs to\").Action(c.Set).StringVar(&c.Value)\n}",
"func (c *Client) ReadRemotePath(path string) ([]byte, error) {\n\tvar stdout bytes.Buffer\n\tvar stderr bytes.Buffer\n\terr := c.Run(fmt.Sprintf(\n\t\t`(\n\t\ttest -e \"%s\" &&\n\t\twhile IFS='' read f; do\n\t\t\techo \"$f\";\n\t\tdone < \"%s\" &&\n\t\tif [ ! -z \"$f\" ];\n\t\t\tthen echo \"$f\";\n\t\tfi\n\t\t)`, path, path), &stdout, &stderr)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to read %q: %s: %s\", path, err, string(stderr.Bytes()))\n\t}\n\n\treturn stdout.Bytes(), nil\n}",
"func (g *GpgCLI) Path(mctx MetaContext) string {\n\tcanExec, err := g.CanExec(mctx)\n\tif err == nil && canExec {\n\t\treturn g.path\n\t}\n\treturn \"\"\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
New constructs a new Sender which will write journal entries to outpath. The file name must end in '.journal' and the directory must already exist. The journal file will be created if it does not exist. An existing journal file will be appended to.
|
func New(outpath string) (*Sender, error) {
p, err := JournalRemoteCmdPath()
if err != nil {
return nil, err
}
sender := &Sender{
CmdName: p,
OutputPath: outpath,
Clock: clock.NewClock(),
}
return sender, nil
}
|
[
"func newJournal() *journal {\n\treturn &journal{\n\t\ttails: make(map[DN]*entry),\n\t\theads: make(map[DN]*entry),\n\n\t\tquota: make(map[DN]*quota),\n\t}\n}",
"func newFileAppender(path string) (*fileAppender, error) {\n\tf, err := os.OpenFile(path, os.O_CREATE|os.O_RDWR, 0600)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t_, err = f.Write([]byte(\"X\"))\n\n\treturn &fileAppender{\n\t\tfile: f,\n\t}, err\n}",
"func New(conf Config) (*Journal, error) {\n\tif err := conf.load(); err != nil {\n\t\treturn nil, err\n\t}\n\tdb, err := sql.New(conf.Database)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tcomma := conf.Comma\n\tif comma == \"\" {\n\t\tcomma = \".\"\n\t}\n\tdefaultGroup := conf.DefaultGroup\n\tif defaultGroup == \"\" {\n\t\tdefaultGroup = \"* ungrouped *\"\n\t}\n\treturn &Journal{\n\t\tdb: db,\n\t\taccounts: conf.Accounts,\n\t\tgroups: conf.Groups,\n\t\tComma: comma,\n\t\tDefaultGroup: defaultGroup,\n\t\tDiscarding: true,\n\t}, nil\n}",
"func New(out io.Writer, prefix string, flag int) *Logger {\n\treturn &Logger{out: out, prefix: prefix, Level: 1, flag: flag}\n}",
"func (app *App) makeJournal(level logrus.Level) *logrus.Logger {\n const m = \"begin writing application journal\"\n var journal *logrus.Logger = &logrus.Logger {}\n formatter := new(logrus.TextFormatter) // std\n journal.Level = level // use requested level\n journal.Out = os.Stdout // all goes to stdout\n journal.Hooks = make(logrus.LevelHooks) // empty\n journal.Formatter = formatter // set formatter\n formatter.ForceColors = false // act smart\n formatter.DisableColors = false // make pretty\n formatter.DisableTimestamp = false // is useful\n formatter.FullTimestamp = false // numbers\n formatter.TimestampFormat = time.StampMilli\n formatter.DisableSorting = false // order!\n moment := time.Now().Format(app.TimeLayout)\n journal.WithField(\"time\", moment).Info(m)\n return journal // is ready to use\n}",
"func NewAppender(filename string, truncate bool) (*Appender, error) {\n\tflags := os.O_RDWR | os.O_CREATE\n\tif truncate {\n\t\tflags = flags | os.O_TRUNC\n\t}\n\t_ = os.MkdirAll(filepath.Dir(filename), 0777)\n\tf, err := os.OpenFile(filename, flags, 0666)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Read timestamp, if any. Start time is zero if the log file is empty\n\tbuf := make([]byte, 64)\n\tn, err := f.Read(buf)\n\tif n == 0 && err == io.EOF {\n\t\treturn &Appender{f: f}, nil\n\t} else if err != nil {\n\t\treturn nil, err\n\t}\n\tunix := int64(0)\n\tfor i := 0; i < n; i++ {\n\t\tif buf[i] >= '0' && buf[i] <= '9' {\n\t\t\tunix = unix*10 + int64(buf[i]-'0')\n\t\t} else {\n\t\t\tbreak\n\t\t}\n\t}\n\n\t// Jump to the end of the file for appending\n\tif _, err := f.Seek(0, io.SeekEnd); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn &Appender{f: f, start: time.Unix(unix, 0)}, nil\n}",
"func newLogTargetFile(conf *viper.Viper) io.Writer {\n\t// TODO: Log file not created. We need to fix it\n\tlogDir := conf.GetString(\"LOG_DIR\")\n\tif err := os.MkdirAll(logDir, 0744); err != nil {\n\t\tlog.Error().Err(err).Str(\"path\", logDir).Msg(\"can't create log directory\")\n\t\treturn nil\n\t}\n\treturn &lumberjack.Logger{\n\t\tFilename: path.Join(logDir, conf.GetString(\"LOG_FILE\")),\n\t\tMaxBackups: conf.GetInt(\"LOG_MAX_BACKUPS\"),\n\t\tMaxAge: conf.GetInt(\"LOG_MAX_AGE\"),\n\t\tMaxSize: conf.GetInt(\"LOG_MAX_SIZE\"),\n\t\tCompress: conf.GetBool(\"LOG_COMPRESS\"),\n\t}\n}",
"func WriteToFile(filePath string, msg string, verbosity int) {\n\n\tif _, err := os.Stat(filePath); os.IsNotExist(err) {\n\t\t_, err := os.Create(filePath)\n\t\tif err != nil {\n\t\t\tprintMessage(\"Cannot create the lock file! \"+filePath, verbosity, Error)\n\t\t}\n\t}\n\n\tfile, err := os.OpenFile(filePath, os.O_APPEND|os.O_WRONLY, 0600)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tdefer file.Close()\n\n\tif _, err = file.WriteString(msg); err != nil {\n\t\tpanic(err)\n\t}\n\n}",
"func WriteToFile(msg string) (err error) {\n\tif len(LogPath) == 0 {\n\t\treturn errors.New(\"no log path specified\")\n\t}\n\tcurrTime := time.Now()\n\n\tyear := currTime.Format(yearFormat)\n\tmonth := currTime.Format(monthFormat)\n\tday := currTime.Format(dayFormat)\n\n\tlogDirPath := filepath.Join(LogPath, year, month)\n\tcompleteLogPath := filepath.Join(LogPath, year, month, day+\".log\")\n\terr = os.MkdirAll(logDirPath, os.ModePerm)\n\tif err != nil {\n\t\treturn\n\t}\n\tfile, err := os.OpenFile(completeLogPath, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)\n\tif err != nil {\n\t\treturn\n\t}\n\tdefer func() {\n\t\tcloseErr := file.Close()\n\t\tif err == nil {\n\t\t\terr = closeErr\n\t\t}\n\t}()\n\t_, err = file.Write([]byte(msg))\n\treturn\n}",
"func Export(journal string) *Journal {\n\tdir, err := ioutil.TempDir(\"\", \"\")\n\tif err != nil {\n\t\tlogger.Fatalf(\"Could not generate temp directory for exporting: %v\", err)\n\t}\n\n\ttmp, err := ioutil.TempFile(dir, \"\")\n\tif err != nil {\n\t\tlogger.Fatalf(\"Could not generate temp file for exporting: %v\", err)\n\t}\n\n\tlogger.Tracef(\"Created temp file %q for exporting\", tmp.Name())\n\n\tcmd := exec.Command(\"jrnl\", journal, \"--export\", \"json\", \"-o\", tmp.Name())\n\n\tcmd.Stdout = os.Stdout\n\tcmd.Stderr = os.Stderr\n\tcmd.Stdin = os.Stdin\n\n\tfmt.Println(\"\")\n\terr = cmd.Run()\n\tfmt.Println(\"\")\n\n\tif err != nil {\n\t\tlogger.Fatalf(\"Error exporting journal with command %q, error: %v\", cmd.String(), err)\n\t}\n\n\tvar jrnl Journal\n\n\tbytes, _ := ioutil.ReadAll(tmp)\n\terr = json.Unmarshal(bytes, &jrnl)\n\n\tif err != nil {\n\t\tlogger.Fatalf(\"Error parsing exported json: %v\", err)\n\t}\n\n\terr = os.RemoveAll(dir)\n\tif err != nil {\n\t\tlogger.Errorf(\"Error deleting temp directory for exporting (%s): %v\", dir, err)\n\t}\n\n\tjrnl.Title = fmt.Sprintf(\"Journal ('%s')\", journal)\n\tjrnl.Description = fmt.Sprintf(\"Journal web page generated by jbook.\")\n\n\treturn &jrnl\n}",
"func New(outputDir string, conn *net.UDPConn, droppingChance int, senderPort int) *FileReceiver {\n\tif droppingChance < 0 || droppingChance > 100 {\n\t\tlog.Warning.Fatal(\"dropping chance out of range: should be between 0 and 100\")\n\t}\n\tif err := createDir(outputDir); err != nil {\n\t\tlog.Warning.Fatalf(\"cannot create %s: %s\", outputDir, err)\n\t}\n\treturn &FileReceiver{\n\t\tsocket: conn,\n\t\treconstructData: make(chan []byte),\n\t\treconstructDone: make(chan struct{}),\n\t\tsenderPort: senderPort,\n\t\tdroppingChance: droppingChance,\n\t\tout: outputDir,\n\t\tsenderTimeout: protocol.UnresponsiveTimeout,\n\t}\n}",
"func (jd *tierDiskJournal) Open() error {\n\tjd.Lock()\n\tdefer jd.Unlock()\n\tif jd.file != nil { // already open\n\t\treturn nil\n\t}\n\n\tvar err error\n\tjd.file, err = os.OpenFile(jd.JournalPath(), os.O_APPEND|os.O_CREATE|os.O_WRONLY|writeMode, 0666)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// write journal version header if active journal is empty\n\tfi, err := jd.file.Stat()\n\tif err != nil {\n\t\treturn err\n\t}\n\tif fi.Size() == 0 {\n\t\tvar data [tierJournalHdrLen]byte\n\t\tbinary.LittleEndian.PutUint16(data[:], tierJournalVersion)\n\t\t_, err = jd.file.Write(data[:])\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}",
"func NewFile(path string) (*Logger, error) {\n\t// Make path absolute, so Reopen continues to work if the program changes\n\t// its working directory later.\n\tpath, err := filepath.Abs(path)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tf, err := os.OpenFile(path, os.O_CREATE|os.O_APPEND|os.O_WRONLY, 0644)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tl := New(f)\n\tl.fname = path\n\treturn l, nil\n}",
"func CreateLogger (name string, level int) (*log.Logger) {\n cwd,_ := os.Getwd()\n log_path := strings.Join([]string{cwd, \"log\"}, \"/\")\n log_file := strings.Join([]string{log_path, name}, \"/\")\n\n // MkdirAll will not do anything if the directory already exists\n os.MkdirAll(log_path, 0755)\n\n f, _ := os.OpenFile(log_file, os.O_RDWR|os.O_APPEND|os.O_CREATE, 0666)\n return log.New(f, \"\", level)\n}",
"func NewJournaler(name string) Journaler {\n\treturn logging.NewGrip(name)\n}",
"func NewLogFile(path string) (*LogFile, error) {\n\tlfLock.Lock()\n\tdefer lfLock.Unlock()\n\n\tlf := lfm[path]\n\tif lf != nil {\n\t\tlf.link++\n\t\treturn lf, nil\n\t}\n\n\tf, err := os.OpenFile(path, os.O_CREATE|os.O_APPEND|os.O_WRONLY, 0644)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tlf = &LogFile{\n\t\tpath: path,\n\t\tfile: f,\n\t\tlink: 1,\n\t}\n\n\tlfm[path] = lf\n\n\treturn lf, nil\n}",
"func (self *FileOut) openNew() error {\n\terr := os.MkdirAll(self.dir(), 0744)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"can't make directories for new logfile: %s\", err)\n\t}\n\n\tname := self.filename()\n\tif _, e := os.Stat(name); e == nil {\n\t\t// move the existing file\n\t\tvar newname = backupName(name)\n\t\tif err := os.Rename(name, newname); err != nil {\n\t\t\treturn fmt.Errorf(\"can't rename log file: %s\", err)\n\t\t}\n\t}\n\n\t// we use truncate here because this should only get called when we've moved\n\t// the file ourselves. if someone else creates the file in the meantime,\n\t// just wipe out the contents.\n\tmode := os.FileMode(0644)\n\tf, err := os.OpenFile(name, os.O_CREATE|os.O_WRONLY|os.O_TRUNC, mode)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"can't open new logfile: %s\", err)\n\t}\n\n\tself.file = f\n\tself.size = 0\n\treturn nil\n}",
"func New(out io.Writer, prefix string, flag int) Log5Go {\n\tl := Logger(LogAll).ToWriter(out).WithTimeFmt(parseTimeFmt(flag))\n\tif prefix != \"\" {\n\t\tl = l.WithPrefix(prefix)\n\t}\n\tlines := parseLines(flag)\n\tif lines == Lshortfile {\n\t\tl = l.WithLn()\n\t} else if lines == Llongfile {\n\t\tl = l.WithLine()\n\t}\n\n\t// HACKY: need to set flags directly on the underlying struct\n\tlogger, _ := l.(*logger)\n\tlogger.flag = flag\n\n\treturn l\n}",
"func Append(path string, mode os.FileMode, templateString string) (*WriterHandler, error) {\n\tf, err := os.OpenFile(path, os.O_WRONLY|os.O_APPEND|os.O_CREATE, mode)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn New(f, templateString)\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
NewT is like New but will skip the test if the systemdjournalremote command is not available.
|
func NewT(t *testing.T, outpath string) *Sender {
t.Helper()
s, err := New(outpath)
if errors.Is(err, ErrCommandNotFound) {
t.Skip(err)
}
assert.NilError(t, err)
return s
}
|
[
"func testClientCreateWorkflowTemplateVersionNew(t *testing.T) {\n\tc := DefaultTestClient()\n\tclearDatabase(t)\n\n\tnamespace := \"onepanel\"\n\tworkflowTemplate := &WorkflowTemplate{\n\t\tName: \"test\",\n\t\tManifest: defaultWorkflowTemplate,\n\t}\n\n\tc.CreateWorkflowTemplate(namespace, workflowTemplate)\n\t_, err := c.CreateWorkflowTemplateVersion(namespace, workflowTemplate)\n\n\tassert.Nil(t, err)\n}",
"func (t *TgtdTarget) Create() error {\n\tvar stdout, stderr bytes.Buffer\n\n\tcmd := exec.Command(\"/bin/sh\", \"-c\",\n\t\tfmt.Sprintf(\"%s --lld iscsi --op new --mode target --tid %s -T %s \", TgtadmCmd, t.TargetId, t.TargetIQN),\n\t)\n\tcmd.Stdout = &stdout\n\tcmd.Stderr = &stderr\n\tlog.V(3).Info(cmd.String())\n\tif err := cmd.Run(); err != nil {\n\t\treturn errors.New(strings.TrimSpace(fmt.Sprintf(string(stderr.Bytes()))))\n\t}\n\tlog.Info(string(stdout.Bytes()))\n\treturn nil\n}",
"func testClientCreateWorkflowTemplateTimestamp(t *testing.T) {\n\tc := DefaultTestClient()\n\tclearDatabase(t)\n\n\tnamespace := \"onepanel\"\n\n\tworkflowTemplate := &WorkflowTemplate{\n\t\tName: \"test\",\n\t\tManifest: defaultWorkflowTemplate,\n\t}\n\n\t// This method creates a workflow template version underneath\n\twft, err := c.CreateWorkflowTemplate(\"onepanel\", workflowTemplate)\n\tassert.Nil(t, err)\n\tassert.NotNil(t, wft.ArgoWorkflowTemplate)\n\n\t// This method creates a brand new version\n\twft, err = c.CreateWorkflowTemplateVersion(namespace, workflowTemplate)\n\tassert.Nil(t, err)\n\tassert.NotNil(t, wft.ArgoWorkflowTemplate)\n}",
"func NewT(t *testing.T) *T {\n\treturn &T{t: t, verbose: false}\n}",
"func TestNewMissedToken(t *testing.T) {\n\tinfo := logger.Info{\n\t\tConfig: map[string]string{\n\t\t\tsplunkURLKey: \"http://127.0.0.1:8088\",\n\t\t},\n\t}\n\t_, err := New(info)\n\tif err.Error() != \"splunk: splunk-token is expected\" {\n\t\tt.Fatal(\"Logger driver should fail when no required parameters specified\")\n\t}\n}",
"func testClientCreateWorkflowTemplateVersionMarkOldNotLatest(t *testing.T) {\n\tc := DefaultTestClient()\n\tclearDatabase(t)\n\n\tnamespace := \"onepanel\"\n\tname := \"test\"\n\tworkflowTemplate := &WorkflowTemplate{\n\t\tName: name,\n\t\tManifest: defaultWorkflowTemplate,\n\t}\n\n\toriginal, _ := c.CreateWorkflowTemplate(namespace, workflowTemplate)\n\toriginalVersionAsString := fmt.Sprintf(\"%v\", original.Version)\n\tc.CreateWorkflowTemplateVersion(namespace, workflowTemplate)\n\n\tupdated, _ := c.getWorkflowTemplateVersionDB(namespace, name, originalVersionAsString)\n\n\tassert.False(t, updated.IsLatest)\n}",
"func New(outpath string) (*Sender, error) {\n\tp, err := JournalRemoteCmdPath()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tsender := &Sender{\n\t\tCmdName: p,\n\t\tOutputPath: outpath,\n\t\tClock: clock.NewClock(),\n\t}\n\treturn sender, nil\n}",
"func TestNew(t *testing.T) {\n\n\tvar buf bytes.Buffer\n\ttracer := New(&buf)\n\n\tif tracer == nil {\n\t\tt.Error(\"Return from New should not be nil\")\n\t}\n\ttracer.Trace(\"Hello trace package.\")\n\tif buf.String() != \"Hello trace package.\\n\" {\n\t\tt.Errorf(\"Trace should not write '%s'.\", buf.String())\n\t}\n\n}",
"func CreateTestJournal() TaskJournal {\n\tjournal := TaskJournal{\n\t\tTaskList: TaskArray{\n\t\t\tCreateTestTask(1, \"Write documentation for todogo\"),\n\t\t\tCreateTestTask(2, \"Create unit test for todogo\"),\n\t\t\tCreateTestTask(3, \"Add a function to print a tasks journal\"),\n\t\t\tCreateTestTask(4, \"Organize a code review of todogo\"),\n\t\t},\n\t}\n\treturn journal\n}",
"func newLocalNode(node string, rpcPort int, members []serf.Member,\n\tcheckers []health.Checker, clock clockwork.Clock, c *C) *agent {\n\tagent := newAgent(node, rpcPort, members, checkers, clock, nil, c)\n\tagent.rpc = &testServer{&server{agent: agent}}\n\terr := agent.Start()\n\tc.Assert(err, IsNil)\n\treturn agent\n}",
"func TestReadNewLogs(t *testing.T) {\n\tt.Parallel()\n\toperator, logReceived, tempDir := newTestFileOperator(t, nil, nil)\n\n\trequire.NoError(t, operator.Start(testutil.NewMockPersister(\"test\")))\n\tdefer func() {\n\t\trequire.NoError(t, operator.Stop())\n\t}()\n\n\t// Create a new file\n\ttemp := openTemp(t, tempDir)\n\twriteString(t, temp, \"testlog\\n\")\n\n\t// Expect the message to come through\n\twaitForMessage(t, logReceived, \"testlog\")\n}",
"func TestNewMissedUrl(t *testing.T) {\n\tinfo := logger.Info{\n\t\tConfig: map[string]string{\n\t\t\tsplunkTokenKey: \"4642492F-D8BD-47F1-A005-0C08AE4657DF\",\n\t\t},\n\t}\n\t_, err := New(info)\n\tif err.Error() != \"splunk: splunk-url is expected\" {\n\t\tt.Fatal(\"Logger driver should fail when no required parameters specified\")\n\t}\n}",
"func newNopSystemInfo() *nopSystemInfo {\n\treturn &nopSystemInfo{}\n}",
"func TestTelemeterRemoteWrite(t *testing.T) {\n\tcm := f.BuildCMOConfigMap(t, \"{}\")\n\tf.MustCreateOrUpdateConfigMap(t, cm)\n\n\tt.Cleanup(func() {\n\t\tf.MustDeleteConfigMap(t, cm)\n\t})\n\n\t// Put CMO deployment into unmanaged state and enable telemetry via remote-write manually.\n\tctx := context.Background()\n\tpatch := []byte(`{\n\t\"spec\": {\n\t\t\"overrides\": [{\n\t\t\t\"group\": \"apps\",\n\t\t\t\"kind\": \"Deployment\",\n\t\t\t\"name\": \"cluster-monitoring-operator\",\n\t\t\t\"namespace\": \"openshift-monitoring\",\n\t\t\t\"unmanaged\": true\n\t\t}]\n\t}\n}`)\n\t_, err := f.OpenShiftConfigClient.ConfigV1().ClusterVersions().Patch(ctx, \"version\", types.MergePatchType, patch, metav1.PatchOptions{})\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tt.Cleanup(func() {\n\t\tpatch := []byte(`{\"spec\": {\"overrides\": []}}`)\n\t\t_, _ = f.OpenShiftConfigClient.ConfigV1().ClusterVersions().Patch(ctx, \"version\", types.MergePatchType, patch, metav1.PatchOptions{})\n\t})\n\n\tdep, err := f.KubeClient.AppsV1().Deployments(f.Ns).Get(ctx, \"cluster-monitoring-operator\", metav1.GetOptions{})\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tfor i, c := range dep.Spec.Template.Spec.Containers {\n\t\tif c.Name != \"cluster-monitoring-operator\" {\n\t\t\tcontinue\n\t\t}\n\t\tdep.Spec.Template.Spec.Containers[i].Args = append(dep.Spec.Template.Spec.Containers[i].Args, \"-enabled-remote-write=true\")\n\t}\n\tdep, err = f.KubeClient.AppsV1().Deployments(f.Ns).Update(ctx, dep, metav1.UpdateOptions{})\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\t// Check that Prometheus sends samples to Telemeter.\n\tf.PrometheusK8sClient.WaitForQueryReturn(\n\t\tt,\n\t\t5*time.Minute,\n\t\t`min without(pod,instance) (rate(prometheus_remote_storage_samples_total{job=\"prometheus-k8s\",url=~\"https://infogw.api.openshift.com.+\"}[5m]))`,\n\t\tfunc(v float64) error {\n\t\t\tif v == 0 {\n\t\t\t\treturn errors.New(\"expecting samples to be sent via Prometheus remote write but got none\")\n\t\t\t}\n\t\t\treturn nil\n\t\t},\n\t)\n}",
"func createNewCluster() error {\n\n\tfmt.Println(\"☸ Creating Minikube cluster...\")\n\tfmt.Println(\"\\nBy default, using the standard minikube driver for your system\")\n\tfmt.Println(\"If you wish to use a different driver, please configure minikube using\")\n\tfmt.Print(\" minikube config set driver <your-driver>\\n\\n\")\n\n\t// create cluster and wait until ready\n\tcreateCluster := exec.Command(\"minikube\", \"start\", \"--kubernetes-version\", kubernetesVersion, \"--cpus\", \"3\", \"--profile\", clusterName, \"--wait\", \"all\")\n\tif err := runCommandWithOutput(createCluster); err != nil {\n\t\treturn fmt.Errorf(\"minikube create: %w\", err)\n\t}\n\n\treturn nil\n}",
"func newNoOpNode(et *ExecutingTask, n *pipeline.NoOpNode, l *log.Logger) (*NoOpNode, error) {\n\tnn := &NoOpNode{\n\t\tnode: node{Node: n, et: et, logger: l},\n\t}\n\tnn.node.runF = nn.runNoOp\n\treturn nn, nil\n}",
"func newTestVTY() (*VTY, *fakeVTYServer, error) {\n\tvs, err := newFakeVTYServer()\n\tif err != nil {\n\t\treturn nil, nil, fmt.Errorf(\"Failed to get VTY server: %v\", err)\n\t}\n\tvty := NewVTY(\"\")\n\tvty.conn = vs.clientConn\n\treturn vty, vs, nil\n}",
"func newTestNode(lg *LicenseGraph, targetName string) *TargetNode {\n\tif tn, alreadyExists := lg.targets[targetName]; alreadyExists {\n\t\treturn tn\n\t}\n\ttn := &TargetNode{name: targetName}\n\tlg.targets[targetName] = tn\n\treturn tn\n}",
"func TestV3GetNonExistLease(t *testing.T) {\n\tintegration.BeforeTest(t)\n\tclus := integration.NewCluster(t, &integration.ClusterConfig{Size: 3})\n\tdefer clus.Terminate(t)\n\n\tctx, cancel := context.WithCancel(context.Background())\n\tdefer cancel()\n\tlc := integration.ToGRPC(clus.RandClient()).Lease\n\tlresp, err := lc.LeaseGrant(ctx, &pb.LeaseGrantRequest{TTL: 10})\n\tif err != nil {\n\t\tt.Errorf(\"failed to create lease %v\", err)\n\t}\n\t_, err = lc.LeaseRevoke(context.TODO(), &pb.LeaseRevokeRequest{ID: lresp.ID})\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tleaseTTLr := &pb.LeaseTimeToLiveRequest{\n\t\tID: lresp.ID,\n\t\tKeys: true,\n\t}\n\n\tfor _, m := range clus.Members {\n\t\t// quorum-read to ensure revoke completes before TimeToLive\n\t\tif _, err := integration.ToGRPC(m.Client).KV.Range(ctx, &pb.RangeRequest{Key: []byte(\"_\")}); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tresp, err := integration.ToGRPC(m.Client).Lease.LeaseTimeToLive(ctx, leaseTTLr)\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"expected non nil error, but go %v\", err)\n\t\t}\n\t\tif resp.TTL != -1 {\n\t\t\tt.Fatalf(\"expected TTL to be -1, but got %v\", resp.TTL)\n\t\t}\n\t}\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
resourceVolterraFastAclRule is implementation of Volterra's FastAclRule resources
|
func resourceVolterraFastAclRule() *schema.Resource {
return &schema.Resource{
Create: resourceVolterraFastAclRuleCreate,
Read: resourceVolterraFastAclRuleRead,
Update: resourceVolterraFastAclRuleUpdate,
Delete: resourceVolterraFastAclRuleDelete,
Schema: map[string]*schema.Schema{
"annotations": {
Type: schema.TypeMap,
Optional: true,
},
"description": {
Type: schema.TypeString,
Optional: true,
},
"disable": {
Type: schema.TypeBool,
Optional: true,
},
"labels": {
Type: schema.TypeMap,
Optional: true,
},
"name": {
Type: schema.TypeString,
Required: true,
ForceNew: true,
},
"namespace": {
Type: schema.TypeString,
Required: true,
ForceNew: true,
},
"action": {
Type: schema.TypeSet,
Optional: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"policer_action": {
Type: schema.TypeSet,
Optional: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"ref": {
Type: schema.TypeList,
Optional: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"kind": {
Type: schema.TypeString,
Computed: true,
},
"name": {
Type: schema.TypeString,
Optional: true,
},
"namespace": {
Type: schema.TypeString,
Optional: true,
},
"tenant": {
Type: schema.TypeString,
Optional: true,
},
},
},
},
},
},
},
"protocol_policer_action": {
Type: schema.TypeSet,
Optional: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"ref": {
Type: schema.TypeList,
Optional: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"kind": {
Type: schema.TypeString,
Computed: true,
},
"name": {
Type: schema.TypeString,
Optional: true,
},
"namespace": {
Type: schema.TypeString,
Optional: true,
},
"tenant": {
Type: schema.TypeString,
Optional: true,
},
},
},
},
},
},
},
"simple_action": {
Type: schema.TypeString,
Optional: true,
},
},
},
},
"port": {
Type: schema.TypeList,
Optional: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"all": {
Type: schema.TypeBool,
Optional: true,
},
"dns": {
Type: schema.TypeBool,
Optional: true,
},
"user_defined": {
Type: schema.TypeInt,
Optional: true,
},
},
},
},
"ip_prefix_set": {
Type: schema.TypeSet,
Optional: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"ref": {
Type: schema.TypeList,
Optional: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"kind": {
Type: schema.TypeString,
Computed: true,
},
"name": {
Type: schema.TypeString,
Optional: true,
},
"namespace": {
Type: schema.TypeString,
Optional: true,
},
"tenant": {
Type: schema.TypeString,
Optional: true,
},
},
},
},
},
},
},
"prefix": {
Type: schema.TypeSet,
Optional: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"ipv6_prefix": {
Type: schema.TypeList,
Optional: true,
Elem: &schema.Schema{
Type: schema.TypeString,
},
},
"prefix": {
Type: schema.TypeList,
Optional: true,
Elem: &schema.Schema{
Type: schema.TypeString,
},
},
},
},
},
},
}
}
|
[
"func resourceVolterraFastAclRuleCreate(d *schema.ResourceData, meta interface{}) error {\n\tclient := meta.(*APIClient)\n\n\tcreateMeta := &ves_io_schema.ObjectCreateMetaType{}\n\tcreateSpec := &ves_io_schema_fast_acl_rule.CreateSpecType{}\n\tcreateReq := &ves_io_schema_fast_acl_rule.CreateRequest{\n\t\tMetadata: createMeta,\n\t\tSpec: createSpec,\n\t}\n\n\tif v, ok := d.GetOk(\"annotations\"); ok && !isIntfNil(v) {\n\n\t\tms := map[string]string{}\n\n\t\tfor k, v := range v.(map[string]interface{}) {\n\t\t\tval := v.(string)\n\t\t\tms[k] = val\n\t\t}\n\t\tcreateMeta.Annotations = ms\n\t}\n\n\tif v, ok := d.GetOk(\"description\"); ok && !isIntfNil(v) {\n\t\tcreateMeta.Description =\n\t\t\tv.(string)\n\t}\n\n\tif v, ok := d.GetOk(\"disable\"); ok && !isIntfNil(v) {\n\t\tcreateMeta.Disable =\n\t\t\tv.(bool)\n\t}\n\n\tif v, ok := d.GetOk(\"labels\"); ok && !isIntfNil(v) {\n\n\t\tms := map[string]string{}\n\n\t\tfor k, v := range v.(map[string]interface{}) {\n\t\t\tval := v.(string)\n\t\t\tms[k] = val\n\t\t}\n\t\tcreateMeta.Labels = ms\n\t}\n\n\tif v, ok := d.GetOk(\"name\"); ok && !isIntfNil(v) {\n\t\tcreateMeta.Name =\n\t\t\tv.(string)\n\t}\n\n\tif v, ok := d.GetOk(\"namespace\"); ok && !isIntfNil(v) {\n\t\tcreateMeta.Namespace =\n\t\t\tv.(string)\n\t}\n\n\t//action\n\tif v, ok := d.GetOk(\"action\"); ok && !isIntfNil(v) {\n\n\t\tsl := v.(*schema.Set).List()\n\t\taction := &ves_io_schema_fast_acl_rule.FastAclRuleAction{}\n\t\tcreateSpec.Action = action\n\t\tfor _, set := range sl {\n\t\t\tactionMapStrToI := set.(map[string]interface{})\n\n\t\t\tactionTypeFound := false\n\n\t\t\tif v, ok := actionMapStrToI[\"policer_action\"]; ok && !isIntfNil(v) && !actionTypeFound {\n\n\t\t\t\tactionTypeFound = true\n\t\t\t\tactionInt := &ves_io_schema_fast_acl_rule.FastAclRuleAction_PolicerAction{}\n\t\t\t\tactionInt.PolicerAction = &ves_io_schema.PolicerRefType{}\n\t\t\t\taction.Action = actionInt\n\n\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\tfor _, set := range sl {\n\t\t\t\t\tcs := set.(map[string]interface{})\n\n\t\t\t\t\tif v, ok := cs[\"ref\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\tsl := v.([]interface{})\n\t\t\t\t\t\trefInt := make([]*ves_io_schema.ObjectRefType, len(sl))\n\t\t\t\t\t\tactionInt.PolicerAction.Ref = refInt\n\t\t\t\t\t\tfor i, ps := range sl {\n\n\t\t\t\t\t\t\trMapToStrVal := ps.(map[string]interface{})\n\t\t\t\t\t\t\trefInt[i] = &ves_io_schema.ObjectRefType{}\n\n\t\t\t\t\t\t\trefInt[i].Kind = \"policer\"\n\n\t\t\t\t\t\t\tif v, ok := rMapToStrVal[\"name\"]; ok && !isIntfNil(v) {\n\t\t\t\t\t\t\t\trefInt[i].Name = v.(string)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif v, ok := rMapToStrVal[\"namespace\"]; ok && !isIntfNil(v) {\n\t\t\t\t\t\t\t\trefInt[i].Namespace = v.(string)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif v, ok := rMapToStrVal[\"tenant\"]; ok && !isIntfNil(v) {\n\t\t\t\t\t\t\t\trefInt[i].Tenant = v.(string)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif v, ok := rMapToStrVal[\"uid\"]; ok && !isIntfNil(v) {\n\t\t\t\t\t\t\t\trefInt[i].Uid = v.(string)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif v, ok := actionMapStrToI[\"protocol_policer_action\"]; ok && !isIntfNil(v) && !actionTypeFound {\n\n\t\t\t\tactionTypeFound = true\n\t\t\t\tactionInt := &ves_io_schema_fast_acl_rule.FastAclRuleAction_ProtocolPolicerAction{}\n\t\t\t\tactionInt.ProtocolPolicerAction = &ves_io_schema.ProtocolPolicerRefType{}\n\t\t\t\taction.Action = actionInt\n\n\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\tfor _, set := range sl {\n\t\t\t\t\tcs := set.(map[string]interface{})\n\n\t\t\t\t\tif v, ok := cs[\"ref\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\tsl := v.([]interface{})\n\t\t\t\t\t\trefInt := make([]*ves_io_schema.ObjectRefType, len(sl))\n\t\t\t\t\t\tactionInt.ProtocolPolicerAction.Ref = refInt\n\t\t\t\t\t\tfor i, ps := range sl {\n\n\t\t\t\t\t\t\trMapToStrVal := ps.(map[string]interface{})\n\t\t\t\t\t\t\trefInt[i] = &ves_io_schema.ObjectRefType{}\n\n\t\t\t\t\t\t\trefInt[i].Kind = \"protocol_policer\"\n\n\t\t\t\t\t\t\tif v, ok := rMapToStrVal[\"name\"]; ok && !isIntfNil(v) {\n\t\t\t\t\t\t\t\trefInt[i].Name = v.(string)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif v, ok := rMapToStrVal[\"namespace\"]; ok && !isIntfNil(v) {\n\t\t\t\t\t\t\t\trefInt[i].Namespace = v.(string)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif v, ok := rMapToStrVal[\"tenant\"]; ok && !isIntfNil(v) {\n\t\t\t\t\t\t\t\trefInt[i].Tenant = v.(string)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif v, ok := rMapToStrVal[\"uid\"]; ok && !isIntfNil(v) {\n\t\t\t\t\t\t\t\trefInt[i].Uid = v.(string)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif v, ok := actionMapStrToI[\"simple_action\"]; ok && !isIntfNil(v) && !actionTypeFound {\n\n\t\t\t\tactionTypeFound = true\n\t\t\t\tactionInt := &ves_io_schema_fast_acl_rule.FastAclRuleAction_SimpleAction{}\n\n\t\t\t\taction.Action = actionInt\n\n\t\t\t\tactionInt.SimpleAction = ves_io_schema_fast_acl_rule.FastAclRuleSimpleAction(ves_io_schema_fast_acl_rule.FastAclRuleSimpleAction_value[v.(string)])\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\t//port\n\tif v, ok := d.GetOk(\"port\"); ok && !isIntfNil(v) {\n\n\t\tsl := v.([]interface{})\n\t\tport := make([]*ves_io_schema.PortValueType, len(sl))\n\t\tcreateSpec.Port = port\n\t\tfor i, set := range sl {\n\t\t\tport[i] = &ves_io_schema.PortValueType{}\n\t\t\tportMapStrToI := set.(map[string]interface{})\n\n\t\t\tportValueTypeChoiceTypeFound := false\n\n\t\t\tif v, ok := portMapStrToI[\"all\"]; ok && !isIntfNil(v) && !portValueTypeChoiceTypeFound {\n\n\t\t\t\tportValueTypeChoiceTypeFound = true\n\n\t\t\t\tif v.(bool) {\n\t\t\t\t\tportValueTypeChoiceInt := &ves_io_schema.PortValueType_All{}\n\t\t\t\t\tportValueTypeChoiceInt.All = &ves_io_schema.Empty{}\n\t\t\t\t\tport[i].PortValueTypeChoice = portValueTypeChoiceInt\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif v, ok := portMapStrToI[\"dns\"]; ok && !isIntfNil(v) && !portValueTypeChoiceTypeFound {\n\n\t\t\t\tportValueTypeChoiceTypeFound = true\n\n\t\t\t\tif v.(bool) {\n\t\t\t\t\tportValueTypeChoiceInt := &ves_io_schema.PortValueType_Dns{}\n\t\t\t\t\tportValueTypeChoiceInt.Dns = &ves_io_schema.Empty{}\n\t\t\t\t\tport[i].PortValueTypeChoice = portValueTypeChoiceInt\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif v, ok := portMapStrToI[\"user_defined\"]; ok && !isIntfNil(v) && !portValueTypeChoiceTypeFound {\n\n\t\t\t\tportValueTypeChoiceTypeFound = true\n\t\t\t\tportValueTypeChoiceInt := &ves_io_schema.PortValueType_UserDefined{}\n\n\t\t\t\tport[i].PortValueTypeChoice = portValueTypeChoiceInt\n\n\t\t\t\tportValueTypeChoiceInt.UserDefined = uint32(v.(int))\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\t//source\n\n\tsourceTypeFound := false\n\n\tif v, ok := d.GetOk(\"ip_prefix_set\"); ok && !sourceTypeFound {\n\n\t\tsourceTypeFound = true\n\t\tsourceInt := &ves_io_schema_fast_acl_rule.CreateSpecType_IpPrefixSet{}\n\t\tsourceInt.IpPrefixSet = &ves_io_schema.IpPrefixSetRefType{}\n\t\tcreateSpec.Source = sourceInt\n\n\t\tsl := v.(*schema.Set).List()\n\t\tfor _, set := range sl {\n\t\t\tcs := set.(map[string]interface{})\n\n\t\t\tif v, ok := cs[\"ref\"]; ok && !isIntfNil(v) {\n\n\t\t\t\tsl := v.([]interface{})\n\t\t\t\trefInt := make([]*ves_io_schema.ObjectRefType, len(sl))\n\t\t\t\tsourceInt.IpPrefixSet.Ref = refInt\n\t\t\t\tfor i, ps := range sl {\n\n\t\t\t\t\trMapToStrVal := ps.(map[string]interface{})\n\t\t\t\t\trefInt[i] = &ves_io_schema.ObjectRefType{}\n\n\t\t\t\t\trefInt[i].Kind = \"ip_prefix_set\"\n\n\t\t\t\t\tif v, ok := rMapToStrVal[\"name\"]; ok && !isIntfNil(v) {\n\t\t\t\t\t\trefInt[i].Name = v.(string)\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := rMapToStrVal[\"namespace\"]; ok && !isIntfNil(v) {\n\t\t\t\t\t\trefInt[i].Namespace = v.(string)\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := rMapToStrVal[\"tenant\"]; ok && !isIntfNil(v) {\n\t\t\t\t\t\trefInt[i].Tenant = v.(string)\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := rMapToStrVal[\"uid\"]; ok && !isIntfNil(v) {\n\t\t\t\t\t\trefInt[i].Uid = v.(string)\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tif v, ok := d.GetOk(\"prefix\"); ok && !sourceTypeFound {\n\n\t\tsourceTypeFound = true\n\t\tsourceInt := &ves_io_schema_fast_acl_rule.CreateSpecType_Prefix{}\n\t\tsourceInt.Prefix = &ves_io_schema.PrefixListType{}\n\t\tcreateSpec.Source = sourceInt\n\n\t\tsl := v.(*schema.Set).List()\n\t\tfor _, set := range sl {\n\t\t\tcs := set.(map[string]interface{})\n\n\t\t\tif v, ok := cs[\"ipv6_prefix\"]; ok && !isIntfNil(v) {\n\n\t\t\t\tls := make([]string, len(v.([]interface{})))\n\t\t\t\tfor i, v := range v.([]interface{}) {\n\t\t\t\t\tls[i] = v.(string)\n\t\t\t\t}\n\t\t\t\tsourceInt.Prefix.Ipv6Prefix = ls\n\n\t\t\t}\n\n\t\t\tif v, ok := cs[\"prefix\"]; ok && !isIntfNil(v) {\n\n\t\t\t\tls := make([]string, len(v.([]interface{})))\n\t\t\t\tfor i, v := range v.([]interface{}) {\n\t\t\t\t\tls[i] = v.(string)\n\t\t\t\t}\n\t\t\t\tsourceInt.Prefix.Prefix = ls\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tlog.Printf(\"[DEBUG] Creating Volterra FastAclRule object with struct: %+v\", createReq)\n\n\tcreateFastAclRuleResp, err := client.CreateObject(context.Background(), ves_io_schema_fast_acl_rule.ObjectType, createReq)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error creating FastAclRule: %s\", err)\n\t}\n\td.SetId(createFastAclRuleResp.GetObjSystemMetadata().GetUid())\n\n\treturn resourceVolterraFastAclRuleRead(d, meta)\n}",
"func resourceVolterraFastAclRuleUpdate(d *schema.ResourceData, meta interface{}) error {\n\tclient := meta.(*APIClient)\n\n\tupdateMeta := &ves_io_schema.ObjectReplaceMetaType{}\n\tupdateSpec := &ves_io_schema_fast_acl_rule.ReplaceSpecType{}\n\tupdateReq := &ves_io_schema_fast_acl_rule.ReplaceRequest{\n\t\tMetadata: updateMeta,\n\t\tSpec: updateSpec,\n\t}\n\tif v, ok := d.GetOk(\"annotations\"); ok && !isIntfNil(v) {\n\n\t\tms := map[string]string{}\n\n\t\tfor k, v := range v.(map[string]interface{}) {\n\t\t\tval := v.(string)\n\t\t\tms[k] = val\n\t\t}\n\t\tupdateMeta.Annotations = ms\n\t}\n\n\tif v, ok := d.GetOk(\"description\"); ok && !isIntfNil(v) {\n\t\tupdateMeta.Description =\n\t\t\tv.(string)\n\t}\n\n\tif v, ok := d.GetOk(\"disable\"); ok && !isIntfNil(v) {\n\t\tupdateMeta.Disable =\n\t\t\tv.(bool)\n\t}\n\n\tif v, ok := d.GetOk(\"labels\"); ok && !isIntfNil(v) {\n\n\t\tms := map[string]string{}\n\n\t\tfor k, v := range v.(map[string]interface{}) {\n\t\t\tval := v.(string)\n\t\t\tms[k] = val\n\t\t}\n\t\tupdateMeta.Labels = ms\n\t}\n\n\tif v, ok := d.GetOk(\"name\"); ok && !isIntfNil(v) {\n\t\tupdateMeta.Name =\n\t\t\tv.(string)\n\t}\n\n\tif v, ok := d.GetOk(\"namespace\"); ok && !isIntfNil(v) {\n\t\tupdateMeta.Namespace =\n\t\t\tv.(string)\n\t}\n\n\tif v, ok := d.GetOk(\"action\"); ok && !isIntfNil(v) {\n\n\t\tsl := v.(*schema.Set).List()\n\t\taction := &ves_io_schema_fast_acl_rule.FastAclRuleAction{}\n\t\tupdateSpec.Action = action\n\t\tfor _, set := range sl {\n\t\t\tactionMapStrToI := set.(map[string]interface{})\n\n\t\t\tactionTypeFound := false\n\n\t\t\tif v, ok := actionMapStrToI[\"policer_action\"]; ok && !isIntfNil(v) && !actionTypeFound {\n\n\t\t\t\tactionTypeFound = true\n\t\t\t\tactionInt := &ves_io_schema_fast_acl_rule.FastAclRuleAction_PolicerAction{}\n\t\t\t\tactionInt.PolicerAction = &ves_io_schema.PolicerRefType{}\n\t\t\t\taction.Action = actionInt\n\n\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\tfor _, set := range sl {\n\t\t\t\t\tcs := set.(map[string]interface{})\n\n\t\t\t\t\tif v, ok := cs[\"ref\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\tsl := v.([]interface{})\n\t\t\t\t\t\trefInt := make([]*ves_io_schema.ObjectRefType, len(sl))\n\t\t\t\t\t\tactionInt.PolicerAction.Ref = refInt\n\t\t\t\t\t\tfor i, ps := range sl {\n\n\t\t\t\t\t\t\trMapToStrVal := ps.(map[string]interface{})\n\t\t\t\t\t\t\trefInt[i] = &ves_io_schema.ObjectRefType{}\n\n\t\t\t\t\t\t\trefInt[i].Kind = \"policer\"\n\n\t\t\t\t\t\t\tif v, ok := rMapToStrVal[\"name\"]; ok && !isIntfNil(v) {\n\t\t\t\t\t\t\t\trefInt[i].Name = v.(string)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif v, ok := rMapToStrVal[\"namespace\"]; ok && !isIntfNil(v) {\n\t\t\t\t\t\t\t\trefInt[i].Namespace = v.(string)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif v, ok := rMapToStrVal[\"tenant\"]; ok && !isIntfNil(v) {\n\t\t\t\t\t\t\t\trefInt[i].Tenant = v.(string)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif v, ok := rMapToStrVal[\"uid\"]; ok && !isIntfNil(v) {\n\t\t\t\t\t\t\t\trefInt[i].Uid = v.(string)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif v, ok := actionMapStrToI[\"protocol_policer_action\"]; ok && !isIntfNil(v) && !actionTypeFound {\n\n\t\t\t\tactionTypeFound = true\n\t\t\t\tactionInt := &ves_io_schema_fast_acl_rule.FastAclRuleAction_ProtocolPolicerAction{}\n\t\t\t\tactionInt.ProtocolPolicerAction = &ves_io_schema.ProtocolPolicerRefType{}\n\t\t\t\taction.Action = actionInt\n\n\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\tfor _, set := range sl {\n\t\t\t\t\tcs := set.(map[string]interface{})\n\n\t\t\t\t\tif v, ok := cs[\"ref\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\tsl := v.([]interface{})\n\t\t\t\t\t\trefInt := make([]*ves_io_schema.ObjectRefType, len(sl))\n\t\t\t\t\t\tactionInt.ProtocolPolicerAction.Ref = refInt\n\t\t\t\t\t\tfor i, ps := range sl {\n\n\t\t\t\t\t\t\trMapToStrVal := ps.(map[string]interface{})\n\t\t\t\t\t\t\trefInt[i] = &ves_io_schema.ObjectRefType{}\n\n\t\t\t\t\t\t\trefInt[i].Kind = \"protocol_policer\"\n\n\t\t\t\t\t\t\tif v, ok := rMapToStrVal[\"name\"]; ok && !isIntfNil(v) {\n\t\t\t\t\t\t\t\trefInt[i].Name = v.(string)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif v, ok := rMapToStrVal[\"namespace\"]; ok && !isIntfNil(v) {\n\t\t\t\t\t\t\t\trefInt[i].Namespace = v.(string)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif v, ok := rMapToStrVal[\"tenant\"]; ok && !isIntfNil(v) {\n\t\t\t\t\t\t\t\trefInt[i].Tenant = v.(string)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif v, ok := rMapToStrVal[\"uid\"]; ok && !isIntfNil(v) {\n\t\t\t\t\t\t\t\trefInt[i].Uid = v.(string)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif v, ok := actionMapStrToI[\"simple_action\"]; ok && !isIntfNil(v) && !actionTypeFound {\n\n\t\t\t\tactionTypeFound = true\n\t\t\t\tactionInt := &ves_io_schema_fast_acl_rule.FastAclRuleAction_SimpleAction{}\n\n\t\t\t\taction.Action = actionInt\n\n\t\t\t\tactionInt.SimpleAction = ves_io_schema_fast_acl_rule.FastAclRuleSimpleAction(ves_io_schema_fast_acl_rule.FastAclRuleSimpleAction_value[v.(string)])\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tif v, ok := d.GetOk(\"port\"); ok && !isIntfNil(v) {\n\n\t\tsl := v.([]interface{})\n\t\tport := make([]*ves_io_schema.PortValueType, len(sl))\n\t\tupdateSpec.Port = port\n\t\tfor i, set := range sl {\n\t\t\tport[i] = &ves_io_schema.PortValueType{}\n\t\t\tportMapStrToI := set.(map[string]interface{})\n\n\t\t\tportValueTypeChoiceTypeFound := false\n\n\t\t\tif v, ok := portMapStrToI[\"all\"]; ok && !isIntfNil(v) && !portValueTypeChoiceTypeFound {\n\n\t\t\t\tportValueTypeChoiceTypeFound = true\n\n\t\t\t\tif v.(bool) {\n\t\t\t\t\tportValueTypeChoiceInt := &ves_io_schema.PortValueType_All{}\n\t\t\t\t\tportValueTypeChoiceInt.All = &ves_io_schema.Empty{}\n\t\t\t\t\tport[i].PortValueTypeChoice = portValueTypeChoiceInt\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif v, ok := portMapStrToI[\"dns\"]; ok && !isIntfNil(v) && !portValueTypeChoiceTypeFound {\n\n\t\t\t\tportValueTypeChoiceTypeFound = true\n\n\t\t\t\tif v.(bool) {\n\t\t\t\t\tportValueTypeChoiceInt := &ves_io_schema.PortValueType_Dns{}\n\t\t\t\t\tportValueTypeChoiceInt.Dns = &ves_io_schema.Empty{}\n\t\t\t\t\tport[i].PortValueTypeChoice = portValueTypeChoiceInt\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif v, ok := portMapStrToI[\"user_defined\"]; ok && !isIntfNil(v) && !portValueTypeChoiceTypeFound {\n\n\t\t\t\tportValueTypeChoiceTypeFound = true\n\t\t\t\tportValueTypeChoiceInt := &ves_io_schema.PortValueType_UserDefined{}\n\n\t\t\t\tport[i].PortValueTypeChoice = portValueTypeChoiceInt\n\n\t\t\t\tportValueTypeChoiceInt.UserDefined = uint32(v.(int))\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tsourceTypeFound := false\n\n\tif v, ok := d.GetOk(\"ip_prefix_set\"); ok && !sourceTypeFound {\n\n\t\tsourceTypeFound = true\n\t\tsourceInt := &ves_io_schema_fast_acl_rule.ReplaceSpecType_IpPrefixSet{}\n\t\tsourceInt.IpPrefixSet = &ves_io_schema.IpPrefixSetRefType{}\n\t\tupdateSpec.Source = sourceInt\n\n\t\tsl := v.(*schema.Set).List()\n\t\tfor _, set := range sl {\n\t\t\tcs := set.(map[string]interface{})\n\n\t\t\tif v, ok := cs[\"ref\"]; ok && !isIntfNil(v) {\n\n\t\t\t\tsl := v.([]interface{})\n\t\t\t\trefInt := make([]*ves_io_schema.ObjectRefType, len(sl))\n\t\t\t\tsourceInt.IpPrefixSet.Ref = refInt\n\t\t\t\tfor i, ps := range sl {\n\n\t\t\t\t\trMapToStrVal := ps.(map[string]interface{})\n\t\t\t\t\trefInt[i] = &ves_io_schema.ObjectRefType{}\n\n\t\t\t\t\trefInt[i].Kind = \"ip_prefix_set\"\n\n\t\t\t\t\tif v, ok := rMapToStrVal[\"name\"]; ok && !isIntfNil(v) {\n\t\t\t\t\t\trefInt[i].Name = v.(string)\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := rMapToStrVal[\"namespace\"]; ok && !isIntfNil(v) {\n\t\t\t\t\t\trefInt[i].Namespace = v.(string)\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := rMapToStrVal[\"tenant\"]; ok && !isIntfNil(v) {\n\t\t\t\t\t\trefInt[i].Tenant = v.(string)\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := rMapToStrVal[\"uid\"]; ok && !isIntfNil(v) {\n\t\t\t\t\t\trefInt[i].Uid = v.(string)\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tif v, ok := d.GetOk(\"prefix\"); ok && !sourceTypeFound {\n\n\t\tsourceTypeFound = true\n\t\tsourceInt := &ves_io_schema_fast_acl_rule.ReplaceSpecType_Prefix{}\n\t\tsourceInt.Prefix = &ves_io_schema.PrefixListType{}\n\t\tupdateSpec.Source = sourceInt\n\n\t\tsl := v.(*schema.Set).List()\n\t\tfor _, set := range sl {\n\t\t\tcs := set.(map[string]interface{})\n\n\t\t\tif v, ok := cs[\"ipv6_prefix\"]; ok && !isIntfNil(v) {\n\n\t\t\t\tls := make([]string, len(v.([]interface{})))\n\t\t\t\tfor i, v := range v.([]interface{}) {\n\t\t\t\t\tls[i] = v.(string)\n\t\t\t\t}\n\t\t\t\tsourceInt.Prefix.Ipv6Prefix = ls\n\n\t\t\t}\n\n\t\t\tif v, ok := cs[\"prefix\"]; ok && !isIntfNil(v) {\n\n\t\t\t\tls := make([]string, len(v.([]interface{})))\n\t\t\t\tfor i, v := range v.([]interface{}) {\n\t\t\t\t\tls[i] = v.(string)\n\t\t\t\t}\n\t\t\t\tsourceInt.Prefix.Prefix = ls\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tlog.Printf(\"[DEBUG] Updating Volterra FastAclRule obj with struct: %+v\", updateReq)\n\n\terr := client.ReplaceObject(context.Background(), ves_io_schema_fast_acl_rule.ObjectType, updateReq)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error updating FastAclRule: %s\", err)\n\t}\n\n\treturn resourceVolterraFastAclRuleRead(d, meta)\n}",
"func resourceVolterraRateLimiter() *schema.Resource {\n\treturn &schema.Resource{\n\t\tCreate: resourceVolterraRateLimiterCreate,\n\t\tRead: resourceVolterraRateLimiterRead,\n\t\tUpdate: resourceVolterraRateLimiterUpdate,\n\t\tDelete: resourceVolterraRateLimiterDelete,\n\n\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\"annotations\": {\n\t\t\t\tType: schema.TypeMap,\n\t\t\t\tOptional: true,\n\t\t\t},\n\n\t\t\t\"description\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tOptional: true,\n\t\t\t},\n\n\t\t\t\"disable\": {\n\t\t\t\tType: schema.TypeBool,\n\t\t\t\tOptional: true,\n\t\t\t},\n\n\t\t\t\"labels\": {\n\t\t\t\tType: schema.TypeMap,\n\t\t\t\tOptional: true,\n\t\t\t},\n\n\t\t\t\"name\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tRequired: true,\n\t\t\t\tForceNew: true,\n\t\t\t},\n\n\t\t\t\"namespace\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tRequired: true,\n\t\t\t\tForceNew: true,\n\t\t\t},\n\n\t\t\t\"limits\": {\n\n\t\t\t\tType: schema.TypeList,\n\t\t\t\tOptional: true,\n\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\"burst_multiplier\": {\n\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"total_number\": {\n\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"unit\": {\n\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t\"user_identification\": {\n\n\t\t\t\tType: schema.TypeList,\n\t\t\t\tOptional: true,\n\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\"kind\": {\n\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\tComputed: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n}",
"func resourceVolterraRoute() *schema.Resource {\n\treturn &schema.Resource{\n\t\tCreate: resourceVolterraRouteCreate,\n\t\tRead: resourceVolterraRouteRead,\n\t\tUpdate: resourceVolterraRouteUpdate,\n\t\tDelete: resourceVolterraRouteDelete,\n\n\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\"annotations\": {\n\t\t\t\tType: schema.TypeMap,\n\t\t\t\tOptional: true,\n\t\t\t},\n\n\t\t\t\"description\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tOptional: true,\n\t\t\t},\n\n\t\t\t\"disable\": {\n\t\t\t\tType: schema.TypeBool,\n\t\t\t\tOptional: true,\n\t\t\t},\n\n\t\t\t\"labels\": {\n\t\t\t\tType: schema.TypeMap,\n\t\t\t\tOptional: true,\n\t\t\t},\n\n\t\t\t\"name\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tRequired: true,\n\t\t\t\tForceNew: true,\n\t\t\t},\n\n\t\t\t\"namespace\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tRequired: true,\n\t\t\t\tForceNew: true,\n\t\t\t},\n\n\t\t\t\"routes\": {\n\n\t\t\t\tType: schema.TypeList,\n\t\t\t\tOptional: true,\n\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\"bot_defense_javascript_injection\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"javascript_location\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"javascript_tags\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"javascript_url\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"tag_attributes\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"javascript_tag\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"tag_value\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"inherited_bot_defense_javascript_injection\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"bot_defense_javascript_injection_inline_mode\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"element_selector\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"insert_content\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"position\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"disable_custom_script\": {\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"disable_location_add\": {\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"match\": {\n\n\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"headers\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"invert_match\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"exact\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"presence\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"regex\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"http_method\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"incoming_port\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"no_port_match\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"port\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"port_ranges\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"path\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"path\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"prefix\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"regex\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"query_params\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"key\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"exact\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"regex\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"request_headers_to_add\": {\n\n\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"append\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"secret_value\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"blindfold_secret_info_internal\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"decryption_provider\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"location\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"store_provider\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"secret_encoding_type\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"blindfold_secret_info\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"decryption_provider\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"location\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"store_provider\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"clear_secret_info\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"provider\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"url\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"vault_secret_info\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"key\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"location\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"provider\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"secret_encoding\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"version\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"wingman_secret_info\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"value\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"request_headers_to_remove\": {\n\n\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"response_headers_to_add\": {\n\n\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"append\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"secret_value\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"blindfold_secret_info_internal\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"decryption_provider\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"location\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"store_provider\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"secret_encoding_type\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"blindfold_secret_info\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"decryption_provider\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"location\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"store_provider\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"clear_secret_info\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"provider\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"url\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"vault_secret_info\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"key\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"location\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"provider\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"secret_encoding\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"version\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"wingman_secret_info\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"value\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"response_headers_to_remove\": {\n\n\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"route_destination\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"buffer_policy\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"disabled\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"max_request_bytes\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"max_request_time\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"do_not_retract_cluster\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"retract_cluster\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"cors_policy\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"allow_credentials\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"allow_headers\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"allow_methods\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"allow_origin\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"allow_origin_regex\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"disabled\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"expose_headers\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"max_age\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"maximum_age\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"destinations\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"cluster\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"kind\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tComputed: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"endpoint_subsets\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeMap,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"priority\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"weight\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"endpoint_subsets\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeMap,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"hash_policy\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"cookie\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"add_httponly\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"ignore_httponly\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"path\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"ignore_samesite\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"samesite_lax\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"samesite_none\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"samesite_strict\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"add_secure\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"ignore_secure\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"ttl\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"header_name\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"source_ip\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"terminal\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"auto_host_rewrite\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"host_rewrite\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"mirror_policy\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"cluster\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"kind\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tComputed: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"percent\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"denominator\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"numerator\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"prefix_rewrite\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"priority\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"retry_policy\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"back_off\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"base_interval\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"max_interval\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"num_retries\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"per_try_timeout\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"retriable_status_codes\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"retry_condition\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"retry_on\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"spdy_config\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"use_spdy\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"timeout\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"web_socket_config\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"idle_timeout\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"max_connect_attempts\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"use_websocket\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"route_direct_response\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"response_body\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"response_code\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"route_redirect\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"host_redirect\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"port_redirect\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"proto_redirect\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"all_params\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"remove_all_params\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"replace_params\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"retain_all_params\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"strip_query_params\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"query_params\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"path_redirect\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"prefix_rewrite\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"response_code\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"service_policy\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"context_extensions\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"context_extensions\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeMap,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"disable\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"skip_lb_override\": {\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"waf_type\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"app_firewall\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"app_firewall\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"kind\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tComputed: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"disable_waf\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"inherit_waf\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n}",
"func resourceVolterraDnsLoadBalancer() *schema.Resource {\n\treturn &schema.Resource{\n\t\tCreate: resourceVolterraDnsLoadBalancerCreate,\n\t\tRead: resourceVolterraDnsLoadBalancerRead,\n\t\tUpdate: resourceVolterraDnsLoadBalancerUpdate,\n\t\tDelete: resourceVolterraDnsLoadBalancerDelete,\n\n\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\"annotations\": {\n\t\t\t\tType: schema.TypeMap,\n\t\t\t\tOptional: true,\n\t\t\t},\n\n\t\t\t\"description\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tOptional: true,\n\t\t\t},\n\n\t\t\t\"disable\": {\n\t\t\t\tType: schema.TypeBool,\n\t\t\t\tOptional: true,\n\t\t\t},\n\n\t\t\t\"labels\": {\n\t\t\t\tType: schema.TypeMap,\n\t\t\t\tOptional: true,\n\t\t\t},\n\n\t\t\t\"name\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tRequired: true,\n\t\t\t\tForceNew: true,\n\t\t\t},\n\n\t\t\t\"namespace\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tRequired: true,\n\t\t\t\tForceNew: true,\n\t\t\t},\n\n\t\t\t\"record_type\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tRequired: true,\n\t\t\t},\n\n\t\t\t\"response_cache\": {\n\n\t\t\t\tType: schema.TypeSet,\n\t\t\t\tOptional: true,\n\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\"default_response_cache_parameters\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"disable\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"response_cache_parameters\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"cache_cidr_ipv4\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"cache_cidr_ipv6\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"cache_ttl\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t\"rule_list\": {\n\n\t\t\t\tType: schema.TypeSet,\n\t\t\t\tOptional: true,\n\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\"rules\": {\n\n\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"nxdomain\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"pool\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"geo_location_label_selector\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"expressions\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tRequired: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"geo_location_set\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"score\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n}",
"func resourceVolterraNetworkPolicyView() *schema.Resource {\n\treturn &schema.Resource{\n\t\tCreate: resourceVolterraNetworkPolicyViewCreate,\n\t\tRead: resourceVolterraNetworkPolicyViewRead,\n\t\tUpdate: resourceVolterraNetworkPolicyViewUpdate,\n\t\tDelete: resourceVolterraNetworkPolicyViewDelete,\n\n\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\"annotations\": {\n\t\t\t\tType: schema.TypeMap,\n\t\t\t\tOptional: true,\n\t\t\t},\n\n\t\t\t\"description\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tOptional: true,\n\t\t\t},\n\n\t\t\t\"disable\": {\n\t\t\t\tType: schema.TypeBool,\n\t\t\t\tOptional: true,\n\t\t\t},\n\n\t\t\t\"labels\": {\n\t\t\t\tType: schema.TypeMap,\n\t\t\t\tOptional: true,\n\t\t\t},\n\n\t\t\t\"name\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tRequired: true,\n\t\t\t\tForceNew: true,\n\t\t\t},\n\n\t\t\t\"namespace\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tRequired: true,\n\t\t\t\tForceNew: true,\n\t\t\t},\n\n\t\t\t\"egress_rules\": {\n\n\t\t\t\tType: schema.TypeList,\n\t\t\t\tOptional: true,\n\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\"action\": {\n\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"adv_action\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"keys\": {\n\n\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"label_matcher\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"keys\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"metadata\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"description\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"disable\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"any\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"inside_endpoints\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"ip_prefix_set\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"ref\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"kind\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tComputed: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"label_selector\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"expressions\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\tRequired: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"namespace\": {\n\n\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"outside_endpoints\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"prefix_list\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"prefixes\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\tRequired: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"rule_description\": {\n\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"rule_name\": {\n\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"all_tcp_traffic\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"all_traffic\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"all_udp_traffic\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"applications\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"applications\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"protocol_port_range\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"port_ranges\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"protocol\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t\"endpoint\": {\n\n\t\t\t\tType: schema.TypeSet,\n\t\t\t\tOptional: true,\n\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\"any\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"inside_endpoints\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"interface\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"label_selector\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"expressions\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\tRequired: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"namespace\": {\n\n\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"outside_endpoints\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"prefix_list\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"prefixes\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\tRequired: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t\"ingress_rules\": {\n\n\t\t\t\tType: schema.TypeList,\n\t\t\t\tOptional: true,\n\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\"action\": {\n\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"adv_action\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"keys\": {\n\n\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"label_matcher\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"keys\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"metadata\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"description\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"disable\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"any\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"inside_endpoints\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"ip_prefix_set\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"ref\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"kind\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tComputed: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"label_selector\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"expressions\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\tRequired: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"namespace\": {\n\n\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"outside_endpoints\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"prefix_list\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"prefixes\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\tRequired: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"rule_description\": {\n\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"rule_name\": {\n\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"all_tcp_traffic\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"all_traffic\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"all_udp_traffic\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"applications\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"applications\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"protocol_port_range\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"port_ranges\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"protocol\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n}",
"func resourceVolterraOriginPool() *schema.Resource {\n\treturn &schema.Resource{\n\t\tCreate: resourceVolterraOriginPoolCreate,\n\t\tRead: resourceVolterraOriginPoolRead,\n\t\tUpdate: resourceVolterraOriginPoolUpdate,\n\t\tDelete: resourceVolterraOriginPoolDelete,\n\n\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\"annotations\": {\n\t\t\t\tType: schema.TypeMap,\n\t\t\t\tOptional: true,\n\t\t\t},\n\n\t\t\t\"description\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tOptional: true,\n\t\t\t},\n\n\t\t\t\"disable\": {\n\t\t\t\tType: schema.TypeBool,\n\t\t\t\tOptional: true,\n\t\t\t},\n\n\t\t\t\"labels\": {\n\t\t\t\tType: schema.TypeMap,\n\t\t\t\tOptional: true,\n\t\t\t},\n\n\t\t\t\"name\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tRequired: true,\n\t\t\t\tForceNew: true,\n\t\t\t},\n\n\t\t\t\"namespace\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tRequired: true,\n\t\t\t\tForceNew: true,\n\t\t\t},\n\n\t\t\t\"advanced_options\": {\n\n\t\t\t\tType: schema.TypeSet,\n\t\t\t\tOptional: true,\n\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\"circuit_breaker\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"connection_limit\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"max_requests\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"pending_requests\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"priority\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"retries\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"default_circuit_breaker\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"disable_circuit_breaker\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"connection_timeout\": {\n\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"header_transformation_type\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"default_header_transformation\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"proper_case_header_transformation\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"http_idle_timeout\": {\n\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"auto_http_config\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"http1_config\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"http2_options\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"enabled\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"disable_outlier_detection\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"outlier_detection\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"base_ejection_time\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"consecutive_5xx\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"consecutive_gateway_failure\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"interval\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"max_ejection_percent\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"no_panic_threshold\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"panic_threshold\": {\n\n\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"disable_subsets\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"enable_subsets\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"endpoint_subsets\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"keys\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tRequired: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"any_endpoint\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"default_subset\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"default_subset\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeMap,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"fail_request\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t\"endpoint_selection\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tRequired: true,\n\t\t\t},\n\n\t\t\t\"health_check_port\": {\n\n\t\t\t\tType: schema.TypeInt,\n\t\t\t\tOptional: true,\n\t\t\t},\n\n\t\t\t\"same_as_endpoint_port\": {\n\n\t\t\t\tType: schema.TypeBool,\n\t\t\t\tOptional: true,\n\t\t\t},\n\n\t\t\t\"healthcheck\": {\n\n\t\t\t\tType: schema.TypeList,\n\t\t\t\tOptional: true,\n\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t\"loadbalancer_algorithm\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tRequired: true,\n\t\t\t},\n\n\t\t\t\"origin_servers\": {\n\n\t\t\t\tType: schema.TypeList,\n\t\t\t\tOptional: true,\n\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\"consul_service\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"inside_network\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"outside_network\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"service_name\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"site_locator\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"site\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"kind\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tComputed: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"virtual_site\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"kind\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tComputed: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"custom_endpoint_object\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"endpoint\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"k8s_service\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"inside_network\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"outside_network\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"vk8s_networks\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"service_name\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"service_selector\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"expressions\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tRequired: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"site_locator\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"site\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"kind\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tComputed: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"virtual_site\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"kind\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tComputed: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"private_ip\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"inside_network\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"outside_network\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"ip\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"ipv6\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"site_locator\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"site\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"kind\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tComputed: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"virtual_site\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"kind\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tComputed: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"private_name\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"dns_name\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"inside_network\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"outside_network\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"site_locator\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"site\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"kind\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tComputed: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"virtual_site\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"kind\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tComputed: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"public_ip\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"ip\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"ipv6\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"public_name\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"dns_name\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"vn_private_ip\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"virtual_network\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"ip\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"ipv6\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"vn_private_name\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"dns_name\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"private_network\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"labels\": {\n\t\t\t\t\t\t\tType: schema.TypeMap,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t\"automatic_port\": {\n\n\t\t\t\tType: schema.TypeBool,\n\t\t\t\tOptional: true,\n\t\t\t},\n\n\t\t\t\"lb_port\": {\n\n\t\t\t\tType: schema.TypeBool,\n\t\t\t\tOptional: true,\n\t\t\t},\n\n\t\t\t\"port\": {\n\n\t\t\t\tType: schema.TypeInt,\n\t\t\t\tOptional: true,\n\t\t\t},\n\n\t\t\t\"no_tls\": {\n\n\t\t\t\tType: schema.TypeBool,\n\t\t\t\tOptional: true,\n\t\t\t},\n\n\t\t\t\"use_tls\": {\n\n\t\t\t\tType: schema.TypeSet,\n\t\t\t\tOptional: true,\n\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\"no_mtls\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"use_mtls\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"tls_certificates\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"certificate_url\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"description\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"custom_hash_algorithms\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"hash_algorithms\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tRequired: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"disable_ocsp_stapling\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"use_system_defaults\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"private_key\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"blindfold_secret_info_internal\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"decryption_provider\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"location\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"store_provider\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"secret_encoding_type\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"blindfold_secret_info\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"decryption_provider\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"location\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"store_provider\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"clear_secret_info\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"provider\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"url\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"vault_secret_info\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"key\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"location\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"provider\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"secret_encoding\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"version\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"wingman_secret_info\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"use_mtls_obj\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"skip_server_verification\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"use_server_verification\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"trusted_ca\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"trusted_ca_url\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"volterra_trusted_ca\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"disable_sni\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"sni\": {\n\n\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"use_host_header_as_sni\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"tls_config\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"custom_security\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"cipher_suites\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tRequired: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"max_version\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"min_version\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"default_security\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"low_security\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"medium_security\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n}",
"func resourceVolterraRateLimiterCreate(d *schema.ResourceData, meta interface{}) error {\n\tclient := meta.(*APIClient)\n\n\tcreateMeta := &ves_io_schema.ObjectCreateMetaType{}\n\tcreateSpec := &ves_io_schema_rate_limiter.CreateSpecType{}\n\tcreateReq := &ves_io_schema_rate_limiter.CreateRequest{\n\t\tMetadata: createMeta,\n\t\tSpec: createSpec,\n\t}\n\n\tif v, ok := d.GetOk(\"annotations\"); ok && !isIntfNil(v) {\n\n\t\tms := map[string]string{}\n\n\t\tfor k, v := range v.(map[string]interface{}) {\n\t\t\tval := v.(string)\n\t\t\tms[k] = val\n\t\t}\n\t\tcreateMeta.Annotations = ms\n\t}\n\n\tif v, ok := d.GetOk(\"description\"); ok && !isIntfNil(v) {\n\t\tcreateMeta.Description =\n\t\t\tv.(string)\n\t}\n\n\tif v, ok := d.GetOk(\"disable\"); ok && !isIntfNil(v) {\n\t\tcreateMeta.Disable =\n\t\t\tv.(bool)\n\t}\n\n\tif v, ok := d.GetOk(\"labels\"); ok && !isIntfNil(v) {\n\n\t\tms := map[string]string{}\n\n\t\tfor k, v := range v.(map[string]interface{}) {\n\t\t\tval := v.(string)\n\t\t\tms[k] = val\n\t\t}\n\t\tcreateMeta.Labels = ms\n\t}\n\n\tif v, ok := d.GetOk(\"name\"); ok && !isIntfNil(v) {\n\t\tcreateMeta.Name =\n\t\t\tv.(string)\n\t}\n\n\tif v, ok := d.GetOk(\"namespace\"); ok && !isIntfNil(v) {\n\t\tcreateMeta.Namespace =\n\t\t\tv.(string)\n\t}\n\n\t//limits\n\tif v, ok := d.GetOk(\"limits\"); ok && !isIntfNil(v) {\n\n\t\tsl := v.([]interface{})\n\t\tlimits := make([]*ves_io_schema_rate_limiter.RateLimitValue, len(sl))\n\t\tcreateSpec.Limits = limits\n\t\tfor i, set := range sl {\n\t\t\tlimits[i] = &ves_io_schema_rate_limiter.RateLimitValue{}\n\t\t\tlimitsMapStrToI := set.(map[string]interface{})\n\n\t\t\tif w, ok := limitsMapStrToI[\"burst_multiplier\"]; ok && !isIntfNil(w) {\n\t\t\t\tlimits[i].BurstMultiplier = uint32(w.(int))\n\t\t\t}\n\n\t\t\tif w, ok := limitsMapStrToI[\"total_number\"]; ok && !isIntfNil(w) {\n\t\t\t\tlimits[i].TotalNumber = uint32(w.(int))\n\t\t\t}\n\n\t\t\tif v, ok := limitsMapStrToI[\"unit\"]; ok && !isIntfNil(v) {\n\n\t\t\t\tlimits[i].Unit = ves_io_schema_rate_limiter.RateLimitPeriodUnit(ves_io_schema_rate_limiter.RateLimitPeriodUnit_value[v.(string)])\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\t//user_identification\n\tif v, ok := d.GetOk(\"user_identification\"); ok && !isIntfNil(v) {\n\n\t\tsl := v.([]interface{})\n\t\tuserIdentificationInt := make([]*ves_io_schema.ObjectRefType, len(sl))\n\t\tcreateSpec.UserIdentification = userIdentificationInt\n\t\tfor i, ps := range sl {\n\n\t\t\tuiMapToStrVal := ps.(map[string]interface{})\n\t\t\tuserIdentificationInt[i] = &ves_io_schema.ObjectRefType{}\n\n\t\t\tuserIdentificationInt[i].Kind = \"user_identification\"\n\n\t\t\tif v, ok := uiMapToStrVal[\"name\"]; ok && !isIntfNil(v) {\n\t\t\t\tuserIdentificationInt[i].Name = v.(string)\n\t\t\t}\n\n\t\t\tif v, ok := uiMapToStrVal[\"namespace\"]; ok && !isIntfNil(v) {\n\t\t\t\tuserIdentificationInt[i].Namespace = v.(string)\n\t\t\t}\n\n\t\t\tif v, ok := uiMapToStrVal[\"tenant\"]; ok && !isIntfNil(v) {\n\t\t\t\tuserIdentificationInt[i].Tenant = v.(string)\n\t\t\t}\n\n\t\t\tif v, ok := uiMapToStrVal[\"uid\"]; ok && !isIntfNil(v) {\n\t\t\t\tuserIdentificationInt[i].Uid = v.(string)\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tlog.Printf(\"[DEBUG] Creating Volterra RateLimiter object with struct: %+v\", createReq)\n\n\tcreateRateLimiterResp, err := client.CreateObject(context.Background(), ves_io_schema_rate_limiter.ObjectType, createReq)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error creating RateLimiter: %s\", err)\n\t}\n\td.SetId(createRateLimiterResp.GetObjSystemMetadata().GetUid())\n\n\treturn resourceVolterraRateLimiterRead(d, meta)\n}",
"func resourceVolterraDnsLbPool() *schema.Resource {\n\treturn &schema.Resource{\n\t\tCreate: resourceVolterraDnsLbPoolCreate,\n\t\tRead: resourceVolterraDnsLbPoolRead,\n\t\tUpdate: resourceVolterraDnsLbPoolUpdate,\n\t\tDelete: resourceVolterraDnsLbPoolDelete,\n\n\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\"annotations\": {\n\t\t\t\tType: schema.TypeMap,\n\t\t\t\tOptional: true,\n\t\t\t},\n\n\t\t\t\"description\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tOptional: true,\n\t\t\t},\n\n\t\t\t\"disable\": {\n\t\t\t\tType: schema.TypeBool,\n\t\t\t\tOptional: true,\n\t\t\t},\n\n\t\t\t\"labels\": {\n\t\t\t\tType: schema.TypeMap,\n\t\t\t\tOptional: true,\n\t\t\t},\n\n\t\t\t\"name\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tRequired: true,\n\t\t\t\tForceNew: true,\n\t\t\t},\n\n\t\t\t\"namespace\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tRequired: true,\n\t\t\t\tForceNew: true,\n\t\t\t},\n\n\t\t\t\"load_balancing_mode\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tRequired: true,\n\t\t\t},\n\n\t\t\t\"a_pool\": {\n\n\t\t\t\tType: schema.TypeSet,\n\t\t\t\tOptional: true,\n\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\"disable_health_check\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"health_check\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"max_answers\": {\n\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"members\": {\n\n\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"disable\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"ip_endpoint\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"priority\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"ratio\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t\"aaaa_pool\": {\n\n\t\t\t\tType: schema.TypeSet,\n\t\t\t\tOptional: true,\n\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\"max_answers\": {\n\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"members\": {\n\n\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"disable\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"ip_endpoint\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"priority\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"ratio\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t\"cname_pool\": {\n\n\t\t\t\tType: schema.TypeSet,\n\t\t\t\tOptional: true,\n\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\"members\": {\n\n\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"domain\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"final_translation\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"ratio\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t\"mx_pool\": {\n\n\t\t\t\tType: schema.TypeSet,\n\t\t\t\tOptional: true,\n\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\"max_answers\": {\n\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"members\": {\n\n\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"domain\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"priority\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"ratio\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t\"ttl\": {\n\n\t\t\t\tType: schema.TypeInt,\n\t\t\t\tOptional: true,\n\t\t\t},\n\n\t\t\t\"use_rrset_ttl\": {\n\n\t\t\t\tType: schema.TypeBool,\n\t\t\t\tOptional: true,\n\t\t\t},\n\t\t},\n\t}\n}",
"func resourceVolterraHttpLoadbalancer() *schema.Resource {\n\treturn &schema.Resource{\n\t\tCreate: resourceVolterraHttpLoadbalancerCreate,\n\t\tRead: resourceVolterraHttpLoadbalancerRead,\n\t\tUpdate: resourceVolterraHttpLoadbalancerUpdate,\n\t\tDelete: resourceVolterraHttpLoadbalancerDelete,\n\n\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\"annotations\": {\n\t\t\t\tType: schema.TypeMap,\n\t\t\t\tOptional: true,\n\t\t\t},\n\n\t\t\t\"description\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tOptional: true,\n\t\t\t},\n\n\t\t\t\"disable\": {\n\t\t\t\tType: schema.TypeBool,\n\t\t\t\tOptional: true,\n\t\t\t},\n\n\t\t\t\"labels\": {\n\t\t\t\tType: schema.TypeMap,\n\t\t\t\tOptional: true,\n\t\t\t},\n\n\t\t\t\"name\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tRequired: true,\n\t\t\t\tForceNew: true,\n\t\t\t},\n\n\t\t\t\"namespace\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tRequired: true,\n\t\t\t\tForceNew: true,\n\t\t\t},\n\n\t\t\t\"add_location\": {\n\t\t\t\tType: schema.TypeBool,\n\t\t\t\tOptional: true,\n\t\t\t},\n\n\t\t\t\"advertise_custom\": {\n\n\t\t\t\tType: schema.TypeSet,\n\t\t\t\tOptional: true,\n\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\"advertise_where\": {\n\n\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"site\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"ip\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"ipv6\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"network\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"site\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"kind\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tComputed: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"virtual_network\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"default_v6_vip\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"specific_v6_vip\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"default_v4_vip\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"specific_v4_vip\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"virtual_network\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"kind\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tComputed: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"virtual_site\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"network\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"virtual_site\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"kind\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tComputed: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"vk8s_service\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"site\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"kind\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tComputed: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"virtual_site\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"kind\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tComputed: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"port\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"use_default_port\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t\"advertise_on_public\": {\n\n\t\t\t\tType: schema.TypeSet,\n\t\t\t\tOptional: true,\n\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\"public_ip\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"kind\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tComputed: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t\"advertise_on_public_default_vip\": {\n\n\t\t\t\tType: schema.TypeBool,\n\t\t\t\tOptional: true,\n\t\t\t},\n\n\t\t\t\"do_not_advertise\": {\n\n\t\t\t\tType: schema.TypeBool,\n\t\t\t\tOptional: true,\n\t\t\t},\n\n\t\t\t\"api_definition\": {\n\n\t\t\t\tType: schema.TypeSet,\n\t\t\t\tOptional: true,\n\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t\"api_definitions\": {\n\n\t\t\t\tType: schema.TypeSet,\n\t\t\t\tOptional: true,\n\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\"api_definitions\": {\n\n\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t\"api_specification\": {\n\n\t\t\t\tType: schema.TypeSet,\n\t\t\t\tOptional: true,\n\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\"api_definition\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"validation_all_spec_endpoints\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"fall_through_mode\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"fall_through_mode_allow\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"fall_through_mode_custom\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"open_api_validation_rules\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"action_block\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"action_report\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"action_skip\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"api_endpoint\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"methods\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"path\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"api_group\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"base_path\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"metadata\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"description\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"disable\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"oversized_body_fail_validation\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"oversized_body_skip_validation\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"validation_mode\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"response_validation_mode_active\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"response_validation_properties\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tRequired: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"enforcement_block\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"enforcement_report\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"skip_response_validation\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"skip_validation\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"validation_mode_active\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"request_validation_properties\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tRequired: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"enforcement_block\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"enforcement_report\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"validation_custom_list\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"fall_through_mode\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"fall_through_mode_allow\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"fall_through_mode_custom\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"open_api_validation_rules\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"action_block\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"action_report\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"action_skip\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"api_endpoint\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"methods\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"path\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"api_group\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"base_path\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"metadata\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"description\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"disable\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"open_api_validation_rules\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"api_endpoint\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"methods\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"path\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"api_group\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"base_path\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"any_domain\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"specific_domain\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"metadata\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"description\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"disable\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"validation_mode\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"response_validation_mode_active\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"response_validation_properties\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tRequired: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"enforcement_block\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"enforcement_report\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"skip_response_validation\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"skip_validation\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"validation_mode_active\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"request_validation_properties\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tRequired: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"enforcement_block\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"enforcement_report\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"oversized_body_fail_validation\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"oversized_body_skip_validation\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"validation_disabled\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t\"disable_api_definition\": {\n\n\t\t\t\tType: schema.TypeBool,\n\t\t\t\tOptional: true,\n\t\t\t},\n\n\t\t\t\"disable_api_discovery\": {\n\n\t\t\t\tType: schema.TypeBool,\n\t\t\t\tOptional: true,\n\t\t\t},\n\n\t\t\t\"enable_api_discovery\": {\n\n\t\t\t\tType: schema.TypeSet,\n\t\t\t\tOptional: true,\n\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\"disable_learn_from_redirect_traffic\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"enable_learn_from_redirect_traffic\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"sensitive_data_detection_rules\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"custom_sensitive_data_detection_rules\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"metadata\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"description\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"disable\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"sensitive_data_detection_config\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"any_domain\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"specific_domain\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"key_pattern\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"exact_value\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"regex_value\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"key_value_pattern\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"key_pattern\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"exact_value\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"regex_value\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"value_pattern\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"exact_value\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"regex_value\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"value_pattern\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"exact_value\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"regex_value\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"all_request_sections\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"all_response_sections\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"all_sections\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"custom_sections\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"custom_sections\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tRequired: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"any_target\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"api_endpoint_target\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"api_endpoint_path\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"methods\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tRequired: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"api_group\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"base_path\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"sensitive_data_type\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"type\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"disabled_built_in_rules\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t\"api_protection_rules\": {\n\n\t\t\t\tType: schema.TypeSet,\n\t\t\t\tOptional: true,\n\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\"api_endpoint_rules\": {\n\n\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"action\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"allow\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"deny\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"api_endpoint_method\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"invert_matcher\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"methods\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"api_endpoint_path\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"client_matcher\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"any_client\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"client_selector\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"expressions\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tRequired: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"ip_threat_category_list\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"ip_threat_categories\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tRequired: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"any_ip\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"asn_list\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"as_numbers\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tRequired: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"asn_matcher\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"asn_sets\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"kind\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tComputed: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"ip_matcher\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"invert_matcher\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"prefix_sets\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"kind\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tComputed: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"ip_prefix_list\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"invert_match\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"ip_prefixes\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"ipv6_prefixes\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"tls_fingerprint_matcher\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"classes\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"exact_values\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"excluded_values\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"any_domain\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"specific_domain\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"metadata\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"description\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"disable\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"request_matcher\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"cookie_matchers\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"invert_matcher\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"check_not_present\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"check_present\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"item\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"exact_values\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"regex_values\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"transformers\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"presence\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"headers\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"invert_matcher\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"check_not_present\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"check_present\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"item\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"exact_values\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"regex_values\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"transformers\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"presence\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"query_params\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"invert_matcher\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"key\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"check_not_present\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"check_present\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"item\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"exact_values\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"regex_values\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"transformers\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"presence\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"api_groups_rules\": {\n\n\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"action\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"allow\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"deny\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"api_group\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"base_path\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"client_matcher\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"any_client\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"client_selector\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"expressions\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tRequired: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"ip_threat_category_list\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"ip_threat_categories\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tRequired: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"any_ip\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"asn_list\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"as_numbers\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tRequired: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"asn_matcher\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"asn_sets\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"kind\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tComputed: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"ip_matcher\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"invert_matcher\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"prefix_sets\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"kind\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tComputed: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"ip_prefix_list\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"invert_match\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"ip_prefixes\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"ipv6_prefixes\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"tls_fingerprint_matcher\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"classes\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"exact_values\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"excluded_values\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"any_domain\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"specific_domain\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"metadata\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"description\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"disable\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"request_matcher\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"cookie_matchers\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"invert_matcher\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"check_not_present\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"check_present\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"item\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"exact_values\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"regex_values\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"transformers\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"presence\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"headers\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"invert_matcher\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"check_not_present\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"check_present\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"item\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"exact_values\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"regex_values\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"transformers\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"presence\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"query_params\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"invert_matcher\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"key\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"check_not_present\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"check_present\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"item\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"exact_values\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"regex_values\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"transformers\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"presence\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t\"blocked_clients\": {\n\n\t\t\t\tType: schema.TypeList,\n\t\t\t\tOptional: true,\n\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\"bot_skip_processing\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"skip_processing\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"waf_skip_processing\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"actions\": {\n\n\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"as_number\": {\n\n\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"http_header\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"headers\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"invert_match\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"exact\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"presence\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"regex\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"ip_prefix\": {\n\n\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"user_identifier\": {\n\n\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"expiration_timestamp\": {\n\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"metadata\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"description\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"disable\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t\"bot_defense\": {\n\n\t\t\t\tType: schema.TypeSet,\n\t\t\t\tOptional: true,\n\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\"policy\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"disable_js_insert\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"js_insert_all_pages\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"javascript_location\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"js_insert_all_pages_except\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"exclude_list\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"any_domain\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"domain\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"exact_value\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"regex_value\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"suffix_value\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"metadata\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"description\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"disable\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"path\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"path\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"prefix\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"regex\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"javascript_location\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"js_insertion_rules\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"exclude_list\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"any_domain\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"domain\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"exact_value\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"regex_value\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"suffix_value\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"metadata\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"description\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"disable\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"path\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"path\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"prefix\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"regex\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"rules\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"any_domain\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"domain\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"exact_value\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"regex_value\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"suffix_value\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"javascript_location\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"metadata\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"description\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"disable\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"path\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"path\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"prefix\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"regex\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"javascript_mode\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"js_download_path\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"disable_mobile_sdk\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"mobile_sdk_config\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"mobile_identifier\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"headers\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"check_not_present\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"check_present\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"item\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"exact_values\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"regex_values\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"transformers\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"reload_header_name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"protected_app_endpoints\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"mobile\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"web\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"web_mobile\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"header\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"check_not_present\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"check_present\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"item\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"exact_values\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"regex_values\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"transformers\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"headers\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"check_not_present\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"check_present\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"item\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"exact_values\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"regex_values\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"transformers\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"mobile_identifier\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"any_domain\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"domain\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"exact_value\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"regex_value\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"suffix_value\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"flow_label\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"account_management\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"create\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"password_reset\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"authentication\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"login\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"disable_transaction_result\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"transaction_result\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"failure_conditions\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"regex_values\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"status\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"success_conditions\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"regex_values\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"status\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"login_mfa\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"login_partner\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"logout\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"token_refresh\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"financial_services\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"apply\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"money_transfer\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"flight\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"checkin\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"profile_management\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"create\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"update\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"view\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"search\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"flight_search\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"product_search\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"reservation_search\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"room_search\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"shopping_gift_cards\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"gift_card_make_purchase_with_gift_card\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"gift_card_validation\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"shop_add_to_cart\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"shop_checkout\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"shop_choose_seat\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"shop_enter_drawing_submission\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"shop_make_payment\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"shop_order\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"shop_price_inquiry\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"shop_promo_code_validation\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"shop_purchase_gift_card\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"shop_update_quantity\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"undefined_flow_label\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"allow_good_bots\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"mitigate_good_bots\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"http_methods\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tRequired: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"metadata\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"description\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"disable\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"mitigation\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"block\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"body\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"body_hash\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"status\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"flag\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"append_headers\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"auto_type_header_name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"inference_header_name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"no_headers\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"none\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"redirect\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"uri\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"path\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"path\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"prefix\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"regex\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"protocol\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"regional_endpoint\": {\n\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"timeout\": {\n\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t\"disable_bot_defense\": {\n\n\t\t\t\tType: schema.TypeBool,\n\t\t\t\tOptional: true,\n\t\t\t},\n\n\t\t\t\"captcha_challenge\": {\n\n\t\t\t\tType: schema.TypeSet,\n\t\t\t\tOptional: true,\n\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\"cookie_expiry\": {\n\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"custom_page\": {\n\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t\"enable_challenge\": {\n\n\t\t\t\tType: schema.TypeSet,\n\t\t\t\tOptional: true,\n\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\"captcha_challenge_parameters\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"cookie_expiry\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"custom_page\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"default_captcha_challenge_parameters\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"default_js_challenge_parameters\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"js_challenge_parameters\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"cookie_expiry\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"custom_page\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"js_script_delay\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"default_mitigation_settings\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"malicious_user_mitigation\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t\"js_challenge\": {\n\n\t\t\t\tType: schema.TypeSet,\n\t\t\t\tOptional: true,\n\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\"cookie_expiry\": {\n\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"custom_page\": {\n\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"js_script_delay\": {\n\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t\"no_challenge\": {\n\n\t\t\t\tType: schema.TypeBool,\n\t\t\t\tOptional: true,\n\t\t\t},\n\n\t\t\t\"policy_based_challenge\": {\n\n\t\t\t\tType: schema.TypeSet,\n\t\t\t\tOptional: true,\n\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\"captcha_challenge_parameters\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"cookie_expiry\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"custom_page\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"default_captcha_challenge_parameters\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"always_enable_captcha_challenge\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"always_enable_js_challenge\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"no_challenge\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"default_js_challenge_parameters\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"js_challenge_parameters\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"cookie_expiry\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"custom_page\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"js_script_delay\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"default_mitigation_settings\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"malicious_user_mitigation\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"rule_list\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"rules\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"metadata\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"description\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"disable\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"spec\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"arg_matchers\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"invert_matcher\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"check_not_present\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"check_present\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"item\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"exact_values\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"regex_values\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"transformers\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"presence\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"any_asn\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"asn_list\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"as_numbers\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tRequired: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"asn_matcher\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"asn_sets\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"kind\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tComputed: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"body_matcher\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"exact_values\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"regex_values\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"transformers\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"disable_challenge\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"enable_captcha_challenge\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"enable_javascript_challenge\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"any_client\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"client_name\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"client_name_matcher\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"exact_values\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"regex_values\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"transformers\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"client_selector\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"expressions\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tRequired: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"cookie_matchers\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"invert_matcher\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"check_not_present\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"check_present\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"item\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"exact_values\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"regex_values\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"transformers\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"presence\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"domain_matcher\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"exact_values\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"regex_values\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"expiration_timestamp\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"headers\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"invert_matcher\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"check_not_present\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"check_present\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"item\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"exact_values\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"regex_values\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"transformers\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"presence\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"http_method\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"invert_matcher\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"methods\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"any_ip\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"ip_matcher\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"invert_matcher\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"prefix_sets\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"kind\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tComputed: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"ip_prefix_list\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"invert_match\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"ip_prefixes\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"ipv6_prefixes\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"path\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"exact_values\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"prefix_values\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"regex_values\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"suffix_values\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"transformers\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"query_params\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"invert_matcher\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"key\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"check_not_present\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"check_present\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"item\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"exact_values\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"regex_values\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"transformers\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"presence\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"tls_fingerprint_matcher\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"classes\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"exact_values\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"excluded_values\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"default_temporary_blocking_parameters\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"temporary_user_blocking\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"custom_page\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t\"client_side_defense\": {\n\n\t\t\t\tType: schema.TypeSet,\n\t\t\t\tOptional: true,\n\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\"policy\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"disable_js_insert\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"js_insert_all_pages\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"js_insert_all_pages_except\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"exclude_list\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"any_domain\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"domain\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"exact_value\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"regex_value\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"suffix_value\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"metadata\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"description\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"disable\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"path\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"path\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"prefix\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"regex\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"js_insertion_rules\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"exclude_list\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"any_domain\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"domain\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"exact_value\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"regex_value\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"suffix_value\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"metadata\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"description\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"disable\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"path\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"path\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"prefix\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"regex\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"rules\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"any_domain\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"domain\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"exact_value\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"regex_value\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"suffix_value\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"metadata\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"description\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"disable\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"path\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"path\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"prefix\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"regex\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t\"disable_client_side_defense\": {\n\n\t\t\t\tType: schema.TypeBool,\n\t\t\t\tOptional: true,\n\t\t\t},\n\n\t\t\t\"cors_policy\": {\n\n\t\t\t\tType: schema.TypeSet,\n\t\t\t\tOptional: true,\n\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\"allow_credentials\": {\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"allow_headers\": {\n\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"allow_methods\": {\n\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"allow_origin\": {\n\n\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"allow_origin_regex\": {\n\n\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"disabled\": {\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"expose_headers\": {\n\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"max_age\": {\n\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"maximum_age\": {\n\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t\"csrf_policy\": {\n\n\t\t\t\tType: schema.TypeSet,\n\t\t\t\tOptional: true,\n\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\"all_load_balancer_domains\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"custom_domain_list\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"domains\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\tRequired: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t\"data_guard_rules\": {\n\n\t\t\t\tType: schema.TypeList,\n\t\t\t\tOptional: true,\n\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\"apply_data_guard\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"skip_data_guard\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"any_domain\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"exact_value\": {\n\n\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"suffix_value\": {\n\n\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"metadata\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"description\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"disable\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"path\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"path\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"prefix\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"regex\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t\"disable_ddos_detection\": {\n\n\t\t\t\tType: schema.TypeBool,\n\t\t\t\tOptional: true,\n\t\t\t},\n\n\t\t\t\"enable_ddos_detection\": {\n\n\t\t\t\tType: schema.TypeSet,\n\t\t\t\tOptional: true,\n\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\"disable_auto_mitigation\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"enable_auto_mitigation\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t\"ddos_mitigation_rules\": {\n\n\t\t\t\tType: schema.TypeList,\n\t\t\t\tOptional: true,\n\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\"expiration_timestamp\": {\n\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"metadata\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"description\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"disable\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"block\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"ddos_client_source\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"asn_list\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"as_numbers\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tRequired: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"country_list\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"tls_fingerprint_matcher\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"classes\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"exact_values\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"excluded_values\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"ip_prefix_list\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"invert_match\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"ip_prefixes\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"ipv6_prefixes\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t\"default_route_pools\": {\n\n\t\t\t\tType: schema.TypeList,\n\t\t\t\tOptional: true,\n\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\"endpoint_subsets\": {\n\t\t\t\t\t\t\tType: schema.TypeMap,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"cluster\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"kind\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tComputed: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"pool\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"kind\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tComputed: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"priority\": {\n\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"weight\": {\n\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t\"domains\": {\n\n\t\t\t\tType: schema.TypeList,\n\n\t\t\t\tRequired: true,\n\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t\"graphql_rules\": {\n\n\t\t\t\tType: schema.TypeList,\n\t\t\t\tOptional: true,\n\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\"any_domain\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"exact_value\": {\n\n\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"suffix_value\": {\n\n\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"exact_path\": {\n\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"graphql_settings\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"disable_introspection\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"enable_introspection\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"max_batched_queries\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"max_depth\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"max_total_length\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"max_value_length\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"policy_name\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"metadata\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"description\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"disable\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"method_get\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"method_post\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t\"cookie_stickiness\": {\n\n\t\t\t\tType: schema.TypeSet,\n\t\t\t\tOptional: true,\n\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\"add_httponly\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"ignore_httponly\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"path\": {\n\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"ignore_samesite\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"samesite_lax\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"samesite_none\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"samesite_strict\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"add_secure\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"ignore_secure\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"ttl\": {\n\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t\"least_active\": {\n\n\t\t\t\tType: schema.TypeBool,\n\t\t\t\tOptional: true,\n\t\t\t},\n\n\t\t\t\"random\": {\n\n\t\t\t\tType: schema.TypeBool,\n\t\t\t\tOptional: true,\n\t\t\t},\n\n\t\t\t\"ring_hash\": {\n\n\t\t\t\tType: schema.TypeSet,\n\t\t\t\tOptional: true,\n\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\"hash_policy\": {\n\n\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"cookie\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"add_httponly\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"ignore_httponly\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"path\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"ignore_samesite\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"samesite_lax\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"samesite_none\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"samesite_strict\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"add_secure\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"ignore_secure\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"ttl\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"header_name\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"source_ip\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"terminal\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t\"round_robin\": {\n\n\t\t\t\tType: schema.TypeBool,\n\t\t\t\tOptional: true,\n\t\t\t},\n\n\t\t\t\"source_ip_stickiness\": {\n\n\t\t\t\tType: schema.TypeBool,\n\t\t\t\tOptional: true,\n\t\t\t},\n\n\t\t\t\"disable_ip_reputation\": {\n\n\t\t\t\tType: schema.TypeBool,\n\t\t\t\tOptional: true,\n\t\t\t},\n\n\t\t\t\"enable_ip_reputation\": {\n\n\t\t\t\tType: schema.TypeSet,\n\t\t\t\tOptional: true,\n\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\"ip_threat_categories\": {\n\n\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\tRequired: true,\n\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t\"http\": {\n\n\t\t\t\tType: schema.TypeSet,\n\t\t\t\tOptional: true,\n\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\"dns_volterra_managed\": {\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"port\": {\n\n\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"port_ranges\": {\n\n\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t\"https\": {\n\n\t\t\t\tType: schema.TypeSet,\n\t\t\t\tOptional: true,\n\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\"add_hsts\": {\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"connection_idle_timeout\": {\n\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"default_loadbalancer\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"non_default_loadbalancer\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"header_transformation_type\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"default_header_transformation\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"proper_case_header_transformation\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"http_protocol_options\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"http_protocol_enable_v1_only\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"http_protocol_enable_v1_v2\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"http_protocol_enable_v2_only\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"http_redirect\": {\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"disable_path_normalize\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"enable_path_normalize\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"port\": {\n\n\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"port_ranges\": {\n\n\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"append_server_name\": {\n\n\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"default_header\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"pass_through\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"server_name\": {\n\n\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"tls_cert_params\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"certificates\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"kind\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tComputed: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"no_mtls\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"use_mtls\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"crl\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"kind\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tComputed: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"no_crl\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"trusted_ca\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"kind\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tComputed: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"trusted_ca_url\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"xfcc_disabled\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"xfcc_options\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"xfcc_header_elements\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tRequired: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"tls_config\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"custom_security\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"cipher_suites\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tRequired: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"max_version\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"min_version\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"default_security\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"low_security\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"medium_security\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"tls_parameters\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"no_mtls\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"use_mtls\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"crl\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"kind\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tComputed: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"no_crl\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"trusted_ca\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"kind\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tComputed: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"trusted_ca_url\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"xfcc_disabled\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"xfcc_options\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"xfcc_header_elements\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tRequired: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"tls_certificates\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"certificate_url\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"description\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"custom_hash_algorithms\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"hash_algorithms\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tRequired: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"disable_ocsp_stapling\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"use_system_defaults\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"private_key\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"blindfold_secret_info_internal\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"decryption_provider\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"location\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"store_provider\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"secret_encoding_type\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"blindfold_secret_info\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"decryption_provider\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"location\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"store_provider\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"clear_secret_info\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"provider\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"url\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"vault_secret_info\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"key\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"location\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"provider\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"secret_encoding\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"version\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"wingman_secret_info\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"tls_config\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"custom_security\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"cipher_suites\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tRequired: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"max_version\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"min_version\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"default_security\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"low_security\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"medium_security\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t\"https_auto_cert\": {\n\n\t\t\t\tType: schema.TypeSet,\n\t\t\t\tOptional: true,\n\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\"add_hsts\": {\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"connection_idle_timeout\": {\n\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"default_loadbalancer\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"non_default_loadbalancer\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"header_transformation_type\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"default_header_transformation\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"proper_case_header_transformation\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"http_protocol_options\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"http_protocol_enable_v1_only\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"http_protocol_enable_v1_v2\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"http_protocol_enable_v2_only\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"http_redirect\": {\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"no_mtls\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"use_mtls\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"crl\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"kind\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tComputed: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"no_crl\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"trusted_ca\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"kind\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tComputed: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"trusted_ca_url\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"xfcc_disabled\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"xfcc_options\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"xfcc_header_elements\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tRequired: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"disable_path_normalize\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"enable_path_normalize\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"port\": {\n\n\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"port_ranges\": {\n\n\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"append_server_name\": {\n\n\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"default_header\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"pass_through\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"server_name\": {\n\n\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"tls_config\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"custom_security\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"cipher_suites\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tRequired: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"max_version\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"min_version\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"default_security\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"low_security\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"medium_security\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t\"disable_malicious_user_detection\": {\n\n\t\t\t\tType: schema.TypeBool,\n\t\t\t\tOptional: true,\n\t\t\t},\n\n\t\t\t\"enable_malicious_user_detection\": {\n\n\t\t\t\tType: schema.TypeBool,\n\t\t\t\tOptional: true,\n\t\t\t},\n\n\t\t\t\"malicious_user_mitigation\": {\n\n\t\t\t\tType: schema.TypeSet,\n\t\t\t\tOptional: true,\n\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t\"multi_lb_app\": {\n\n\t\t\t\tType: schema.TypeBool,\n\t\t\t\tOptional: true,\n\t\t\t},\n\n\t\t\t\"single_lb_app\": {\n\n\t\t\t\tType: schema.TypeSet,\n\t\t\t\tOptional: true,\n\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\"disable_discovery\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"enable_discovery\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"disable_learn_from_redirect_traffic\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"enable_learn_from_redirect_traffic\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"sensitive_data_detection_rules\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"custom_sensitive_data_detection_rules\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"metadata\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"description\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"disable\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"sensitive_data_detection_config\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"any_domain\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"specific_domain\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"key_pattern\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"exact_value\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"regex_value\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"key_value_pattern\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"key_pattern\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"exact_value\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"regex_value\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"value_pattern\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"exact_value\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"regex_value\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"value_pattern\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"exact_value\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"regex_value\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"all_request_sections\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"all_response_sections\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"all_sections\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"custom_sections\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"custom_sections\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tRequired: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"any_target\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"api_endpoint_target\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"api_endpoint_path\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"methods\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tRequired: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"api_group\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"base_path\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"sensitive_data_type\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"type\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"disabled_built_in_rules\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"disable_ddos_detection\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"enable_ddos_detection\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"disable_auto_mitigation\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"enable_auto_mitigation\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"disable_malicious_user_detection\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"enable_malicious_user_detection\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t\"more_option\": {\n\n\t\t\t\tType: schema.TypeSet,\n\t\t\t\tOptional: true,\n\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\"buffer_policy\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"disabled\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"max_request_bytes\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"max_request_time\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"compression_params\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"content_length\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"content_type\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"disable_on_etag_header\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"remove_accept_encoding_header\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"cookies_to_modify\": {\n\n\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"disable_tampering_protection\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"enable_tampering_protection\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"add_httponly\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"ignore_httponly\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"ignore_max_age\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"max_age_value\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"ignore_samesite\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"samesite_lax\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"samesite_none\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"samesite_strict\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"add_secure\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"ignore_secure\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"custom_errors\": {\n\t\t\t\t\t\t\tType: schema.TypeMap,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"disable_default_error_pages\": {\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"idle_timeout\": {\n\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"javascript_info\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"cache_prefix\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"custom_script_url\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"script_config\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"jwt\": {\n\n\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"max_request_header_size\": {\n\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"disable_path_normalize\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"enable_path_normalize\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"request_headers_to_add\": {\n\n\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"append\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"secret_value\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"blindfold_secret_info_internal\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"decryption_provider\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"location\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"store_provider\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"secret_encoding_type\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"blindfold_secret_info\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"decryption_provider\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"location\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"store_provider\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"clear_secret_info\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"provider\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"url\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"vault_secret_info\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"key\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"location\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"provider\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"secret_encoding\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"version\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"wingman_secret_info\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"value\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"request_headers_to_remove\": {\n\n\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"response_headers_to_add\": {\n\n\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"append\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"secret_value\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"blindfold_secret_info_internal\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"decryption_provider\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"location\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"store_provider\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"secret_encoding_type\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"blindfold_secret_info\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"decryption_provider\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"location\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"store_provider\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"clear_secret_info\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"provider\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"url\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"vault_secret_info\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"key\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"location\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"provider\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"secret_encoding\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"version\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"wingman_secret_info\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"value\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"response_headers_to_remove\": {\n\n\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"additional_domains\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"domains\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\tRequired: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"enable_strict_sni_host_header_check\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t\"default_pool\": {\n\n\t\t\t\tType: schema.TypeSet,\n\t\t\t\tOptional: true,\n\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\"advanced_options\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"circuit_breaker\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"default_circuit_breaker\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"disable_circuit_breaker\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"connection_timeout\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"header_transformation_type\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"default_header_transformation\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"proper_case_header_transformation\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"http_idle_timeout\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"auto_http_config\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"http1_config\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"http2_options\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"disable_outlier_detection\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"outlier_detection\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"no_panic_threshold\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"panic_threshold\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"disable_subsets\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"enable_subsets\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"endpoint_subsets\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"any_endpoint\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"default_subset\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"default_subset\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeMap,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"fail_request\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"endpoint_selection\": {\n\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"health_check_port\": {\n\n\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"same_as_endpoint_port\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"healthcheck\": {\n\n\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"loadbalancer_algorithm\": {\n\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"origin_servers\": {\n\n\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"consul_service\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"inside_network\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"outside_network\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"service_name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"site_locator\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"site\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"kind\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tComputed: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"virtual_site\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"kind\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tComputed: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"custom_endpoint_object\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"endpoint\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"k8s_service\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"inside_network\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"outside_network\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"vk8s_networks\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"service_name\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"service_selector\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"expressions\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tRequired: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"site_locator\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"site\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"kind\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tComputed: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"virtual_site\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"kind\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tComputed: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"private_ip\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"inside_network\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"outside_network\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"ip\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"ipv6\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"site_locator\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"site\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"kind\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tComputed: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"virtual_site\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"kind\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tComputed: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"private_name\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"dns_name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"inside_network\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"outside_network\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"site_locator\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"site\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"kind\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tComputed: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"virtual_site\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"kind\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tComputed: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"public_ip\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"ip\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"ipv6\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"public_name\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"dns_name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"vn_private_ip\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"virtual_network\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"ip\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"ipv6\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"vn_private_name\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"dns_name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"private_network\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"labels\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeMap,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"automatic_port\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"lb_port\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"port\": {\n\n\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"no_tls\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"use_tls\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"no_mtls\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"use_mtls\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"tls_certificates\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"certificate_url\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"description\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"custom_hash_algorithms\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"hash_algorithms\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tRequired: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"disable_ocsp_stapling\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"use_system_defaults\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"private_key\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"blindfold_secret_info_internal\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"decryption_provider\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"location\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"store_provider\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"secret_encoding_type\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"blindfold_secret_info\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"decryption_provider\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"location\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"store_provider\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"clear_secret_info\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"provider\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"url\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"vault_secret_info\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"key\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"location\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"provider\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"secret_encoding\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"version\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"wingman_secret_info\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"use_mtls_obj\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"skip_server_verification\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"use_server_verification\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"trusted_ca\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"trusted_ca_url\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"volterra_trusted_ca\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"disable_sni\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"sni\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"use_host_header_as_sni\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"tls_config\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"custom_security\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"cipher_suites\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tRequired: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"max_version\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"min_version\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"default_security\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"low_security\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"medium_security\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"view_internal\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t\"default_pool_list\": {\n\n\t\t\t\tType: schema.TypeSet,\n\t\t\t\tOptional: true,\n\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\"pools\": {\n\n\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"endpoint_subsets\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeMap,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"cluster\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"kind\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tComputed: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"pool\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"kind\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tComputed: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"priority\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"weight\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t\"origin_server_subset_rule_list\": {\n\n\t\t\t\tType: schema.TypeSet,\n\t\t\t\tOptional: true,\n\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\"origin_server_subset_rules\": {\n\n\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"any_asn\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"asn_list\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"as_numbers\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tRequired: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"asn_matcher\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"asn_sets\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"kind\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tComputed: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"body_matcher\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"exact_values\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"regex_values\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"transformers\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"country_codes\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"any_ip\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"ip_matcher\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"invert_matcher\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"prefix_sets\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"kind\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tComputed: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"ip_prefix_list\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"invert_match\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"ip_prefixes\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"ipv6_prefixes\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"metadata\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"description\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"disable\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"origin_server_subsets_action\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeMap,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"re_name_list\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"client_selector\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"expressions\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tRequired: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"none\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t\"protected_cookies\": {\n\n\t\t\t\tType: schema.TypeList,\n\t\t\t\tOptional: true,\n\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\"disable_tampering_protection\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"enable_tampering_protection\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"add_httponly\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"ignore_httponly\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"ignore_max_age\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"max_age_value\": {\n\n\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"ignore_samesite\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"samesite_lax\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"samesite_none\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"samesite_strict\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"add_secure\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"ignore_secure\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t\"api_rate_limit\": {\n\n\t\t\t\tType: schema.TypeSet,\n\t\t\t\tOptional: true,\n\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\"api_endpoint_rules\": {\n\n\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"api_endpoint_method\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"invert_matcher\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"methods\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"api_endpoint_path\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"base_path\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"any_domain\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"specific_domain\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"inline_rate_limiter\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"ref_user_id\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"use_http_lb_user_id\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"threshold\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"unit\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"ref_rate_limiter\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"custom_ip_allowed_list\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"rate_limiter_allowed_prefixes\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"ip_allowed_list\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"ipv6_prefixes\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"prefixes\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"no_ip_allowed_list\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"server_url_rules\": {\n\n\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"base_path\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"any_domain\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"specific_domain\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"inline_rate_limiter\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"ref_user_id\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"use_http_lb_user_id\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"threshold\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"unit\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"ref_rate_limiter\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t\"disable_rate_limit\": {\n\n\t\t\t\tType: schema.TypeBool,\n\t\t\t\tOptional: true,\n\t\t\t},\n\n\t\t\t\"rate_limit\": {\n\n\t\t\t\tType: schema.TypeSet,\n\t\t\t\tOptional: true,\n\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\"custom_ip_allowed_list\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"rate_limiter_allowed_prefixes\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"ip_allowed_list\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"ipv6_prefixes\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"prefixes\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"no_ip_allowed_list\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"no_policies\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"policies\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"policies\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"rate_limiter\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"burst_multiplier\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"total_number\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"unit\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t\"routes\": {\n\n\t\t\t\tType: schema.TypeList,\n\t\t\t\tOptional: true,\n\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\"custom_route_object\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"route_ref\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"direct_response_route\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"headers\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"invert_match\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"exact\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"presence\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"regex\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"http_method\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"incoming_port\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"no_port_match\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"port\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"port_ranges\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"path\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"path\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"prefix\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"regex\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"route_direct_response\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"response_body\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"response_code\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"redirect_route\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"headers\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"invert_match\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"exact\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"presence\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"regex\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"http_method\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"incoming_port\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"no_port_match\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"port\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"port_ranges\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"path\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"path\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"prefix\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"regex\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"route_redirect\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"host_redirect\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"port_redirect\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"proto_redirect\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"all_params\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"remove_all_params\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"replace_params\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"retain_all_params\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"strip_query_params\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"query_params\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"path_redirect\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"prefix_rewrite\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"response_code\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"simple_route\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"advanced_options\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"bot_defense_javascript_injection\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"javascript_location\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"javascript_tags\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"javascript_url\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"tag_attributes\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"javascript_tag\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"tag_value\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"inherited_bot_defense_javascript_injection\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"buffer_policy\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"disabled\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"max_request_bytes\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"max_request_time\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"common_buffering\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"do_not_retract_cluster\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"retract_cluster\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"cors_policy\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"allow_credentials\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"allow_headers\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"allow_methods\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"allow_origin\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"allow_origin_regex\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"disabled\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"expose_headers\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"max_age\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"maximum_age\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"disable_location_add\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"endpoint_subsets\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeMap,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"common_hash_policy\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"specific_hash_policy\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"hash_policy\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"cookie\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"add_httponly\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"ignore_httponly\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"path\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"ignore_samesite\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"samesite_lax\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"samesite_none\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"samesite_strict\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"add_secure\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"ignore_secure\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"ttl\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"header_name\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"source_ip\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"terminal\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"disable_mirroring\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"mirror_policy\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"origin_pool\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"percent\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"denominator\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"numerator\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"priority\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"request_headers_to_add\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"append\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"secret_value\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"blindfold_secret_info_internal\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"decryption_provider\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"location\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"store_provider\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"secret_encoding_type\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"blindfold_secret_info\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"decryption_provider\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"location\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"store_provider\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"clear_secret_info\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"provider\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"url\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"vault_secret_info\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"key\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"location\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"provider\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"secret_encoding\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"version\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"wingman_secret_info\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"value\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"request_headers_to_remove\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"response_headers_to_add\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"append\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"secret_value\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"blindfold_secret_info_internal\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"decryption_provider\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"location\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"store_provider\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"secret_encoding_type\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"blindfold_secret_info\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"decryption_provider\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"location\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"store_provider\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"clear_secret_info\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"provider\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"url\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"vault_secret_info\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"key\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"location\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"provider\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"secret_encoding\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"version\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"wingman_secret_info\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"value\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"response_headers_to_remove\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"default_retry_policy\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"retry_policy\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"back_off\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"base_interval\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"max_interval\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"num_retries\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"per_try_timeout\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"retriable_status_codes\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"retry_condition\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"retry_on\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"disable_prefix_rewrite\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"prefix_rewrite\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"disable_spdy\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"enable_spdy\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"timeout\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"app_firewall\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"disable_waf\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"inherited_waf\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"disable_web_socket_config\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"web_socket_config\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"idle_timeout\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"max_connect_attempts\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"use_websocket\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"headers\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"invert_match\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"exact\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"presence\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"regex\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"auto_host_rewrite\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"disable_host_rewrite\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"host_rewrite\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"http_method\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"incoming_port\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"no_port_match\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"port\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"port_ranges\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"origin_pools\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"endpoint_subsets\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeMap,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"cluster\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"kind\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tComputed: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"pool\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"kind\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tComputed: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"priority\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"weight\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"path\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"path\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"prefix\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"regex\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t\"active_service_policies\": {\n\n\t\t\t\tType: schema.TypeSet,\n\t\t\t\tOptional: true,\n\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\"policies\": {\n\n\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t\"no_service_policies\": {\n\n\t\t\t\tType: schema.TypeBool,\n\t\t\t\tOptional: true,\n\t\t\t},\n\n\t\t\t\"service_policies_from_namespace\": {\n\n\t\t\t\tType: schema.TypeBool,\n\t\t\t\tOptional: true,\n\t\t\t},\n\n\t\t\t\"slow_ddos_mitigation\": {\n\n\t\t\t\tType: schema.TypeSet,\n\t\t\t\tOptional: true,\n\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\"request_headers_timeout\": {\n\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"request_timeout\": {\n\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t\"system_default_timeouts\": {\n\n\t\t\t\tType: schema.TypeBool,\n\t\t\t\tOptional: true,\n\t\t\t},\n\n\t\t\t\"disable_trust_client_ip_headers\": {\n\n\t\t\t\tType: schema.TypeBool,\n\t\t\t\tOptional: true,\n\t\t\t},\n\n\t\t\t\"enable_trust_client_ip_headers\": {\n\n\t\t\t\tType: schema.TypeSet,\n\t\t\t\tOptional: true,\n\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\"client_ip_headers\": {\n\n\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t\"trusted_clients\": {\n\n\t\t\t\tType: schema.TypeList,\n\t\t\t\tOptional: true,\n\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\"bot_skip_processing\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"skip_processing\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"waf_skip_processing\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"actions\": {\n\n\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"as_number\": {\n\n\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"http_header\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"headers\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"invert_match\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"exact\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"presence\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"regex\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"ip_prefix\": {\n\n\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"user_identifier\": {\n\n\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"expiration_timestamp\": {\n\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"metadata\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"description\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"disable\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t\"user_id_client_ip\": {\n\n\t\t\t\tType: schema.TypeBool,\n\t\t\t\tOptional: true,\n\t\t\t},\n\n\t\t\t\"user_identification\": {\n\n\t\t\t\tType: schema.TypeSet,\n\t\t\t\tOptional: true,\n\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t\"app_firewall\": {\n\n\t\t\t\tType: schema.TypeSet,\n\t\t\t\tOptional: true,\n\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t\"disable_waf\": {\n\n\t\t\t\tType: schema.TypeBool,\n\t\t\t\tOptional: true,\n\t\t\t},\n\n\t\t\t\"waf_exclusion_rules\": {\n\n\t\t\t\tType: schema.TypeList,\n\t\t\t\tOptional: true,\n\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\"any_domain\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"exact_value\": {\n\n\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"suffix_value\": {\n\n\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"expiration_timestamp\": {\n\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"metadata\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"description\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"disable\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"methods\": {\n\n\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"any_path\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"path_prefix\": {\n\n\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"path_regex\": {\n\n\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"app_firewall_detection_control\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"exclude_attack_type_contexts\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"exclude_attack_type\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"exclude_bot_name_contexts\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"bot_name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"exclude_signature_contexts\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"context\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"context_name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"signature_id\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"exclude_violation_contexts\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"context\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"context_name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"exclude_violation\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"waf_skip_processing\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n}",
"func resourceVolterraSecuremeshSite() *schema.Resource {\n\treturn &schema.Resource{\n\t\tCreate: resourceVolterraSecuremeshSiteCreate,\n\t\tRead: resourceVolterraSecuremeshSiteRead,\n\t\tUpdate: resourceVolterraSecuremeshSiteUpdate,\n\t\tDelete: resourceVolterraSecuremeshSiteDelete,\n\n\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\"annotations\": {\n\t\t\t\tType: schema.TypeMap,\n\t\t\t\tOptional: true,\n\t\t\t},\n\n\t\t\t\"description\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tOptional: true,\n\t\t\t},\n\n\t\t\t\"disable\": {\n\t\t\t\tType: schema.TypeBool,\n\t\t\t\tOptional: true,\n\t\t\t},\n\n\t\t\t\"labels\": {\n\t\t\t\tType: schema.TypeMap,\n\t\t\t\tOptional: true,\n\t\t\t},\n\n\t\t\t\"name\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tRequired: true,\n\t\t\t\tForceNew: true,\n\t\t\t},\n\n\t\t\t\"namespace\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tRequired: true,\n\t\t\t\tForceNew: true,\n\t\t\t},\n\n\t\t\t\"address\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tOptional: true,\n\t\t\t},\n\n\t\t\t\"blocked_services\": {\n\n\t\t\t\tType: schema.TypeSet,\n\t\t\t\tOptional: true,\n\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\"blocked_sevice\": {\n\n\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"dns\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"ssh\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"web_user_interface\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"network_type\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t\"default_blocked_services\": {\n\n\t\t\t\tType: schema.TypeBool,\n\t\t\t\tOptional: true,\n\t\t\t},\n\n\t\t\t\"bond_device_list\": {\n\n\t\t\t\tType: schema.TypeSet,\n\t\t\t\tOptional: true,\n\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\"bond_devices\": {\n\n\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"devices\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\tRequired: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"active_backup\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"lacp\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"rate\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"link_polling_interval\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"link_up_delay\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t\"no_bond_devices\": {\n\n\t\t\t\tType: schema.TypeBool,\n\t\t\t\tOptional: true,\n\t\t\t},\n\n\t\t\t\"coordinates\": {\n\n\t\t\t\tType: schema.TypeSet,\n\t\t\t\tOptional: true,\n\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\"latitude\": {\n\t\t\t\t\t\t\tType: schema.TypeFloat,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"longitude\": {\n\t\t\t\t\t\t\tType: schema.TypeFloat,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t\"log_receiver\": {\n\n\t\t\t\tType: schema.TypeSet,\n\t\t\t\tOptional: true,\n\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t\"logs_streaming_disabled\": {\n\n\t\t\t\tType: schema.TypeBool,\n\t\t\t\tOptional: true,\n\t\t\t},\n\n\t\t\t\"master_node_configuration\": {\n\n\t\t\t\tType: schema.TypeList,\n\t\t\t\tOptional: true,\n\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"public_ip\": {\n\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t\"custom_network_config\": {\n\n\t\t\t\tType: schema.TypeSet,\n\t\t\t\tOptional: true,\n\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\"bgp_peer_address\": {\n\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"bgp_router_id\": {\n\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"active_forward_proxy_policies\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"forward_proxy_policies\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"forward_proxy_allow_all\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"no_forward_proxy\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"global_network_list\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"global_network_connections\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"sli_to_global_dr\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"global_vn\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"kind\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tComputed: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"slo_to_global_dr\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"global_vn\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"kind\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tComputed: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"disable_forward_proxy\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"enable_forward_proxy\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"connection_timeout\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"max_connect_attempts\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"no_interception\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"tls_intercept\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"enable_for_all_domains\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"policy\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"interception_rules\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"domain_match\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"exact_value\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"regex_value\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"suffix_value\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"disable_interception\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"enable_interception\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"custom_certificate\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"certificate_url\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"description\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"custom_hash_algorithms\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"hash_algorithms\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tRequired: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"disable_ocsp_stapling\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"use_system_defaults\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"private_key\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"blindfold_secret_info_internal\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"decryption_provider\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"location\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"store_provider\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"secret_encoding_type\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"blindfold_secret_info\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"decryption_provider\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"location\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"store_provider\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"clear_secret_info\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"provider\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"url\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"vault_secret_info\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"key\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"location\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"provider\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"secret_encoding\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"version\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"wingman_secret_info\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"volterra_certificate\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"trusted_ca_url\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"volterra_trusted_ca\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"white_listed_ports\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"white_listed_prefixes\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"no_global_network\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"default_interface_config\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"interface_list\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"interfaces\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"dc_cluster_group_connectivity_interface_disabled\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"dc_cluster_group_connectivity_interface_enabled\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"description\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"dedicated_interface\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"device\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"monitor\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"monitor_disabled\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"mtu\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"cluster\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"node\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"is_primary\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"not_primary\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"priority\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"dedicated_management_interface\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"device\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"mtu\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"cluster\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"node\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"ethernet_interface\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"dhcp_client\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"dhcp_server\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"dhcp_networks\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"dns_address\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"same_as_dgw\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"dgw_address\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"first_address\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"last_address\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"network_prefix\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"network_prefix_allocator\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"pool_settings\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"pools\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"end_ip\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"exclude\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"start_ip\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"dhcp_option82_tag\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"fixed_ip_map\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeMap,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"automatic_from_end\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"automatic_from_start\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"interface_ip_map\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"interface_ip_map\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeMap,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"static_ip\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"cluster_static_ip\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"interface_ip_map\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tRequired: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"value\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tRequired: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"default_gw\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"dns_server\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"ip_address\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"fleet_static_ip\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"default_gw\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"dns_server\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"network_prefix_allocator\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"node_static_ip\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"default_gw\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"dns_server\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"ip_address\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"device\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"ipv6_auto_config\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"host\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"router\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"network_prefix\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"stateful\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"dhcp_networks\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"network_prefix\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"network_prefix_allocator\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"pools\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"end_ip\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"exclude\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"start_ip\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"fixed_ip_map\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeMap,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"automatic_from_end\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"automatic_from_start\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"interface_ip_map\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"interface_ip_map\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeMap,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"dns_config\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"configured_list\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"dns_list\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tRequired: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"local_dns\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"configured_address\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"first_address\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"last_address\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"no_ipv6_address\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"static_ipv6_address\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"cluster_static_ip\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"interface_ip_map\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tRequired: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"value\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tRequired: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"default_gw\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"dns_server\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"ip_address\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"fleet_static_ip\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"default_gw\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"dns_server\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"network_prefix_allocator\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"node_static_ip\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"default_gw\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"dns_server\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"ip_address\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"monitor\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"monitor_disabled\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"mtu\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"inside_network\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"ip_fabric_network\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"site_local_inside_network\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"site_local_network\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"srv6_network\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"storage_network\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"cluster\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"node\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"is_primary\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"not_primary\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"priority\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"untagged\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"vlan_id\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"loopback_interface\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"dhcp_client\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"dhcp_server\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"dhcp_networks\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"dns_address\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"same_as_dgw\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"dgw_address\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"first_address\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"last_address\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"network_prefix\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"network_prefix_allocator\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"pool_settings\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"pools\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"end_ip\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"exclude\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"start_ip\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"dhcp_option82_tag\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"fixed_ip_map\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeMap,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"automatic_from_end\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"automatic_from_start\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"interface_ip_map\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"interface_ip_map\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeMap,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"static_ip\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"cluster_static_ip\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"interface_ip_map\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tRequired: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"value\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tRequired: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"default_gw\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"dns_server\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"ip_address\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"fleet_static_ip\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"default_gw\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"dns_server\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"network_prefix_allocator\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"node_static_ip\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"default_gw\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"dns_server\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"ip_address\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"device\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"no_ipv6_address\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"static_ipv6_address\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"cluster_static_ip\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"interface_ip_map\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tRequired: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"value\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tRequired: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"default_gw\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"dns_server\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"ip_address\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"fleet_static_ip\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"default_gw\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"dns_server\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"network_prefix_allocator\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"node_static_ip\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"default_gw\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"dns_server\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"ip_address\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"mtu\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"ip_fabric_network\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"site_local_inside_network\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"site_local_network\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"cluster\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"node\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"labels\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeMap,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"active_enhanced_firewall_policies\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"enhanced_firewall_policies\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"active_network_policies\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"network_policies\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"no_network_policy\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"sm_connection_public_ip\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"sm_connection_pvt_ip\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"default_sli_config\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"sli_config\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"dc_cluster_group\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"no_dc_cluster_group\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"dc_cluster_group_interface\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"labels\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeMap,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"nameserver\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"no_static_routes\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"static_routes\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"static_routes\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"attrs\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"ip_prefixes\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tRequired: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"default_gateway\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"interface\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"ip_address\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"no_v6_static_routes\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"static_v6_routes\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"static_routes\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"attrs\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"ip_prefixes\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tRequired: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"default_gateway\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"interface\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"ip_address\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"vip\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"default_config\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"slo_config\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"dc_cluster_group\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"no_dc_cluster_group\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"dc_cluster_group_interface\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"labels\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeMap,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"nameserver\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"no_static_routes\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"static_routes\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"static_routes\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"attrs\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"ip_prefixes\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tRequired: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"default_gateway\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"interface\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"ip_address\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"no_v6_static_routes\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"static_v6_routes\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"static_routes\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"attrs\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"ip_prefixes\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tRequired: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"default_gateway\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"interface\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"ip_address\": {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"vip\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"tunnel_dead_timeout\": {\n\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"vip_vrrp_mode\": {\n\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t\"default_network_config\": {\n\n\t\t\t\tType: schema.TypeBool,\n\t\t\t\tOptional: true,\n\t\t\t},\n\n\t\t\t\"offline_survivability_mode\": {\n\n\t\t\t\tType: schema.TypeSet,\n\t\t\t\tOptional: true,\n\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\"enable_offline_survivability_mode\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"no_offline_survivability_mode\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t\"os\": {\n\n\t\t\t\tType: schema.TypeSet,\n\t\t\t\tOptional: true,\n\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\"default_os_version\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"operating_system_version\": {\n\n\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t\"performance_enhancement_mode\": {\n\n\t\t\t\tType: schema.TypeSet,\n\t\t\t\tOptional: true,\n\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\"perf_mode_l3_enhanced\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"jumbo\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"no_jumbo\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"perf_mode_l7_enhanced\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t\"sw\": {\n\n\t\t\t\tType: schema.TypeSet,\n\t\t\t\tOptional: true,\n\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\"default_sw_version\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"volterra_software_version\": {\n\n\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t\"volterra_certified_hw\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tRequired: true,\n\t\t\t},\n\n\t\t\t\"worker_nodes\": {\n\n\t\t\t\tType: schema.TypeList,\n\n\t\t\t\tOptional: true,\n\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n}",
"func resourceVolterraRouteCreate(d *schema.ResourceData, meta interface{}) error {\n\tclient := meta.(*APIClient)\n\n\tcreateMeta := &ves_io_schema.ObjectCreateMetaType{}\n\tcreateSpec := &ves_io_schema_route.CreateSpecType{}\n\tcreateReq := &ves_io_schema_route.CreateRequest{\n\t\tMetadata: createMeta,\n\t\tSpec: createSpec,\n\t}\n\n\tif v, ok := d.GetOk(\"annotations\"); ok && !isIntfNil(v) {\n\n\t\tms := map[string]string{}\n\n\t\tfor k, v := range v.(map[string]interface{}) {\n\t\t\tval := v.(string)\n\t\t\tms[k] = val\n\t\t}\n\t\tcreateMeta.Annotations = ms\n\t}\n\n\tif v, ok := d.GetOk(\"description\"); ok && !isIntfNil(v) {\n\t\tcreateMeta.Description =\n\t\t\tv.(string)\n\t}\n\n\tif v, ok := d.GetOk(\"disable\"); ok && !isIntfNil(v) {\n\t\tcreateMeta.Disable =\n\t\t\tv.(bool)\n\t}\n\n\tif v, ok := d.GetOk(\"labels\"); ok && !isIntfNil(v) {\n\n\t\tms := map[string]string{}\n\n\t\tfor k, v := range v.(map[string]interface{}) {\n\t\t\tval := v.(string)\n\t\t\tms[k] = val\n\t\t}\n\t\tcreateMeta.Labels = ms\n\t}\n\n\tif v, ok := d.GetOk(\"name\"); ok && !isIntfNil(v) {\n\t\tcreateMeta.Name =\n\t\t\tv.(string)\n\t}\n\n\tif v, ok := d.GetOk(\"namespace\"); ok && !isIntfNil(v) {\n\t\tcreateMeta.Namespace =\n\t\t\tv.(string)\n\t}\n\n\t//routes\n\tif v, ok := d.GetOk(\"routes\"); ok && !isIntfNil(v) {\n\n\t\tsl := v.([]interface{})\n\t\troutes := make([]*ves_io_schema_route.RouteType, len(sl))\n\t\tcreateSpec.Routes = routes\n\t\tfor i, set := range sl {\n\t\t\troutes[i] = &ves_io_schema_route.RouteType{}\n\t\t\troutesMapStrToI := set.(map[string]interface{})\n\n\t\t\tbotDefenseJavascriptInjectionChoiceTypeFound := false\n\n\t\t\tif v, ok := routesMapStrToI[\"bot_defense_javascript_injection\"]; ok && !isIntfNil(v) && !botDefenseJavascriptInjectionChoiceTypeFound {\n\n\t\t\t\tbotDefenseJavascriptInjectionChoiceTypeFound = true\n\t\t\t\tbotDefenseJavascriptInjectionChoiceInt := &ves_io_schema_route.RouteType_BotDefenseJavascriptInjection{}\n\t\t\t\tbotDefenseJavascriptInjectionChoiceInt.BotDefenseJavascriptInjection = &ves_io_schema_route.BotDefenseJavascriptInjectionType{}\n\t\t\t\troutes[i].BotDefenseJavascriptInjectionChoice = botDefenseJavascriptInjectionChoiceInt\n\n\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\tfor _, set := range sl {\n\t\t\t\t\tcs := set.(map[string]interface{})\n\n\t\t\t\t\tif v, ok := cs[\"javascript_location\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\tbotDefenseJavascriptInjectionChoiceInt.BotDefenseJavascriptInjection.JavascriptLocation = ves_io_schema_route.JavaScriptLocation(ves_io_schema_route.JavaScriptLocation_value[v.(string)])\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := cs[\"javascript_tags\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\tsl := v.([]interface{})\n\t\t\t\t\t\tjavascriptTags := make([]*ves_io_schema_route.JavaScriptTag, len(sl))\n\t\t\t\t\t\tbotDefenseJavascriptInjectionChoiceInt.BotDefenseJavascriptInjection.JavascriptTags = javascriptTags\n\t\t\t\t\t\tfor i, set := range sl {\n\t\t\t\t\t\t\tjavascriptTags[i] = &ves_io_schema_route.JavaScriptTag{}\n\t\t\t\t\t\t\tjavascriptTagsMapStrToI := set.(map[string]interface{})\n\n\t\t\t\t\t\t\tif w, ok := javascriptTagsMapStrToI[\"javascript_url\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\tjavascriptTags[i].JavascriptUrl = w.(string)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif v, ok := javascriptTagsMapStrToI[\"tag_attributes\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\tsl := v.([]interface{})\n\t\t\t\t\t\t\t\ttagAttributes := make([]*ves_io_schema_route.TagAttribute, len(sl))\n\t\t\t\t\t\t\t\tjavascriptTags[i].TagAttributes = tagAttributes\n\t\t\t\t\t\t\t\tfor i, set := range sl {\n\t\t\t\t\t\t\t\t\ttagAttributes[i] = &ves_io_schema_route.TagAttribute{}\n\t\t\t\t\t\t\t\t\ttagAttributesMapStrToI := set.(map[string]interface{})\n\n\t\t\t\t\t\t\t\t\tif v, ok := tagAttributesMapStrToI[\"javascript_tag\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\t\t\ttagAttributes[i].JavascriptTag = ves_io_schema_route.TagAttributeName(ves_io_schema_route.TagAttributeName_value[v.(string)])\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif w, ok := tagAttributesMapStrToI[\"tag_value\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\t\t\ttagAttributes[i].TagValue = w.(string)\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif v, ok := routesMapStrToI[\"inherited_bot_defense_javascript_injection\"]; ok && !isIntfNil(v) && !botDefenseJavascriptInjectionChoiceTypeFound {\n\n\t\t\t\tbotDefenseJavascriptInjectionChoiceTypeFound = true\n\n\t\t\t\tif v.(bool) {\n\t\t\t\t\tbotDefenseJavascriptInjectionChoiceInt := &ves_io_schema_route.RouteType_InheritedBotDefenseJavascriptInjection{}\n\t\t\t\t\tbotDefenseJavascriptInjectionChoiceInt.InheritedBotDefenseJavascriptInjection = &ves_io_schema.Empty{}\n\t\t\t\t\troutes[i].BotDefenseJavascriptInjectionChoice = botDefenseJavascriptInjectionChoiceInt\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif v, ok := routesMapStrToI[\"bot_defense_javascript_injection_inline_mode\"]; ok && !isIntfNil(v) {\n\n\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\tbotDefenseJavascriptInjectionInlineMode := &ves_io_schema_route.ContentRewriteType{}\n\t\t\t\troutes[i].BotDefenseJavascriptInjectionInlineMode = botDefenseJavascriptInjectionInlineMode\n\t\t\t\tfor _, set := range sl {\n\t\t\t\t\tbotDefenseJavascriptInjectionInlineModeMapStrToI := set.(map[string]interface{})\n\n\t\t\t\t\tif w, ok := botDefenseJavascriptInjectionInlineModeMapStrToI[\"element_selector\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\tbotDefenseJavascriptInjectionInlineMode.ElementSelector = w.(string)\n\t\t\t\t\t}\n\n\t\t\t\t\tif w, ok := botDefenseJavascriptInjectionInlineModeMapStrToI[\"insert_content\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\tbotDefenseJavascriptInjectionInlineMode.InsertContent = w.(string)\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := botDefenseJavascriptInjectionInlineModeMapStrToI[\"position\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\tbotDefenseJavascriptInjectionInlineMode.Position = ves_io_schema_policy.HTMLPosition(ves_io_schema_policy.HTMLPosition_value[v.(string)])\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif w, ok := routesMapStrToI[\"disable_custom_script\"]; ok && !isIntfNil(w) {\n\t\t\t\troutes[i].DisableCustomScript = w.(bool)\n\t\t\t}\n\n\t\t\tif w, ok := routesMapStrToI[\"disable_location_add\"]; ok && !isIntfNil(w) {\n\t\t\t\troutes[i].DisableLocationAdd = w.(bool)\n\t\t\t}\n\n\t\t\tif v, ok := routesMapStrToI[\"match\"]; ok && !isIntfNil(v) {\n\n\t\t\t\tsl := v.([]interface{})\n\t\t\t\tmatch := make([]*ves_io_schema.RouteMatch, len(sl))\n\t\t\t\troutes[i].Match = match\n\t\t\t\tfor i, set := range sl {\n\t\t\t\t\tmatch[i] = &ves_io_schema.RouteMatch{}\n\t\t\t\t\tmatchMapStrToI := set.(map[string]interface{})\n\n\t\t\t\t\tif v, ok := matchMapStrToI[\"headers\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\tsl := v.([]interface{})\n\t\t\t\t\t\theaders := make([]*ves_io_schema.HeaderMatcherType, len(sl))\n\t\t\t\t\t\tmatch[i].Headers = headers\n\t\t\t\t\t\tfor i, set := range sl {\n\t\t\t\t\t\t\theaders[i] = &ves_io_schema.HeaderMatcherType{}\n\t\t\t\t\t\t\theadersMapStrToI := set.(map[string]interface{})\n\n\t\t\t\t\t\t\tif w, ok := headersMapStrToI[\"invert_match\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\theaders[i].InvertMatch = w.(bool)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif w, ok := headersMapStrToI[\"name\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\theaders[i].Name = w.(string)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tvalueMatchTypeFound := false\n\n\t\t\t\t\t\t\tif v, ok := headersMapStrToI[\"exact\"]; ok && !isIntfNil(v) && !valueMatchTypeFound {\n\n\t\t\t\t\t\t\t\tvalueMatchTypeFound = true\n\t\t\t\t\t\t\t\tvalueMatchInt := &ves_io_schema.HeaderMatcherType_Exact{}\n\n\t\t\t\t\t\t\t\theaders[i].ValueMatch = valueMatchInt\n\n\t\t\t\t\t\t\t\tvalueMatchInt.Exact = v.(string)\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif v, ok := headersMapStrToI[\"presence\"]; ok && !isIntfNil(v) && !valueMatchTypeFound {\n\n\t\t\t\t\t\t\t\tvalueMatchTypeFound = true\n\t\t\t\t\t\t\t\tvalueMatchInt := &ves_io_schema.HeaderMatcherType_Presence{}\n\n\t\t\t\t\t\t\t\theaders[i].ValueMatch = valueMatchInt\n\n\t\t\t\t\t\t\t\tvalueMatchInt.Presence = v.(bool)\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif v, ok := headersMapStrToI[\"regex\"]; ok && !isIntfNil(v) && !valueMatchTypeFound {\n\n\t\t\t\t\t\t\t\tvalueMatchTypeFound = true\n\t\t\t\t\t\t\t\tvalueMatchInt := &ves_io_schema.HeaderMatcherType_Regex{}\n\n\t\t\t\t\t\t\t\theaders[i].ValueMatch = valueMatchInt\n\n\t\t\t\t\t\t\t\tvalueMatchInt.Regex = v.(string)\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := matchMapStrToI[\"http_method\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\tmatch[i].HttpMethod = ves_io_schema.HttpMethod(ves_io_schema.HttpMethod_value[v.(string)])\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := matchMapStrToI[\"incoming_port\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\t\t\tincomingPort := &ves_io_schema.PortMatcherType{}\n\t\t\t\t\t\tmatch[i].IncomingPort = incomingPort\n\t\t\t\t\t\tfor _, set := range sl {\n\t\t\t\t\t\t\tincomingPortMapStrToI := set.(map[string]interface{})\n\n\t\t\t\t\t\t\tportMatchTypeFound := false\n\n\t\t\t\t\t\t\tif v, ok := incomingPortMapStrToI[\"no_port_match\"]; ok && !isIntfNil(v) && !portMatchTypeFound {\n\n\t\t\t\t\t\t\t\tportMatchTypeFound = true\n\n\t\t\t\t\t\t\t\tif v.(bool) {\n\t\t\t\t\t\t\t\t\tportMatchInt := &ves_io_schema.PortMatcherType_NoPortMatch{}\n\t\t\t\t\t\t\t\t\tportMatchInt.NoPortMatch = &ves_io_schema.Empty{}\n\t\t\t\t\t\t\t\t\tincomingPort.PortMatch = portMatchInt\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif v, ok := incomingPortMapStrToI[\"port\"]; ok && !isIntfNil(v) && !portMatchTypeFound {\n\n\t\t\t\t\t\t\t\tportMatchTypeFound = true\n\t\t\t\t\t\t\t\tportMatchInt := &ves_io_schema.PortMatcherType_Port{}\n\n\t\t\t\t\t\t\t\tincomingPort.PortMatch = portMatchInt\n\n\t\t\t\t\t\t\t\tportMatchInt.Port = uint32(v.(int))\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif v, ok := incomingPortMapStrToI[\"port_ranges\"]; ok && !isIntfNil(v) && !portMatchTypeFound {\n\n\t\t\t\t\t\t\t\tportMatchTypeFound = true\n\t\t\t\t\t\t\t\tportMatchInt := &ves_io_schema.PortMatcherType_PortRanges{}\n\n\t\t\t\t\t\t\t\tincomingPort.PortMatch = portMatchInt\n\n\t\t\t\t\t\t\t\tportMatchInt.PortRanges = v.(string)\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := matchMapStrToI[\"path\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\t\t\tpath := &ves_io_schema.PathMatcherType{}\n\t\t\t\t\t\tmatch[i].Path = path\n\t\t\t\t\t\tfor _, set := range sl {\n\t\t\t\t\t\t\tpathMapStrToI := set.(map[string]interface{})\n\n\t\t\t\t\t\t\tpathMatchTypeFound := false\n\n\t\t\t\t\t\t\tif v, ok := pathMapStrToI[\"path\"]; ok && !isIntfNil(v) && !pathMatchTypeFound {\n\n\t\t\t\t\t\t\t\tpathMatchTypeFound = true\n\t\t\t\t\t\t\t\tpathMatchInt := &ves_io_schema.PathMatcherType_Path{}\n\n\t\t\t\t\t\t\t\tpath.PathMatch = pathMatchInt\n\n\t\t\t\t\t\t\t\tpathMatchInt.Path = v.(string)\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif v, ok := pathMapStrToI[\"prefix\"]; ok && !isIntfNil(v) && !pathMatchTypeFound {\n\n\t\t\t\t\t\t\t\tpathMatchTypeFound = true\n\t\t\t\t\t\t\t\tpathMatchInt := &ves_io_schema.PathMatcherType_Prefix{}\n\n\t\t\t\t\t\t\t\tpath.PathMatch = pathMatchInt\n\n\t\t\t\t\t\t\t\tpathMatchInt.Prefix = v.(string)\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif v, ok := pathMapStrToI[\"regex\"]; ok && !isIntfNil(v) && !pathMatchTypeFound {\n\n\t\t\t\t\t\t\t\tpathMatchTypeFound = true\n\t\t\t\t\t\t\t\tpathMatchInt := &ves_io_schema.PathMatcherType_Regex{}\n\n\t\t\t\t\t\t\t\tpath.PathMatch = pathMatchInt\n\n\t\t\t\t\t\t\t\tpathMatchInt.Regex = v.(string)\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := matchMapStrToI[\"query_params\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\tsl := v.([]interface{})\n\t\t\t\t\t\tqueryParams := make([]*ves_io_schema.QueryParameterMatcherType, len(sl))\n\t\t\t\t\t\tmatch[i].QueryParams = queryParams\n\t\t\t\t\t\tfor i, set := range sl {\n\t\t\t\t\t\t\tqueryParams[i] = &ves_io_schema.QueryParameterMatcherType{}\n\t\t\t\t\t\t\tqueryParamsMapStrToI := set.(map[string]interface{})\n\n\t\t\t\t\t\t\tif w, ok := queryParamsMapStrToI[\"key\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\tqueryParams[i].Key = w.(string)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tvalueMatchTypeFound := false\n\n\t\t\t\t\t\t\tif v, ok := queryParamsMapStrToI[\"exact\"]; ok && !isIntfNil(v) && !valueMatchTypeFound {\n\n\t\t\t\t\t\t\t\tvalueMatchTypeFound = true\n\t\t\t\t\t\t\t\tvalueMatchInt := &ves_io_schema.QueryParameterMatcherType_Exact{}\n\n\t\t\t\t\t\t\t\tqueryParams[i].ValueMatch = valueMatchInt\n\n\t\t\t\t\t\t\t\tvalueMatchInt.Exact = v.(string)\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif v, ok := queryParamsMapStrToI[\"regex\"]; ok && !isIntfNil(v) && !valueMatchTypeFound {\n\n\t\t\t\t\t\t\t\tvalueMatchTypeFound = true\n\t\t\t\t\t\t\t\tvalueMatchInt := &ves_io_schema.QueryParameterMatcherType_Regex{}\n\n\t\t\t\t\t\t\t\tqueryParams[i].ValueMatch = valueMatchInt\n\n\t\t\t\t\t\t\t\tvalueMatchInt.Regex = v.(string)\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif v, ok := routesMapStrToI[\"request_headers_to_add\"]; ok && !isIntfNil(v) {\n\n\t\t\t\tsl := v.([]interface{})\n\t\t\t\trequestHeadersToAdd := make([]*ves_io_schema.HeaderManipulationOptionType, len(sl))\n\t\t\t\troutes[i].RequestHeadersToAdd = requestHeadersToAdd\n\t\t\t\tfor i, set := range sl {\n\t\t\t\t\trequestHeadersToAdd[i] = &ves_io_schema.HeaderManipulationOptionType{}\n\t\t\t\t\trequestHeadersToAddMapStrToI := set.(map[string]interface{})\n\n\t\t\t\t\tif w, ok := requestHeadersToAddMapStrToI[\"append\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\trequestHeadersToAdd[i].Append = w.(bool)\n\t\t\t\t\t}\n\n\t\t\t\t\tif w, ok := requestHeadersToAddMapStrToI[\"name\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\trequestHeadersToAdd[i].Name = w.(string)\n\t\t\t\t\t}\n\n\t\t\t\t\tvalueChoiceTypeFound := false\n\n\t\t\t\t\tif v, ok := requestHeadersToAddMapStrToI[\"secret_value\"]; ok && !isIntfNil(v) && !valueChoiceTypeFound {\n\n\t\t\t\t\t\tvalueChoiceTypeFound = true\n\t\t\t\t\t\tvalueChoiceInt := &ves_io_schema.HeaderManipulationOptionType_SecretValue{}\n\t\t\t\t\t\tvalueChoiceInt.SecretValue = &ves_io_schema.SecretType{}\n\t\t\t\t\t\trequestHeadersToAdd[i].ValueChoice = valueChoiceInt\n\n\t\t\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\t\t\tfor _, set := range sl {\n\t\t\t\t\t\t\tcs := set.(map[string]interface{})\n\n\t\t\t\t\t\t\tif v, ok := cs[\"blindfold_secret_info_internal\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\t\t\t\t\tblindfoldSecretInfoInternal := &ves_io_schema.BlindfoldSecretInfoType{}\n\t\t\t\t\t\t\t\tvalueChoiceInt.SecretValue.BlindfoldSecretInfoInternal = blindfoldSecretInfoInternal\n\t\t\t\t\t\t\t\tfor _, set := range sl {\n\t\t\t\t\t\t\t\t\tblindfoldSecretInfoInternalMapStrToI := set.(map[string]interface{})\n\n\t\t\t\t\t\t\t\t\tif w, ok := blindfoldSecretInfoInternalMapStrToI[\"decryption_provider\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\t\t\tblindfoldSecretInfoInternal.DecryptionProvider = w.(string)\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif w, ok := blindfoldSecretInfoInternalMapStrToI[\"location\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\t\t\tblindfoldSecretInfoInternal.Location = w.(string)\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif w, ok := blindfoldSecretInfoInternalMapStrToI[\"store_provider\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\t\t\tblindfoldSecretInfoInternal.StoreProvider = w.(string)\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif v, ok := cs[\"secret_encoding_type\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\tvalueChoiceInt.SecretValue.SecretEncodingType = ves_io_schema.SecretEncodingType(ves_io_schema.SecretEncodingType_value[v.(string)])\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tsecretInfoOneofTypeFound := false\n\n\t\t\t\t\t\t\tif v, ok := cs[\"blindfold_secret_info\"]; ok && !isIntfNil(v) && !secretInfoOneofTypeFound {\n\n\t\t\t\t\t\t\t\tsecretInfoOneofTypeFound = true\n\t\t\t\t\t\t\t\tsecretInfoOneofInt := &ves_io_schema.SecretType_BlindfoldSecretInfo{}\n\t\t\t\t\t\t\t\tsecretInfoOneofInt.BlindfoldSecretInfo = &ves_io_schema.BlindfoldSecretInfoType{}\n\t\t\t\t\t\t\t\tvalueChoiceInt.SecretValue.SecretInfoOneof = secretInfoOneofInt\n\n\t\t\t\t\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\t\t\t\t\tfor _, set := range sl {\n\t\t\t\t\t\t\t\t\tcs := set.(map[string]interface{})\n\n\t\t\t\t\t\t\t\t\tif v, ok := cs[\"decryption_provider\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\t\t\tsecretInfoOneofInt.BlindfoldSecretInfo.DecryptionProvider = v.(string)\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif v, ok := cs[\"location\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\t\t\tsecretInfoOneofInt.BlindfoldSecretInfo.Location = v.(string)\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif v, ok := cs[\"store_provider\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\t\t\tsecretInfoOneofInt.BlindfoldSecretInfo.StoreProvider = v.(string)\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif v, ok := cs[\"clear_secret_info\"]; ok && !isIntfNil(v) && !secretInfoOneofTypeFound {\n\n\t\t\t\t\t\t\t\tsecretInfoOneofTypeFound = true\n\t\t\t\t\t\t\t\tsecretInfoOneofInt := &ves_io_schema.SecretType_ClearSecretInfo{}\n\t\t\t\t\t\t\t\tsecretInfoOneofInt.ClearSecretInfo = &ves_io_schema.ClearSecretInfoType{}\n\t\t\t\t\t\t\t\tvalueChoiceInt.SecretValue.SecretInfoOneof = secretInfoOneofInt\n\n\t\t\t\t\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\t\t\t\t\tfor _, set := range sl {\n\t\t\t\t\t\t\t\t\tcs := set.(map[string]interface{})\n\n\t\t\t\t\t\t\t\t\tif v, ok := cs[\"provider\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\t\t\tsecretInfoOneofInt.ClearSecretInfo.Provider = v.(string)\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif v, ok := cs[\"url\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\t\t\tsecretInfoOneofInt.ClearSecretInfo.Url = v.(string)\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif v, ok := cs[\"vault_secret_info\"]; ok && !isIntfNil(v) && !secretInfoOneofTypeFound {\n\n\t\t\t\t\t\t\t\tsecretInfoOneofTypeFound = true\n\t\t\t\t\t\t\t\tsecretInfoOneofInt := &ves_io_schema.SecretType_VaultSecretInfo{}\n\t\t\t\t\t\t\t\tsecretInfoOneofInt.VaultSecretInfo = &ves_io_schema.VaultSecretInfoType{}\n\t\t\t\t\t\t\t\tvalueChoiceInt.SecretValue.SecretInfoOneof = secretInfoOneofInt\n\n\t\t\t\t\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\t\t\t\t\tfor _, set := range sl {\n\t\t\t\t\t\t\t\t\tcs := set.(map[string]interface{})\n\n\t\t\t\t\t\t\t\t\tif v, ok := cs[\"key\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\t\t\tsecretInfoOneofInt.VaultSecretInfo.Key = v.(string)\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif v, ok := cs[\"location\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\t\t\tsecretInfoOneofInt.VaultSecretInfo.Location = v.(string)\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif v, ok := cs[\"provider\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\t\t\tsecretInfoOneofInt.VaultSecretInfo.Provider = v.(string)\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif v, ok := cs[\"secret_encoding\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\t\t\tsecretInfoOneofInt.VaultSecretInfo.SecretEncoding = ves_io_schema.SecretEncodingType(ves_io_schema.SecretEncodingType_value[v.(string)])\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif v, ok := cs[\"version\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\t\t\tsecretInfoOneofInt.VaultSecretInfo.Version = uint32(v.(int))\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif v, ok := cs[\"wingman_secret_info\"]; ok && !isIntfNil(v) && !secretInfoOneofTypeFound {\n\n\t\t\t\t\t\t\t\tsecretInfoOneofTypeFound = true\n\t\t\t\t\t\t\t\tsecretInfoOneofInt := &ves_io_schema.SecretType_WingmanSecretInfo{}\n\t\t\t\t\t\t\t\tsecretInfoOneofInt.WingmanSecretInfo = &ves_io_schema.WingmanSecretInfoType{}\n\t\t\t\t\t\t\t\tvalueChoiceInt.SecretValue.SecretInfoOneof = secretInfoOneofInt\n\n\t\t\t\t\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\t\t\t\t\tfor _, set := range sl {\n\t\t\t\t\t\t\t\t\tcs := set.(map[string]interface{})\n\n\t\t\t\t\t\t\t\t\tif v, ok := cs[\"name\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\t\t\tsecretInfoOneofInt.WingmanSecretInfo.Name = v.(string)\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := requestHeadersToAddMapStrToI[\"value\"]; ok && !isIntfNil(v) && !valueChoiceTypeFound {\n\n\t\t\t\t\t\tvalueChoiceTypeFound = true\n\t\t\t\t\t\tvalueChoiceInt := &ves_io_schema.HeaderManipulationOptionType_Value{}\n\n\t\t\t\t\t\trequestHeadersToAdd[i].ValueChoice = valueChoiceInt\n\n\t\t\t\t\t\tvalueChoiceInt.Value = v.(string)\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif w, ok := routesMapStrToI[\"request_headers_to_remove\"]; ok && !isIntfNil(w) {\n\t\t\t\tls := make([]string, len(w.([]interface{})))\n\t\t\t\tfor i, v := range w.([]interface{}) {\n\t\t\t\t\tls[i] = v.(string)\n\t\t\t\t}\n\t\t\t\troutes[i].RequestHeadersToRemove = ls\n\t\t\t}\n\n\t\t\tif v, ok := routesMapStrToI[\"response_headers_to_add\"]; ok && !isIntfNil(v) {\n\n\t\t\t\tsl := v.([]interface{})\n\t\t\t\tresponseHeadersToAdd := make([]*ves_io_schema.HeaderManipulationOptionType, len(sl))\n\t\t\t\troutes[i].ResponseHeadersToAdd = responseHeadersToAdd\n\t\t\t\tfor i, set := range sl {\n\t\t\t\t\tresponseHeadersToAdd[i] = &ves_io_schema.HeaderManipulationOptionType{}\n\t\t\t\t\tresponseHeadersToAddMapStrToI := set.(map[string]interface{})\n\n\t\t\t\t\tif w, ok := responseHeadersToAddMapStrToI[\"append\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\tresponseHeadersToAdd[i].Append = w.(bool)\n\t\t\t\t\t}\n\n\t\t\t\t\tif w, ok := responseHeadersToAddMapStrToI[\"name\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\tresponseHeadersToAdd[i].Name = w.(string)\n\t\t\t\t\t}\n\n\t\t\t\t\tvalueChoiceTypeFound := false\n\n\t\t\t\t\tif v, ok := responseHeadersToAddMapStrToI[\"secret_value\"]; ok && !isIntfNil(v) && !valueChoiceTypeFound {\n\n\t\t\t\t\t\tvalueChoiceTypeFound = true\n\t\t\t\t\t\tvalueChoiceInt := &ves_io_schema.HeaderManipulationOptionType_SecretValue{}\n\t\t\t\t\t\tvalueChoiceInt.SecretValue = &ves_io_schema.SecretType{}\n\t\t\t\t\t\tresponseHeadersToAdd[i].ValueChoice = valueChoiceInt\n\n\t\t\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\t\t\tfor _, set := range sl {\n\t\t\t\t\t\t\tcs := set.(map[string]interface{})\n\n\t\t\t\t\t\t\tif v, ok := cs[\"blindfold_secret_info_internal\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\t\t\t\t\tblindfoldSecretInfoInternal := &ves_io_schema.BlindfoldSecretInfoType{}\n\t\t\t\t\t\t\t\tvalueChoiceInt.SecretValue.BlindfoldSecretInfoInternal = blindfoldSecretInfoInternal\n\t\t\t\t\t\t\t\tfor _, set := range sl {\n\t\t\t\t\t\t\t\t\tblindfoldSecretInfoInternalMapStrToI := set.(map[string]interface{})\n\n\t\t\t\t\t\t\t\t\tif w, ok := blindfoldSecretInfoInternalMapStrToI[\"decryption_provider\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\t\t\tblindfoldSecretInfoInternal.DecryptionProvider = w.(string)\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif w, ok := blindfoldSecretInfoInternalMapStrToI[\"location\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\t\t\tblindfoldSecretInfoInternal.Location = w.(string)\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif w, ok := blindfoldSecretInfoInternalMapStrToI[\"store_provider\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\t\t\tblindfoldSecretInfoInternal.StoreProvider = w.(string)\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif v, ok := cs[\"secret_encoding_type\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\tvalueChoiceInt.SecretValue.SecretEncodingType = ves_io_schema.SecretEncodingType(ves_io_schema.SecretEncodingType_value[v.(string)])\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tsecretInfoOneofTypeFound := false\n\n\t\t\t\t\t\t\tif v, ok := cs[\"blindfold_secret_info\"]; ok && !isIntfNil(v) && !secretInfoOneofTypeFound {\n\n\t\t\t\t\t\t\t\tsecretInfoOneofTypeFound = true\n\t\t\t\t\t\t\t\tsecretInfoOneofInt := &ves_io_schema.SecretType_BlindfoldSecretInfo{}\n\t\t\t\t\t\t\t\tsecretInfoOneofInt.BlindfoldSecretInfo = &ves_io_schema.BlindfoldSecretInfoType{}\n\t\t\t\t\t\t\t\tvalueChoiceInt.SecretValue.SecretInfoOneof = secretInfoOneofInt\n\n\t\t\t\t\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\t\t\t\t\tfor _, set := range sl {\n\t\t\t\t\t\t\t\t\tcs := set.(map[string]interface{})\n\n\t\t\t\t\t\t\t\t\tif v, ok := cs[\"decryption_provider\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\t\t\tsecretInfoOneofInt.BlindfoldSecretInfo.DecryptionProvider = v.(string)\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif v, ok := cs[\"location\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\t\t\tsecretInfoOneofInt.BlindfoldSecretInfo.Location = v.(string)\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif v, ok := cs[\"store_provider\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\t\t\tsecretInfoOneofInt.BlindfoldSecretInfo.StoreProvider = v.(string)\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif v, ok := cs[\"clear_secret_info\"]; ok && !isIntfNil(v) && !secretInfoOneofTypeFound {\n\n\t\t\t\t\t\t\t\tsecretInfoOneofTypeFound = true\n\t\t\t\t\t\t\t\tsecretInfoOneofInt := &ves_io_schema.SecretType_ClearSecretInfo{}\n\t\t\t\t\t\t\t\tsecretInfoOneofInt.ClearSecretInfo = &ves_io_schema.ClearSecretInfoType{}\n\t\t\t\t\t\t\t\tvalueChoiceInt.SecretValue.SecretInfoOneof = secretInfoOneofInt\n\n\t\t\t\t\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\t\t\t\t\tfor _, set := range sl {\n\t\t\t\t\t\t\t\t\tcs := set.(map[string]interface{})\n\n\t\t\t\t\t\t\t\t\tif v, ok := cs[\"provider\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\t\t\tsecretInfoOneofInt.ClearSecretInfo.Provider = v.(string)\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif v, ok := cs[\"url\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\t\t\tsecretInfoOneofInt.ClearSecretInfo.Url = v.(string)\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif v, ok := cs[\"vault_secret_info\"]; ok && !isIntfNil(v) && !secretInfoOneofTypeFound {\n\n\t\t\t\t\t\t\t\tsecretInfoOneofTypeFound = true\n\t\t\t\t\t\t\t\tsecretInfoOneofInt := &ves_io_schema.SecretType_VaultSecretInfo{}\n\t\t\t\t\t\t\t\tsecretInfoOneofInt.VaultSecretInfo = &ves_io_schema.VaultSecretInfoType{}\n\t\t\t\t\t\t\t\tvalueChoiceInt.SecretValue.SecretInfoOneof = secretInfoOneofInt\n\n\t\t\t\t\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\t\t\t\t\tfor _, set := range sl {\n\t\t\t\t\t\t\t\t\tcs := set.(map[string]interface{})\n\n\t\t\t\t\t\t\t\t\tif v, ok := cs[\"key\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\t\t\tsecretInfoOneofInt.VaultSecretInfo.Key = v.(string)\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif v, ok := cs[\"location\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\t\t\tsecretInfoOneofInt.VaultSecretInfo.Location = v.(string)\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif v, ok := cs[\"provider\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\t\t\tsecretInfoOneofInt.VaultSecretInfo.Provider = v.(string)\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif v, ok := cs[\"secret_encoding\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\t\t\tsecretInfoOneofInt.VaultSecretInfo.SecretEncoding = ves_io_schema.SecretEncodingType(ves_io_schema.SecretEncodingType_value[v.(string)])\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif v, ok := cs[\"version\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\t\t\tsecretInfoOneofInt.VaultSecretInfo.Version = uint32(v.(int))\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif v, ok := cs[\"wingman_secret_info\"]; ok && !isIntfNil(v) && !secretInfoOneofTypeFound {\n\n\t\t\t\t\t\t\t\tsecretInfoOneofTypeFound = true\n\t\t\t\t\t\t\t\tsecretInfoOneofInt := &ves_io_schema.SecretType_WingmanSecretInfo{}\n\t\t\t\t\t\t\t\tsecretInfoOneofInt.WingmanSecretInfo = &ves_io_schema.WingmanSecretInfoType{}\n\t\t\t\t\t\t\t\tvalueChoiceInt.SecretValue.SecretInfoOneof = secretInfoOneofInt\n\n\t\t\t\t\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\t\t\t\t\tfor _, set := range sl {\n\t\t\t\t\t\t\t\t\tcs := set.(map[string]interface{})\n\n\t\t\t\t\t\t\t\t\tif v, ok := cs[\"name\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\t\t\tsecretInfoOneofInt.WingmanSecretInfo.Name = v.(string)\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := responseHeadersToAddMapStrToI[\"value\"]; ok && !isIntfNil(v) && !valueChoiceTypeFound {\n\n\t\t\t\t\t\tvalueChoiceTypeFound = true\n\t\t\t\t\t\tvalueChoiceInt := &ves_io_schema.HeaderManipulationOptionType_Value{}\n\n\t\t\t\t\t\tresponseHeadersToAdd[i].ValueChoice = valueChoiceInt\n\n\t\t\t\t\t\tvalueChoiceInt.Value = v.(string)\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif w, ok := routesMapStrToI[\"response_headers_to_remove\"]; ok && !isIntfNil(w) {\n\t\t\t\tls := make([]string, len(w.([]interface{})))\n\t\t\t\tfor i, v := range w.([]interface{}) {\n\t\t\t\t\tls[i] = v.(string)\n\t\t\t\t}\n\t\t\t\troutes[i].ResponseHeadersToRemove = ls\n\t\t\t}\n\n\t\t\trouteActionTypeFound := false\n\n\t\t\tif v, ok := routesMapStrToI[\"route_destination\"]; ok && !isIntfNil(v) && !routeActionTypeFound {\n\n\t\t\t\trouteActionTypeFound = true\n\t\t\t\trouteActionInt := &ves_io_schema_route.RouteType_RouteDestination{}\n\t\t\t\trouteActionInt.RouteDestination = &ves_io_schema_route.RouteDestinationList{}\n\t\t\t\troutes[i].RouteAction = routeActionInt\n\n\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\tfor _, set := range sl {\n\t\t\t\t\tcs := set.(map[string]interface{})\n\n\t\t\t\t\tif v, ok := cs[\"buffer_policy\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\t\t\tbufferPolicy := &ves_io_schema.BufferConfigType{}\n\t\t\t\t\t\trouteActionInt.RouteDestination.BufferPolicy = bufferPolicy\n\t\t\t\t\t\tfor _, set := range sl {\n\t\t\t\t\t\t\tbufferPolicyMapStrToI := set.(map[string]interface{})\n\n\t\t\t\t\t\t\tif w, ok := bufferPolicyMapStrToI[\"disabled\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\tbufferPolicy.Disabled = w.(bool)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif w, ok := bufferPolicyMapStrToI[\"max_request_bytes\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\tbufferPolicy.MaxRequestBytes = uint32(w.(int))\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif w, ok := bufferPolicyMapStrToI[\"max_request_time\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\tbufferPolicy.MaxRequestTime = uint32(w.(int))\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tclusterRetractChoiceTypeFound := false\n\n\t\t\t\t\tif v, ok := cs[\"do_not_retract_cluster\"]; ok && !isIntfNil(v) && !clusterRetractChoiceTypeFound {\n\n\t\t\t\t\t\tclusterRetractChoiceTypeFound = true\n\n\t\t\t\t\t\tif v.(bool) {\n\t\t\t\t\t\t\tclusterRetractChoiceInt := &ves_io_schema_route.RouteDestinationList_DoNotRetractCluster{}\n\t\t\t\t\t\t\tclusterRetractChoiceInt.DoNotRetractCluster = &ves_io_schema.Empty{}\n\t\t\t\t\t\t\trouteActionInt.RouteDestination.ClusterRetractChoice = clusterRetractChoiceInt\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := cs[\"retract_cluster\"]; ok && !isIntfNil(v) && !clusterRetractChoiceTypeFound {\n\n\t\t\t\t\t\tclusterRetractChoiceTypeFound = true\n\n\t\t\t\t\t\tif v.(bool) {\n\t\t\t\t\t\t\tclusterRetractChoiceInt := &ves_io_schema_route.RouteDestinationList_RetractCluster{}\n\t\t\t\t\t\t\tclusterRetractChoiceInt.RetractCluster = &ves_io_schema.Empty{}\n\t\t\t\t\t\t\trouteActionInt.RouteDestination.ClusterRetractChoice = clusterRetractChoiceInt\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := cs[\"cors_policy\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\t\t\tcorsPolicy := &ves_io_schema.CorsPolicy{}\n\t\t\t\t\t\trouteActionInt.RouteDestination.CorsPolicy = corsPolicy\n\t\t\t\t\t\tfor _, set := range sl {\n\t\t\t\t\t\t\tcorsPolicyMapStrToI := set.(map[string]interface{})\n\n\t\t\t\t\t\t\tif w, ok := corsPolicyMapStrToI[\"allow_credentials\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\tcorsPolicy.AllowCredentials = w.(bool)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif w, ok := corsPolicyMapStrToI[\"allow_headers\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\tcorsPolicy.AllowHeaders = w.(string)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif w, ok := corsPolicyMapStrToI[\"allow_methods\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\tcorsPolicy.AllowMethods = w.(string)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif w, ok := corsPolicyMapStrToI[\"allow_origin\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\tls := make([]string, len(w.([]interface{})))\n\t\t\t\t\t\t\t\tfor i, v := range w.([]interface{}) {\n\t\t\t\t\t\t\t\t\tls[i] = v.(string)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tcorsPolicy.AllowOrigin = ls\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif w, ok := corsPolicyMapStrToI[\"allow_origin_regex\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\tls := make([]string, len(w.([]interface{})))\n\t\t\t\t\t\t\t\tfor i, v := range w.([]interface{}) {\n\t\t\t\t\t\t\t\t\tls[i] = v.(string)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tcorsPolicy.AllowOriginRegex = ls\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif w, ok := corsPolicyMapStrToI[\"disabled\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\tcorsPolicy.Disabled = w.(bool)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif w, ok := corsPolicyMapStrToI[\"expose_headers\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\tcorsPolicy.ExposeHeaders = w.(string)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif w, ok := corsPolicyMapStrToI[\"max_age\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\tcorsPolicy.MaxAge = w.(string)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif w, ok := corsPolicyMapStrToI[\"maximum_age\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\tcorsPolicy.MaximumAge = int32(w.(int))\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := cs[\"destinations\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\tsl := v.([]interface{})\n\t\t\t\t\t\tdestinations := make([]*ves_io_schema_route.RouteDestination, len(sl))\n\t\t\t\t\t\trouteActionInt.RouteDestination.Destinations = destinations\n\t\t\t\t\t\tfor i, set := range sl {\n\t\t\t\t\t\t\tdestinations[i] = &ves_io_schema_route.RouteDestination{}\n\t\t\t\t\t\t\tdestinationsMapStrToI := set.(map[string]interface{})\n\n\t\t\t\t\t\t\tif v, ok := destinationsMapStrToI[\"cluster\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\tsl := v.([]interface{})\n\t\t\t\t\t\t\t\tclusterInt := make([]*ves_io_schema.ObjectRefType, len(sl))\n\t\t\t\t\t\t\t\tdestinations[i].Cluster = clusterInt\n\t\t\t\t\t\t\t\tfor i, ps := range sl {\n\n\t\t\t\t\t\t\t\t\tcMapToStrVal := ps.(map[string]interface{})\n\t\t\t\t\t\t\t\t\tclusterInt[i] = &ves_io_schema.ObjectRefType{}\n\n\t\t\t\t\t\t\t\t\tclusterInt[i].Kind = \"cluster\"\n\n\t\t\t\t\t\t\t\t\tif v, ok := cMapToStrVal[\"name\"]; ok && !isIntfNil(v) {\n\t\t\t\t\t\t\t\t\t\tclusterInt[i].Name = v.(string)\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif v, ok := cMapToStrVal[\"namespace\"]; ok && !isIntfNil(v) {\n\t\t\t\t\t\t\t\t\t\tclusterInt[i].Namespace = v.(string)\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif v, ok := cMapToStrVal[\"tenant\"]; ok && !isIntfNil(v) {\n\t\t\t\t\t\t\t\t\t\tclusterInt[i].Tenant = v.(string)\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif v, ok := cMapToStrVal[\"uid\"]; ok && !isIntfNil(v) {\n\t\t\t\t\t\t\t\t\t\tclusterInt[i].Uid = v.(string)\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif w, ok := destinationsMapStrToI[\"endpoint_subsets\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\tms := map[string]string{}\n\t\t\t\t\t\t\t\tfor k, v := range w.(map[string]interface{}) {\n\t\t\t\t\t\t\t\t\tms[k] = v.(string)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tdestinations[i].EndpointSubsets = ms\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif w, ok := destinationsMapStrToI[\"priority\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\tdestinations[i].Priority = uint32(w.(int))\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif w, ok := destinationsMapStrToI[\"weight\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\tdestinations[i].Weight = uint32(w.(int))\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := cs[\"endpoint_subsets\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\tms := map[string]string{}\n\t\t\t\t\t\tfor k, v := range v.(map[string]interface{}) {\n\t\t\t\t\t\t\tms[k] = v.(string)\n\t\t\t\t\t\t}\n\t\t\t\t\t\trouteActionInt.RouteDestination.EndpointSubsets = ms\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := cs[\"hash_policy\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\tsl := v.([]interface{})\n\t\t\t\t\t\thashPolicy := make([]*ves_io_schema_route.HashPolicyType, len(sl))\n\t\t\t\t\t\trouteActionInt.RouteDestination.HashPolicy = hashPolicy\n\t\t\t\t\t\tfor i, set := range sl {\n\t\t\t\t\t\t\thashPolicy[i] = &ves_io_schema_route.HashPolicyType{}\n\t\t\t\t\t\t\thashPolicyMapStrToI := set.(map[string]interface{})\n\n\t\t\t\t\t\t\tpolicySpecifierTypeFound := false\n\n\t\t\t\t\t\t\tif v, ok := hashPolicyMapStrToI[\"cookie\"]; ok && !isIntfNil(v) && !policySpecifierTypeFound {\n\n\t\t\t\t\t\t\t\tpolicySpecifierTypeFound = true\n\t\t\t\t\t\t\t\tpolicySpecifierInt := &ves_io_schema_route.HashPolicyType_Cookie{}\n\t\t\t\t\t\t\t\tpolicySpecifierInt.Cookie = &ves_io_schema_route.CookieForHashing{}\n\t\t\t\t\t\t\t\thashPolicy[i].PolicySpecifier = policySpecifierInt\n\n\t\t\t\t\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\t\t\t\t\tfor _, set := range sl {\n\t\t\t\t\t\t\t\t\tcs := set.(map[string]interface{})\n\n\t\t\t\t\t\t\t\t\thttponlyTypeFound := false\n\n\t\t\t\t\t\t\t\t\tif v, ok := cs[\"add_httponly\"]; ok && !isIntfNil(v) && !httponlyTypeFound {\n\n\t\t\t\t\t\t\t\t\t\thttponlyTypeFound = true\n\n\t\t\t\t\t\t\t\t\t\tif v.(bool) {\n\t\t\t\t\t\t\t\t\t\t\thttponlyInt := &ves_io_schema_route.CookieForHashing_AddHttponly{}\n\t\t\t\t\t\t\t\t\t\t\thttponlyInt.AddHttponly = &ves_io_schema.Empty{}\n\t\t\t\t\t\t\t\t\t\t\tpolicySpecifierInt.Cookie.Httponly = httponlyInt\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif v, ok := cs[\"ignore_httponly\"]; ok && !isIntfNil(v) && !httponlyTypeFound {\n\n\t\t\t\t\t\t\t\t\t\thttponlyTypeFound = true\n\n\t\t\t\t\t\t\t\t\t\tif v.(bool) {\n\t\t\t\t\t\t\t\t\t\t\thttponlyInt := &ves_io_schema_route.CookieForHashing_IgnoreHttponly{}\n\t\t\t\t\t\t\t\t\t\t\thttponlyInt.IgnoreHttponly = &ves_io_schema.Empty{}\n\t\t\t\t\t\t\t\t\t\t\tpolicySpecifierInt.Cookie.Httponly = httponlyInt\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif v, ok := cs[\"name\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\t\t\tpolicySpecifierInt.Cookie.Name = v.(string)\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif v, ok := cs[\"path\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\t\t\tpolicySpecifierInt.Cookie.Path = v.(string)\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tsamesiteTypeFound := false\n\n\t\t\t\t\t\t\t\t\tif v, ok := cs[\"ignore_samesite\"]; ok && !isIntfNil(v) && !samesiteTypeFound {\n\n\t\t\t\t\t\t\t\t\t\tsamesiteTypeFound = true\n\n\t\t\t\t\t\t\t\t\t\tif v.(bool) {\n\t\t\t\t\t\t\t\t\t\t\tsamesiteInt := &ves_io_schema_route.CookieForHashing_IgnoreSamesite{}\n\t\t\t\t\t\t\t\t\t\t\tsamesiteInt.IgnoreSamesite = &ves_io_schema.Empty{}\n\t\t\t\t\t\t\t\t\t\t\tpolicySpecifierInt.Cookie.Samesite = samesiteInt\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif v, ok := cs[\"samesite_lax\"]; ok && !isIntfNil(v) && !samesiteTypeFound {\n\n\t\t\t\t\t\t\t\t\t\tsamesiteTypeFound = true\n\n\t\t\t\t\t\t\t\t\t\tif v.(bool) {\n\t\t\t\t\t\t\t\t\t\t\tsamesiteInt := &ves_io_schema_route.CookieForHashing_SamesiteLax{}\n\t\t\t\t\t\t\t\t\t\t\tsamesiteInt.SamesiteLax = &ves_io_schema.Empty{}\n\t\t\t\t\t\t\t\t\t\t\tpolicySpecifierInt.Cookie.Samesite = samesiteInt\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif v, ok := cs[\"samesite_none\"]; ok && !isIntfNil(v) && !samesiteTypeFound {\n\n\t\t\t\t\t\t\t\t\t\tsamesiteTypeFound = true\n\n\t\t\t\t\t\t\t\t\t\tif v.(bool) {\n\t\t\t\t\t\t\t\t\t\t\tsamesiteInt := &ves_io_schema_route.CookieForHashing_SamesiteNone{}\n\t\t\t\t\t\t\t\t\t\t\tsamesiteInt.SamesiteNone = &ves_io_schema.Empty{}\n\t\t\t\t\t\t\t\t\t\t\tpolicySpecifierInt.Cookie.Samesite = samesiteInt\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif v, ok := cs[\"samesite_strict\"]; ok && !isIntfNil(v) && !samesiteTypeFound {\n\n\t\t\t\t\t\t\t\t\t\tsamesiteTypeFound = true\n\n\t\t\t\t\t\t\t\t\t\tif v.(bool) {\n\t\t\t\t\t\t\t\t\t\t\tsamesiteInt := &ves_io_schema_route.CookieForHashing_SamesiteStrict{}\n\t\t\t\t\t\t\t\t\t\t\tsamesiteInt.SamesiteStrict = &ves_io_schema.Empty{}\n\t\t\t\t\t\t\t\t\t\t\tpolicySpecifierInt.Cookie.Samesite = samesiteInt\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tsecureTypeFound := false\n\n\t\t\t\t\t\t\t\t\tif v, ok := cs[\"add_secure\"]; ok && !isIntfNil(v) && !secureTypeFound {\n\n\t\t\t\t\t\t\t\t\t\tsecureTypeFound = true\n\n\t\t\t\t\t\t\t\t\t\tif v.(bool) {\n\t\t\t\t\t\t\t\t\t\t\tsecureInt := &ves_io_schema_route.CookieForHashing_AddSecure{}\n\t\t\t\t\t\t\t\t\t\t\tsecureInt.AddSecure = &ves_io_schema.Empty{}\n\t\t\t\t\t\t\t\t\t\t\tpolicySpecifierInt.Cookie.Secure = secureInt\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif v, ok := cs[\"ignore_secure\"]; ok && !isIntfNil(v) && !secureTypeFound {\n\n\t\t\t\t\t\t\t\t\t\tsecureTypeFound = true\n\n\t\t\t\t\t\t\t\t\t\tif v.(bool) {\n\t\t\t\t\t\t\t\t\t\t\tsecureInt := &ves_io_schema_route.CookieForHashing_IgnoreSecure{}\n\t\t\t\t\t\t\t\t\t\t\tsecureInt.IgnoreSecure = &ves_io_schema.Empty{}\n\t\t\t\t\t\t\t\t\t\t\tpolicySpecifierInt.Cookie.Secure = secureInt\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif v, ok := cs[\"ttl\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\t\t\tpolicySpecifierInt.Cookie.Ttl = uint32(v.(int))\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif v, ok := hashPolicyMapStrToI[\"header_name\"]; ok && !isIntfNil(v) && !policySpecifierTypeFound {\n\n\t\t\t\t\t\t\t\tpolicySpecifierTypeFound = true\n\t\t\t\t\t\t\t\tpolicySpecifierInt := &ves_io_schema_route.HashPolicyType_HeaderName{}\n\n\t\t\t\t\t\t\t\thashPolicy[i].PolicySpecifier = policySpecifierInt\n\n\t\t\t\t\t\t\t\tpolicySpecifierInt.HeaderName = v.(string)\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif v, ok := hashPolicyMapStrToI[\"source_ip\"]; ok && !isIntfNil(v) && !policySpecifierTypeFound {\n\n\t\t\t\t\t\t\t\tpolicySpecifierTypeFound = true\n\t\t\t\t\t\t\t\tpolicySpecifierInt := &ves_io_schema_route.HashPolicyType_SourceIp{}\n\n\t\t\t\t\t\t\t\thashPolicy[i].PolicySpecifier = policySpecifierInt\n\n\t\t\t\t\t\t\t\tpolicySpecifierInt.SourceIp = v.(bool)\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif w, ok := hashPolicyMapStrToI[\"terminal\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\thashPolicy[i].Terminal = w.(bool)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\thostRewriteParamsTypeFound := false\n\n\t\t\t\t\tif v, ok := cs[\"auto_host_rewrite\"]; ok && !isIntfNil(v) && !hostRewriteParamsTypeFound {\n\n\t\t\t\t\t\thostRewriteParamsTypeFound = true\n\t\t\t\t\t\thostRewriteParamsInt := &ves_io_schema_route.RouteDestinationList_AutoHostRewrite{}\n\n\t\t\t\t\t\trouteActionInt.RouteDestination.HostRewriteParams = hostRewriteParamsInt\n\n\t\t\t\t\t\thostRewriteParamsInt.AutoHostRewrite = v.(bool)\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := cs[\"host_rewrite\"]; ok && !isIntfNil(v) && !hostRewriteParamsTypeFound {\n\n\t\t\t\t\t\thostRewriteParamsTypeFound = true\n\t\t\t\t\t\thostRewriteParamsInt := &ves_io_schema_route.RouteDestinationList_HostRewrite{}\n\n\t\t\t\t\t\trouteActionInt.RouteDestination.HostRewriteParams = hostRewriteParamsInt\n\n\t\t\t\t\t\thostRewriteParamsInt.HostRewrite = v.(string)\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := cs[\"mirror_policy\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\t\t\tmirrorPolicy := &ves_io_schema_route.MirrorPolicyType{}\n\t\t\t\t\t\trouteActionInt.RouteDestination.MirrorPolicy = mirrorPolicy\n\t\t\t\t\t\tfor _, set := range sl {\n\t\t\t\t\t\t\tmirrorPolicyMapStrToI := set.(map[string]interface{})\n\n\t\t\t\t\t\t\tif v, ok := mirrorPolicyMapStrToI[\"cluster\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\tsl := v.([]interface{})\n\t\t\t\t\t\t\t\tclusterInt := make([]*ves_io_schema.ObjectRefType, len(sl))\n\t\t\t\t\t\t\t\tmirrorPolicy.Cluster = clusterInt\n\t\t\t\t\t\t\t\tfor i, ps := range sl {\n\n\t\t\t\t\t\t\t\t\tcMapToStrVal := ps.(map[string]interface{})\n\t\t\t\t\t\t\t\t\tclusterInt[i] = &ves_io_schema.ObjectRefType{}\n\n\t\t\t\t\t\t\t\t\tclusterInt[i].Kind = \"cluster\"\n\n\t\t\t\t\t\t\t\t\tif v, ok := cMapToStrVal[\"name\"]; ok && !isIntfNil(v) {\n\t\t\t\t\t\t\t\t\t\tclusterInt[i].Name = v.(string)\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif v, ok := cMapToStrVal[\"namespace\"]; ok && !isIntfNil(v) {\n\t\t\t\t\t\t\t\t\t\tclusterInt[i].Namespace = v.(string)\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif v, ok := cMapToStrVal[\"tenant\"]; ok && !isIntfNil(v) {\n\t\t\t\t\t\t\t\t\t\tclusterInt[i].Tenant = v.(string)\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif v, ok := cMapToStrVal[\"uid\"]; ok && !isIntfNil(v) {\n\t\t\t\t\t\t\t\t\t\tclusterInt[i].Uid = v.(string)\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif v, ok := mirrorPolicyMapStrToI[\"percent\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\t\t\t\t\tpercent := &ves_io_schema.FractionalPercent{}\n\t\t\t\t\t\t\t\tmirrorPolicy.Percent = percent\n\t\t\t\t\t\t\t\tfor _, set := range sl {\n\t\t\t\t\t\t\t\t\tpercentMapStrToI := set.(map[string]interface{})\n\n\t\t\t\t\t\t\t\t\tif v, ok := percentMapStrToI[\"denominator\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\t\t\tpercent.Denominator = ves_io_schema.DenominatorType(ves_io_schema.DenominatorType_value[v.(string)])\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif w, ok := percentMapStrToI[\"numerator\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\t\t\tpercent.Numerator = uint32(w.(int))\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := cs[\"prefix_rewrite\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\trouteActionInt.RouteDestination.PrefixRewrite = v.(string)\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := cs[\"priority\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\trouteActionInt.RouteDestination.Priority = ves_io_schema.RoutingPriority(ves_io_schema.RoutingPriority_value[v.(string)])\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := cs[\"retry_policy\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\t\t\tretryPolicy := &ves_io_schema.RetryPolicyType{}\n\t\t\t\t\t\trouteActionInt.RouteDestination.RetryPolicy = retryPolicy\n\t\t\t\t\t\tfor _, set := range sl {\n\t\t\t\t\t\t\tretryPolicyMapStrToI := set.(map[string]interface{})\n\n\t\t\t\t\t\t\tif v, ok := retryPolicyMapStrToI[\"back_off\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\t\t\t\t\tbackOff := &ves_io_schema.RetryBackOff{}\n\t\t\t\t\t\t\t\tretryPolicy.BackOff = backOff\n\t\t\t\t\t\t\t\tfor _, set := range sl {\n\t\t\t\t\t\t\t\t\tbackOffMapStrToI := set.(map[string]interface{})\n\n\t\t\t\t\t\t\t\t\tif w, ok := backOffMapStrToI[\"base_interval\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\t\t\tbackOff.BaseInterval = uint32(w.(int))\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif w, ok := backOffMapStrToI[\"max_interval\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\t\t\tbackOff.MaxInterval = uint32(w.(int))\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif w, ok := retryPolicyMapStrToI[\"num_retries\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\tretryPolicy.NumRetries = uint32(w.(int))\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif w, ok := retryPolicyMapStrToI[\"per_try_timeout\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\tretryPolicy.PerTryTimeout = uint32(w.(int))\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif w, ok := retryPolicyMapStrToI[\"retriable_status_codes\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\tls := make([]uint32, len(w.([]interface{})))\n\t\t\t\t\t\t\t\tfor i, v := range w.([]interface{}) {\n\t\t\t\t\t\t\t\t\tls[i] = uint32(v.(int))\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tretryPolicy.RetriableStatusCodes = ls\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif w, ok := retryPolicyMapStrToI[\"retry_condition\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\tls := make([]string, len(w.([]interface{})))\n\t\t\t\t\t\t\t\tfor i, v := range w.([]interface{}) {\n\t\t\t\t\t\t\t\t\tls[i] = v.(string)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tretryPolicy.RetryCondition = ls\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif w, ok := retryPolicyMapStrToI[\"retry_on\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\tretryPolicy.RetryOn = w.(string)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := cs[\"spdy_config\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\t\t\tspdyConfig := &ves_io_schema_route.SpdyConfigType{}\n\t\t\t\t\t\trouteActionInt.RouteDestination.SpdyConfig = spdyConfig\n\t\t\t\t\t\tfor _, set := range sl {\n\t\t\t\t\t\t\tspdyConfigMapStrToI := set.(map[string]interface{})\n\n\t\t\t\t\t\t\tif w, ok := spdyConfigMapStrToI[\"use_spdy\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\tspdyConfig.UseSpdy = w.(bool)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := cs[\"timeout\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\trouteActionInt.RouteDestination.Timeout = uint32(v.(int))\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := cs[\"web_socket_config\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\t\t\twebSocketConfig := &ves_io_schema_route.WebsocketConfigType{}\n\t\t\t\t\t\trouteActionInt.RouteDestination.WebSocketConfig = webSocketConfig\n\t\t\t\t\t\tfor _, set := range sl {\n\t\t\t\t\t\t\twebSocketConfigMapStrToI := set.(map[string]interface{})\n\n\t\t\t\t\t\t\tif w, ok := webSocketConfigMapStrToI[\"idle_timeout\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\twebSocketConfig.IdleTimeout = uint32(w.(int))\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif w, ok := webSocketConfigMapStrToI[\"max_connect_attempts\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\twebSocketConfig.MaxConnectAttempts = uint32(w.(int))\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif w, ok := webSocketConfigMapStrToI[\"use_websocket\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\twebSocketConfig.UseWebsocket = w.(bool)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif v, ok := routesMapStrToI[\"route_direct_response\"]; ok && !isIntfNil(v) && !routeActionTypeFound {\n\n\t\t\t\trouteActionTypeFound = true\n\t\t\t\trouteActionInt := &ves_io_schema_route.RouteType_RouteDirectResponse{}\n\t\t\t\trouteActionInt.RouteDirectResponse = &ves_io_schema_route.RouteDirectResponse{}\n\t\t\t\troutes[i].RouteAction = routeActionInt\n\n\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\tfor _, set := range sl {\n\t\t\t\t\tcs := set.(map[string]interface{})\n\n\t\t\t\t\tif v, ok := cs[\"response_body\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\trouteActionInt.RouteDirectResponse.ResponseBody = v.(string)\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := cs[\"response_code\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\trouteActionInt.RouteDirectResponse.ResponseCode = uint32(v.(int))\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif v, ok := routesMapStrToI[\"route_redirect\"]; ok && !isIntfNil(v) && !routeActionTypeFound {\n\n\t\t\t\trouteActionTypeFound = true\n\t\t\t\trouteActionInt := &ves_io_schema_route.RouteType_RouteRedirect{}\n\t\t\t\trouteActionInt.RouteRedirect = &ves_io_schema_route.RouteRedirect{}\n\t\t\t\troutes[i].RouteAction = routeActionInt\n\n\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\tfor _, set := range sl {\n\t\t\t\t\tcs := set.(map[string]interface{})\n\n\t\t\t\t\tif v, ok := cs[\"host_redirect\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\trouteActionInt.RouteRedirect.HostRedirect = v.(string)\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := cs[\"port_redirect\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\trouteActionInt.RouteRedirect.PortRedirect = uint32(v.(int))\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := cs[\"proto_redirect\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\trouteActionInt.RouteRedirect.ProtoRedirect = v.(string)\n\n\t\t\t\t\t}\n\n\t\t\t\t\tqueryParamsTypeFound := false\n\n\t\t\t\t\tif v, ok := cs[\"all_params\"]; ok && !isIntfNil(v) && !queryParamsTypeFound {\n\n\t\t\t\t\t\tqueryParamsTypeFound = true\n\t\t\t\t\t\tqueryParamsInt := &ves_io_schema_route.RouteRedirect_AllParams{}\n\n\t\t\t\t\t\trouteActionInt.RouteRedirect.QueryParams = queryParamsInt\n\n\t\t\t\t\t\tqueryParamsInt.AllParams = v.(bool)\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := cs[\"remove_all_params\"]; ok && !isIntfNil(v) && !queryParamsTypeFound {\n\n\t\t\t\t\t\tqueryParamsTypeFound = true\n\n\t\t\t\t\t\tif v.(bool) {\n\t\t\t\t\t\t\tqueryParamsInt := &ves_io_schema_route.RouteRedirect_RemoveAllParams{}\n\t\t\t\t\t\t\tqueryParamsInt.RemoveAllParams = &ves_io_schema.Empty{}\n\t\t\t\t\t\t\trouteActionInt.RouteRedirect.QueryParams = queryParamsInt\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := cs[\"replace_params\"]; ok && !isIntfNil(v) && !queryParamsTypeFound {\n\n\t\t\t\t\t\tqueryParamsTypeFound = true\n\t\t\t\t\t\tqueryParamsInt := &ves_io_schema_route.RouteRedirect_ReplaceParams{}\n\n\t\t\t\t\t\trouteActionInt.RouteRedirect.QueryParams = queryParamsInt\n\n\t\t\t\t\t\tqueryParamsInt.ReplaceParams = v.(string)\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := cs[\"retain_all_params\"]; ok && !isIntfNil(v) && !queryParamsTypeFound {\n\n\t\t\t\t\t\tqueryParamsTypeFound = true\n\n\t\t\t\t\t\tif v.(bool) {\n\t\t\t\t\t\t\tqueryParamsInt := &ves_io_schema_route.RouteRedirect_RetainAllParams{}\n\t\t\t\t\t\t\tqueryParamsInt.RetainAllParams = &ves_io_schema.Empty{}\n\t\t\t\t\t\t\trouteActionInt.RouteRedirect.QueryParams = queryParamsInt\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := cs[\"strip_query_params\"]; ok && !isIntfNil(v) && !queryParamsTypeFound {\n\n\t\t\t\t\t\tqueryParamsTypeFound = true\n\t\t\t\t\t\tqueryParamsInt := &ves_io_schema_route.RouteRedirect_StripQueryParams{}\n\t\t\t\t\t\tqueryParamsInt.StripQueryParams = &ves_io_schema_route.RouteQueryParams{}\n\t\t\t\t\t\trouteActionInt.RouteRedirect.QueryParams = queryParamsInt\n\n\t\t\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\t\t\tfor _, set := range sl {\n\t\t\t\t\t\t\tcs := set.(map[string]interface{})\n\n\t\t\t\t\t\t\tif v, ok := cs[\"query_params\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\tls := make([]string, len(v.([]interface{})))\n\t\t\t\t\t\t\t\tfor i, v := range v.([]interface{}) {\n\t\t\t\t\t\t\t\t\tls[i] = v.(string)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tqueryParamsInt.StripQueryParams.QueryParams = ls\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tredirectPathChoiceTypeFound := false\n\n\t\t\t\t\tif v, ok := cs[\"path_redirect\"]; ok && !isIntfNil(v) && !redirectPathChoiceTypeFound {\n\n\t\t\t\t\t\tredirectPathChoiceTypeFound = true\n\t\t\t\t\t\tredirectPathChoiceInt := &ves_io_schema_route.RouteRedirect_PathRedirect{}\n\n\t\t\t\t\t\trouteActionInt.RouteRedirect.RedirectPathChoice = redirectPathChoiceInt\n\n\t\t\t\t\t\tredirectPathChoiceInt.PathRedirect = v.(string)\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := cs[\"prefix_rewrite\"]; ok && !isIntfNil(v) && !redirectPathChoiceTypeFound {\n\n\t\t\t\t\t\tredirectPathChoiceTypeFound = true\n\t\t\t\t\t\tredirectPathChoiceInt := &ves_io_schema_route.RouteRedirect_PrefixRewrite{}\n\n\t\t\t\t\t\trouteActionInt.RouteRedirect.RedirectPathChoice = redirectPathChoiceInt\n\n\t\t\t\t\t\tredirectPathChoiceInt.PrefixRewrite = v.(string)\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := cs[\"response_code\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\trouteActionInt.RouteRedirect.ResponseCode = uint32(v.(int))\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif v, ok := routesMapStrToI[\"service_policy\"]; ok && !isIntfNil(v) {\n\n\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\tservicePolicy := &ves_io_schema_route.ServicePolicyInfo{}\n\t\t\t\troutes[i].ServicePolicy = servicePolicy\n\t\t\t\tfor _, set := range sl {\n\t\t\t\t\tservicePolicyMapStrToI := set.(map[string]interface{})\n\n\t\t\t\t\tservicePolicyChoiceTypeFound := false\n\n\t\t\t\t\tif v, ok := servicePolicyMapStrToI[\"context_extensions\"]; ok && !isIntfNil(v) && !servicePolicyChoiceTypeFound {\n\n\t\t\t\t\t\tservicePolicyChoiceTypeFound = true\n\t\t\t\t\t\tservicePolicyChoiceInt := &ves_io_schema_route.ServicePolicyInfo_ContextExtensions{}\n\t\t\t\t\t\tservicePolicyChoiceInt.ContextExtensions = &ves_io_schema_route.ContextExtensionInfo{}\n\t\t\t\t\t\tservicePolicy.ServicePolicyChoice = servicePolicyChoiceInt\n\n\t\t\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\t\t\tfor _, set := range sl {\n\t\t\t\t\t\t\tcs := set.(map[string]interface{})\n\n\t\t\t\t\t\t\tif v, ok := cs[\"context_extensions\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\tms := map[string]string{}\n\t\t\t\t\t\t\t\tfor k, v := range v.(map[string]interface{}) {\n\t\t\t\t\t\t\t\t\tms[k] = v.(string)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tservicePolicyChoiceInt.ContextExtensions.ContextExtensions = ms\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := servicePolicyMapStrToI[\"disable\"]; ok && !isIntfNil(v) && !servicePolicyChoiceTypeFound {\n\n\t\t\t\t\t\tservicePolicyChoiceTypeFound = true\n\t\t\t\t\t\tservicePolicyChoiceInt := &ves_io_schema_route.ServicePolicyInfo_Disable{}\n\n\t\t\t\t\t\tservicePolicy.ServicePolicyChoice = servicePolicyChoiceInt\n\n\t\t\t\t\t\tservicePolicyChoiceInt.Disable = v.(bool)\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif w, ok := routesMapStrToI[\"skip_lb_override\"]; ok && !isIntfNil(w) {\n\t\t\t\troutes[i].SkipLbOverride = w.(bool)\n\t\t\t}\n\n\t\t\tif v, ok := routesMapStrToI[\"waf_type\"]; ok && !isIntfNil(v) {\n\n\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\twafType := &ves_io_schema.WafType{}\n\t\t\t\troutes[i].WafType = wafType\n\t\t\t\tfor _, set := range sl {\n\t\t\t\t\twafTypeMapStrToI := set.(map[string]interface{})\n\n\t\t\t\t\trefTypeTypeFound := false\n\n\t\t\t\t\tif v, ok := wafTypeMapStrToI[\"app_firewall\"]; ok && !isIntfNil(v) && !refTypeTypeFound {\n\n\t\t\t\t\t\trefTypeTypeFound = true\n\t\t\t\t\t\trefTypeInt := &ves_io_schema.WafType_AppFirewall{}\n\t\t\t\t\t\trefTypeInt.AppFirewall = &ves_io_schema.AppFirewallRefType{}\n\t\t\t\t\t\twafType.RefType = refTypeInt\n\n\t\t\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\t\t\tfor _, set := range sl {\n\t\t\t\t\t\t\tcs := set.(map[string]interface{})\n\n\t\t\t\t\t\t\tif v, ok := cs[\"app_firewall\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\tsl := v.([]interface{})\n\t\t\t\t\t\t\t\tappFirewallInt := make([]*ves_io_schema.ObjectRefType, len(sl))\n\t\t\t\t\t\t\t\trefTypeInt.AppFirewall.AppFirewall = appFirewallInt\n\t\t\t\t\t\t\t\tfor i, ps := range sl {\n\n\t\t\t\t\t\t\t\t\tafMapToStrVal := ps.(map[string]interface{})\n\t\t\t\t\t\t\t\t\tappFirewallInt[i] = &ves_io_schema.ObjectRefType{}\n\n\t\t\t\t\t\t\t\t\tappFirewallInt[i].Kind = \"app_firewall\"\n\n\t\t\t\t\t\t\t\t\tif v, ok := afMapToStrVal[\"name\"]; ok && !isIntfNil(v) {\n\t\t\t\t\t\t\t\t\t\tappFirewallInt[i].Name = v.(string)\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif v, ok := afMapToStrVal[\"namespace\"]; ok && !isIntfNil(v) {\n\t\t\t\t\t\t\t\t\t\tappFirewallInt[i].Namespace = v.(string)\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif v, ok := afMapToStrVal[\"tenant\"]; ok && !isIntfNil(v) {\n\t\t\t\t\t\t\t\t\t\tappFirewallInt[i].Tenant = v.(string)\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif v, ok := afMapToStrVal[\"uid\"]; ok && !isIntfNil(v) {\n\t\t\t\t\t\t\t\t\t\tappFirewallInt[i].Uid = v.(string)\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := wafTypeMapStrToI[\"disable_waf\"]; ok && !isIntfNil(v) && !refTypeTypeFound {\n\n\t\t\t\t\t\trefTypeTypeFound = true\n\n\t\t\t\t\t\tif v.(bool) {\n\t\t\t\t\t\t\trefTypeInt := &ves_io_schema.WafType_DisableWaf{}\n\t\t\t\t\t\t\trefTypeInt.DisableWaf = &ves_io_schema.Empty{}\n\t\t\t\t\t\t\twafType.RefType = refTypeInt\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := wafTypeMapStrToI[\"inherit_waf\"]; ok && !isIntfNil(v) && !refTypeTypeFound {\n\n\t\t\t\t\t\trefTypeTypeFound = true\n\n\t\t\t\t\t\tif v.(bool) {\n\t\t\t\t\t\t\trefTypeInt := &ves_io_schema.WafType_InheritWaf{}\n\t\t\t\t\t\t\trefTypeInt.InheritWaf = &ves_io_schema.Empty{}\n\t\t\t\t\t\t\twafType.RefType = refTypeInt\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tlog.Printf(\"[DEBUG] Creating Volterra Route object with struct: %+v\", createReq)\n\n\tcreateRouteResp, err := client.CreateObject(context.Background(), ves_io_schema_route.ObjectType, createReq)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error creating Route: %s\", err)\n\t}\n\td.SetId(createRouteResp.GetObjSystemMetadata().GetUid())\n\n\treturn resourceVolterraRouteRead(d, meta)\n}",
"func newFsResourceAnalyzer(statsProvider Provider, calcVolumePeriod time.Duration) *fsResourceAnalyzer {\n\tr := &fsResourceAnalyzer{\n\t\tstatsProvider: statsProvider,\n\t\tcalcPeriod: calcVolumePeriod,\n\t}\n\tr.cachedVolumeStats.Store(make(statCache))\n\treturn r\n}",
"func resourceVolterraRateLimiterUpdate(d *schema.ResourceData, meta interface{}) error {\n\tclient := meta.(*APIClient)\n\n\tupdateMeta := &ves_io_schema.ObjectReplaceMetaType{}\n\tupdateSpec := &ves_io_schema_rate_limiter.ReplaceSpecType{}\n\tupdateReq := &ves_io_schema_rate_limiter.ReplaceRequest{\n\t\tMetadata: updateMeta,\n\t\tSpec: updateSpec,\n\t}\n\tif v, ok := d.GetOk(\"annotations\"); ok && !isIntfNil(v) {\n\n\t\tms := map[string]string{}\n\n\t\tfor k, v := range v.(map[string]interface{}) {\n\t\t\tval := v.(string)\n\t\t\tms[k] = val\n\t\t}\n\t\tupdateMeta.Annotations = ms\n\t}\n\n\tif v, ok := d.GetOk(\"description\"); ok && !isIntfNil(v) {\n\t\tupdateMeta.Description =\n\t\t\tv.(string)\n\t}\n\n\tif v, ok := d.GetOk(\"disable\"); ok && !isIntfNil(v) {\n\t\tupdateMeta.Disable =\n\t\t\tv.(bool)\n\t}\n\n\tif v, ok := d.GetOk(\"labels\"); ok && !isIntfNil(v) {\n\n\t\tms := map[string]string{}\n\n\t\tfor k, v := range v.(map[string]interface{}) {\n\t\t\tval := v.(string)\n\t\t\tms[k] = val\n\t\t}\n\t\tupdateMeta.Labels = ms\n\t}\n\n\tif v, ok := d.GetOk(\"name\"); ok && !isIntfNil(v) {\n\t\tupdateMeta.Name =\n\t\t\tv.(string)\n\t}\n\n\tif v, ok := d.GetOk(\"namespace\"); ok && !isIntfNil(v) {\n\t\tupdateMeta.Namespace =\n\t\t\tv.(string)\n\t}\n\n\tif v, ok := d.GetOk(\"limits\"); ok && !isIntfNil(v) {\n\n\t\tsl := v.([]interface{})\n\t\tlimits := make([]*ves_io_schema_rate_limiter.RateLimitValue, len(sl))\n\t\tupdateSpec.Limits = limits\n\t\tfor i, set := range sl {\n\t\t\tlimits[i] = &ves_io_schema_rate_limiter.RateLimitValue{}\n\t\t\tlimitsMapStrToI := set.(map[string]interface{})\n\n\t\t\tif w, ok := limitsMapStrToI[\"burst_multiplier\"]; ok && !isIntfNil(w) {\n\t\t\t\tlimits[i].BurstMultiplier = uint32(w.(int))\n\t\t\t}\n\n\t\t\tif w, ok := limitsMapStrToI[\"total_number\"]; ok && !isIntfNil(w) {\n\t\t\t\tlimits[i].TotalNumber = uint32(w.(int))\n\t\t\t}\n\n\t\t\tif v, ok := limitsMapStrToI[\"unit\"]; ok && !isIntfNil(v) {\n\n\t\t\t\tlimits[i].Unit = ves_io_schema_rate_limiter.RateLimitPeriodUnit(ves_io_schema_rate_limiter.RateLimitPeriodUnit_value[v.(string)])\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tif v, ok := d.GetOk(\"user_identification\"); ok && !isIntfNil(v) {\n\n\t\tsl := v.([]interface{})\n\t\tuserIdentificationInt := make([]*ves_io_schema.ObjectRefType, len(sl))\n\t\tupdateSpec.UserIdentification = userIdentificationInt\n\t\tfor i, ps := range sl {\n\n\t\t\tuiMapToStrVal := ps.(map[string]interface{})\n\t\t\tuserIdentificationInt[i] = &ves_io_schema.ObjectRefType{}\n\n\t\t\tuserIdentificationInt[i].Kind = \"user_identification\"\n\n\t\t\tif v, ok := uiMapToStrVal[\"name\"]; ok && !isIntfNil(v) {\n\t\t\t\tuserIdentificationInt[i].Name = v.(string)\n\t\t\t}\n\n\t\t\tif v, ok := uiMapToStrVal[\"namespace\"]; ok && !isIntfNil(v) {\n\t\t\t\tuserIdentificationInt[i].Namespace = v.(string)\n\t\t\t}\n\n\t\t\tif v, ok := uiMapToStrVal[\"tenant\"]; ok && !isIntfNil(v) {\n\t\t\t\tuserIdentificationInt[i].Tenant = v.(string)\n\t\t\t}\n\n\t\t\tif v, ok := uiMapToStrVal[\"uid\"]; ok && !isIntfNil(v) {\n\t\t\t\tuserIdentificationInt[i].Uid = v.(string)\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tlog.Printf(\"[DEBUG] Updating Volterra RateLimiter obj with struct: %+v\", updateReq)\n\n\terr := client.ReplaceObject(context.Background(), ves_io_schema_rate_limiter.ObjectType, updateReq)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error updating RateLimiter: %s\", err)\n\t}\n\n\treturn resourceVolterraRateLimiterRead(d, meta)\n}",
"func (*GetSelfAllowedResources) Descriptor() ([]byte, []int) {\n\treturn file_uac_Authorization_proto_rawDescGZIP(), []int{3}\n}",
"func (r *REST) Create(ctx context.Context, obj runtime.Object, _ rest.ValidateObjectFunc, _ bool) (runtime.Object, error) {\n\tlocalRAR, ok := obj.(*authorizationapi.LocalResourceAccessReview)\n\tif !ok {\n\t\treturn nil, kapierrors.NewBadRequest(fmt.Sprintf(\"not a localResourceAccessReview: %#v\", obj))\n\t}\n\tif errs := authorizationvalidation.ValidateLocalResourceAccessReview(localRAR); len(errs) > 0 {\n\t\treturn nil, kapierrors.NewInvalid(authorization.Kind(localRAR.Kind), \"\", errs)\n\t}\n\tif namespace := apirequest.NamespaceValue(ctx); len(namespace) == 0 {\n\t\treturn nil, kapierrors.NewBadRequest(fmt.Sprintf(\"namespace is required on this type: %v\", namespace))\n\t} else if (len(localRAR.Action.Namespace) > 0) && (namespace != localRAR.Action.Namespace) {\n\t\treturn nil, field.Invalid(field.NewPath(\"namespace\"), localRAR.Action.Namespace, fmt.Sprintf(\"namespace must be: %v\", namespace))\n\t}\n\n\t// transform this into a ResourceAccessReview\n\tclusterRAR := &authorizationapi.ResourceAccessReview{\n\t\tAction: localRAR.Action,\n\t}\n\tclusterRAR.Action.Namespace = apirequest.NamespaceValue(ctx)\n\n\treturn r.clusterRARRegistry.CreateResourceAccessReview(apirequest.WithNamespace(ctx, \"\"), clusterRAR)\n}",
"func (m *FakeMethod) ResourceAllocFunc(ctx context.Context, i interface{}, kvstore kvstore.Interface, kvtxn kvstore.Txn, key string, oper apiintf.APIOperType, apidryrun bool) (apisrv.ResourceRollbackFn, error) {\n\treturn m.ResourceRollbackFunc, nil\n\n}",
"func apiResource(gvk schema.GroupVersionKind, restMapper *restmapper.DeferredDiscoveryRESTMapper) (*metav1.APIResource, error) {\r\n\tmapping, err := restMapper.RESTMapping(gvk.GroupKind(), gvk.Version)\r\n\tif err != nil {\r\n\t\treturn nil, fmt.Errorf(\"failed to get the resource REST mapping for GroupVersionKind(%s): %v\", gvk.String(), err)\r\n\t}\r\n\tresource := &metav1.APIResource{\r\n\t\tName: mapping.Resource.Resource,\r\n\t\tNamespaced: mapping.Scope == meta.RESTScopeNamespace,\r\n\t\tKind: gvk.Kind,\r\n\t}\r\n\treturn resource, nil\r\n}",
"func matchKubernetesResource(resource types.KubernetesResource, allowed, denied []types.KubernetesResource) ([]string, error) {\n\t// utils.KubeResourceMatchesRegex checks if the resource.Kind is strictly equal\n\t// to each entry and validates if the Name and Namespace fields matches the\n\t// regex allowed by each entry.\n\tresult, _, err := utils.KubeResourceMatchesRegexWithVerbsCollector(resource, denied)\n\tif err != nil {\n\t\treturn nil, trace.Wrap(err)\n\t} else if result {\n\t\treturn nil, trace.AccessDenied(\"access to %s %q denied\", resource.Kind, resource.ClusterResource())\n\t}\n\n\tresult, verbs, err := utils.KubeResourceMatchesRegexWithVerbsCollector(resource, allowed)\n\tif err != nil {\n\t\treturn nil, trace.Wrap(err)\n\t} else if !result {\n\t\treturn nil, trace.AccessDenied(\"access to %s %q denied\", resource.Kind, resource.ClusterResource())\n\t}\n\treturn verbs, nil\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
resourceVolterraFastAclRuleCreate creates FastAclRule resource
|
func resourceVolterraFastAclRuleCreate(d *schema.ResourceData, meta interface{}) error {
client := meta.(*APIClient)
createMeta := &ves_io_schema.ObjectCreateMetaType{}
createSpec := &ves_io_schema_fast_acl_rule.CreateSpecType{}
createReq := &ves_io_schema_fast_acl_rule.CreateRequest{
Metadata: createMeta,
Spec: createSpec,
}
if v, ok := d.GetOk("annotations"); ok && !isIntfNil(v) {
ms := map[string]string{}
for k, v := range v.(map[string]interface{}) {
val := v.(string)
ms[k] = val
}
createMeta.Annotations = ms
}
if v, ok := d.GetOk("description"); ok && !isIntfNil(v) {
createMeta.Description =
v.(string)
}
if v, ok := d.GetOk("disable"); ok && !isIntfNil(v) {
createMeta.Disable =
v.(bool)
}
if v, ok := d.GetOk("labels"); ok && !isIntfNil(v) {
ms := map[string]string{}
for k, v := range v.(map[string]interface{}) {
val := v.(string)
ms[k] = val
}
createMeta.Labels = ms
}
if v, ok := d.GetOk("name"); ok && !isIntfNil(v) {
createMeta.Name =
v.(string)
}
if v, ok := d.GetOk("namespace"); ok && !isIntfNil(v) {
createMeta.Namespace =
v.(string)
}
//action
if v, ok := d.GetOk("action"); ok && !isIntfNil(v) {
sl := v.(*schema.Set).List()
action := &ves_io_schema_fast_acl_rule.FastAclRuleAction{}
createSpec.Action = action
for _, set := range sl {
actionMapStrToI := set.(map[string]interface{})
actionTypeFound := false
if v, ok := actionMapStrToI["policer_action"]; ok && !isIntfNil(v) && !actionTypeFound {
actionTypeFound = true
actionInt := &ves_io_schema_fast_acl_rule.FastAclRuleAction_PolicerAction{}
actionInt.PolicerAction = &ves_io_schema.PolicerRefType{}
action.Action = actionInt
sl := v.(*schema.Set).List()
for _, set := range sl {
cs := set.(map[string]interface{})
if v, ok := cs["ref"]; ok && !isIntfNil(v) {
sl := v.([]interface{})
refInt := make([]*ves_io_schema.ObjectRefType, len(sl))
actionInt.PolicerAction.Ref = refInt
for i, ps := range sl {
rMapToStrVal := ps.(map[string]interface{})
refInt[i] = &ves_io_schema.ObjectRefType{}
refInt[i].Kind = "policer"
if v, ok := rMapToStrVal["name"]; ok && !isIntfNil(v) {
refInt[i].Name = v.(string)
}
if v, ok := rMapToStrVal["namespace"]; ok && !isIntfNil(v) {
refInt[i].Namespace = v.(string)
}
if v, ok := rMapToStrVal["tenant"]; ok && !isIntfNil(v) {
refInt[i].Tenant = v.(string)
}
if v, ok := rMapToStrVal["uid"]; ok && !isIntfNil(v) {
refInt[i].Uid = v.(string)
}
}
}
}
}
if v, ok := actionMapStrToI["protocol_policer_action"]; ok && !isIntfNil(v) && !actionTypeFound {
actionTypeFound = true
actionInt := &ves_io_schema_fast_acl_rule.FastAclRuleAction_ProtocolPolicerAction{}
actionInt.ProtocolPolicerAction = &ves_io_schema.ProtocolPolicerRefType{}
action.Action = actionInt
sl := v.(*schema.Set).List()
for _, set := range sl {
cs := set.(map[string]interface{})
if v, ok := cs["ref"]; ok && !isIntfNil(v) {
sl := v.([]interface{})
refInt := make([]*ves_io_schema.ObjectRefType, len(sl))
actionInt.ProtocolPolicerAction.Ref = refInt
for i, ps := range sl {
rMapToStrVal := ps.(map[string]interface{})
refInt[i] = &ves_io_schema.ObjectRefType{}
refInt[i].Kind = "protocol_policer"
if v, ok := rMapToStrVal["name"]; ok && !isIntfNil(v) {
refInt[i].Name = v.(string)
}
if v, ok := rMapToStrVal["namespace"]; ok && !isIntfNil(v) {
refInt[i].Namespace = v.(string)
}
if v, ok := rMapToStrVal["tenant"]; ok && !isIntfNil(v) {
refInt[i].Tenant = v.(string)
}
if v, ok := rMapToStrVal["uid"]; ok && !isIntfNil(v) {
refInt[i].Uid = v.(string)
}
}
}
}
}
if v, ok := actionMapStrToI["simple_action"]; ok && !isIntfNil(v) && !actionTypeFound {
actionTypeFound = true
actionInt := &ves_io_schema_fast_acl_rule.FastAclRuleAction_SimpleAction{}
action.Action = actionInt
actionInt.SimpleAction = ves_io_schema_fast_acl_rule.FastAclRuleSimpleAction(ves_io_schema_fast_acl_rule.FastAclRuleSimpleAction_value[v.(string)])
}
}
}
//port
if v, ok := d.GetOk("port"); ok && !isIntfNil(v) {
sl := v.([]interface{})
port := make([]*ves_io_schema.PortValueType, len(sl))
createSpec.Port = port
for i, set := range sl {
port[i] = &ves_io_schema.PortValueType{}
portMapStrToI := set.(map[string]interface{})
portValueTypeChoiceTypeFound := false
if v, ok := portMapStrToI["all"]; ok && !isIntfNil(v) && !portValueTypeChoiceTypeFound {
portValueTypeChoiceTypeFound = true
if v.(bool) {
portValueTypeChoiceInt := &ves_io_schema.PortValueType_All{}
portValueTypeChoiceInt.All = &ves_io_schema.Empty{}
port[i].PortValueTypeChoice = portValueTypeChoiceInt
}
}
if v, ok := portMapStrToI["dns"]; ok && !isIntfNil(v) && !portValueTypeChoiceTypeFound {
portValueTypeChoiceTypeFound = true
if v.(bool) {
portValueTypeChoiceInt := &ves_io_schema.PortValueType_Dns{}
portValueTypeChoiceInt.Dns = &ves_io_schema.Empty{}
port[i].PortValueTypeChoice = portValueTypeChoiceInt
}
}
if v, ok := portMapStrToI["user_defined"]; ok && !isIntfNil(v) && !portValueTypeChoiceTypeFound {
portValueTypeChoiceTypeFound = true
portValueTypeChoiceInt := &ves_io_schema.PortValueType_UserDefined{}
port[i].PortValueTypeChoice = portValueTypeChoiceInt
portValueTypeChoiceInt.UserDefined = uint32(v.(int))
}
}
}
//source
sourceTypeFound := false
if v, ok := d.GetOk("ip_prefix_set"); ok && !sourceTypeFound {
sourceTypeFound = true
sourceInt := &ves_io_schema_fast_acl_rule.CreateSpecType_IpPrefixSet{}
sourceInt.IpPrefixSet = &ves_io_schema.IpPrefixSetRefType{}
createSpec.Source = sourceInt
sl := v.(*schema.Set).List()
for _, set := range sl {
cs := set.(map[string]interface{})
if v, ok := cs["ref"]; ok && !isIntfNil(v) {
sl := v.([]interface{})
refInt := make([]*ves_io_schema.ObjectRefType, len(sl))
sourceInt.IpPrefixSet.Ref = refInt
for i, ps := range sl {
rMapToStrVal := ps.(map[string]interface{})
refInt[i] = &ves_io_schema.ObjectRefType{}
refInt[i].Kind = "ip_prefix_set"
if v, ok := rMapToStrVal["name"]; ok && !isIntfNil(v) {
refInt[i].Name = v.(string)
}
if v, ok := rMapToStrVal["namespace"]; ok && !isIntfNil(v) {
refInt[i].Namespace = v.(string)
}
if v, ok := rMapToStrVal["tenant"]; ok && !isIntfNil(v) {
refInt[i].Tenant = v.(string)
}
if v, ok := rMapToStrVal["uid"]; ok && !isIntfNil(v) {
refInt[i].Uid = v.(string)
}
}
}
}
}
if v, ok := d.GetOk("prefix"); ok && !sourceTypeFound {
sourceTypeFound = true
sourceInt := &ves_io_schema_fast_acl_rule.CreateSpecType_Prefix{}
sourceInt.Prefix = &ves_io_schema.PrefixListType{}
createSpec.Source = sourceInt
sl := v.(*schema.Set).List()
for _, set := range sl {
cs := set.(map[string]interface{})
if v, ok := cs["ipv6_prefix"]; ok && !isIntfNil(v) {
ls := make([]string, len(v.([]interface{})))
for i, v := range v.([]interface{}) {
ls[i] = v.(string)
}
sourceInt.Prefix.Ipv6Prefix = ls
}
if v, ok := cs["prefix"]; ok && !isIntfNil(v) {
ls := make([]string, len(v.([]interface{})))
for i, v := range v.([]interface{}) {
ls[i] = v.(string)
}
sourceInt.Prefix.Prefix = ls
}
}
}
log.Printf("[DEBUG] Creating Volterra FastAclRule object with struct: %+v", createReq)
createFastAclRuleResp, err := client.CreateObject(context.Background(), ves_io_schema_fast_acl_rule.ObjectType, createReq)
if err != nil {
return fmt.Errorf("error creating FastAclRule: %s", err)
}
d.SetId(createFastAclRuleResp.GetObjSystemMetadata().GetUid())
return resourceVolterraFastAclRuleRead(d, meta)
}
|
[
"func resourceVolterraFastAclRule() *schema.Resource {\n\treturn &schema.Resource{\n\t\tCreate: resourceVolterraFastAclRuleCreate,\n\t\tRead: resourceVolterraFastAclRuleRead,\n\t\tUpdate: resourceVolterraFastAclRuleUpdate,\n\t\tDelete: resourceVolterraFastAclRuleDelete,\n\n\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\"annotations\": {\n\t\t\t\tType: schema.TypeMap,\n\t\t\t\tOptional: true,\n\t\t\t},\n\n\t\t\t\"description\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tOptional: true,\n\t\t\t},\n\n\t\t\t\"disable\": {\n\t\t\t\tType: schema.TypeBool,\n\t\t\t\tOptional: true,\n\t\t\t},\n\n\t\t\t\"labels\": {\n\t\t\t\tType: schema.TypeMap,\n\t\t\t\tOptional: true,\n\t\t\t},\n\n\t\t\t\"name\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tRequired: true,\n\t\t\t\tForceNew: true,\n\t\t\t},\n\n\t\t\t\"namespace\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tRequired: true,\n\t\t\t\tForceNew: true,\n\t\t\t},\n\n\t\t\t\"action\": {\n\n\t\t\t\tType: schema.TypeSet,\n\t\t\t\tOptional: true,\n\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\"policer_action\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"ref\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"kind\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tComputed: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"protocol_policer_action\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"ref\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"kind\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tComputed: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"simple_action\": {\n\n\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t\"port\": {\n\n\t\t\t\tType: schema.TypeList,\n\t\t\t\tOptional: true,\n\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\"all\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"dns\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"user_defined\": {\n\n\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t\"ip_prefix_set\": {\n\n\t\t\t\tType: schema.TypeSet,\n\t\t\t\tOptional: true,\n\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\"ref\": {\n\n\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"kind\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tComputed: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t\"prefix\": {\n\n\t\t\t\tType: schema.TypeSet,\n\t\t\t\tOptional: true,\n\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\"ipv6_prefix\": {\n\n\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"prefix\": {\n\n\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n}",
"func resourceVolterraFastAclRuleUpdate(d *schema.ResourceData, meta interface{}) error {\n\tclient := meta.(*APIClient)\n\n\tupdateMeta := &ves_io_schema.ObjectReplaceMetaType{}\n\tupdateSpec := &ves_io_schema_fast_acl_rule.ReplaceSpecType{}\n\tupdateReq := &ves_io_schema_fast_acl_rule.ReplaceRequest{\n\t\tMetadata: updateMeta,\n\t\tSpec: updateSpec,\n\t}\n\tif v, ok := d.GetOk(\"annotations\"); ok && !isIntfNil(v) {\n\n\t\tms := map[string]string{}\n\n\t\tfor k, v := range v.(map[string]interface{}) {\n\t\t\tval := v.(string)\n\t\t\tms[k] = val\n\t\t}\n\t\tupdateMeta.Annotations = ms\n\t}\n\n\tif v, ok := d.GetOk(\"description\"); ok && !isIntfNil(v) {\n\t\tupdateMeta.Description =\n\t\t\tv.(string)\n\t}\n\n\tif v, ok := d.GetOk(\"disable\"); ok && !isIntfNil(v) {\n\t\tupdateMeta.Disable =\n\t\t\tv.(bool)\n\t}\n\n\tif v, ok := d.GetOk(\"labels\"); ok && !isIntfNil(v) {\n\n\t\tms := map[string]string{}\n\n\t\tfor k, v := range v.(map[string]interface{}) {\n\t\t\tval := v.(string)\n\t\t\tms[k] = val\n\t\t}\n\t\tupdateMeta.Labels = ms\n\t}\n\n\tif v, ok := d.GetOk(\"name\"); ok && !isIntfNil(v) {\n\t\tupdateMeta.Name =\n\t\t\tv.(string)\n\t}\n\n\tif v, ok := d.GetOk(\"namespace\"); ok && !isIntfNil(v) {\n\t\tupdateMeta.Namespace =\n\t\t\tv.(string)\n\t}\n\n\tif v, ok := d.GetOk(\"action\"); ok && !isIntfNil(v) {\n\n\t\tsl := v.(*schema.Set).List()\n\t\taction := &ves_io_schema_fast_acl_rule.FastAclRuleAction{}\n\t\tupdateSpec.Action = action\n\t\tfor _, set := range sl {\n\t\t\tactionMapStrToI := set.(map[string]interface{})\n\n\t\t\tactionTypeFound := false\n\n\t\t\tif v, ok := actionMapStrToI[\"policer_action\"]; ok && !isIntfNil(v) && !actionTypeFound {\n\n\t\t\t\tactionTypeFound = true\n\t\t\t\tactionInt := &ves_io_schema_fast_acl_rule.FastAclRuleAction_PolicerAction{}\n\t\t\t\tactionInt.PolicerAction = &ves_io_schema.PolicerRefType{}\n\t\t\t\taction.Action = actionInt\n\n\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\tfor _, set := range sl {\n\t\t\t\t\tcs := set.(map[string]interface{})\n\n\t\t\t\t\tif v, ok := cs[\"ref\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\tsl := v.([]interface{})\n\t\t\t\t\t\trefInt := make([]*ves_io_schema.ObjectRefType, len(sl))\n\t\t\t\t\t\tactionInt.PolicerAction.Ref = refInt\n\t\t\t\t\t\tfor i, ps := range sl {\n\n\t\t\t\t\t\t\trMapToStrVal := ps.(map[string]interface{})\n\t\t\t\t\t\t\trefInt[i] = &ves_io_schema.ObjectRefType{}\n\n\t\t\t\t\t\t\trefInt[i].Kind = \"policer\"\n\n\t\t\t\t\t\t\tif v, ok := rMapToStrVal[\"name\"]; ok && !isIntfNil(v) {\n\t\t\t\t\t\t\t\trefInt[i].Name = v.(string)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif v, ok := rMapToStrVal[\"namespace\"]; ok && !isIntfNil(v) {\n\t\t\t\t\t\t\t\trefInt[i].Namespace = v.(string)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif v, ok := rMapToStrVal[\"tenant\"]; ok && !isIntfNil(v) {\n\t\t\t\t\t\t\t\trefInt[i].Tenant = v.(string)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif v, ok := rMapToStrVal[\"uid\"]; ok && !isIntfNil(v) {\n\t\t\t\t\t\t\t\trefInt[i].Uid = v.(string)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif v, ok := actionMapStrToI[\"protocol_policer_action\"]; ok && !isIntfNil(v) && !actionTypeFound {\n\n\t\t\t\tactionTypeFound = true\n\t\t\t\tactionInt := &ves_io_schema_fast_acl_rule.FastAclRuleAction_ProtocolPolicerAction{}\n\t\t\t\tactionInt.ProtocolPolicerAction = &ves_io_schema.ProtocolPolicerRefType{}\n\t\t\t\taction.Action = actionInt\n\n\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\tfor _, set := range sl {\n\t\t\t\t\tcs := set.(map[string]interface{})\n\n\t\t\t\t\tif v, ok := cs[\"ref\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\tsl := v.([]interface{})\n\t\t\t\t\t\trefInt := make([]*ves_io_schema.ObjectRefType, len(sl))\n\t\t\t\t\t\tactionInt.ProtocolPolicerAction.Ref = refInt\n\t\t\t\t\t\tfor i, ps := range sl {\n\n\t\t\t\t\t\t\trMapToStrVal := ps.(map[string]interface{})\n\t\t\t\t\t\t\trefInt[i] = &ves_io_schema.ObjectRefType{}\n\n\t\t\t\t\t\t\trefInt[i].Kind = \"protocol_policer\"\n\n\t\t\t\t\t\t\tif v, ok := rMapToStrVal[\"name\"]; ok && !isIntfNil(v) {\n\t\t\t\t\t\t\t\trefInt[i].Name = v.(string)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif v, ok := rMapToStrVal[\"namespace\"]; ok && !isIntfNil(v) {\n\t\t\t\t\t\t\t\trefInt[i].Namespace = v.(string)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif v, ok := rMapToStrVal[\"tenant\"]; ok && !isIntfNil(v) {\n\t\t\t\t\t\t\t\trefInt[i].Tenant = v.(string)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif v, ok := rMapToStrVal[\"uid\"]; ok && !isIntfNil(v) {\n\t\t\t\t\t\t\t\trefInt[i].Uid = v.(string)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif v, ok := actionMapStrToI[\"simple_action\"]; ok && !isIntfNil(v) && !actionTypeFound {\n\n\t\t\t\tactionTypeFound = true\n\t\t\t\tactionInt := &ves_io_schema_fast_acl_rule.FastAclRuleAction_SimpleAction{}\n\n\t\t\t\taction.Action = actionInt\n\n\t\t\t\tactionInt.SimpleAction = ves_io_schema_fast_acl_rule.FastAclRuleSimpleAction(ves_io_schema_fast_acl_rule.FastAclRuleSimpleAction_value[v.(string)])\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tif v, ok := d.GetOk(\"port\"); ok && !isIntfNil(v) {\n\n\t\tsl := v.([]interface{})\n\t\tport := make([]*ves_io_schema.PortValueType, len(sl))\n\t\tupdateSpec.Port = port\n\t\tfor i, set := range sl {\n\t\t\tport[i] = &ves_io_schema.PortValueType{}\n\t\t\tportMapStrToI := set.(map[string]interface{})\n\n\t\t\tportValueTypeChoiceTypeFound := false\n\n\t\t\tif v, ok := portMapStrToI[\"all\"]; ok && !isIntfNil(v) && !portValueTypeChoiceTypeFound {\n\n\t\t\t\tportValueTypeChoiceTypeFound = true\n\n\t\t\t\tif v.(bool) {\n\t\t\t\t\tportValueTypeChoiceInt := &ves_io_schema.PortValueType_All{}\n\t\t\t\t\tportValueTypeChoiceInt.All = &ves_io_schema.Empty{}\n\t\t\t\t\tport[i].PortValueTypeChoice = portValueTypeChoiceInt\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif v, ok := portMapStrToI[\"dns\"]; ok && !isIntfNil(v) && !portValueTypeChoiceTypeFound {\n\n\t\t\t\tportValueTypeChoiceTypeFound = true\n\n\t\t\t\tif v.(bool) {\n\t\t\t\t\tportValueTypeChoiceInt := &ves_io_schema.PortValueType_Dns{}\n\t\t\t\t\tportValueTypeChoiceInt.Dns = &ves_io_schema.Empty{}\n\t\t\t\t\tport[i].PortValueTypeChoice = portValueTypeChoiceInt\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif v, ok := portMapStrToI[\"user_defined\"]; ok && !isIntfNil(v) && !portValueTypeChoiceTypeFound {\n\n\t\t\t\tportValueTypeChoiceTypeFound = true\n\t\t\t\tportValueTypeChoiceInt := &ves_io_schema.PortValueType_UserDefined{}\n\n\t\t\t\tport[i].PortValueTypeChoice = portValueTypeChoiceInt\n\n\t\t\t\tportValueTypeChoiceInt.UserDefined = uint32(v.(int))\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tsourceTypeFound := false\n\n\tif v, ok := d.GetOk(\"ip_prefix_set\"); ok && !sourceTypeFound {\n\n\t\tsourceTypeFound = true\n\t\tsourceInt := &ves_io_schema_fast_acl_rule.ReplaceSpecType_IpPrefixSet{}\n\t\tsourceInt.IpPrefixSet = &ves_io_schema.IpPrefixSetRefType{}\n\t\tupdateSpec.Source = sourceInt\n\n\t\tsl := v.(*schema.Set).List()\n\t\tfor _, set := range sl {\n\t\t\tcs := set.(map[string]interface{})\n\n\t\t\tif v, ok := cs[\"ref\"]; ok && !isIntfNil(v) {\n\n\t\t\t\tsl := v.([]interface{})\n\t\t\t\trefInt := make([]*ves_io_schema.ObjectRefType, len(sl))\n\t\t\t\tsourceInt.IpPrefixSet.Ref = refInt\n\t\t\t\tfor i, ps := range sl {\n\n\t\t\t\t\trMapToStrVal := ps.(map[string]interface{})\n\t\t\t\t\trefInt[i] = &ves_io_schema.ObjectRefType{}\n\n\t\t\t\t\trefInt[i].Kind = \"ip_prefix_set\"\n\n\t\t\t\t\tif v, ok := rMapToStrVal[\"name\"]; ok && !isIntfNil(v) {\n\t\t\t\t\t\trefInt[i].Name = v.(string)\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := rMapToStrVal[\"namespace\"]; ok && !isIntfNil(v) {\n\t\t\t\t\t\trefInt[i].Namespace = v.(string)\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := rMapToStrVal[\"tenant\"]; ok && !isIntfNil(v) {\n\t\t\t\t\t\trefInt[i].Tenant = v.(string)\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := rMapToStrVal[\"uid\"]; ok && !isIntfNil(v) {\n\t\t\t\t\t\trefInt[i].Uid = v.(string)\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tif v, ok := d.GetOk(\"prefix\"); ok && !sourceTypeFound {\n\n\t\tsourceTypeFound = true\n\t\tsourceInt := &ves_io_schema_fast_acl_rule.ReplaceSpecType_Prefix{}\n\t\tsourceInt.Prefix = &ves_io_schema.PrefixListType{}\n\t\tupdateSpec.Source = sourceInt\n\n\t\tsl := v.(*schema.Set).List()\n\t\tfor _, set := range sl {\n\t\t\tcs := set.(map[string]interface{})\n\n\t\t\tif v, ok := cs[\"ipv6_prefix\"]; ok && !isIntfNil(v) {\n\n\t\t\t\tls := make([]string, len(v.([]interface{})))\n\t\t\t\tfor i, v := range v.([]interface{}) {\n\t\t\t\t\tls[i] = v.(string)\n\t\t\t\t}\n\t\t\t\tsourceInt.Prefix.Ipv6Prefix = ls\n\n\t\t\t}\n\n\t\t\tif v, ok := cs[\"prefix\"]; ok && !isIntfNil(v) {\n\n\t\t\t\tls := make([]string, len(v.([]interface{})))\n\t\t\t\tfor i, v := range v.([]interface{}) {\n\t\t\t\t\tls[i] = v.(string)\n\t\t\t\t}\n\t\t\t\tsourceInt.Prefix.Prefix = ls\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tlog.Printf(\"[DEBUG] Updating Volterra FastAclRule obj with struct: %+v\", updateReq)\n\n\terr := client.ReplaceObject(context.Background(), ves_io_schema_fast_acl_rule.ObjectType, updateReq)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error updating FastAclRule: %s\", err)\n\t}\n\n\treturn resourceVolterraFastAclRuleRead(d, meta)\n}",
"func ACLCreate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics {\n\tlog.Printf(\"IN ACLCreate()\\n\")\n\n\tlog.Println(\"ResourceData\")\n\tlog.Println(d)\n\tlog.Println(\"meta\")\n\tlog.Println(meta)\n\tlog.Println(\"ctx\")\n\tlog.Println(ctx)\n\n\tbrokers := meta.([]interface{})\n\tvar brokersList []string\n\tif brokers != nil {\n\t\tfor _, b := range brokers {\n\t\t\tbrokersList = append(brokersList, b.(string))\n\t\t\tlog.Println(\"broker: \", b.(string))\n\t\t}\n\t}\n\tprincipal := d.Get(\"principal\")\n\thost := d.Get(\"host\").(string)\n\toperationStr := d.Get(\"operation\").(string)\n\tpermissionTypeStr := d.Get(\"permission\").(string)\n\n\tresource, ok := d.GetOk(\"resource\")\n\n\tlog.Println(\"ok: \" + strconv.FormatBool(ok))\n\tlog.Println(\"resource\")\n\tlog.Println(resource)\n\n\tresourceTypeStr := \"\" // resource[\"resource_type\"].(string)\n\tresourceName := \"\" // resource[\"resource_name\"].(string)\n\tresourcePatternTypeStr := \"\" // resource[\"resource_pattern_type\"].(string)\n\n\toperation, err := operationToOpCode(operationStr)\n\tpermission, err := permissionToOpCode(permissionTypeStr)\n\n\tresourceOp, err := resourceToOpCode(resourceTypeStr)\n\tpatternOp, err := resourcePatternToOpCode(resourcePatternTypeStr)\n\t// r := Resource{ResourceType: AclResourceTopic, ResourceName: \"my_topic\"}\n\t// a := Acl{Host: \"localhost\", Operation: AclOperationAlter, PermissionType: AclPermissionAny}\n\n\tresourceStruct := sarama.Resource{\n\t\tResourceType: sarama.AclResourceType(resourceOp),\n\t\tResourceName: resourceName,\n\t\tResourcePatternType: sarama.AclResourcePatternType(patternOp),\n\t}\n\taclStruct := sarama.Acl{\n\t\tPrincipal: principal.(string),\n\t\tHost: host,\n\t\tOperation: sarama.AclOperation(operation),\n\t\tPermissionType: sarama.AclPermissionType(permission),\n\t}\n\n\tlog.Println(\"Building config\")\n\tconfig := sarama.NewConfig()\n\t// client, err := sarama.NewClient(brokersList, config)\n\t// if err != nil {\n\t// \tlog.Fatal(\"Error occurred building client. Error was: %s\\n\", err.Error())\n\t// }\n\tclusterAdmin, err := sarama.NewClusterAdmin(brokersList, config)\n\tif err != nil {\n\t\tlog.Fatal(\"Error occurred building admin client. Error was: %s\\n\", err.Error())\n\t}\n\n\tlog.Println(\"Creating ACL via Admin-Client\")\n\terr = clusterAdmin.CreateACL(resourceStruct, aclStruct)\n\tif err != nil {\n\t\tlog.Fatal(\"Error occurred calling CreateACL(). Error was: %s\\n\", err.Error())\n\t}\n\terr = clusterAdmin.Close()\n\tif err != nil {\n\t\tlog.Fatal(\"Error occurred closing out client connection. Error was: %s\\n\", err.Error())\n\t}\n\n\treturn nil\n}",
"func (r *REST) Create(ctx context.Context, obj runtime.Object, _ rest.ValidateObjectFunc, _ bool) (runtime.Object, error) {\n\tlocalRAR, ok := obj.(*authorizationapi.LocalResourceAccessReview)\n\tif !ok {\n\t\treturn nil, kapierrors.NewBadRequest(fmt.Sprintf(\"not a localResourceAccessReview: %#v\", obj))\n\t}\n\tif errs := authorizationvalidation.ValidateLocalResourceAccessReview(localRAR); len(errs) > 0 {\n\t\treturn nil, kapierrors.NewInvalid(authorization.Kind(localRAR.Kind), \"\", errs)\n\t}\n\tif namespace := apirequest.NamespaceValue(ctx); len(namespace) == 0 {\n\t\treturn nil, kapierrors.NewBadRequest(fmt.Sprintf(\"namespace is required on this type: %v\", namespace))\n\t} else if (len(localRAR.Action.Namespace) > 0) && (namespace != localRAR.Action.Namespace) {\n\t\treturn nil, field.Invalid(field.NewPath(\"namespace\"), localRAR.Action.Namespace, fmt.Sprintf(\"namespace must be: %v\", namespace))\n\t}\n\n\t// transform this into a ResourceAccessReview\n\tclusterRAR := &authorizationapi.ResourceAccessReview{\n\t\tAction: localRAR.Action,\n\t}\n\tclusterRAR.Action.Namespace = apirequest.NamespaceValue(ctx)\n\n\treturn r.clusterRARRegistry.CreateResourceAccessReview(apirequest.WithNamespace(ctx, \"\"), clusterRAR)\n}",
"func (h *GRPCRuleMgr) CreateOrUpdateRule(servicePrefix, forwardDst string, insecure bool) {\n\th.Store(servicePrefix, &GRPCRule{\n\t\tServicePrefix: servicePrefix,\n\t\tForwardDst: forwardDst,\n\t\tInsecure: insecure})\n}",
"func (af *afData) afCreate(nefCtx *nefContext, afID string) error {\n\n\t//Validate afid ??\n\n\taf.afID = afID\n\taf.subIDnum = nefCtx.cfg.SubStartID //Start Number\n\taf.maxSubSupp = nefCtx.cfg.MaxSubSupport\n\taf.subs = make(map[string]*afSubscription)\n\treturn nil\n}",
"func (p *PCE) CreateRule(rulesetHref string, rule Rule) (createdRule Rule, api APIResponse, err error) {\n\tapi, err = p.Post(strings.TrimPrefix(rulesetHref, fmt.Sprintf(\"/orgs/%d/\", p.Org))+\"/sec_rules\", &rule, &createdRule)\n\treturn createdRule, api, err\n}",
"func (f *FTD) CreateAccessRule(n *AccessRule, policy string) error {\n\tvar err error\n\n\t// Define expected type for this object\n\tn.Type = \"accessrule\"\n\n\tendpoint := fmt.Sprintf(\"policy/accesspolicies/%s/accessrules\", policy)\n\tdata, err := f.Post(endpoint, n)\n\tif err != nil {\n\t\tif f.debug {\n\t\t\tglog.Errorf(\"Error: %s\\n\", err)\n\t\t}\n\t\treturn err\n\t}\n\n\terr = json.Unmarshal(data, &n)\n\tif err != nil {\n\t\tif f.debug {\n\t\t\tglog.Errorf(\"Error: %s\\n\", err)\n\t\t}\n\t\treturn err\n\t}\n\n\tn.parent = policy\n\n\treturn nil\n}",
"func Create(c *gophercloud.ServiceClient, opts CreateOpts) CreateResult {\n\n\ttype rule struct {\n\t\tTenantID string `json:\"tenant_id,omitempty\"`\n\t\tName string `json:\"name\"`\n\t\tDescription string `json:\"description\"`\n\t\tProtocol string `json:\"protocol\"`\n\t\tAction string `json:\"action\"`\n\t\tIPVersion *int `json:\"ip_version,omitempty\"`\n\t\tSourceIPAddress string `json:\"source_ip_address,omitempty\"`\n\t\tDestinationIPAddress string `json:\"destination_ip_address,omitempty\"`\n\t\tSourcePort string `json:\"source_port,omitempty\"`\n\t\tDestinationPort string `json:\"destination_port,omitempty\"`\n\t\tShared *bool `json:\"shared,omitempty\"`\n\t\tEnabled *bool `json:\"enabled,omitempty\"`\n\t}\n\ttype request struct {\n\t\tRule rule `json:\"firewall_rule\"`\n\t}\n\n\treqBody := request{Rule: rule{\n\t\tTenantID: opts.TenantID,\n\t\tName: opts.Name,\n\t\tDescription: opts.Description,\n\t\tProtocol: opts.Protocol,\n\t\tAction: opts.Action,\n\t\tIPVersion: opts.IPVersion,\n\t\tSourceIPAddress: opts.SourceIPAddress,\n\t\tDestinationIPAddress: opts.DestinationIPAddress,\n\t\tSourcePort: opts.SourcePort,\n\t\tDestinationPort: opts.DestinationPort,\n\t\tShared: opts.Shared,\n\t\tEnabled: opts.Enabled,\n\t}}\n\n\tvar res CreateResult\n\t_, res.Err = perigee.Request(\"POST\", rootURL(c), perigee.Options{\n\t\tMoreHeaders: c.AuthenticatedHeaders(),\n\t\tReqBody: &reqBody,\n\t\tResults: &res.Body,\n\t\tOkCodes: []int{201},\n\t})\n\treturn res\n}",
"func createResource(env *localenv.LocalEnvironment, filename string, upsert bool) error {\n\toperator, err := env.OperatorService(\"\")\n\tif err != nil {\n\t\treturn trace.Wrap(err)\n\t}\n\topsURL, err := env.SelectOpsCenter(\"\")\n\tif err != nil {\n\t\treturn trace.Wrap(err)\n\t}\n\tapps, err := env.AppService(opsURL, localenv.AppConfig{})\n\tif err != nil {\n\t\treturn trace.Wrap(err)\n\t}\n\tteleResources := tele.New(tele.Config{\n\t\tOperator: operator,\n\t\tApps: apps,\n\t\tSilent: env.Silent,\n\t})\n\treader, err := common.GetReader(filename)\n\tif err != nil {\n\t\treturn trace.Wrap(err)\n\t}\n\tdefer reader.Close()\n\treq := resources.CreateRequest{\n\t\tUpsert: upsert,\n\t}\n\terr = resources.NewControl(teleResources).Create(context.TODO(), reader, req)\n\tif err != nil {\n\t\treturn trace.Wrap(err)\n\t}\n\treturn nil\n}",
"func (k *Visor) CreateResource(ctx context.Context, t ResourceType, v ManagedNames, name string) (err error) {\n\tvv, ok := v.(runtime.Object)\n\tif !ok {\n\t\treturn errors.Errorf(\"provided value was not castable to runtime.Object\")\n\t}\n\n\tgenfix := \"x-\"\n\tvar c rest.Interface\n\tswitch t {\n\tcase ResourceTypeJobs:\n\t\tc = k.api.BatchV1().RESTClient()\n\t\tgenfix = \"j-\"\n\tcase ResourceTypePods:\n\t\tc = k.api.CoreV1().RESTClient()\n\t\tgenfix = \"p-\"\n\tcase ResourceTypeDeployments, ResourceTypeDaemonsets:\n\t\tc = k.api.AppsV1().RESTClient()\n\t\tgenfix = \"d-\"\n\tcase ResourceTypeSecrets:\n\t\tc = k.api.CoreV1().RESTClient()\n\t\tgenfix = \"s-\"\n\tcase ResourceTypeDatasets:\n\t\tc = k.crd.NerdalizeV1().RESTClient()\n\t\tgenfix = \"d-\"\n\tdefault:\n\t\treturn errors.Errorf(\"unknown Kubernetes resource type provided for creation: '%s'\", t)\n\t}\n\n\tif name != \"\" && genfix != \"\" {\n\t\tv.SetName(k.applyPrefix(name))\n\t} else {\n\t\tv.SetGenerateName(k.prefix + genfix)\n\t}\n\n\tlabels := v.GetLabels()\n\tif labels == nil {\n\t\tlabels = map[string]string{}\n\t}\n\n\tlabels[\"nerd-app\"] = \"cli\"\n\tv.SetLabels(labels)\n\n\tk.logs.Debugf(\"creating %s '%s' in namespace '%s' and labels '%v': %s\", t, v.GetName(), k.ns, labels, ctx)\n\terr = c.Post().\n\t\tNamespace(k.ns).\n\t\tResource(string(t)).\n\t\tBody(vv).\n\t\tContext(ctx).\n\t\tDo().\n\t\tInto(vv)\n\n\tif err != nil {\n\t\treturn k.tagError(err)\n\t}\n\n\tv.SetName(k.removePrefix(v.GetName())) //normalize back to unprefixed resource name\n\treturn nil\n}",
"func resourceVolterraRouteCreate(d *schema.ResourceData, meta interface{}) error {\n\tclient := meta.(*APIClient)\n\n\tcreateMeta := &ves_io_schema.ObjectCreateMetaType{}\n\tcreateSpec := &ves_io_schema_route.CreateSpecType{}\n\tcreateReq := &ves_io_schema_route.CreateRequest{\n\t\tMetadata: createMeta,\n\t\tSpec: createSpec,\n\t}\n\n\tif v, ok := d.GetOk(\"annotations\"); ok && !isIntfNil(v) {\n\n\t\tms := map[string]string{}\n\n\t\tfor k, v := range v.(map[string]interface{}) {\n\t\t\tval := v.(string)\n\t\t\tms[k] = val\n\t\t}\n\t\tcreateMeta.Annotations = ms\n\t}\n\n\tif v, ok := d.GetOk(\"description\"); ok && !isIntfNil(v) {\n\t\tcreateMeta.Description =\n\t\t\tv.(string)\n\t}\n\n\tif v, ok := d.GetOk(\"disable\"); ok && !isIntfNil(v) {\n\t\tcreateMeta.Disable =\n\t\t\tv.(bool)\n\t}\n\n\tif v, ok := d.GetOk(\"labels\"); ok && !isIntfNil(v) {\n\n\t\tms := map[string]string{}\n\n\t\tfor k, v := range v.(map[string]interface{}) {\n\t\t\tval := v.(string)\n\t\t\tms[k] = val\n\t\t}\n\t\tcreateMeta.Labels = ms\n\t}\n\n\tif v, ok := d.GetOk(\"name\"); ok && !isIntfNil(v) {\n\t\tcreateMeta.Name =\n\t\t\tv.(string)\n\t}\n\n\tif v, ok := d.GetOk(\"namespace\"); ok && !isIntfNil(v) {\n\t\tcreateMeta.Namespace =\n\t\t\tv.(string)\n\t}\n\n\t//routes\n\tif v, ok := d.GetOk(\"routes\"); ok && !isIntfNil(v) {\n\n\t\tsl := v.([]interface{})\n\t\troutes := make([]*ves_io_schema_route.RouteType, len(sl))\n\t\tcreateSpec.Routes = routes\n\t\tfor i, set := range sl {\n\t\t\troutes[i] = &ves_io_schema_route.RouteType{}\n\t\t\troutesMapStrToI := set.(map[string]interface{})\n\n\t\t\tbotDefenseJavascriptInjectionChoiceTypeFound := false\n\n\t\t\tif v, ok := routesMapStrToI[\"bot_defense_javascript_injection\"]; ok && !isIntfNil(v) && !botDefenseJavascriptInjectionChoiceTypeFound {\n\n\t\t\t\tbotDefenseJavascriptInjectionChoiceTypeFound = true\n\t\t\t\tbotDefenseJavascriptInjectionChoiceInt := &ves_io_schema_route.RouteType_BotDefenseJavascriptInjection{}\n\t\t\t\tbotDefenseJavascriptInjectionChoiceInt.BotDefenseJavascriptInjection = &ves_io_schema_route.BotDefenseJavascriptInjectionType{}\n\t\t\t\troutes[i].BotDefenseJavascriptInjectionChoice = botDefenseJavascriptInjectionChoiceInt\n\n\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\tfor _, set := range sl {\n\t\t\t\t\tcs := set.(map[string]interface{})\n\n\t\t\t\t\tif v, ok := cs[\"javascript_location\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\tbotDefenseJavascriptInjectionChoiceInt.BotDefenseJavascriptInjection.JavascriptLocation = ves_io_schema_route.JavaScriptLocation(ves_io_schema_route.JavaScriptLocation_value[v.(string)])\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := cs[\"javascript_tags\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\tsl := v.([]interface{})\n\t\t\t\t\t\tjavascriptTags := make([]*ves_io_schema_route.JavaScriptTag, len(sl))\n\t\t\t\t\t\tbotDefenseJavascriptInjectionChoiceInt.BotDefenseJavascriptInjection.JavascriptTags = javascriptTags\n\t\t\t\t\t\tfor i, set := range sl {\n\t\t\t\t\t\t\tjavascriptTags[i] = &ves_io_schema_route.JavaScriptTag{}\n\t\t\t\t\t\t\tjavascriptTagsMapStrToI := set.(map[string]interface{})\n\n\t\t\t\t\t\t\tif w, ok := javascriptTagsMapStrToI[\"javascript_url\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\tjavascriptTags[i].JavascriptUrl = w.(string)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif v, ok := javascriptTagsMapStrToI[\"tag_attributes\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\tsl := v.([]interface{})\n\t\t\t\t\t\t\t\ttagAttributes := make([]*ves_io_schema_route.TagAttribute, len(sl))\n\t\t\t\t\t\t\t\tjavascriptTags[i].TagAttributes = tagAttributes\n\t\t\t\t\t\t\t\tfor i, set := range sl {\n\t\t\t\t\t\t\t\t\ttagAttributes[i] = &ves_io_schema_route.TagAttribute{}\n\t\t\t\t\t\t\t\t\ttagAttributesMapStrToI := set.(map[string]interface{})\n\n\t\t\t\t\t\t\t\t\tif v, ok := tagAttributesMapStrToI[\"javascript_tag\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\t\t\ttagAttributes[i].JavascriptTag = ves_io_schema_route.TagAttributeName(ves_io_schema_route.TagAttributeName_value[v.(string)])\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif w, ok := tagAttributesMapStrToI[\"tag_value\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\t\t\ttagAttributes[i].TagValue = w.(string)\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif v, ok := routesMapStrToI[\"inherited_bot_defense_javascript_injection\"]; ok && !isIntfNil(v) && !botDefenseJavascriptInjectionChoiceTypeFound {\n\n\t\t\t\tbotDefenseJavascriptInjectionChoiceTypeFound = true\n\n\t\t\t\tif v.(bool) {\n\t\t\t\t\tbotDefenseJavascriptInjectionChoiceInt := &ves_io_schema_route.RouteType_InheritedBotDefenseJavascriptInjection{}\n\t\t\t\t\tbotDefenseJavascriptInjectionChoiceInt.InheritedBotDefenseJavascriptInjection = &ves_io_schema.Empty{}\n\t\t\t\t\troutes[i].BotDefenseJavascriptInjectionChoice = botDefenseJavascriptInjectionChoiceInt\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif v, ok := routesMapStrToI[\"bot_defense_javascript_injection_inline_mode\"]; ok && !isIntfNil(v) {\n\n\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\tbotDefenseJavascriptInjectionInlineMode := &ves_io_schema_route.ContentRewriteType{}\n\t\t\t\troutes[i].BotDefenseJavascriptInjectionInlineMode = botDefenseJavascriptInjectionInlineMode\n\t\t\t\tfor _, set := range sl {\n\t\t\t\t\tbotDefenseJavascriptInjectionInlineModeMapStrToI := set.(map[string]interface{})\n\n\t\t\t\t\tif w, ok := botDefenseJavascriptInjectionInlineModeMapStrToI[\"element_selector\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\tbotDefenseJavascriptInjectionInlineMode.ElementSelector = w.(string)\n\t\t\t\t\t}\n\n\t\t\t\t\tif w, ok := botDefenseJavascriptInjectionInlineModeMapStrToI[\"insert_content\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\tbotDefenseJavascriptInjectionInlineMode.InsertContent = w.(string)\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := botDefenseJavascriptInjectionInlineModeMapStrToI[\"position\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\tbotDefenseJavascriptInjectionInlineMode.Position = ves_io_schema_policy.HTMLPosition(ves_io_schema_policy.HTMLPosition_value[v.(string)])\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif w, ok := routesMapStrToI[\"disable_custom_script\"]; ok && !isIntfNil(w) {\n\t\t\t\troutes[i].DisableCustomScript = w.(bool)\n\t\t\t}\n\n\t\t\tif w, ok := routesMapStrToI[\"disable_location_add\"]; ok && !isIntfNil(w) {\n\t\t\t\troutes[i].DisableLocationAdd = w.(bool)\n\t\t\t}\n\n\t\t\tif v, ok := routesMapStrToI[\"match\"]; ok && !isIntfNil(v) {\n\n\t\t\t\tsl := v.([]interface{})\n\t\t\t\tmatch := make([]*ves_io_schema.RouteMatch, len(sl))\n\t\t\t\troutes[i].Match = match\n\t\t\t\tfor i, set := range sl {\n\t\t\t\t\tmatch[i] = &ves_io_schema.RouteMatch{}\n\t\t\t\t\tmatchMapStrToI := set.(map[string]interface{})\n\n\t\t\t\t\tif v, ok := matchMapStrToI[\"headers\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\tsl := v.([]interface{})\n\t\t\t\t\t\theaders := make([]*ves_io_schema.HeaderMatcherType, len(sl))\n\t\t\t\t\t\tmatch[i].Headers = headers\n\t\t\t\t\t\tfor i, set := range sl {\n\t\t\t\t\t\t\theaders[i] = &ves_io_schema.HeaderMatcherType{}\n\t\t\t\t\t\t\theadersMapStrToI := set.(map[string]interface{})\n\n\t\t\t\t\t\t\tif w, ok := headersMapStrToI[\"invert_match\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\theaders[i].InvertMatch = w.(bool)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif w, ok := headersMapStrToI[\"name\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\theaders[i].Name = w.(string)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tvalueMatchTypeFound := false\n\n\t\t\t\t\t\t\tif v, ok := headersMapStrToI[\"exact\"]; ok && !isIntfNil(v) && !valueMatchTypeFound {\n\n\t\t\t\t\t\t\t\tvalueMatchTypeFound = true\n\t\t\t\t\t\t\t\tvalueMatchInt := &ves_io_schema.HeaderMatcherType_Exact{}\n\n\t\t\t\t\t\t\t\theaders[i].ValueMatch = valueMatchInt\n\n\t\t\t\t\t\t\t\tvalueMatchInt.Exact = v.(string)\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif v, ok := headersMapStrToI[\"presence\"]; ok && !isIntfNil(v) && !valueMatchTypeFound {\n\n\t\t\t\t\t\t\t\tvalueMatchTypeFound = true\n\t\t\t\t\t\t\t\tvalueMatchInt := &ves_io_schema.HeaderMatcherType_Presence{}\n\n\t\t\t\t\t\t\t\theaders[i].ValueMatch = valueMatchInt\n\n\t\t\t\t\t\t\t\tvalueMatchInt.Presence = v.(bool)\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif v, ok := headersMapStrToI[\"regex\"]; ok && !isIntfNil(v) && !valueMatchTypeFound {\n\n\t\t\t\t\t\t\t\tvalueMatchTypeFound = true\n\t\t\t\t\t\t\t\tvalueMatchInt := &ves_io_schema.HeaderMatcherType_Regex{}\n\n\t\t\t\t\t\t\t\theaders[i].ValueMatch = valueMatchInt\n\n\t\t\t\t\t\t\t\tvalueMatchInt.Regex = v.(string)\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := matchMapStrToI[\"http_method\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\tmatch[i].HttpMethod = ves_io_schema.HttpMethod(ves_io_schema.HttpMethod_value[v.(string)])\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := matchMapStrToI[\"incoming_port\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\t\t\tincomingPort := &ves_io_schema.PortMatcherType{}\n\t\t\t\t\t\tmatch[i].IncomingPort = incomingPort\n\t\t\t\t\t\tfor _, set := range sl {\n\t\t\t\t\t\t\tincomingPortMapStrToI := set.(map[string]interface{})\n\n\t\t\t\t\t\t\tportMatchTypeFound := false\n\n\t\t\t\t\t\t\tif v, ok := incomingPortMapStrToI[\"no_port_match\"]; ok && !isIntfNil(v) && !portMatchTypeFound {\n\n\t\t\t\t\t\t\t\tportMatchTypeFound = true\n\n\t\t\t\t\t\t\t\tif v.(bool) {\n\t\t\t\t\t\t\t\t\tportMatchInt := &ves_io_schema.PortMatcherType_NoPortMatch{}\n\t\t\t\t\t\t\t\t\tportMatchInt.NoPortMatch = &ves_io_schema.Empty{}\n\t\t\t\t\t\t\t\t\tincomingPort.PortMatch = portMatchInt\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif v, ok := incomingPortMapStrToI[\"port\"]; ok && !isIntfNil(v) && !portMatchTypeFound {\n\n\t\t\t\t\t\t\t\tportMatchTypeFound = true\n\t\t\t\t\t\t\t\tportMatchInt := &ves_io_schema.PortMatcherType_Port{}\n\n\t\t\t\t\t\t\t\tincomingPort.PortMatch = portMatchInt\n\n\t\t\t\t\t\t\t\tportMatchInt.Port = uint32(v.(int))\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif v, ok := incomingPortMapStrToI[\"port_ranges\"]; ok && !isIntfNil(v) && !portMatchTypeFound {\n\n\t\t\t\t\t\t\t\tportMatchTypeFound = true\n\t\t\t\t\t\t\t\tportMatchInt := &ves_io_schema.PortMatcherType_PortRanges{}\n\n\t\t\t\t\t\t\t\tincomingPort.PortMatch = portMatchInt\n\n\t\t\t\t\t\t\t\tportMatchInt.PortRanges = v.(string)\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := matchMapStrToI[\"path\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\t\t\tpath := &ves_io_schema.PathMatcherType{}\n\t\t\t\t\t\tmatch[i].Path = path\n\t\t\t\t\t\tfor _, set := range sl {\n\t\t\t\t\t\t\tpathMapStrToI := set.(map[string]interface{})\n\n\t\t\t\t\t\t\tpathMatchTypeFound := false\n\n\t\t\t\t\t\t\tif v, ok := pathMapStrToI[\"path\"]; ok && !isIntfNil(v) && !pathMatchTypeFound {\n\n\t\t\t\t\t\t\t\tpathMatchTypeFound = true\n\t\t\t\t\t\t\t\tpathMatchInt := &ves_io_schema.PathMatcherType_Path{}\n\n\t\t\t\t\t\t\t\tpath.PathMatch = pathMatchInt\n\n\t\t\t\t\t\t\t\tpathMatchInt.Path = v.(string)\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif v, ok := pathMapStrToI[\"prefix\"]; ok && !isIntfNil(v) && !pathMatchTypeFound {\n\n\t\t\t\t\t\t\t\tpathMatchTypeFound = true\n\t\t\t\t\t\t\t\tpathMatchInt := &ves_io_schema.PathMatcherType_Prefix{}\n\n\t\t\t\t\t\t\t\tpath.PathMatch = pathMatchInt\n\n\t\t\t\t\t\t\t\tpathMatchInt.Prefix = v.(string)\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif v, ok := pathMapStrToI[\"regex\"]; ok && !isIntfNil(v) && !pathMatchTypeFound {\n\n\t\t\t\t\t\t\t\tpathMatchTypeFound = true\n\t\t\t\t\t\t\t\tpathMatchInt := &ves_io_schema.PathMatcherType_Regex{}\n\n\t\t\t\t\t\t\t\tpath.PathMatch = pathMatchInt\n\n\t\t\t\t\t\t\t\tpathMatchInt.Regex = v.(string)\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := matchMapStrToI[\"query_params\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\tsl := v.([]interface{})\n\t\t\t\t\t\tqueryParams := make([]*ves_io_schema.QueryParameterMatcherType, len(sl))\n\t\t\t\t\t\tmatch[i].QueryParams = queryParams\n\t\t\t\t\t\tfor i, set := range sl {\n\t\t\t\t\t\t\tqueryParams[i] = &ves_io_schema.QueryParameterMatcherType{}\n\t\t\t\t\t\t\tqueryParamsMapStrToI := set.(map[string]interface{})\n\n\t\t\t\t\t\t\tif w, ok := queryParamsMapStrToI[\"key\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\tqueryParams[i].Key = w.(string)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tvalueMatchTypeFound := false\n\n\t\t\t\t\t\t\tif v, ok := queryParamsMapStrToI[\"exact\"]; ok && !isIntfNil(v) && !valueMatchTypeFound {\n\n\t\t\t\t\t\t\t\tvalueMatchTypeFound = true\n\t\t\t\t\t\t\t\tvalueMatchInt := &ves_io_schema.QueryParameterMatcherType_Exact{}\n\n\t\t\t\t\t\t\t\tqueryParams[i].ValueMatch = valueMatchInt\n\n\t\t\t\t\t\t\t\tvalueMatchInt.Exact = v.(string)\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif v, ok := queryParamsMapStrToI[\"regex\"]; ok && !isIntfNil(v) && !valueMatchTypeFound {\n\n\t\t\t\t\t\t\t\tvalueMatchTypeFound = true\n\t\t\t\t\t\t\t\tvalueMatchInt := &ves_io_schema.QueryParameterMatcherType_Regex{}\n\n\t\t\t\t\t\t\t\tqueryParams[i].ValueMatch = valueMatchInt\n\n\t\t\t\t\t\t\t\tvalueMatchInt.Regex = v.(string)\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif v, ok := routesMapStrToI[\"request_headers_to_add\"]; ok && !isIntfNil(v) {\n\n\t\t\t\tsl := v.([]interface{})\n\t\t\t\trequestHeadersToAdd := make([]*ves_io_schema.HeaderManipulationOptionType, len(sl))\n\t\t\t\troutes[i].RequestHeadersToAdd = requestHeadersToAdd\n\t\t\t\tfor i, set := range sl {\n\t\t\t\t\trequestHeadersToAdd[i] = &ves_io_schema.HeaderManipulationOptionType{}\n\t\t\t\t\trequestHeadersToAddMapStrToI := set.(map[string]interface{})\n\n\t\t\t\t\tif w, ok := requestHeadersToAddMapStrToI[\"append\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\trequestHeadersToAdd[i].Append = w.(bool)\n\t\t\t\t\t}\n\n\t\t\t\t\tif w, ok := requestHeadersToAddMapStrToI[\"name\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\trequestHeadersToAdd[i].Name = w.(string)\n\t\t\t\t\t}\n\n\t\t\t\t\tvalueChoiceTypeFound := false\n\n\t\t\t\t\tif v, ok := requestHeadersToAddMapStrToI[\"secret_value\"]; ok && !isIntfNil(v) && !valueChoiceTypeFound {\n\n\t\t\t\t\t\tvalueChoiceTypeFound = true\n\t\t\t\t\t\tvalueChoiceInt := &ves_io_schema.HeaderManipulationOptionType_SecretValue{}\n\t\t\t\t\t\tvalueChoiceInt.SecretValue = &ves_io_schema.SecretType{}\n\t\t\t\t\t\trequestHeadersToAdd[i].ValueChoice = valueChoiceInt\n\n\t\t\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\t\t\tfor _, set := range sl {\n\t\t\t\t\t\t\tcs := set.(map[string]interface{})\n\n\t\t\t\t\t\t\tif v, ok := cs[\"blindfold_secret_info_internal\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\t\t\t\t\tblindfoldSecretInfoInternal := &ves_io_schema.BlindfoldSecretInfoType{}\n\t\t\t\t\t\t\t\tvalueChoiceInt.SecretValue.BlindfoldSecretInfoInternal = blindfoldSecretInfoInternal\n\t\t\t\t\t\t\t\tfor _, set := range sl {\n\t\t\t\t\t\t\t\t\tblindfoldSecretInfoInternalMapStrToI := set.(map[string]interface{})\n\n\t\t\t\t\t\t\t\t\tif w, ok := blindfoldSecretInfoInternalMapStrToI[\"decryption_provider\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\t\t\tblindfoldSecretInfoInternal.DecryptionProvider = w.(string)\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif w, ok := blindfoldSecretInfoInternalMapStrToI[\"location\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\t\t\tblindfoldSecretInfoInternal.Location = w.(string)\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif w, ok := blindfoldSecretInfoInternalMapStrToI[\"store_provider\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\t\t\tblindfoldSecretInfoInternal.StoreProvider = w.(string)\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif v, ok := cs[\"secret_encoding_type\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\tvalueChoiceInt.SecretValue.SecretEncodingType = ves_io_schema.SecretEncodingType(ves_io_schema.SecretEncodingType_value[v.(string)])\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tsecretInfoOneofTypeFound := false\n\n\t\t\t\t\t\t\tif v, ok := cs[\"blindfold_secret_info\"]; ok && !isIntfNil(v) && !secretInfoOneofTypeFound {\n\n\t\t\t\t\t\t\t\tsecretInfoOneofTypeFound = true\n\t\t\t\t\t\t\t\tsecretInfoOneofInt := &ves_io_schema.SecretType_BlindfoldSecretInfo{}\n\t\t\t\t\t\t\t\tsecretInfoOneofInt.BlindfoldSecretInfo = &ves_io_schema.BlindfoldSecretInfoType{}\n\t\t\t\t\t\t\t\tvalueChoiceInt.SecretValue.SecretInfoOneof = secretInfoOneofInt\n\n\t\t\t\t\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\t\t\t\t\tfor _, set := range sl {\n\t\t\t\t\t\t\t\t\tcs := set.(map[string]interface{})\n\n\t\t\t\t\t\t\t\t\tif v, ok := cs[\"decryption_provider\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\t\t\tsecretInfoOneofInt.BlindfoldSecretInfo.DecryptionProvider = v.(string)\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif v, ok := cs[\"location\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\t\t\tsecretInfoOneofInt.BlindfoldSecretInfo.Location = v.(string)\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif v, ok := cs[\"store_provider\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\t\t\tsecretInfoOneofInt.BlindfoldSecretInfo.StoreProvider = v.(string)\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif v, ok := cs[\"clear_secret_info\"]; ok && !isIntfNil(v) && !secretInfoOneofTypeFound {\n\n\t\t\t\t\t\t\t\tsecretInfoOneofTypeFound = true\n\t\t\t\t\t\t\t\tsecretInfoOneofInt := &ves_io_schema.SecretType_ClearSecretInfo{}\n\t\t\t\t\t\t\t\tsecretInfoOneofInt.ClearSecretInfo = &ves_io_schema.ClearSecretInfoType{}\n\t\t\t\t\t\t\t\tvalueChoiceInt.SecretValue.SecretInfoOneof = secretInfoOneofInt\n\n\t\t\t\t\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\t\t\t\t\tfor _, set := range sl {\n\t\t\t\t\t\t\t\t\tcs := set.(map[string]interface{})\n\n\t\t\t\t\t\t\t\t\tif v, ok := cs[\"provider\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\t\t\tsecretInfoOneofInt.ClearSecretInfo.Provider = v.(string)\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif v, ok := cs[\"url\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\t\t\tsecretInfoOneofInt.ClearSecretInfo.Url = v.(string)\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif v, ok := cs[\"vault_secret_info\"]; ok && !isIntfNil(v) && !secretInfoOneofTypeFound {\n\n\t\t\t\t\t\t\t\tsecretInfoOneofTypeFound = true\n\t\t\t\t\t\t\t\tsecretInfoOneofInt := &ves_io_schema.SecretType_VaultSecretInfo{}\n\t\t\t\t\t\t\t\tsecretInfoOneofInt.VaultSecretInfo = &ves_io_schema.VaultSecretInfoType{}\n\t\t\t\t\t\t\t\tvalueChoiceInt.SecretValue.SecretInfoOneof = secretInfoOneofInt\n\n\t\t\t\t\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\t\t\t\t\tfor _, set := range sl {\n\t\t\t\t\t\t\t\t\tcs := set.(map[string]interface{})\n\n\t\t\t\t\t\t\t\t\tif v, ok := cs[\"key\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\t\t\tsecretInfoOneofInt.VaultSecretInfo.Key = v.(string)\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif v, ok := cs[\"location\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\t\t\tsecretInfoOneofInt.VaultSecretInfo.Location = v.(string)\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif v, ok := cs[\"provider\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\t\t\tsecretInfoOneofInt.VaultSecretInfo.Provider = v.(string)\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif v, ok := cs[\"secret_encoding\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\t\t\tsecretInfoOneofInt.VaultSecretInfo.SecretEncoding = ves_io_schema.SecretEncodingType(ves_io_schema.SecretEncodingType_value[v.(string)])\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif v, ok := cs[\"version\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\t\t\tsecretInfoOneofInt.VaultSecretInfo.Version = uint32(v.(int))\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif v, ok := cs[\"wingman_secret_info\"]; ok && !isIntfNil(v) && !secretInfoOneofTypeFound {\n\n\t\t\t\t\t\t\t\tsecretInfoOneofTypeFound = true\n\t\t\t\t\t\t\t\tsecretInfoOneofInt := &ves_io_schema.SecretType_WingmanSecretInfo{}\n\t\t\t\t\t\t\t\tsecretInfoOneofInt.WingmanSecretInfo = &ves_io_schema.WingmanSecretInfoType{}\n\t\t\t\t\t\t\t\tvalueChoiceInt.SecretValue.SecretInfoOneof = secretInfoOneofInt\n\n\t\t\t\t\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\t\t\t\t\tfor _, set := range sl {\n\t\t\t\t\t\t\t\t\tcs := set.(map[string]interface{})\n\n\t\t\t\t\t\t\t\t\tif v, ok := cs[\"name\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\t\t\tsecretInfoOneofInt.WingmanSecretInfo.Name = v.(string)\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := requestHeadersToAddMapStrToI[\"value\"]; ok && !isIntfNil(v) && !valueChoiceTypeFound {\n\n\t\t\t\t\t\tvalueChoiceTypeFound = true\n\t\t\t\t\t\tvalueChoiceInt := &ves_io_schema.HeaderManipulationOptionType_Value{}\n\n\t\t\t\t\t\trequestHeadersToAdd[i].ValueChoice = valueChoiceInt\n\n\t\t\t\t\t\tvalueChoiceInt.Value = v.(string)\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif w, ok := routesMapStrToI[\"request_headers_to_remove\"]; ok && !isIntfNil(w) {\n\t\t\t\tls := make([]string, len(w.([]interface{})))\n\t\t\t\tfor i, v := range w.([]interface{}) {\n\t\t\t\t\tls[i] = v.(string)\n\t\t\t\t}\n\t\t\t\troutes[i].RequestHeadersToRemove = ls\n\t\t\t}\n\n\t\t\tif v, ok := routesMapStrToI[\"response_headers_to_add\"]; ok && !isIntfNil(v) {\n\n\t\t\t\tsl := v.([]interface{})\n\t\t\t\tresponseHeadersToAdd := make([]*ves_io_schema.HeaderManipulationOptionType, len(sl))\n\t\t\t\troutes[i].ResponseHeadersToAdd = responseHeadersToAdd\n\t\t\t\tfor i, set := range sl {\n\t\t\t\t\tresponseHeadersToAdd[i] = &ves_io_schema.HeaderManipulationOptionType{}\n\t\t\t\t\tresponseHeadersToAddMapStrToI := set.(map[string]interface{})\n\n\t\t\t\t\tif w, ok := responseHeadersToAddMapStrToI[\"append\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\tresponseHeadersToAdd[i].Append = w.(bool)\n\t\t\t\t\t}\n\n\t\t\t\t\tif w, ok := responseHeadersToAddMapStrToI[\"name\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\tresponseHeadersToAdd[i].Name = w.(string)\n\t\t\t\t\t}\n\n\t\t\t\t\tvalueChoiceTypeFound := false\n\n\t\t\t\t\tif v, ok := responseHeadersToAddMapStrToI[\"secret_value\"]; ok && !isIntfNil(v) && !valueChoiceTypeFound {\n\n\t\t\t\t\t\tvalueChoiceTypeFound = true\n\t\t\t\t\t\tvalueChoiceInt := &ves_io_schema.HeaderManipulationOptionType_SecretValue{}\n\t\t\t\t\t\tvalueChoiceInt.SecretValue = &ves_io_schema.SecretType{}\n\t\t\t\t\t\tresponseHeadersToAdd[i].ValueChoice = valueChoiceInt\n\n\t\t\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\t\t\tfor _, set := range sl {\n\t\t\t\t\t\t\tcs := set.(map[string]interface{})\n\n\t\t\t\t\t\t\tif v, ok := cs[\"blindfold_secret_info_internal\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\t\t\t\t\tblindfoldSecretInfoInternal := &ves_io_schema.BlindfoldSecretInfoType{}\n\t\t\t\t\t\t\t\tvalueChoiceInt.SecretValue.BlindfoldSecretInfoInternal = blindfoldSecretInfoInternal\n\t\t\t\t\t\t\t\tfor _, set := range sl {\n\t\t\t\t\t\t\t\t\tblindfoldSecretInfoInternalMapStrToI := set.(map[string]interface{})\n\n\t\t\t\t\t\t\t\t\tif w, ok := blindfoldSecretInfoInternalMapStrToI[\"decryption_provider\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\t\t\tblindfoldSecretInfoInternal.DecryptionProvider = w.(string)\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif w, ok := blindfoldSecretInfoInternalMapStrToI[\"location\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\t\t\tblindfoldSecretInfoInternal.Location = w.(string)\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif w, ok := blindfoldSecretInfoInternalMapStrToI[\"store_provider\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\t\t\tblindfoldSecretInfoInternal.StoreProvider = w.(string)\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif v, ok := cs[\"secret_encoding_type\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\tvalueChoiceInt.SecretValue.SecretEncodingType = ves_io_schema.SecretEncodingType(ves_io_schema.SecretEncodingType_value[v.(string)])\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tsecretInfoOneofTypeFound := false\n\n\t\t\t\t\t\t\tif v, ok := cs[\"blindfold_secret_info\"]; ok && !isIntfNil(v) && !secretInfoOneofTypeFound {\n\n\t\t\t\t\t\t\t\tsecretInfoOneofTypeFound = true\n\t\t\t\t\t\t\t\tsecretInfoOneofInt := &ves_io_schema.SecretType_BlindfoldSecretInfo{}\n\t\t\t\t\t\t\t\tsecretInfoOneofInt.BlindfoldSecretInfo = &ves_io_schema.BlindfoldSecretInfoType{}\n\t\t\t\t\t\t\t\tvalueChoiceInt.SecretValue.SecretInfoOneof = secretInfoOneofInt\n\n\t\t\t\t\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\t\t\t\t\tfor _, set := range sl {\n\t\t\t\t\t\t\t\t\tcs := set.(map[string]interface{})\n\n\t\t\t\t\t\t\t\t\tif v, ok := cs[\"decryption_provider\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\t\t\tsecretInfoOneofInt.BlindfoldSecretInfo.DecryptionProvider = v.(string)\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif v, ok := cs[\"location\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\t\t\tsecretInfoOneofInt.BlindfoldSecretInfo.Location = v.(string)\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif v, ok := cs[\"store_provider\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\t\t\tsecretInfoOneofInt.BlindfoldSecretInfo.StoreProvider = v.(string)\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif v, ok := cs[\"clear_secret_info\"]; ok && !isIntfNil(v) && !secretInfoOneofTypeFound {\n\n\t\t\t\t\t\t\t\tsecretInfoOneofTypeFound = true\n\t\t\t\t\t\t\t\tsecretInfoOneofInt := &ves_io_schema.SecretType_ClearSecretInfo{}\n\t\t\t\t\t\t\t\tsecretInfoOneofInt.ClearSecretInfo = &ves_io_schema.ClearSecretInfoType{}\n\t\t\t\t\t\t\t\tvalueChoiceInt.SecretValue.SecretInfoOneof = secretInfoOneofInt\n\n\t\t\t\t\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\t\t\t\t\tfor _, set := range sl {\n\t\t\t\t\t\t\t\t\tcs := set.(map[string]interface{})\n\n\t\t\t\t\t\t\t\t\tif v, ok := cs[\"provider\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\t\t\tsecretInfoOneofInt.ClearSecretInfo.Provider = v.(string)\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif v, ok := cs[\"url\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\t\t\tsecretInfoOneofInt.ClearSecretInfo.Url = v.(string)\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif v, ok := cs[\"vault_secret_info\"]; ok && !isIntfNil(v) && !secretInfoOneofTypeFound {\n\n\t\t\t\t\t\t\t\tsecretInfoOneofTypeFound = true\n\t\t\t\t\t\t\t\tsecretInfoOneofInt := &ves_io_schema.SecretType_VaultSecretInfo{}\n\t\t\t\t\t\t\t\tsecretInfoOneofInt.VaultSecretInfo = &ves_io_schema.VaultSecretInfoType{}\n\t\t\t\t\t\t\t\tvalueChoiceInt.SecretValue.SecretInfoOneof = secretInfoOneofInt\n\n\t\t\t\t\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\t\t\t\t\tfor _, set := range sl {\n\t\t\t\t\t\t\t\t\tcs := set.(map[string]interface{})\n\n\t\t\t\t\t\t\t\t\tif v, ok := cs[\"key\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\t\t\tsecretInfoOneofInt.VaultSecretInfo.Key = v.(string)\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif v, ok := cs[\"location\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\t\t\tsecretInfoOneofInt.VaultSecretInfo.Location = v.(string)\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif v, ok := cs[\"provider\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\t\t\tsecretInfoOneofInt.VaultSecretInfo.Provider = v.(string)\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif v, ok := cs[\"secret_encoding\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\t\t\tsecretInfoOneofInt.VaultSecretInfo.SecretEncoding = ves_io_schema.SecretEncodingType(ves_io_schema.SecretEncodingType_value[v.(string)])\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif v, ok := cs[\"version\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\t\t\tsecretInfoOneofInt.VaultSecretInfo.Version = uint32(v.(int))\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif v, ok := cs[\"wingman_secret_info\"]; ok && !isIntfNil(v) && !secretInfoOneofTypeFound {\n\n\t\t\t\t\t\t\t\tsecretInfoOneofTypeFound = true\n\t\t\t\t\t\t\t\tsecretInfoOneofInt := &ves_io_schema.SecretType_WingmanSecretInfo{}\n\t\t\t\t\t\t\t\tsecretInfoOneofInt.WingmanSecretInfo = &ves_io_schema.WingmanSecretInfoType{}\n\t\t\t\t\t\t\t\tvalueChoiceInt.SecretValue.SecretInfoOneof = secretInfoOneofInt\n\n\t\t\t\t\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\t\t\t\t\tfor _, set := range sl {\n\t\t\t\t\t\t\t\t\tcs := set.(map[string]interface{})\n\n\t\t\t\t\t\t\t\t\tif v, ok := cs[\"name\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\t\t\tsecretInfoOneofInt.WingmanSecretInfo.Name = v.(string)\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := responseHeadersToAddMapStrToI[\"value\"]; ok && !isIntfNil(v) && !valueChoiceTypeFound {\n\n\t\t\t\t\t\tvalueChoiceTypeFound = true\n\t\t\t\t\t\tvalueChoiceInt := &ves_io_schema.HeaderManipulationOptionType_Value{}\n\n\t\t\t\t\t\tresponseHeadersToAdd[i].ValueChoice = valueChoiceInt\n\n\t\t\t\t\t\tvalueChoiceInt.Value = v.(string)\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif w, ok := routesMapStrToI[\"response_headers_to_remove\"]; ok && !isIntfNil(w) {\n\t\t\t\tls := make([]string, len(w.([]interface{})))\n\t\t\t\tfor i, v := range w.([]interface{}) {\n\t\t\t\t\tls[i] = v.(string)\n\t\t\t\t}\n\t\t\t\troutes[i].ResponseHeadersToRemove = ls\n\t\t\t}\n\n\t\t\trouteActionTypeFound := false\n\n\t\t\tif v, ok := routesMapStrToI[\"route_destination\"]; ok && !isIntfNil(v) && !routeActionTypeFound {\n\n\t\t\t\trouteActionTypeFound = true\n\t\t\t\trouteActionInt := &ves_io_schema_route.RouteType_RouteDestination{}\n\t\t\t\trouteActionInt.RouteDestination = &ves_io_schema_route.RouteDestinationList{}\n\t\t\t\troutes[i].RouteAction = routeActionInt\n\n\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\tfor _, set := range sl {\n\t\t\t\t\tcs := set.(map[string]interface{})\n\n\t\t\t\t\tif v, ok := cs[\"buffer_policy\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\t\t\tbufferPolicy := &ves_io_schema.BufferConfigType{}\n\t\t\t\t\t\trouteActionInt.RouteDestination.BufferPolicy = bufferPolicy\n\t\t\t\t\t\tfor _, set := range sl {\n\t\t\t\t\t\t\tbufferPolicyMapStrToI := set.(map[string]interface{})\n\n\t\t\t\t\t\t\tif w, ok := bufferPolicyMapStrToI[\"disabled\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\tbufferPolicy.Disabled = w.(bool)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif w, ok := bufferPolicyMapStrToI[\"max_request_bytes\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\tbufferPolicy.MaxRequestBytes = uint32(w.(int))\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif w, ok := bufferPolicyMapStrToI[\"max_request_time\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\tbufferPolicy.MaxRequestTime = uint32(w.(int))\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tclusterRetractChoiceTypeFound := false\n\n\t\t\t\t\tif v, ok := cs[\"do_not_retract_cluster\"]; ok && !isIntfNil(v) && !clusterRetractChoiceTypeFound {\n\n\t\t\t\t\t\tclusterRetractChoiceTypeFound = true\n\n\t\t\t\t\t\tif v.(bool) {\n\t\t\t\t\t\t\tclusterRetractChoiceInt := &ves_io_schema_route.RouteDestinationList_DoNotRetractCluster{}\n\t\t\t\t\t\t\tclusterRetractChoiceInt.DoNotRetractCluster = &ves_io_schema.Empty{}\n\t\t\t\t\t\t\trouteActionInt.RouteDestination.ClusterRetractChoice = clusterRetractChoiceInt\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := cs[\"retract_cluster\"]; ok && !isIntfNil(v) && !clusterRetractChoiceTypeFound {\n\n\t\t\t\t\t\tclusterRetractChoiceTypeFound = true\n\n\t\t\t\t\t\tif v.(bool) {\n\t\t\t\t\t\t\tclusterRetractChoiceInt := &ves_io_schema_route.RouteDestinationList_RetractCluster{}\n\t\t\t\t\t\t\tclusterRetractChoiceInt.RetractCluster = &ves_io_schema.Empty{}\n\t\t\t\t\t\t\trouteActionInt.RouteDestination.ClusterRetractChoice = clusterRetractChoiceInt\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := cs[\"cors_policy\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\t\t\tcorsPolicy := &ves_io_schema.CorsPolicy{}\n\t\t\t\t\t\trouteActionInt.RouteDestination.CorsPolicy = corsPolicy\n\t\t\t\t\t\tfor _, set := range sl {\n\t\t\t\t\t\t\tcorsPolicyMapStrToI := set.(map[string]interface{})\n\n\t\t\t\t\t\t\tif w, ok := corsPolicyMapStrToI[\"allow_credentials\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\tcorsPolicy.AllowCredentials = w.(bool)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif w, ok := corsPolicyMapStrToI[\"allow_headers\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\tcorsPolicy.AllowHeaders = w.(string)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif w, ok := corsPolicyMapStrToI[\"allow_methods\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\tcorsPolicy.AllowMethods = w.(string)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif w, ok := corsPolicyMapStrToI[\"allow_origin\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\tls := make([]string, len(w.([]interface{})))\n\t\t\t\t\t\t\t\tfor i, v := range w.([]interface{}) {\n\t\t\t\t\t\t\t\t\tls[i] = v.(string)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tcorsPolicy.AllowOrigin = ls\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif w, ok := corsPolicyMapStrToI[\"allow_origin_regex\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\tls := make([]string, len(w.([]interface{})))\n\t\t\t\t\t\t\t\tfor i, v := range w.([]interface{}) {\n\t\t\t\t\t\t\t\t\tls[i] = v.(string)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tcorsPolicy.AllowOriginRegex = ls\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif w, ok := corsPolicyMapStrToI[\"disabled\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\tcorsPolicy.Disabled = w.(bool)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif w, ok := corsPolicyMapStrToI[\"expose_headers\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\tcorsPolicy.ExposeHeaders = w.(string)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif w, ok := corsPolicyMapStrToI[\"max_age\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\tcorsPolicy.MaxAge = w.(string)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif w, ok := corsPolicyMapStrToI[\"maximum_age\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\tcorsPolicy.MaximumAge = int32(w.(int))\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := cs[\"destinations\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\tsl := v.([]interface{})\n\t\t\t\t\t\tdestinations := make([]*ves_io_schema_route.RouteDestination, len(sl))\n\t\t\t\t\t\trouteActionInt.RouteDestination.Destinations = destinations\n\t\t\t\t\t\tfor i, set := range sl {\n\t\t\t\t\t\t\tdestinations[i] = &ves_io_schema_route.RouteDestination{}\n\t\t\t\t\t\t\tdestinationsMapStrToI := set.(map[string]interface{})\n\n\t\t\t\t\t\t\tif v, ok := destinationsMapStrToI[\"cluster\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\tsl := v.([]interface{})\n\t\t\t\t\t\t\t\tclusterInt := make([]*ves_io_schema.ObjectRefType, len(sl))\n\t\t\t\t\t\t\t\tdestinations[i].Cluster = clusterInt\n\t\t\t\t\t\t\t\tfor i, ps := range sl {\n\n\t\t\t\t\t\t\t\t\tcMapToStrVal := ps.(map[string]interface{})\n\t\t\t\t\t\t\t\t\tclusterInt[i] = &ves_io_schema.ObjectRefType{}\n\n\t\t\t\t\t\t\t\t\tclusterInt[i].Kind = \"cluster\"\n\n\t\t\t\t\t\t\t\t\tif v, ok := cMapToStrVal[\"name\"]; ok && !isIntfNil(v) {\n\t\t\t\t\t\t\t\t\t\tclusterInt[i].Name = v.(string)\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif v, ok := cMapToStrVal[\"namespace\"]; ok && !isIntfNil(v) {\n\t\t\t\t\t\t\t\t\t\tclusterInt[i].Namespace = v.(string)\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif v, ok := cMapToStrVal[\"tenant\"]; ok && !isIntfNil(v) {\n\t\t\t\t\t\t\t\t\t\tclusterInt[i].Tenant = v.(string)\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif v, ok := cMapToStrVal[\"uid\"]; ok && !isIntfNil(v) {\n\t\t\t\t\t\t\t\t\t\tclusterInt[i].Uid = v.(string)\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif w, ok := destinationsMapStrToI[\"endpoint_subsets\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\tms := map[string]string{}\n\t\t\t\t\t\t\t\tfor k, v := range w.(map[string]interface{}) {\n\t\t\t\t\t\t\t\t\tms[k] = v.(string)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tdestinations[i].EndpointSubsets = ms\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif w, ok := destinationsMapStrToI[\"priority\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\tdestinations[i].Priority = uint32(w.(int))\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif w, ok := destinationsMapStrToI[\"weight\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\tdestinations[i].Weight = uint32(w.(int))\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := cs[\"endpoint_subsets\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\tms := map[string]string{}\n\t\t\t\t\t\tfor k, v := range v.(map[string]interface{}) {\n\t\t\t\t\t\t\tms[k] = v.(string)\n\t\t\t\t\t\t}\n\t\t\t\t\t\trouteActionInt.RouteDestination.EndpointSubsets = ms\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := cs[\"hash_policy\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\tsl := v.([]interface{})\n\t\t\t\t\t\thashPolicy := make([]*ves_io_schema_route.HashPolicyType, len(sl))\n\t\t\t\t\t\trouteActionInt.RouteDestination.HashPolicy = hashPolicy\n\t\t\t\t\t\tfor i, set := range sl {\n\t\t\t\t\t\t\thashPolicy[i] = &ves_io_schema_route.HashPolicyType{}\n\t\t\t\t\t\t\thashPolicyMapStrToI := set.(map[string]interface{})\n\n\t\t\t\t\t\t\tpolicySpecifierTypeFound := false\n\n\t\t\t\t\t\t\tif v, ok := hashPolicyMapStrToI[\"cookie\"]; ok && !isIntfNil(v) && !policySpecifierTypeFound {\n\n\t\t\t\t\t\t\t\tpolicySpecifierTypeFound = true\n\t\t\t\t\t\t\t\tpolicySpecifierInt := &ves_io_schema_route.HashPolicyType_Cookie{}\n\t\t\t\t\t\t\t\tpolicySpecifierInt.Cookie = &ves_io_schema_route.CookieForHashing{}\n\t\t\t\t\t\t\t\thashPolicy[i].PolicySpecifier = policySpecifierInt\n\n\t\t\t\t\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\t\t\t\t\tfor _, set := range sl {\n\t\t\t\t\t\t\t\t\tcs := set.(map[string]interface{})\n\n\t\t\t\t\t\t\t\t\thttponlyTypeFound := false\n\n\t\t\t\t\t\t\t\t\tif v, ok := cs[\"add_httponly\"]; ok && !isIntfNil(v) && !httponlyTypeFound {\n\n\t\t\t\t\t\t\t\t\t\thttponlyTypeFound = true\n\n\t\t\t\t\t\t\t\t\t\tif v.(bool) {\n\t\t\t\t\t\t\t\t\t\t\thttponlyInt := &ves_io_schema_route.CookieForHashing_AddHttponly{}\n\t\t\t\t\t\t\t\t\t\t\thttponlyInt.AddHttponly = &ves_io_schema.Empty{}\n\t\t\t\t\t\t\t\t\t\t\tpolicySpecifierInt.Cookie.Httponly = httponlyInt\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif v, ok := cs[\"ignore_httponly\"]; ok && !isIntfNil(v) && !httponlyTypeFound {\n\n\t\t\t\t\t\t\t\t\t\thttponlyTypeFound = true\n\n\t\t\t\t\t\t\t\t\t\tif v.(bool) {\n\t\t\t\t\t\t\t\t\t\t\thttponlyInt := &ves_io_schema_route.CookieForHashing_IgnoreHttponly{}\n\t\t\t\t\t\t\t\t\t\t\thttponlyInt.IgnoreHttponly = &ves_io_schema.Empty{}\n\t\t\t\t\t\t\t\t\t\t\tpolicySpecifierInt.Cookie.Httponly = httponlyInt\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif v, ok := cs[\"name\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\t\t\tpolicySpecifierInt.Cookie.Name = v.(string)\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif v, ok := cs[\"path\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\t\t\tpolicySpecifierInt.Cookie.Path = v.(string)\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tsamesiteTypeFound := false\n\n\t\t\t\t\t\t\t\t\tif v, ok := cs[\"ignore_samesite\"]; ok && !isIntfNil(v) && !samesiteTypeFound {\n\n\t\t\t\t\t\t\t\t\t\tsamesiteTypeFound = true\n\n\t\t\t\t\t\t\t\t\t\tif v.(bool) {\n\t\t\t\t\t\t\t\t\t\t\tsamesiteInt := &ves_io_schema_route.CookieForHashing_IgnoreSamesite{}\n\t\t\t\t\t\t\t\t\t\t\tsamesiteInt.IgnoreSamesite = &ves_io_schema.Empty{}\n\t\t\t\t\t\t\t\t\t\t\tpolicySpecifierInt.Cookie.Samesite = samesiteInt\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif v, ok := cs[\"samesite_lax\"]; ok && !isIntfNil(v) && !samesiteTypeFound {\n\n\t\t\t\t\t\t\t\t\t\tsamesiteTypeFound = true\n\n\t\t\t\t\t\t\t\t\t\tif v.(bool) {\n\t\t\t\t\t\t\t\t\t\t\tsamesiteInt := &ves_io_schema_route.CookieForHashing_SamesiteLax{}\n\t\t\t\t\t\t\t\t\t\t\tsamesiteInt.SamesiteLax = &ves_io_schema.Empty{}\n\t\t\t\t\t\t\t\t\t\t\tpolicySpecifierInt.Cookie.Samesite = samesiteInt\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif v, ok := cs[\"samesite_none\"]; ok && !isIntfNil(v) && !samesiteTypeFound {\n\n\t\t\t\t\t\t\t\t\t\tsamesiteTypeFound = true\n\n\t\t\t\t\t\t\t\t\t\tif v.(bool) {\n\t\t\t\t\t\t\t\t\t\t\tsamesiteInt := &ves_io_schema_route.CookieForHashing_SamesiteNone{}\n\t\t\t\t\t\t\t\t\t\t\tsamesiteInt.SamesiteNone = &ves_io_schema.Empty{}\n\t\t\t\t\t\t\t\t\t\t\tpolicySpecifierInt.Cookie.Samesite = samesiteInt\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif v, ok := cs[\"samesite_strict\"]; ok && !isIntfNil(v) && !samesiteTypeFound {\n\n\t\t\t\t\t\t\t\t\t\tsamesiteTypeFound = true\n\n\t\t\t\t\t\t\t\t\t\tif v.(bool) {\n\t\t\t\t\t\t\t\t\t\t\tsamesiteInt := &ves_io_schema_route.CookieForHashing_SamesiteStrict{}\n\t\t\t\t\t\t\t\t\t\t\tsamesiteInt.SamesiteStrict = &ves_io_schema.Empty{}\n\t\t\t\t\t\t\t\t\t\t\tpolicySpecifierInt.Cookie.Samesite = samesiteInt\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tsecureTypeFound := false\n\n\t\t\t\t\t\t\t\t\tif v, ok := cs[\"add_secure\"]; ok && !isIntfNil(v) && !secureTypeFound {\n\n\t\t\t\t\t\t\t\t\t\tsecureTypeFound = true\n\n\t\t\t\t\t\t\t\t\t\tif v.(bool) {\n\t\t\t\t\t\t\t\t\t\t\tsecureInt := &ves_io_schema_route.CookieForHashing_AddSecure{}\n\t\t\t\t\t\t\t\t\t\t\tsecureInt.AddSecure = &ves_io_schema.Empty{}\n\t\t\t\t\t\t\t\t\t\t\tpolicySpecifierInt.Cookie.Secure = secureInt\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif v, ok := cs[\"ignore_secure\"]; ok && !isIntfNil(v) && !secureTypeFound {\n\n\t\t\t\t\t\t\t\t\t\tsecureTypeFound = true\n\n\t\t\t\t\t\t\t\t\t\tif v.(bool) {\n\t\t\t\t\t\t\t\t\t\t\tsecureInt := &ves_io_schema_route.CookieForHashing_IgnoreSecure{}\n\t\t\t\t\t\t\t\t\t\t\tsecureInt.IgnoreSecure = &ves_io_schema.Empty{}\n\t\t\t\t\t\t\t\t\t\t\tpolicySpecifierInt.Cookie.Secure = secureInt\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif v, ok := cs[\"ttl\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\t\t\tpolicySpecifierInt.Cookie.Ttl = uint32(v.(int))\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif v, ok := hashPolicyMapStrToI[\"header_name\"]; ok && !isIntfNil(v) && !policySpecifierTypeFound {\n\n\t\t\t\t\t\t\t\tpolicySpecifierTypeFound = true\n\t\t\t\t\t\t\t\tpolicySpecifierInt := &ves_io_schema_route.HashPolicyType_HeaderName{}\n\n\t\t\t\t\t\t\t\thashPolicy[i].PolicySpecifier = policySpecifierInt\n\n\t\t\t\t\t\t\t\tpolicySpecifierInt.HeaderName = v.(string)\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif v, ok := hashPolicyMapStrToI[\"source_ip\"]; ok && !isIntfNil(v) && !policySpecifierTypeFound {\n\n\t\t\t\t\t\t\t\tpolicySpecifierTypeFound = true\n\t\t\t\t\t\t\t\tpolicySpecifierInt := &ves_io_schema_route.HashPolicyType_SourceIp{}\n\n\t\t\t\t\t\t\t\thashPolicy[i].PolicySpecifier = policySpecifierInt\n\n\t\t\t\t\t\t\t\tpolicySpecifierInt.SourceIp = v.(bool)\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif w, ok := hashPolicyMapStrToI[\"terminal\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\thashPolicy[i].Terminal = w.(bool)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\thostRewriteParamsTypeFound := false\n\n\t\t\t\t\tif v, ok := cs[\"auto_host_rewrite\"]; ok && !isIntfNil(v) && !hostRewriteParamsTypeFound {\n\n\t\t\t\t\t\thostRewriteParamsTypeFound = true\n\t\t\t\t\t\thostRewriteParamsInt := &ves_io_schema_route.RouteDestinationList_AutoHostRewrite{}\n\n\t\t\t\t\t\trouteActionInt.RouteDestination.HostRewriteParams = hostRewriteParamsInt\n\n\t\t\t\t\t\thostRewriteParamsInt.AutoHostRewrite = v.(bool)\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := cs[\"host_rewrite\"]; ok && !isIntfNil(v) && !hostRewriteParamsTypeFound {\n\n\t\t\t\t\t\thostRewriteParamsTypeFound = true\n\t\t\t\t\t\thostRewriteParamsInt := &ves_io_schema_route.RouteDestinationList_HostRewrite{}\n\n\t\t\t\t\t\trouteActionInt.RouteDestination.HostRewriteParams = hostRewriteParamsInt\n\n\t\t\t\t\t\thostRewriteParamsInt.HostRewrite = v.(string)\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := cs[\"mirror_policy\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\t\t\tmirrorPolicy := &ves_io_schema_route.MirrorPolicyType{}\n\t\t\t\t\t\trouteActionInt.RouteDestination.MirrorPolicy = mirrorPolicy\n\t\t\t\t\t\tfor _, set := range sl {\n\t\t\t\t\t\t\tmirrorPolicyMapStrToI := set.(map[string]interface{})\n\n\t\t\t\t\t\t\tif v, ok := mirrorPolicyMapStrToI[\"cluster\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\tsl := v.([]interface{})\n\t\t\t\t\t\t\t\tclusterInt := make([]*ves_io_schema.ObjectRefType, len(sl))\n\t\t\t\t\t\t\t\tmirrorPolicy.Cluster = clusterInt\n\t\t\t\t\t\t\t\tfor i, ps := range sl {\n\n\t\t\t\t\t\t\t\t\tcMapToStrVal := ps.(map[string]interface{})\n\t\t\t\t\t\t\t\t\tclusterInt[i] = &ves_io_schema.ObjectRefType{}\n\n\t\t\t\t\t\t\t\t\tclusterInt[i].Kind = \"cluster\"\n\n\t\t\t\t\t\t\t\t\tif v, ok := cMapToStrVal[\"name\"]; ok && !isIntfNil(v) {\n\t\t\t\t\t\t\t\t\t\tclusterInt[i].Name = v.(string)\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif v, ok := cMapToStrVal[\"namespace\"]; ok && !isIntfNil(v) {\n\t\t\t\t\t\t\t\t\t\tclusterInt[i].Namespace = v.(string)\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif v, ok := cMapToStrVal[\"tenant\"]; ok && !isIntfNil(v) {\n\t\t\t\t\t\t\t\t\t\tclusterInt[i].Tenant = v.(string)\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif v, ok := cMapToStrVal[\"uid\"]; ok && !isIntfNil(v) {\n\t\t\t\t\t\t\t\t\t\tclusterInt[i].Uid = v.(string)\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif v, ok := mirrorPolicyMapStrToI[\"percent\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\t\t\t\t\tpercent := &ves_io_schema.FractionalPercent{}\n\t\t\t\t\t\t\t\tmirrorPolicy.Percent = percent\n\t\t\t\t\t\t\t\tfor _, set := range sl {\n\t\t\t\t\t\t\t\t\tpercentMapStrToI := set.(map[string]interface{})\n\n\t\t\t\t\t\t\t\t\tif v, ok := percentMapStrToI[\"denominator\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\t\t\tpercent.Denominator = ves_io_schema.DenominatorType(ves_io_schema.DenominatorType_value[v.(string)])\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif w, ok := percentMapStrToI[\"numerator\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\t\t\tpercent.Numerator = uint32(w.(int))\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := cs[\"prefix_rewrite\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\trouteActionInt.RouteDestination.PrefixRewrite = v.(string)\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := cs[\"priority\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\trouteActionInt.RouteDestination.Priority = ves_io_schema.RoutingPriority(ves_io_schema.RoutingPriority_value[v.(string)])\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := cs[\"retry_policy\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\t\t\tretryPolicy := &ves_io_schema.RetryPolicyType{}\n\t\t\t\t\t\trouteActionInt.RouteDestination.RetryPolicy = retryPolicy\n\t\t\t\t\t\tfor _, set := range sl {\n\t\t\t\t\t\t\tretryPolicyMapStrToI := set.(map[string]interface{})\n\n\t\t\t\t\t\t\tif v, ok := retryPolicyMapStrToI[\"back_off\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\t\t\t\t\tbackOff := &ves_io_schema.RetryBackOff{}\n\t\t\t\t\t\t\t\tretryPolicy.BackOff = backOff\n\t\t\t\t\t\t\t\tfor _, set := range sl {\n\t\t\t\t\t\t\t\t\tbackOffMapStrToI := set.(map[string]interface{})\n\n\t\t\t\t\t\t\t\t\tif w, ok := backOffMapStrToI[\"base_interval\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\t\t\tbackOff.BaseInterval = uint32(w.(int))\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif w, ok := backOffMapStrToI[\"max_interval\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\t\t\tbackOff.MaxInterval = uint32(w.(int))\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif w, ok := retryPolicyMapStrToI[\"num_retries\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\tretryPolicy.NumRetries = uint32(w.(int))\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif w, ok := retryPolicyMapStrToI[\"per_try_timeout\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\tretryPolicy.PerTryTimeout = uint32(w.(int))\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif w, ok := retryPolicyMapStrToI[\"retriable_status_codes\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\tls := make([]uint32, len(w.([]interface{})))\n\t\t\t\t\t\t\t\tfor i, v := range w.([]interface{}) {\n\t\t\t\t\t\t\t\t\tls[i] = uint32(v.(int))\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tretryPolicy.RetriableStatusCodes = ls\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif w, ok := retryPolicyMapStrToI[\"retry_condition\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\tls := make([]string, len(w.([]interface{})))\n\t\t\t\t\t\t\t\tfor i, v := range w.([]interface{}) {\n\t\t\t\t\t\t\t\t\tls[i] = v.(string)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tretryPolicy.RetryCondition = ls\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif w, ok := retryPolicyMapStrToI[\"retry_on\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\tretryPolicy.RetryOn = w.(string)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := cs[\"spdy_config\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\t\t\tspdyConfig := &ves_io_schema_route.SpdyConfigType{}\n\t\t\t\t\t\trouteActionInt.RouteDestination.SpdyConfig = spdyConfig\n\t\t\t\t\t\tfor _, set := range sl {\n\t\t\t\t\t\t\tspdyConfigMapStrToI := set.(map[string]interface{})\n\n\t\t\t\t\t\t\tif w, ok := spdyConfigMapStrToI[\"use_spdy\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\tspdyConfig.UseSpdy = w.(bool)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := cs[\"timeout\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\trouteActionInt.RouteDestination.Timeout = uint32(v.(int))\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := cs[\"web_socket_config\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\t\t\twebSocketConfig := &ves_io_schema_route.WebsocketConfigType{}\n\t\t\t\t\t\trouteActionInt.RouteDestination.WebSocketConfig = webSocketConfig\n\t\t\t\t\t\tfor _, set := range sl {\n\t\t\t\t\t\t\twebSocketConfigMapStrToI := set.(map[string]interface{})\n\n\t\t\t\t\t\t\tif w, ok := webSocketConfigMapStrToI[\"idle_timeout\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\twebSocketConfig.IdleTimeout = uint32(w.(int))\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif w, ok := webSocketConfigMapStrToI[\"max_connect_attempts\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\twebSocketConfig.MaxConnectAttempts = uint32(w.(int))\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif w, ok := webSocketConfigMapStrToI[\"use_websocket\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\twebSocketConfig.UseWebsocket = w.(bool)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif v, ok := routesMapStrToI[\"route_direct_response\"]; ok && !isIntfNil(v) && !routeActionTypeFound {\n\n\t\t\t\trouteActionTypeFound = true\n\t\t\t\trouteActionInt := &ves_io_schema_route.RouteType_RouteDirectResponse{}\n\t\t\t\trouteActionInt.RouteDirectResponse = &ves_io_schema_route.RouteDirectResponse{}\n\t\t\t\troutes[i].RouteAction = routeActionInt\n\n\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\tfor _, set := range sl {\n\t\t\t\t\tcs := set.(map[string]interface{})\n\n\t\t\t\t\tif v, ok := cs[\"response_body\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\trouteActionInt.RouteDirectResponse.ResponseBody = v.(string)\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := cs[\"response_code\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\trouteActionInt.RouteDirectResponse.ResponseCode = uint32(v.(int))\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif v, ok := routesMapStrToI[\"route_redirect\"]; ok && !isIntfNil(v) && !routeActionTypeFound {\n\n\t\t\t\trouteActionTypeFound = true\n\t\t\t\trouteActionInt := &ves_io_schema_route.RouteType_RouteRedirect{}\n\t\t\t\trouteActionInt.RouteRedirect = &ves_io_schema_route.RouteRedirect{}\n\t\t\t\troutes[i].RouteAction = routeActionInt\n\n\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\tfor _, set := range sl {\n\t\t\t\t\tcs := set.(map[string]interface{})\n\n\t\t\t\t\tif v, ok := cs[\"host_redirect\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\trouteActionInt.RouteRedirect.HostRedirect = v.(string)\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := cs[\"port_redirect\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\trouteActionInt.RouteRedirect.PortRedirect = uint32(v.(int))\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := cs[\"proto_redirect\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\trouteActionInt.RouteRedirect.ProtoRedirect = v.(string)\n\n\t\t\t\t\t}\n\n\t\t\t\t\tqueryParamsTypeFound := false\n\n\t\t\t\t\tif v, ok := cs[\"all_params\"]; ok && !isIntfNil(v) && !queryParamsTypeFound {\n\n\t\t\t\t\t\tqueryParamsTypeFound = true\n\t\t\t\t\t\tqueryParamsInt := &ves_io_schema_route.RouteRedirect_AllParams{}\n\n\t\t\t\t\t\trouteActionInt.RouteRedirect.QueryParams = queryParamsInt\n\n\t\t\t\t\t\tqueryParamsInt.AllParams = v.(bool)\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := cs[\"remove_all_params\"]; ok && !isIntfNil(v) && !queryParamsTypeFound {\n\n\t\t\t\t\t\tqueryParamsTypeFound = true\n\n\t\t\t\t\t\tif v.(bool) {\n\t\t\t\t\t\t\tqueryParamsInt := &ves_io_schema_route.RouteRedirect_RemoveAllParams{}\n\t\t\t\t\t\t\tqueryParamsInt.RemoveAllParams = &ves_io_schema.Empty{}\n\t\t\t\t\t\t\trouteActionInt.RouteRedirect.QueryParams = queryParamsInt\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := cs[\"replace_params\"]; ok && !isIntfNil(v) && !queryParamsTypeFound {\n\n\t\t\t\t\t\tqueryParamsTypeFound = true\n\t\t\t\t\t\tqueryParamsInt := &ves_io_schema_route.RouteRedirect_ReplaceParams{}\n\n\t\t\t\t\t\trouteActionInt.RouteRedirect.QueryParams = queryParamsInt\n\n\t\t\t\t\t\tqueryParamsInt.ReplaceParams = v.(string)\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := cs[\"retain_all_params\"]; ok && !isIntfNil(v) && !queryParamsTypeFound {\n\n\t\t\t\t\t\tqueryParamsTypeFound = true\n\n\t\t\t\t\t\tif v.(bool) {\n\t\t\t\t\t\t\tqueryParamsInt := &ves_io_schema_route.RouteRedirect_RetainAllParams{}\n\t\t\t\t\t\t\tqueryParamsInt.RetainAllParams = &ves_io_schema.Empty{}\n\t\t\t\t\t\t\trouteActionInt.RouteRedirect.QueryParams = queryParamsInt\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := cs[\"strip_query_params\"]; ok && !isIntfNil(v) && !queryParamsTypeFound {\n\n\t\t\t\t\t\tqueryParamsTypeFound = true\n\t\t\t\t\t\tqueryParamsInt := &ves_io_schema_route.RouteRedirect_StripQueryParams{}\n\t\t\t\t\t\tqueryParamsInt.StripQueryParams = &ves_io_schema_route.RouteQueryParams{}\n\t\t\t\t\t\trouteActionInt.RouteRedirect.QueryParams = queryParamsInt\n\n\t\t\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\t\t\tfor _, set := range sl {\n\t\t\t\t\t\t\tcs := set.(map[string]interface{})\n\n\t\t\t\t\t\t\tif v, ok := cs[\"query_params\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\tls := make([]string, len(v.([]interface{})))\n\t\t\t\t\t\t\t\tfor i, v := range v.([]interface{}) {\n\t\t\t\t\t\t\t\t\tls[i] = v.(string)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tqueryParamsInt.StripQueryParams.QueryParams = ls\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tredirectPathChoiceTypeFound := false\n\n\t\t\t\t\tif v, ok := cs[\"path_redirect\"]; ok && !isIntfNil(v) && !redirectPathChoiceTypeFound {\n\n\t\t\t\t\t\tredirectPathChoiceTypeFound = true\n\t\t\t\t\t\tredirectPathChoiceInt := &ves_io_schema_route.RouteRedirect_PathRedirect{}\n\n\t\t\t\t\t\trouteActionInt.RouteRedirect.RedirectPathChoice = redirectPathChoiceInt\n\n\t\t\t\t\t\tredirectPathChoiceInt.PathRedirect = v.(string)\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := cs[\"prefix_rewrite\"]; ok && !isIntfNil(v) && !redirectPathChoiceTypeFound {\n\n\t\t\t\t\t\tredirectPathChoiceTypeFound = true\n\t\t\t\t\t\tredirectPathChoiceInt := &ves_io_schema_route.RouteRedirect_PrefixRewrite{}\n\n\t\t\t\t\t\trouteActionInt.RouteRedirect.RedirectPathChoice = redirectPathChoiceInt\n\n\t\t\t\t\t\tredirectPathChoiceInt.PrefixRewrite = v.(string)\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := cs[\"response_code\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\trouteActionInt.RouteRedirect.ResponseCode = uint32(v.(int))\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif v, ok := routesMapStrToI[\"service_policy\"]; ok && !isIntfNil(v) {\n\n\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\tservicePolicy := &ves_io_schema_route.ServicePolicyInfo{}\n\t\t\t\troutes[i].ServicePolicy = servicePolicy\n\t\t\t\tfor _, set := range sl {\n\t\t\t\t\tservicePolicyMapStrToI := set.(map[string]interface{})\n\n\t\t\t\t\tservicePolicyChoiceTypeFound := false\n\n\t\t\t\t\tif v, ok := servicePolicyMapStrToI[\"context_extensions\"]; ok && !isIntfNil(v) && !servicePolicyChoiceTypeFound {\n\n\t\t\t\t\t\tservicePolicyChoiceTypeFound = true\n\t\t\t\t\t\tservicePolicyChoiceInt := &ves_io_schema_route.ServicePolicyInfo_ContextExtensions{}\n\t\t\t\t\t\tservicePolicyChoiceInt.ContextExtensions = &ves_io_schema_route.ContextExtensionInfo{}\n\t\t\t\t\t\tservicePolicy.ServicePolicyChoice = servicePolicyChoiceInt\n\n\t\t\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\t\t\tfor _, set := range sl {\n\t\t\t\t\t\t\tcs := set.(map[string]interface{})\n\n\t\t\t\t\t\t\tif v, ok := cs[\"context_extensions\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\tms := map[string]string{}\n\t\t\t\t\t\t\t\tfor k, v := range v.(map[string]interface{}) {\n\t\t\t\t\t\t\t\t\tms[k] = v.(string)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tservicePolicyChoiceInt.ContextExtensions.ContextExtensions = ms\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := servicePolicyMapStrToI[\"disable\"]; ok && !isIntfNil(v) && !servicePolicyChoiceTypeFound {\n\n\t\t\t\t\t\tservicePolicyChoiceTypeFound = true\n\t\t\t\t\t\tservicePolicyChoiceInt := &ves_io_schema_route.ServicePolicyInfo_Disable{}\n\n\t\t\t\t\t\tservicePolicy.ServicePolicyChoice = servicePolicyChoiceInt\n\n\t\t\t\t\t\tservicePolicyChoiceInt.Disable = v.(bool)\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif w, ok := routesMapStrToI[\"skip_lb_override\"]; ok && !isIntfNil(w) {\n\t\t\t\troutes[i].SkipLbOverride = w.(bool)\n\t\t\t}\n\n\t\t\tif v, ok := routesMapStrToI[\"waf_type\"]; ok && !isIntfNil(v) {\n\n\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\twafType := &ves_io_schema.WafType{}\n\t\t\t\troutes[i].WafType = wafType\n\t\t\t\tfor _, set := range sl {\n\t\t\t\t\twafTypeMapStrToI := set.(map[string]interface{})\n\n\t\t\t\t\trefTypeTypeFound := false\n\n\t\t\t\t\tif v, ok := wafTypeMapStrToI[\"app_firewall\"]; ok && !isIntfNil(v) && !refTypeTypeFound {\n\n\t\t\t\t\t\trefTypeTypeFound = true\n\t\t\t\t\t\trefTypeInt := &ves_io_schema.WafType_AppFirewall{}\n\t\t\t\t\t\trefTypeInt.AppFirewall = &ves_io_schema.AppFirewallRefType{}\n\t\t\t\t\t\twafType.RefType = refTypeInt\n\n\t\t\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\t\t\tfor _, set := range sl {\n\t\t\t\t\t\t\tcs := set.(map[string]interface{})\n\n\t\t\t\t\t\t\tif v, ok := cs[\"app_firewall\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\tsl := v.([]interface{})\n\t\t\t\t\t\t\t\tappFirewallInt := make([]*ves_io_schema.ObjectRefType, len(sl))\n\t\t\t\t\t\t\t\trefTypeInt.AppFirewall.AppFirewall = appFirewallInt\n\t\t\t\t\t\t\t\tfor i, ps := range sl {\n\n\t\t\t\t\t\t\t\t\tafMapToStrVal := ps.(map[string]interface{})\n\t\t\t\t\t\t\t\t\tappFirewallInt[i] = &ves_io_schema.ObjectRefType{}\n\n\t\t\t\t\t\t\t\t\tappFirewallInt[i].Kind = \"app_firewall\"\n\n\t\t\t\t\t\t\t\t\tif v, ok := afMapToStrVal[\"name\"]; ok && !isIntfNil(v) {\n\t\t\t\t\t\t\t\t\t\tappFirewallInt[i].Name = v.(string)\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif v, ok := afMapToStrVal[\"namespace\"]; ok && !isIntfNil(v) {\n\t\t\t\t\t\t\t\t\t\tappFirewallInt[i].Namespace = v.(string)\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif v, ok := afMapToStrVal[\"tenant\"]; ok && !isIntfNil(v) {\n\t\t\t\t\t\t\t\t\t\tappFirewallInt[i].Tenant = v.(string)\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif v, ok := afMapToStrVal[\"uid\"]; ok && !isIntfNil(v) {\n\t\t\t\t\t\t\t\t\t\tappFirewallInt[i].Uid = v.(string)\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := wafTypeMapStrToI[\"disable_waf\"]; ok && !isIntfNil(v) && !refTypeTypeFound {\n\n\t\t\t\t\t\trefTypeTypeFound = true\n\n\t\t\t\t\t\tif v.(bool) {\n\t\t\t\t\t\t\trefTypeInt := &ves_io_schema.WafType_DisableWaf{}\n\t\t\t\t\t\t\trefTypeInt.DisableWaf = &ves_io_schema.Empty{}\n\t\t\t\t\t\t\twafType.RefType = refTypeInt\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := wafTypeMapStrToI[\"inherit_waf\"]; ok && !isIntfNil(v) && !refTypeTypeFound {\n\n\t\t\t\t\t\trefTypeTypeFound = true\n\n\t\t\t\t\t\tif v.(bool) {\n\t\t\t\t\t\t\trefTypeInt := &ves_io_schema.WafType_InheritWaf{}\n\t\t\t\t\t\t\trefTypeInt.InheritWaf = &ves_io_schema.Empty{}\n\t\t\t\t\t\t\twafType.RefType = refTypeInt\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tlog.Printf(\"[DEBUG] Creating Volterra Route object with struct: %+v\", createReq)\n\n\tcreateRouteResp, err := client.CreateObject(context.Background(), ves_io_schema_route.ObjectType, createReq)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error creating Route: %s\", err)\n\t}\n\td.SetId(createRouteResp.GetObjSystemMetadata().GetUid())\n\n\treturn resourceVolterraRouteRead(d, meta)\n}",
"func (k *Visor) CreateClusterResource(ctx context.Context, t ResourceType, v ManagedNames, name string) (err error) {\n\tvv, ok := v.(runtime.Object)\n\tif !ok {\n\t\treturn errors.Errorf(\"provided value was not castable to runtime.Object\")\n\t}\n\n\tvar c rest.Interface\n\tswitch t {\n\tcase ResourceTypeCustomResourceDefinition:\n\t\tc = k.apiext.ApiextensionsV1beta1().RESTClient()\n\tcase ResourceTypeRoles, ResourceTypeRoleBindings, ResourceTypeClusterRoles, ResourceTypeClusterRoleBindings:\n\t\tc = k.api.RbacV1().RESTClient()\n\tdefault:\n\t\treturn errors.Errorf(\"unknown Kubernetes resource type provided for creation: '%s'\", t)\n\t}\n\n\tif name == \"\" {\n\t\tv.SetGenerateName(k.prefix)\n\t}\n\n\tlabels := v.GetLabels()\n\tif labels == nil {\n\t\tlabels = map[string]string{}\n\t}\n\tlabels[\"nerd-app\"] = \"cli\"\n\tv.SetLabels(labels)\n\n\tk.logs.Debugf(\"creating %s '%s' with labels '%v': %s\", t, v.GetName(), labels, ctx)\n\terr = c.Post().\n\t\tResource(string(t)).\n\t\tBody(vv).\n\t\tContext(ctx).\n\t\tDo().\n\t\tInto(vv)\n\n\tif err != nil {\n\t\treturn k.tagError(err)\n\t}\n\n\tv.SetName(k.removePrefix(v.GetName())) //normalize back to unprefixed resource name\n\treturn nil\n}",
"func resourceNATCreate(data *schema.ResourceData, provider interface{}) error {\n\tvar err error\n\n\tpropertyHelper := propertyHelper(data)\n\n\tnetworkDomainID := data.Get(resourceKeyNATNetworkDomainID).(string)\n\tprivateIP := data.Get(resourceKeyNATPrivateAddress).(string)\n\tpublicIP := propertyHelper.GetOptionalString(resourceKeyNATPublicAddress, false)\n\n\tpublicIPDescription := \"<computed>\"\n\tif publicIP != nil {\n\t\tpublicIPDescription = *publicIP\n\t}\n\tlog.Printf(\"Create NAT rule (from public IP '%s' to private IP '%s') in network domain '%s'.\", publicIPDescription, privateIP, networkDomainID)\n\n\tproviderState := provider.(*providerState)\n\tapiClient := providerState.Client()\n\n\tvar (\n\t\tnatRuleID string\n\t\tcreateError error\n\t)\n\n\toperationDescription := fmt.Sprintf(\"Create NAT rule (from public IP '%s' to private IP '%s')\", publicIPDescription, privateIP)\n\terr = providerState.RetryAction(operationDescription, func(context retry.Context) {\n\t\tasyncLock := providerState.AcquireAsyncOperationLock(operationDescription)\n\t\tdefer asyncLock.Release()\n\n\t\tnatRuleID, createError = apiClient.AddNATRule(networkDomainID, privateIP, publicIP)\n\t\tif createError != nil {\n\t\t\tif compute.IsResourceBusyError(createError) {\n\t\t\t\tcontext.Retry()\n\t\t\t} else if compute.IsNoIPAddressAvailableError(createError) {\n\t\t\t\tlog.Printf(\"There are no free public IPv4 addresses in network domain '%s'; requesting allocation of a new address block...\", networkDomainID)\n\n\t\t\t\tpublicIPBlock, addBlockError := addPublicIPBlock(networkDomainID, apiClient)\n\t\t\t\tif addBlockError != nil {\n\t\t\t\t\tcontext.Fail(addBlockError)\n\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tlog.Printf(\"Allocated a new public IPv4 address block '%s' (%d addresses, starting at '%s').\",\n\t\t\t\t\tpublicIPBlock.ID, publicIPBlock.Size, publicIPBlock.BaseIP,\n\t\t\t\t)\n\n\t\t\t\tcontext.Retry() // We'll use the new block next time around.\n\t\t\t} else {\n\t\t\t\tcontext.Fail(createError)\n\t\t\t}\n\t\t}\n\t})\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tdata.SetId(natRuleID)\n\tlog.Printf(\"Successfully created NAT rule '%s'.\", natRuleID)\n\n\tnatRule, err := apiClient.GetNATRule(natRuleID)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif natRule == nil {\n\t\treturn fmt.Errorf(\"cannot find newly-added NAT rule '%s'\", natRuleID)\n\t}\n\n\tdata.Set(resourceKeyNATPublicAddress, natRule.ExternalIPAddress)\n\tdata.Set(resourceKeyNATPrivateAddress, natRule.InternalIPAddress)\n\n\treturn nil\n}",
"func resourceVolterraDnsLoadBalancerCreate(d *schema.ResourceData, meta interface{}) error {\n\tclient := meta.(*APIClient)\n\n\tcreateMeta := &ves_io_schema.ObjectCreateMetaType{}\n\tcreateSpec := &ves_io_schema_dns_load_balancer.CreateSpecType{}\n\tcreateReq := &ves_io_schema_dns_load_balancer.CreateRequest{\n\t\tMetadata: createMeta,\n\t\tSpec: createSpec,\n\t}\n\n\tif v, ok := d.GetOk(\"annotations\"); ok && !isIntfNil(v) {\n\n\t\tms := map[string]string{}\n\n\t\tfor k, v := range v.(map[string]interface{}) {\n\t\t\tval := v.(string)\n\t\t\tms[k] = val\n\t\t}\n\t\tcreateMeta.Annotations = ms\n\t}\n\n\tif v, ok := d.GetOk(\"description\"); ok && !isIntfNil(v) {\n\t\tcreateMeta.Description =\n\t\t\tv.(string)\n\t}\n\n\tif v, ok := d.GetOk(\"disable\"); ok && !isIntfNil(v) {\n\t\tcreateMeta.Disable =\n\t\t\tv.(bool)\n\t}\n\n\tif v, ok := d.GetOk(\"labels\"); ok && !isIntfNil(v) {\n\n\t\tms := map[string]string{}\n\n\t\tfor k, v := range v.(map[string]interface{}) {\n\t\t\tval := v.(string)\n\t\t\tms[k] = val\n\t\t}\n\t\tcreateMeta.Labels = ms\n\t}\n\n\tif v, ok := d.GetOk(\"name\"); ok && !isIntfNil(v) {\n\t\tcreateMeta.Name =\n\t\t\tv.(string)\n\t}\n\n\tif v, ok := d.GetOk(\"namespace\"); ok && !isIntfNil(v) {\n\t\tcreateMeta.Namespace =\n\t\t\tv.(string)\n\t}\n\n\t//record_type\n\tif v, ok := d.GetOk(\"record_type\"); ok && !isIntfNil(v) {\n\n\t\tcreateSpec.RecordType = ves_io_schema_dns_load_balancer.ResourceRecordType(ves_io_schema_dns_load_balancer.ResourceRecordType_value[v.(string)])\n\n\t}\n\n\t//response_cache\n\tif v, ok := d.GetOk(\"response_cache\"); ok && !isIntfNil(v) {\n\n\t\tsl := v.(*schema.Set).List()\n\t\tresponseCache := &ves_io_schema_dns_load_balancer.ResponseCache{}\n\t\tcreateSpec.ResponseCache = responseCache\n\t\tfor _, set := range sl {\n\t\t\tresponseCacheMapStrToI := set.(map[string]interface{})\n\n\t\t\tresponseCacheParametersChoiceTypeFound := false\n\n\t\t\tif v, ok := responseCacheMapStrToI[\"default_response_cache_parameters\"]; ok && !isIntfNil(v) && !responseCacheParametersChoiceTypeFound {\n\n\t\t\t\tresponseCacheParametersChoiceTypeFound = true\n\n\t\t\t\tif v.(bool) {\n\t\t\t\t\tresponseCacheParametersChoiceInt := &ves_io_schema_dns_load_balancer.ResponseCache_DefaultResponseCacheParameters{}\n\t\t\t\t\tresponseCacheParametersChoiceInt.DefaultResponseCacheParameters = &ves_io_schema.Empty{}\n\t\t\t\t\tresponseCache.ResponseCacheParametersChoice = responseCacheParametersChoiceInt\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif v, ok := responseCacheMapStrToI[\"disable\"]; ok && !isIntfNil(v) && !responseCacheParametersChoiceTypeFound {\n\n\t\t\t\tresponseCacheParametersChoiceTypeFound = true\n\n\t\t\t\tif v.(bool) {\n\t\t\t\t\tresponseCacheParametersChoiceInt := &ves_io_schema_dns_load_balancer.ResponseCache_Disable{}\n\t\t\t\t\tresponseCacheParametersChoiceInt.Disable = &ves_io_schema.Empty{}\n\t\t\t\t\tresponseCache.ResponseCacheParametersChoice = responseCacheParametersChoiceInt\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif v, ok := responseCacheMapStrToI[\"response_cache_parameters\"]; ok && !isIntfNil(v) && !responseCacheParametersChoiceTypeFound {\n\n\t\t\t\tresponseCacheParametersChoiceTypeFound = true\n\t\t\t\tresponseCacheParametersChoiceInt := &ves_io_schema_dns_load_balancer.ResponseCache_ResponseCacheParameters{}\n\t\t\t\tresponseCacheParametersChoiceInt.ResponseCacheParameters = &ves_io_schema_dns_load_balancer.ResponseCacheParameters{}\n\t\t\t\tresponseCache.ResponseCacheParametersChoice = responseCacheParametersChoiceInt\n\n\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\tfor _, set := range sl {\n\t\t\t\t\tcs := set.(map[string]interface{})\n\n\t\t\t\t\tif v, ok := cs[\"cache_cidr_ipv4\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\tresponseCacheParametersChoiceInt.ResponseCacheParameters.CacheCidrIpv4 = uint32(v.(int))\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := cs[\"cache_cidr_ipv6\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\tresponseCacheParametersChoiceInt.ResponseCacheParameters.CacheCidrIpv6 = uint32(v.(int))\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := cs[\"cache_ttl\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\tresponseCacheParametersChoiceInt.ResponseCacheParameters.CacheTtl = uint32(v.(int))\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\t//rule_list\n\tif v, ok := d.GetOk(\"rule_list\"); ok && !isIntfNil(v) {\n\n\t\tsl := v.(*schema.Set).List()\n\t\truleList := &ves_io_schema_dns_load_balancer.LoadBalancingRuleList{}\n\t\tcreateSpec.RuleList = ruleList\n\t\tfor _, set := range sl {\n\t\t\truleListMapStrToI := set.(map[string]interface{})\n\n\t\t\tif v, ok := ruleListMapStrToI[\"rules\"]; ok && !isIntfNil(v) {\n\n\t\t\t\tsl := v.([]interface{})\n\t\t\t\trules := make([]*ves_io_schema_dns_load_balancer.LoadBalancingRule, len(sl))\n\t\t\t\truleList.Rules = rules\n\t\t\t\tfor i, set := range sl {\n\t\t\t\t\trules[i] = &ves_io_schema_dns_load_balancer.LoadBalancingRule{}\n\t\t\t\t\trulesMapStrToI := set.(map[string]interface{})\n\n\t\t\t\t\tactionChoiceTypeFound := false\n\n\t\t\t\t\tif v, ok := rulesMapStrToI[\"nxdomain\"]; ok && !isIntfNil(v) && !actionChoiceTypeFound {\n\n\t\t\t\t\t\tactionChoiceTypeFound = true\n\n\t\t\t\t\t\tif v.(bool) {\n\t\t\t\t\t\t\tactionChoiceInt := &ves_io_schema_dns_load_balancer.LoadBalancingRule_Nxdomain{}\n\t\t\t\t\t\t\tactionChoiceInt.Nxdomain = &ves_io_schema.Empty{}\n\t\t\t\t\t\t\trules[i].ActionChoice = actionChoiceInt\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := rulesMapStrToI[\"pool\"]; ok && !isIntfNil(v) && !actionChoiceTypeFound {\n\n\t\t\t\t\t\tactionChoiceTypeFound = true\n\t\t\t\t\t\tactionChoiceInt := &ves_io_schema_dns_load_balancer.LoadBalancingRule_Pool{}\n\t\t\t\t\t\tactionChoiceInt.Pool = &ves_io_schema_views.ObjectRefType{}\n\t\t\t\t\t\trules[i].ActionChoice = actionChoiceInt\n\n\t\t\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\t\t\tfor _, set := range sl {\n\t\t\t\t\t\t\tcs := set.(map[string]interface{})\n\n\t\t\t\t\t\t\tif v, ok := cs[\"name\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\tactionChoiceInt.Pool.Name = v.(string)\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif v, ok := cs[\"namespace\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\tactionChoiceInt.Pool.Namespace = v.(string)\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif v, ok := cs[\"tenant\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\tactionChoiceInt.Pool.Tenant = v.(string)\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tgeoLocationChoiceTypeFound := false\n\n\t\t\t\t\tif v, ok := rulesMapStrToI[\"geo_location_label_selector\"]; ok && !isIntfNil(v) && !geoLocationChoiceTypeFound {\n\n\t\t\t\t\t\tgeoLocationChoiceTypeFound = true\n\t\t\t\t\t\tgeoLocationChoiceInt := &ves_io_schema_dns_load_balancer.LoadBalancingRule_GeoLocationLabelSelector{}\n\t\t\t\t\t\tgeoLocationChoiceInt.GeoLocationLabelSelector = &ves_io_schema.LabelSelectorType{}\n\t\t\t\t\t\trules[i].GeoLocationChoice = geoLocationChoiceInt\n\n\t\t\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\t\t\tfor _, set := range sl {\n\t\t\t\t\t\t\tcs := set.(map[string]interface{})\n\n\t\t\t\t\t\t\tif v, ok := cs[\"expressions\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\tls := make([]string, len(v.([]interface{})))\n\t\t\t\t\t\t\t\tfor i, v := range v.([]interface{}) {\n\t\t\t\t\t\t\t\t\tls[i] = v.(string)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tgeoLocationChoiceInt.GeoLocationLabelSelector.Expressions = ls\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := rulesMapStrToI[\"geo_location_set\"]; ok && !isIntfNil(v) && !geoLocationChoiceTypeFound {\n\n\t\t\t\t\t\tgeoLocationChoiceTypeFound = true\n\t\t\t\t\t\tgeoLocationChoiceInt := &ves_io_schema_dns_load_balancer.LoadBalancingRule_GeoLocationSet{}\n\t\t\t\t\t\tgeoLocationChoiceInt.GeoLocationSet = &ves_io_schema_views.ObjectRefType{}\n\t\t\t\t\t\trules[i].GeoLocationChoice = geoLocationChoiceInt\n\n\t\t\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\t\t\tfor _, set := range sl {\n\t\t\t\t\t\t\tcs := set.(map[string]interface{})\n\n\t\t\t\t\t\t\tif v, ok := cs[\"name\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\tgeoLocationChoiceInt.GeoLocationSet.Name = v.(string)\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif v, ok := cs[\"namespace\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\tgeoLocationChoiceInt.GeoLocationSet.Namespace = v.(string)\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif v, ok := cs[\"tenant\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\tgeoLocationChoiceInt.GeoLocationSet.Tenant = v.(string)\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif w, ok := rulesMapStrToI[\"score\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\trules[i].Score = uint32(w.(int))\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tlog.Printf(\"[DEBUG] Creating Volterra DnsLoadBalancer object with struct: %+v\", createReq)\n\n\tcreateDnsLoadBalancerResp, err := client.CreateObject(context.Background(), ves_io_schema_dns_load_balancer.ObjectType, createReq)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error creating DnsLoadBalancer: %s\", err)\n\t}\n\td.SetId(createDnsLoadBalancerResp.GetObjSystemMetadata().GetUid())\n\n\treturn resourceVolterraDnsLoadBalancerRead(d, meta)\n}",
"func (a *FabricApiService) CreateFabricLinkControlPolicy(ctx context.Context) ApiCreateFabricLinkControlPolicyRequest {\n\treturn ApiCreateFabricLinkControlPolicyRequest{\n\t\tApiService: a,\n\t\tctx: ctx,\n\t}\n}",
"func resourceVolterraRateLimiterCreate(d *schema.ResourceData, meta interface{}) error {\n\tclient := meta.(*APIClient)\n\n\tcreateMeta := &ves_io_schema.ObjectCreateMetaType{}\n\tcreateSpec := &ves_io_schema_rate_limiter.CreateSpecType{}\n\tcreateReq := &ves_io_schema_rate_limiter.CreateRequest{\n\t\tMetadata: createMeta,\n\t\tSpec: createSpec,\n\t}\n\n\tif v, ok := d.GetOk(\"annotations\"); ok && !isIntfNil(v) {\n\n\t\tms := map[string]string{}\n\n\t\tfor k, v := range v.(map[string]interface{}) {\n\t\t\tval := v.(string)\n\t\t\tms[k] = val\n\t\t}\n\t\tcreateMeta.Annotations = ms\n\t}\n\n\tif v, ok := d.GetOk(\"description\"); ok && !isIntfNil(v) {\n\t\tcreateMeta.Description =\n\t\t\tv.(string)\n\t}\n\n\tif v, ok := d.GetOk(\"disable\"); ok && !isIntfNil(v) {\n\t\tcreateMeta.Disable =\n\t\t\tv.(bool)\n\t}\n\n\tif v, ok := d.GetOk(\"labels\"); ok && !isIntfNil(v) {\n\n\t\tms := map[string]string{}\n\n\t\tfor k, v := range v.(map[string]interface{}) {\n\t\t\tval := v.(string)\n\t\t\tms[k] = val\n\t\t}\n\t\tcreateMeta.Labels = ms\n\t}\n\n\tif v, ok := d.GetOk(\"name\"); ok && !isIntfNil(v) {\n\t\tcreateMeta.Name =\n\t\t\tv.(string)\n\t}\n\n\tif v, ok := d.GetOk(\"namespace\"); ok && !isIntfNil(v) {\n\t\tcreateMeta.Namespace =\n\t\t\tv.(string)\n\t}\n\n\t//limits\n\tif v, ok := d.GetOk(\"limits\"); ok && !isIntfNil(v) {\n\n\t\tsl := v.([]interface{})\n\t\tlimits := make([]*ves_io_schema_rate_limiter.RateLimitValue, len(sl))\n\t\tcreateSpec.Limits = limits\n\t\tfor i, set := range sl {\n\t\t\tlimits[i] = &ves_io_schema_rate_limiter.RateLimitValue{}\n\t\t\tlimitsMapStrToI := set.(map[string]interface{})\n\n\t\t\tif w, ok := limitsMapStrToI[\"burst_multiplier\"]; ok && !isIntfNil(w) {\n\t\t\t\tlimits[i].BurstMultiplier = uint32(w.(int))\n\t\t\t}\n\n\t\t\tif w, ok := limitsMapStrToI[\"total_number\"]; ok && !isIntfNil(w) {\n\t\t\t\tlimits[i].TotalNumber = uint32(w.(int))\n\t\t\t}\n\n\t\t\tif v, ok := limitsMapStrToI[\"unit\"]; ok && !isIntfNil(v) {\n\n\t\t\t\tlimits[i].Unit = ves_io_schema_rate_limiter.RateLimitPeriodUnit(ves_io_schema_rate_limiter.RateLimitPeriodUnit_value[v.(string)])\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\t//user_identification\n\tif v, ok := d.GetOk(\"user_identification\"); ok && !isIntfNil(v) {\n\n\t\tsl := v.([]interface{})\n\t\tuserIdentificationInt := make([]*ves_io_schema.ObjectRefType, len(sl))\n\t\tcreateSpec.UserIdentification = userIdentificationInt\n\t\tfor i, ps := range sl {\n\n\t\t\tuiMapToStrVal := ps.(map[string]interface{})\n\t\t\tuserIdentificationInt[i] = &ves_io_schema.ObjectRefType{}\n\n\t\t\tuserIdentificationInt[i].Kind = \"user_identification\"\n\n\t\t\tif v, ok := uiMapToStrVal[\"name\"]; ok && !isIntfNil(v) {\n\t\t\t\tuserIdentificationInt[i].Name = v.(string)\n\t\t\t}\n\n\t\t\tif v, ok := uiMapToStrVal[\"namespace\"]; ok && !isIntfNil(v) {\n\t\t\t\tuserIdentificationInt[i].Namespace = v.(string)\n\t\t\t}\n\n\t\t\tif v, ok := uiMapToStrVal[\"tenant\"]; ok && !isIntfNil(v) {\n\t\t\t\tuserIdentificationInt[i].Tenant = v.(string)\n\t\t\t}\n\n\t\t\tif v, ok := uiMapToStrVal[\"uid\"]; ok && !isIntfNil(v) {\n\t\t\t\tuserIdentificationInt[i].Uid = v.(string)\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tlog.Printf(\"[DEBUG] Creating Volterra RateLimiter object with struct: %+v\", createReq)\n\n\tcreateRateLimiterResp, err := client.CreateObject(context.Background(), ves_io_schema_rate_limiter.ObjectType, createReq)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error creating RateLimiter: %s\", err)\n\t}\n\td.SetId(createRateLimiterResp.GetObjSystemMetadata().GetUid())\n\n\treturn resourceVolterraRateLimiterRead(d, meta)\n}",
"func (a *FabricApiService) CreateFabricFcNetworkPolicy(ctx context.Context) ApiCreateFabricFcNetworkPolicyRequest {\n\treturn ApiCreateFabricFcNetworkPolicyRequest{\n\t\tApiService: a,\n\t\tctx: ctx,\n\t}\n}",
"func createAzureRetentionRule() *dataprotection.AzureRetentionRule {\n\tazureRetentionRule := &dataprotection.AzureRetentionRule{\n\t\tName: to.Ptr(\"Default\"),\n\t\tObjectType: to.Ptr(dataprotection.AzureRetentionRule_ObjectType_AzureRetentionRule),\n\t\tIsDefault: to.Ptr(true),\n\t\tLifecycles: []dataprotection.SourceLifeCycle{\n\t\t\t{\n\t\t\t\tDeleteAfter: &dataprotection.DeleteOption{\n\t\t\t\t\tAbsoluteDeleteOption: &dataprotection.AbsoluteDeleteOption{\n\t\t\t\t\t\tDuration: to.Ptr(\"P9D\"),\n\t\t\t\t\t\tObjectType: to.Ptr(dataprotection.AbsoluteDeleteOption_ObjectType_AbsoluteDeleteOption),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\tSourceDataStore: &dataprotection.DataStoreInfoBase{\n\t\t\t\t\tDataStoreType: to.Ptr(dataprotection.DataStoreInfoBase_DataStoreType_OperationalStore),\n\t\t\t\t\tObjectType: to.Ptr(\"DataStoreInfoBase\"),\n\t\t\t\t},\n\t\t\t\tTargetDataStoreCopySettings: []dataprotection.TargetCopySetting{},\n\t\t\t},\n\t\t},\n\t}\n\n\treturn azureRetentionRule\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
resourceVolterraFastAclRuleUpdate updates FastAclRule resource
|
func resourceVolterraFastAclRuleUpdate(d *schema.ResourceData, meta interface{}) error {
client := meta.(*APIClient)
updateMeta := &ves_io_schema.ObjectReplaceMetaType{}
updateSpec := &ves_io_schema_fast_acl_rule.ReplaceSpecType{}
updateReq := &ves_io_schema_fast_acl_rule.ReplaceRequest{
Metadata: updateMeta,
Spec: updateSpec,
}
if v, ok := d.GetOk("annotations"); ok && !isIntfNil(v) {
ms := map[string]string{}
for k, v := range v.(map[string]interface{}) {
val := v.(string)
ms[k] = val
}
updateMeta.Annotations = ms
}
if v, ok := d.GetOk("description"); ok && !isIntfNil(v) {
updateMeta.Description =
v.(string)
}
if v, ok := d.GetOk("disable"); ok && !isIntfNil(v) {
updateMeta.Disable =
v.(bool)
}
if v, ok := d.GetOk("labels"); ok && !isIntfNil(v) {
ms := map[string]string{}
for k, v := range v.(map[string]interface{}) {
val := v.(string)
ms[k] = val
}
updateMeta.Labels = ms
}
if v, ok := d.GetOk("name"); ok && !isIntfNil(v) {
updateMeta.Name =
v.(string)
}
if v, ok := d.GetOk("namespace"); ok && !isIntfNil(v) {
updateMeta.Namespace =
v.(string)
}
if v, ok := d.GetOk("action"); ok && !isIntfNil(v) {
sl := v.(*schema.Set).List()
action := &ves_io_schema_fast_acl_rule.FastAclRuleAction{}
updateSpec.Action = action
for _, set := range sl {
actionMapStrToI := set.(map[string]interface{})
actionTypeFound := false
if v, ok := actionMapStrToI["policer_action"]; ok && !isIntfNil(v) && !actionTypeFound {
actionTypeFound = true
actionInt := &ves_io_schema_fast_acl_rule.FastAclRuleAction_PolicerAction{}
actionInt.PolicerAction = &ves_io_schema.PolicerRefType{}
action.Action = actionInt
sl := v.(*schema.Set).List()
for _, set := range sl {
cs := set.(map[string]interface{})
if v, ok := cs["ref"]; ok && !isIntfNil(v) {
sl := v.([]interface{})
refInt := make([]*ves_io_schema.ObjectRefType, len(sl))
actionInt.PolicerAction.Ref = refInt
for i, ps := range sl {
rMapToStrVal := ps.(map[string]interface{})
refInt[i] = &ves_io_schema.ObjectRefType{}
refInt[i].Kind = "policer"
if v, ok := rMapToStrVal["name"]; ok && !isIntfNil(v) {
refInt[i].Name = v.(string)
}
if v, ok := rMapToStrVal["namespace"]; ok && !isIntfNil(v) {
refInt[i].Namespace = v.(string)
}
if v, ok := rMapToStrVal["tenant"]; ok && !isIntfNil(v) {
refInt[i].Tenant = v.(string)
}
if v, ok := rMapToStrVal["uid"]; ok && !isIntfNil(v) {
refInt[i].Uid = v.(string)
}
}
}
}
}
if v, ok := actionMapStrToI["protocol_policer_action"]; ok && !isIntfNil(v) && !actionTypeFound {
actionTypeFound = true
actionInt := &ves_io_schema_fast_acl_rule.FastAclRuleAction_ProtocolPolicerAction{}
actionInt.ProtocolPolicerAction = &ves_io_schema.ProtocolPolicerRefType{}
action.Action = actionInt
sl := v.(*schema.Set).List()
for _, set := range sl {
cs := set.(map[string]interface{})
if v, ok := cs["ref"]; ok && !isIntfNil(v) {
sl := v.([]interface{})
refInt := make([]*ves_io_schema.ObjectRefType, len(sl))
actionInt.ProtocolPolicerAction.Ref = refInt
for i, ps := range sl {
rMapToStrVal := ps.(map[string]interface{})
refInt[i] = &ves_io_schema.ObjectRefType{}
refInt[i].Kind = "protocol_policer"
if v, ok := rMapToStrVal["name"]; ok && !isIntfNil(v) {
refInt[i].Name = v.(string)
}
if v, ok := rMapToStrVal["namespace"]; ok && !isIntfNil(v) {
refInt[i].Namespace = v.(string)
}
if v, ok := rMapToStrVal["tenant"]; ok && !isIntfNil(v) {
refInt[i].Tenant = v.(string)
}
if v, ok := rMapToStrVal["uid"]; ok && !isIntfNil(v) {
refInt[i].Uid = v.(string)
}
}
}
}
}
if v, ok := actionMapStrToI["simple_action"]; ok && !isIntfNil(v) && !actionTypeFound {
actionTypeFound = true
actionInt := &ves_io_schema_fast_acl_rule.FastAclRuleAction_SimpleAction{}
action.Action = actionInt
actionInt.SimpleAction = ves_io_schema_fast_acl_rule.FastAclRuleSimpleAction(ves_io_schema_fast_acl_rule.FastAclRuleSimpleAction_value[v.(string)])
}
}
}
if v, ok := d.GetOk("port"); ok && !isIntfNil(v) {
sl := v.([]interface{})
port := make([]*ves_io_schema.PortValueType, len(sl))
updateSpec.Port = port
for i, set := range sl {
port[i] = &ves_io_schema.PortValueType{}
portMapStrToI := set.(map[string]interface{})
portValueTypeChoiceTypeFound := false
if v, ok := portMapStrToI["all"]; ok && !isIntfNil(v) && !portValueTypeChoiceTypeFound {
portValueTypeChoiceTypeFound = true
if v.(bool) {
portValueTypeChoiceInt := &ves_io_schema.PortValueType_All{}
portValueTypeChoiceInt.All = &ves_io_schema.Empty{}
port[i].PortValueTypeChoice = portValueTypeChoiceInt
}
}
if v, ok := portMapStrToI["dns"]; ok && !isIntfNil(v) && !portValueTypeChoiceTypeFound {
portValueTypeChoiceTypeFound = true
if v.(bool) {
portValueTypeChoiceInt := &ves_io_schema.PortValueType_Dns{}
portValueTypeChoiceInt.Dns = &ves_io_schema.Empty{}
port[i].PortValueTypeChoice = portValueTypeChoiceInt
}
}
if v, ok := portMapStrToI["user_defined"]; ok && !isIntfNil(v) && !portValueTypeChoiceTypeFound {
portValueTypeChoiceTypeFound = true
portValueTypeChoiceInt := &ves_io_schema.PortValueType_UserDefined{}
port[i].PortValueTypeChoice = portValueTypeChoiceInt
portValueTypeChoiceInt.UserDefined = uint32(v.(int))
}
}
}
sourceTypeFound := false
if v, ok := d.GetOk("ip_prefix_set"); ok && !sourceTypeFound {
sourceTypeFound = true
sourceInt := &ves_io_schema_fast_acl_rule.ReplaceSpecType_IpPrefixSet{}
sourceInt.IpPrefixSet = &ves_io_schema.IpPrefixSetRefType{}
updateSpec.Source = sourceInt
sl := v.(*schema.Set).List()
for _, set := range sl {
cs := set.(map[string]interface{})
if v, ok := cs["ref"]; ok && !isIntfNil(v) {
sl := v.([]interface{})
refInt := make([]*ves_io_schema.ObjectRefType, len(sl))
sourceInt.IpPrefixSet.Ref = refInt
for i, ps := range sl {
rMapToStrVal := ps.(map[string]interface{})
refInt[i] = &ves_io_schema.ObjectRefType{}
refInt[i].Kind = "ip_prefix_set"
if v, ok := rMapToStrVal["name"]; ok && !isIntfNil(v) {
refInt[i].Name = v.(string)
}
if v, ok := rMapToStrVal["namespace"]; ok && !isIntfNil(v) {
refInt[i].Namespace = v.(string)
}
if v, ok := rMapToStrVal["tenant"]; ok && !isIntfNil(v) {
refInt[i].Tenant = v.(string)
}
if v, ok := rMapToStrVal["uid"]; ok && !isIntfNil(v) {
refInt[i].Uid = v.(string)
}
}
}
}
}
if v, ok := d.GetOk("prefix"); ok && !sourceTypeFound {
sourceTypeFound = true
sourceInt := &ves_io_schema_fast_acl_rule.ReplaceSpecType_Prefix{}
sourceInt.Prefix = &ves_io_schema.PrefixListType{}
updateSpec.Source = sourceInt
sl := v.(*schema.Set).List()
for _, set := range sl {
cs := set.(map[string]interface{})
if v, ok := cs["ipv6_prefix"]; ok && !isIntfNil(v) {
ls := make([]string, len(v.([]interface{})))
for i, v := range v.([]interface{}) {
ls[i] = v.(string)
}
sourceInt.Prefix.Ipv6Prefix = ls
}
if v, ok := cs["prefix"]; ok && !isIntfNil(v) {
ls := make([]string, len(v.([]interface{})))
for i, v := range v.([]interface{}) {
ls[i] = v.(string)
}
sourceInt.Prefix.Prefix = ls
}
}
}
log.Printf("[DEBUG] Updating Volterra FastAclRule obj with struct: %+v", updateReq)
err := client.ReplaceObject(context.Background(), ves_io_schema_fast_acl_rule.ObjectType, updateReq)
if err != nil {
return fmt.Errorf("error updating FastAclRule: %s", err)
}
return resourceVolterraFastAclRuleRead(d, meta)
}
|
[
"func resourceVolterraFastAclRuleCreate(d *schema.ResourceData, meta interface{}) error {\n\tclient := meta.(*APIClient)\n\n\tcreateMeta := &ves_io_schema.ObjectCreateMetaType{}\n\tcreateSpec := &ves_io_schema_fast_acl_rule.CreateSpecType{}\n\tcreateReq := &ves_io_schema_fast_acl_rule.CreateRequest{\n\t\tMetadata: createMeta,\n\t\tSpec: createSpec,\n\t}\n\n\tif v, ok := d.GetOk(\"annotations\"); ok && !isIntfNil(v) {\n\n\t\tms := map[string]string{}\n\n\t\tfor k, v := range v.(map[string]interface{}) {\n\t\t\tval := v.(string)\n\t\t\tms[k] = val\n\t\t}\n\t\tcreateMeta.Annotations = ms\n\t}\n\n\tif v, ok := d.GetOk(\"description\"); ok && !isIntfNil(v) {\n\t\tcreateMeta.Description =\n\t\t\tv.(string)\n\t}\n\n\tif v, ok := d.GetOk(\"disable\"); ok && !isIntfNil(v) {\n\t\tcreateMeta.Disable =\n\t\t\tv.(bool)\n\t}\n\n\tif v, ok := d.GetOk(\"labels\"); ok && !isIntfNil(v) {\n\n\t\tms := map[string]string{}\n\n\t\tfor k, v := range v.(map[string]interface{}) {\n\t\t\tval := v.(string)\n\t\t\tms[k] = val\n\t\t}\n\t\tcreateMeta.Labels = ms\n\t}\n\n\tif v, ok := d.GetOk(\"name\"); ok && !isIntfNil(v) {\n\t\tcreateMeta.Name =\n\t\t\tv.(string)\n\t}\n\n\tif v, ok := d.GetOk(\"namespace\"); ok && !isIntfNil(v) {\n\t\tcreateMeta.Namespace =\n\t\t\tv.(string)\n\t}\n\n\t//action\n\tif v, ok := d.GetOk(\"action\"); ok && !isIntfNil(v) {\n\n\t\tsl := v.(*schema.Set).List()\n\t\taction := &ves_io_schema_fast_acl_rule.FastAclRuleAction{}\n\t\tcreateSpec.Action = action\n\t\tfor _, set := range sl {\n\t\t\tactionMapStrToI := set.(map[string]interface{})\n\n\t\t\tactionTypeFound := false\n\n\t\t\tif v, ok := actionMapStrToI[\"policer_action\"]; ok && !isIntfNil(v) && !actionTypeFound {\n\n\t\t\t\tactionTypeFound = true\n\t\t\t\tactionInt := &ves_io_schema_fast_acl_rule.FastAclRuleAction_PolicerAction{}\n\t\t\t\tactionInt.PolicerAction = &ves_io_schema.PolicerRefType{}\n\t\t\t\taction.Action = actionInt\n\n\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\tfor _, set := range sl {\n\t\t\t\t\tcs := set.(map[string]interface{})\n\n\t\t\t\t\tif v, ok := cs[\"ref\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\tsl := v.([]interface{})\n\t\t\t\t\t\trefInt := make([]*ves_io_schema.ObjectRefType, len(sl))\n\t\t\t\t\t\tactionInt.PolicerAction.Ref = refInt\n\t\t\t\t\t\tfor i, ps := range sl {\n\n\t\t\t\t\t\t\trMapToStrVal := ps.(map[string]interface{})\n\t\t\t\t\t\t\trefInt[i] = &ves_io_schema.ObjectRefType{}\n\n\t\t\t\t\t\t\trefInt[i].Kind = \"policer\"\n\n\t\t\t\t\t\t\tif v, ok := rMapToStrVal[\"name\"]; ok && !isIntfNil(v) {\n\t\t\t\t\t\t\t\trefInt[i].Name = v.(string)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif v, ok := rMapToStrVal[\"namespace\"]; ok && !isIntfNil(v) {\n\t\t\t\t\t\t\t\trefInt[i].Namespace = v.(string)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif v, ok := rMapToStrVal[\"tenant\"]; ok && !isIntfNil(v) {\n\t\t\t\t\t\t\t\trefInt[i].Tenant = v.(string)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif v, ok := rMapToStrVal[\"uid\"]; ok && !isIntfNil(v) {\n\t\t\t\t\t\t\t\trefInt[i].Uid = v.(string)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif v, ok := actionMapStrToI[\"protocol_policer_action\"]; ok && !isIntfNil(v) && !actionTypeFound {\n\n\t\t\t\tactionTypeFound = true\n\t\t\t\tactionInt := &ves_io_schema_fast_acl_rule.FastAclRuleAction_ProtocolPolicerAction{}\n\t\t\t\tactionInt.ProtocolPolicerAction = &ves_io_schema.ProtocolPolicerRefType{}\n\t\t\t\taction.Action = actionInt\n\n\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\tfor _, set := range sl {\n\t\t\t\t\tcs := set.(map[string]interface{})\n\n\t\t\t\t\tif v, ok := cs[\"ref\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\tsl := v.([]interface{})\n\t\t\t\t\t\trefInt := make([]*ves_io_schema.ObjectRefType, len(sl))\n\t\t\t\t\t\tactionInt.ProtocolPolicerAction.Ref = refInt\n\t\t\t\t\t\tfor i, ps := range sl {\n\n\t\t\t\t\t\t\trMapToStrVal := ps.(map[string]interface{})\n\t\t\t\t\t\t\trefInt[i] = &ves_io_schema.ObjectRefType{}\n\n\t\t\t\t\t\t\trefInt[i].Kind = \"protocol_policer\"\n\n\t\t\t\t\t\t\tif v, ok := rMapToStrVal[\"name\"]; ok && !isIntfNil(v) {\n\t\t\t\t\t\t\t\trefInt[i].Name = v.(string)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif v, ok := rMapToStrVal[\"namespace\"]; ok && !isIntfNil(v) {\n\t\t\t\t\t\t\t\trefInt[i].Namespace = v.(string)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif v, ok := rMapToStrVal[\"tenant\"]; ok && !isIntfNil(v) {\n\t\t\t\t\t\t\t\trefInt[i].Tenant = v.(string)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif v, ok := rMapToStrVal[\"uid\"]; ok && !isIntfNil(v) {\n\t\t\t\t\t\t\t\trefInt[i].Uid = v.(string)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif v, ok := actionMapStrToI[\"simple_action\"]; ok && !isIntfNil(v) && !actionTypeFound {\n\n\t\t\t\tactionTypeFound = true\n\t\t\t\tactionInt := &ves_io_schema_fast_acl_rule.FastAclRuleAction_SimpleAction{}\n\n\t\t\t\taction.Action = actionInt\n\n\t\t\t\tactionInt.SimpleAction = ves_io_schema_fast_acl_rule.FastAclRuleSimpleAction(ves_io_schema_fast_acl_rule.FastAclRuleSimpleAction_value[v.(string)])\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\t//port\n\tif v, ok := d.GetOk(\"port\"); ok && !isIntfNil(v) {\n\n\t\tsl := v.([]interface{})\n\t\tport := make([]*ves_io_schema.PortValueType, len(sl))\n\t\tcreateSpec.Port = port\n\t\tfor i, set := range sl {\n\t\t\tport[i] = &ves_io_schema.PortValueType{}\n\t\t\tportMapStrToI := set.(map[string]interface{})\n\n\t\t\tportValueTypeChoiceTypeFound := false\n\n\t\t\tif v, ok := portMapStrToI[\"all\"]; ok && !isIntfNil(v) && !portValueTypeChoiceTypeFound {\n\n\t\t\t\tportValueTypeChoiceTypeFound = true\n\n\t\t\t\tif v.(bool) {\n\t\t\t\t\tportValueTypeChoiceInt := &ves_io_schema.PortValueType_All{}\n\t\t\t\t\tportValueTypeChoiceInt.All = &ves_io_schema.Empty{}\n\t\t\t\t\tport[i].PortValueTypeChoice = portValueTypeChoiceInt\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif v, ok := portMapStrToI[\"dns\"]; ok && !isIntfNil(v) && !portValueTypeChoiceTypeFound {\n\n\t\t\t\tportValueTypeChoiceTypeFound = true\n\n\t\t\t\tif v.(bool) {\n\t\t\t\t\tportValueTypeChoiceInt := &ves_io_schema.PortValueType_Dns{}\n\t\t\t\t\tportValueTypeChoiceInt.Dns = &ves_io_schema.Empty{}\n\t\t\t\t\tport[i].PortValueTypeChoice = portValueTypeChoiceInt\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif v, ok := portMapStrToI[\"user_defined\"]; ok && !isIntfNil(v) && !portValueTypeChoiceTypeFound {\n\n\t\t\t\tportValueTypeChoiceTypeFound = true\n\t\t\t\tportValueTypeChoiceInt := &ves_io_schema.PortValueType_UserDefined{}\n\n\t\t\t\tport[i].PortValueTypeChoice = portValueTypeChoiceInt\n\n\t\t\t\tportValueTypeChoiceInt.UserDefined = uint32(v.(int))\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\t//source\n\n\tsourceTypeFound := false\n\n\tif v, ok := d.GetOk(\"ip_prefix_set\"); ok && !sourceTypeFound {\n\n\t\tsourceTypeFound = true\n\t\tsourceInt := &ves_io_schema_fast_acl_rule.CreateSpecType_IpPrefixSet{}\n\t\tsourceInt.IpPrefixSet = &ves_io_schema.IpPrefixSetRefType{}\n\t\tcreateSpec.Source = sourceInt\n\n\t\tsl := v.(*schema.Set).List()\n\t\tfor _, set := range sl {\n\t\t\tcs := set.(map[string]interface{})\n\n\t\t\tif v, ok := cs[\"ref\"]; ok && !isIntfNil(v) {\n\n\t\t\t\tsl := v.([]interface{})\n\t\t\t\trefInt := make([]*ves_io_schema.ObjectRefType, len(sl))\n\t\t\t\tsourceInt.IpPrefixSet.Ref = refInt\n\t\t\t\tfor i, ps := range sl {\n\n\t\t\t\t\trMapToStrVal := ps.(map[string]interface{})\n\t\t\t\t\trefInt[i] = &ves_io_schema.ObjectRefType{}\n\n\t\t\t\t\trefInt[i].Kind = \"ip_prefix_set\"\n\n\t\t\t\t\tif v, ok := rMapToStrVal[\"name\"]; ok && !isIntfNil(v) {\n\t\t\t\t\t\trefInt[i].Name = v.(string)\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := rMapToStrVal[\"namespace\"]; ok && !isIntfNil(v) {\n\t\t\t\t\t\trefInt[i].Namespace = v.(string)\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := rMapToStrVal[\"tenant\"]; ok && !isIntfNil(v) {\n\t\t\t\t\t\trefInt[i].Tenant = v.(string)\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := rMapToStrVal[\"uid\"]; ok && !isIntfNil(v) {\n\t\t\t\t\t\trefInt[i].Uid = v.(string)\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tif v, ok := d.GetOk(\"prefix\"); ok && !sourceTypeFound {\n\n\t\tsourceTypeFound = true\n\t\tsourceInt := &ves_io_schema_fast_acl_rule.CreateSpecType_Prefix{}\n\t\tsourceInt.Prefix = &ves_io_schema.PrefixListType{}\n\t\tcreateSpec.Source = sourceInt\n\n\t\tsl := v.(*schema.Set).List()\n\t\tfor _, set := range sl {\n\t\t\tcs := set.(map[string]interface{})\n\n\t\t\tif v, ok := cs[\"ipv6_prefix\"]; ok && !isIntfNil(v) {\n\n\t\t\t\tls := make([]string, len(v.([]interface{})))\n\t\t\t\tfor i, v := range v.([]interface{}) {\n\t\t\t\t\tls[i] = v.(string)\n\t\t\t\t}\n\t\t\t\tsourceInt.Prefix.Ipv6Prefix = ls\n\n\t\t\t}\n\n\t\t\tif v, ok := cs[\"prefix\"]; ok && !isIntfNil(v) {\n\n\t\t\t\tls := make([]string, len(v.([]interface{})))\n\t\t\t\tfor i, v := range v.([]interface{}) {\n\t\t\t\t\tls[i] = v.(string)\n\t\t\t\t}\n\t\t\t\tsourceInt.Prefix.Prefix = ls\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tlog.Printf(\"[DEBUG] Creating Volterra FastAclRule object with struct: %+v\", createReq)\n\n\tcreateFastAclRuleResp, err := client.CreateObject(context.Background(), ves_io_schema_fast_acl_rule.ObjectType, createReq)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error creating FastAclRule: %s\", err)\n\t}\n\td.SetId(createFastAclRuleResp.GetObjSystemMetadata().GetUid())\n\n\treturn resourceVolterraFastAclRuleRead(d, meta)\n}",
"func resourceVolterraFastAclRule() *schema.Resource {\n\treturn &schema.Resource{\n\t\tCreate: resourceVolterraFastAclRuleCreate,\n\t\tRead: resourceVolterraFastAclRuleRead,\n\t\tUpdate: resourceVolterraFastAclRuleUpdate,\n\t\tDelete: resourceVolterraFastAclRuleDelete,\n\n\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\"annotations\": {\n\t\t\t\tType: schema.TypeMap,\n\t\t\t\tOptional: true,\n\t\t\t},\n\n\t\t\t\"description\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tOptional: true,\n\t\t\t},\n\n\t\t\t\"disable\": {\n\t\t\t\tType: schema.TypeBool,\n\t\t\t\tOptional: true,\n\t\t\t},\n\n\t\t\t\"labels\": {\n\t\t\t\tType: schema.TypeMap,\n\t\t\t\tOptional: true,\n\t\t\t},\n\n\t\t\t\"name\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tRequired: true,\n\t\t\t\tForceNew: true,\n\t\t\t},\n\n\t\t\t\"namespace\": {\n\t\t\t\tType: schema.TypeString,\n\t\t\t\tRequired: true,\n\t\t\t\tForceNew: true,\n\t\t\t},\n\n\t\t\t\"action\": {\n\n\t\t\t\tType: schema.TypeSet,\n\t\t\t\tOptional: true,\n\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\"policer_action\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"ref\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"kind\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tComputed: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"protocol_policer_action\": {\n\n\t\t\t\t\t\t\tType: schema.TypeSet,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"ref\": {\n\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"kind\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tComputed: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"simple_action\": {\n\n\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t\"port\": {\n\n\t\t\t\tType: schema.TypeList,\n\t\t\t\tOptional: true,\n\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\"all\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"dns\": {\n\n\t\t\t\t\t\t\tType: schema.TypeBool,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"user_defined\": {\n\n\t\t\t\t\t\t\tType: schema.TypeInt,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t\"ip_prefix_set\": {\n\n\t\t\t\tType: schema.TypeSet,\n\t\t\t\tOptional: true,\n\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\"ref\": {\n\n\t\t\t\t\t\t\tType: schema.TypeList,\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\t\t\t\"kind\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tComputed: true,\n\t\t\t\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\t\t\t\"name\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\"namespace\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\"tenant\": {\n\t\t\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\n\t\t\t\"prefix\": {\n\n\t\t\t\tType: schema.TypeSet,\n\t\t\t\tOptional: true,\n\t\t\t\tElem: &schema.Resource{\n\t\t\t\t\tSchema: map[string]*schema.Schema{\n\n\t\t\t\t\t\t\"ipv6_prefix\": {\n\n\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\n\t\t\t\t\t\t\"prefix\": {\n\n\t\t\t\t\t\t\tType: schema.TypeList,\n\n\t\t\t\t\t\t\tOptional: true,\n\t\t\t\t\t\t\tElem: &schema.Schema{\n\t\t\t\t\t\t\t\tType: schema.TypeString,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n}",
"func (h *networkControllerPolicyEventHandler) UpdateResource(oldObj, newObj interface{}, inRetryCache bool) error {\n\tswitch h.objType {\n\tcase factory.AddressSetPodSelectorType:\n\t\tpeerAS := h.extraParameters.(*PodSelectorAddrSetHandlerInfo)\n\t\treturn h.bnc.handlePodAddUpdate(peerAS, newObj)\n\n\tcase factory.LocalPodSelectorType:\n\t\textraParameters := h.extraParameters.(*NetworkPolicyExtraParameters)\n\t\treturn h.bnc.handleLocalPodSelectorAddFunc(\n\t\t\textraParameters.np,\n\t\t\tnewObj)\n\t}\n\treturn fmt.Errorf(\"no update function for object type %s\", h.objType)\n}",
"func resourceVolterraRateLimiterUpdate(d *schema.ResourceData, meta interface{}) error {\n\tclient := meta.(*APIClient)\n\n\tupdateMeta := &ves_io_schema.ObjectReplaceMetaType{}\n\tupdateSpec := &ves_io_schema_rate_limiter.ReplaceSpecType{}\n\tupdateReq := &ves_io_schema_rate_limiter.ReplaceRequest{\n\t\tMetadata: updateMeta,\n\t\tSpec: updateSpec,\n\t}\n\tif v, ok := d.GetOk(\"annotations\"); ok && !isIntfNil(v) {\n\n\t\tms := map[string]string{}\n\n\t\tfor k, v := range v.(map[string]interface{}) {\n\t\t\tval := v.(string)\n\t\t\tms[k] = val\n\t\t}\n\t\tupdateMeta.Annotations = ms\n\t}\n\n\tif v, ok := d.GetOk(\"description\"); ok && !isIntfNil(v) {\n\t\tupdateMeta.Description =\n\t\t\tv.(string)\n\t}\n\n\tif v, ok := d.GetOk(\"disable\"); ok && !isIntfNil(v) {\n\t\tupdateMeta.Disable =\n\t\t\tv.(bool)\n\t}\n\n\tif v, ok := d.GetOk(\"labels\"); ok && !isIntfNil(v) {\n\n\t\tms := map[string]string{}\n\n\t\tfor k, v := range v.(map[string]interface{}) {\n\t\t\tval := v.(string)\n\t\t\tms[k] = val\n\t\t}\n\t\tupdateMeta.Labels = ms\n\t}\n\n\tif v, ok := d.GetOk(\"name\"); ok && !isIntfNil(v) {\n\t\tupdateMeta.Name =\n\t\t\tv.(string)\n\t}\n\n\tif v, ok := d.GetOk(\"namespace\"); ok && !isIntfNil(v) {\n\t\tupdateMeta.Namespace =\n\t\t\tv.(string)\n\t}\n\n\tif v, ok := d.GetOk(\"limits\"); ok && !isIntfNil(v) {\n\n\t\tsl := v.([]interface{})\n\t\tlimits := make([]*ves_io_schema_rate_limiter.RateLimitValue, len(sl))\n\t\tupdateSpec.Limits = limits\n\t\tfor i, set := range sl {\n\t\t\tlimits[i] = &ves_io_schema_rate_limiter.RateLimitValue{}\n\t\t\tlimitsMapStrToI := set.(map[string]interface{})\n\n\t\t\tif w, ok := limitsMapStrToI[\"burst_multiplier\"]; ok && !isIntfNil(w) {\n\t\t\t\tlimits[i].BurstMultiplier = uint32(w.(int))\n\t\t\t}\n\n\t\t\tif w, ok := limitsMapStrToI[\"total_number\"]; ok && !isIntfNil(w) {\n\t\t\t\tlimits[i].TotalNumber = uint32(w.(int))\n\t\t\t}\n\n\t\t\tif v, ok := limitsMapStrToI[\"unit\"]; ok && !isIntfNil(v) {\n\n\t\t\t\tlimits[i].Unit = ves_io_schema_rate_limiter.RateLimitPeriodUnit(ves_io_schema_rate_limiter.RateLimitPeriodUnit_value[v.(string)])\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tif v, ok := d.GetOk(\"user_identification\"); ok && !isIntfNil(v) {\n\n\t\tsl := v.([]interface{})\n\t\tuserIdentificationInt := make([]*ves_io_schema.ObjectRefType, len(sl))\n\t\tupdateSpec.UserIdentification = userIdentificationInt\n\t\tfor i, ps := range sl {\n\n\t\t\tuiMapToStrVal := ps.(map[string]interface{})\n\t\t\tuserIdentificationInt[i] = &ves_io_schema.ObjectRefType{}\n\n\t\t\tuserIdentificationInt[i].Kind = \"user_identification\"\n\n\t\t\tif v, ok := uiMapToStrVal[\"name\"]; ok && !isIntfNil(v) {\n\t\t\t\tuserIdentificationInt[i].Name = v.(string)\n\t\t\t}\n\n\t\t\tif v, ok := uiMapToStrVal[\"namespace\"]; ok && !isIntfNil(v) {\n\t\t\t\tuserIdentificationInt[i].Namespace = v.(string)\n\t\t\t}\n\n\t\t\tif v, ok := uiMapToStrVal[\"tenant\"]; ok && !isIntfNil(v) {\n\t\t\t\tuserIdentificationInt[i].Tenant = v.(string)\n\t\t\t}\n\n\t\t\tif v, ok := uiMapToStrVal[\"uid\"]; ok && !isIntfNil(v) {\n\t\t\t\tuserIdentificationInt[i].Uid = v.(string)\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tlog.Printf(\"[DEBUG] Updating Volterra RateLimiter obj with struct: %+v\", updateReq)\n\n\terr := client.ReplaceObject(context.Background(), ves_io_schema_rate_limiter.ObjectType, updateReq)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error updating RateLimiter: %s\", err)\n\t}\n\n\treturn resourceVolterraRateLimiterRead(d, meta)\n}",
"func resourceVolterraRouteUpdate(d *schema.ResourceData, meta interface{}) error {\n\tclient := meta.(*APIClient)\n\n\tupdateMeta := &ves_io_schema.ObjectReplaceMetaType{}\n\tupdateSpec := &ves_io_schema_route.ReplaceSpecType{}\n\tupdateReq := &ves_io_schema_route.ReplaceRequest{\n\t\tMetadata: updateMeta,\n\t\tSpec: updateSpec,\n\t}\n\tif v, ok := d.GetOk(\"annotations\"); ok && !isIntfNil(v) {\n\n\t\tms := map[string]string{}\n\n\t\tfor k, v := range v.(map[string]interface{}) {\n\t\t\tval := v.(string)\n\t\t\tms[k] = val\n\t\t}\n\t\tupdateMeta.Annotations = ms\n\t}\n\n\tif v, ok := d.GetOk(\"description\"); ok && !isIntfNil(v) {\n\t\tupdateMeta.Description =\n\t\t\tv.(string)\n\t}\n\n\tif v, ok := d.GetOk(\"disable\"); ok && !isIntfNil(v) {\n\t\tupdateMeta.Disable =\n\t\t\tv.(bool)\n\t}\n\n\tif v, ok := d.GetOk(\"labels\"); ok && !isIntfNil(v) {\n\n\t\tms := map[string]string{}\n\n\t\tfor k, v := range v.(map[string]interface{}) {\n\t\t\tval := v.(string)\n\t\t\tms[k] = val\n\t\t}\n\t\tupdateMeta.Labels = ms\n\t}\n\n\tif v, ok := d.GetOk(\"name\"); ok && !isIntfNil(v) {\n\t\tupdateMeta.Name =\n\t\t\tv.(string)\n\t}\n\n\tif v, ok := d.GetOk(\"namespace\"); ok && !isIntfNil(v) {\n\t\tupdateMeta.Namespace =\n\t\t\tv.(string)\n\t}\n\n\tif v, ok := d.GetOk(\"routes\"); ok && !isIntfNil(v) {\n\n\t\tsl := v.([]interface{})\n\t\troutes := make([]*ves_io_schema_route.RouteType, len(sl))\n\t\tupdateSpec.Routes = routes\n\t\tfor i, set := range sl {\n\t\t\troutes[i] = &ves_io_schema_route.RouteType{}\n\t\t\troutesMapStrToI := set.(map[string]interface{})\n\n\t\t\tbotDefenseJavascriptInjectionChoiceTypeFound := false\n\n\t\t\tif v, ok := routesMapStrToI[\"bot_defense_javascript_injection\"]; ok && !isIntfNil(v) && !botDefenseJavascriptInjectionChoiceTypeFound {\n\n\t\t\t\tbotDefenseJavascriptInjectionChoiceTypeFound = true\n\t\t\t\tbotDefenseJavascriptInjectionChoiceInt := &ves_io_schema_route.RouteType_BotDefenseJavascriptInjection{}\n\t\t\t\tbotDefenseJavascriptInjectionChoiceInt.BotDefenseJavascriptInjection = &ves_io_schema_route.BotDefenseJavascriptInjectionType{}\n\t\t\t\troutes[i].BotDefenseJavascriptInjectionChoice = botDefenseJavascriptInjectionChoiceInt\n\n\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\tfor _, set := range sl {\n\t\t\t\t\tcs := set.(map[string]interface{})\n\n\t\t\t\t\tif v, ok := cs[\"javascript_location\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\tbotDefenseJavascriptInjectionChoiceInt.BotDefenseJavascriptInjection.JavascriptLocation = ves_io_schema_route.JavaScriptLocation(ves_io_schema_route.JavaScriptLocation_value[v.(string)])\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := cs[\"javascript_tags\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\tsl := v.([]interface{})\n\t\t\t\t\t\tjavascriptTags := make([]*ves_io_schema_route.JavaScriptTag, len(sl))\n\t\t\t\t\t\tbotDefenseJavascriptInjectionChoiceInt.BotDefenseJavascriptInjection.JavascriptTags = javascriptTags\n\t\t\t\t\t\tfor i, set := range sl {\n\t\t\t\t\t\t\tjavascriptTags[i] = &ves_io_schema_route.JavaScriptTag{}\n\t\t\t\t\t\t\tjavascriptTagsMapStrToI := set.(map[string]interface{})\n\n\t\t\t\t\t\t\tif w, ok := javascriptTagsMapStrToI[\"javascript_url\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\tjavascriptTags[i].JavascriptUrl = w.(string)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif v, ok := javascriptTagsMapStrToI[\"tag_attributes\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\tsl := v.([]interface{})\n\t\t\t\t\t\t\t\ttagAttributes := make([]*ves_io_schema_route.TagAttribute, len(sl))\n\t\t\t\t\t\t\t\tjavascriptTags[i].TagAttributes = tagAttributes\n\t\t\t\t\t\t\t\tfor i, set := range sl {\n\t\t\t\t\t\t\t\t\ttagAttributes[i] = &ves_io_schema_route.TagAttribute{}\n\t\t\t\t\t\t\t\t\ttagAttributesMapStrToI := set.(map[string]interface{})\n\n\t\t\t\t\t\t\t\t\tif v, ok := tagAttributesMapStrToI[\"javascript_tag\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\t\t\ttagAttributes[i].JavascriptTag = ves_io_schema_route.TagAttributeName(ves_io_schema_route.TagAttributeName_value[v.(string)])\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif w, ok := tagAttributesMapStrToI[\"tag_value\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\t\t\ttagAttributes[i].TagValue = w.(string)\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif v, ok := routesMapStrToI[\"inherited_bot_defense_javascript_injection\"]; ok && !isIntfNil(v) && !botDefenseJavascriptInjectionChoiceTypeFound {\n\n\t\t\t\tbotDefenseJavascriptInjectionChoiceTypeFound = true\n\n\t\t\t\tif v.(bool) {\n\t\t\t\t\tbotDefenseJavascriptInjectionChoiceInt := &ves_io_schema_route.RouteType_InheritedBotDefenseJavascriptInjection{}\n\t\t\t\t\tbotDefenseJavascriptInjectionChoiceInt.InheritedBotDefenseJavascriptInjection = &ves_io_schema.Empty{}\n\t\t\t\t\troutes[i].BotDefenseJavascriptInjectionChoice = botDefenseJavascriptInjectionChoiceInt\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif v, ok := routesMapStrToI[\"bot_defense_javascript_injection_inline_mode\"]; ok && !isIntfNil(v) {\n\n\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\tbotDefenseJavascriptInjectionInlineMode := &ves_io_schema_route.ContentRewriteType{}\n\t\t\t\troutes[i].BotDefenseJavascriptInjectionInlineMode = botDefenseJavascriptInjectionInlineMode\n\t\t\t\tfor _, set := range sl {\n\t\t\t\t\tbotDefenseJavascriptInjectionInlineModeMapStrToI := set.(map[string]interface{})\n\n\t\t\t\t\tif w, ok := botDefenseJavascriptInjectionInlineModeMapStrToI[\"element_selector\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\tbotDefenseJavascriptInjectionInlineMode.ElementSelector = w.(string)\n\t\t\t\t\t}\n\n\t\t\t\t\tif w, ok := botDefenseJavascriptInjectionInlineModeMapStrToI[\"insert_content\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\tbotDefenseJavascriptInjectionInlineMode.InsertContent = w.(string)\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := botDefenseJavascriptInjectionInlineModeMapStrToI[\"position\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\tbotDefenseJavascriptInjectionInlineMode.Position = ves_io_schema_policy.HTMLPosition(ves_io_schema_policy.HTMLPosition_value[v.(string)])\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif w, ok := routesMapStrToI[\"disable_custom_script\"]; ok && !isIntfNil(w) {\n\t\t\t\troutes[i].DisableCustomScript = w.(bool)\n\t\t\t}\n\n\t\t\tif w, ok := routesMapStrToI[\"disable_location_add\"]; ok && !isIntfNil(w) {\n\t\t\t\troutes[i].DisableLocationAdd = w.(bool)\n\t\t\t}\n\n\t\t\tif v, ok := routesMapStrToI[\"match\"]; ok && !isIntfNil(v) {\n\n\t\t\t\tsl := v.([]interface{})\n\t\t\t\tmatch := make([]*ves_io_schema.RouteMatch, len(sl))\n\t\t\t\troutes[i].Match = match\n\t\t\t\tfor i, set := range sl {\n\t\t\t\t\tmatch[i] = &ves_io_schema.RouteMatch{}\n\t\t\t\t\tmatchMapStrToI := set.(map[string]interface{})\n\n\t\t\t\t\tif v, ok := matchMapStrToI[\"headers\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\tsl := v.([]interface{})\n\t\t\t\t\t\theaders := make([]*ves_io_schema.HeaderMatcherType, len(sl))\n\t\t\t\t\t\tmatch[i].Headers = headers\n\t\t\t\t\t\tfor i, set := range sl {\n\t\t\t\t\t\t\theaders[i] = &ves_io_schema.HeaderMatcherType{}\n\t\t\t\t\t\t\theadersMapStrToI := set.(map[string]interface{})\n\n\t\t\t\t\t\t\tif w, ok := headersMapStrToI[\"invert_match\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\theaders[i].InvertMatch = w.(bool)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif w, ok := headersMapStrToI[\"name\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\theaders[i].Name = w.(string)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tvalueMatchTypeFound := false\n\n\t\t\t\t\t\t\tif v, ok := headersMapStrToI[\"exact\"]; ok && !isIntfNil(v) && !valueMatchTypeFound {\n\n\t\t\t\t\t\t\t\tvalueMatchTypeFound = true\n\t\t\t\t\t\t\t\tvalueMatchInt := &ves_io_schema.HeaderMatcherType_Exact{}\n\n\t\t\t\t\t\t\t\theaders[i].ValueMatch = valueMatchInt\n\n\t\t\t\t\t\t\t\tvalueMatchInt.Exact = v.(string)\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif v, ok := headersMapStrToI[\"presence\"]; ok && !isIntfNil(v) && !valueMatchTypeFound {\n\n\t\t\t\t\t\t\t\tvalueMatchTypeFound = true\n\t\t\t\t\t\t\t\tvalueMatchInt := &ves_io_schema.HeaderMatcherType_Presence{}\n\n\t\t\t\t\t\t\t\theaders[i].ValueMatch = valueMatchInt\n\n\t\t\t\t\t\t\t\tvalueMatchInt.Presence = v.(bool)\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif v, ok := headersMapStrToI[\"regex\"]; ok && !isIntfNil(v) && !valueMatchTypeFound {\n\n\t\t\t\t\t\t\t\tvalueMatchTypeFound = true\n\t\t\t\t\t\t\t\tvalueMatchInt := &ves_io_schema.HeaderMatcherType_Regex{}\n\n\t\t\t\t\t\t\t\theaders[i].ValueMatch = valueMatchInt\n\n\t\t\t\t\t\t\t\tvalueMatchInt.Regex = v.(string)\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := matchMapStrToI[\"http_method\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\tmatch[i].HttpMethod = ves_io_schema.HttpMethod(ves_io_schema.HttpMethod_value[v.(string)])\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := matchMapStrToI[\"incoming_port\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\t\t\tincomingPort := &ves_io_schema.PortMatcherType{}\n\t\t\t\t\t\tmatch[i].IncomingPort = incomingPort\n\t\t\t\t\t\tfor _, set := range sl {\n\t\t\t\t\t\t\tincomingPortMapStrToI := set.(map[string]interface{})\n\n\t\t\t\t\t\t\tportMatchTypeFound := false\n\n\t\t\t\t\t\t\tif v, ok := incomingPortMapStrToI[\"no_port_match\"]; ok && !isIntfNil(v) && !portMatchTypeFound {\n\n\t\t\t\t\t\t\t\tportMatchTypeFound = true\n\n\t\t\t\t\t\t\t\tif v.(bool) {\n\t\t\t\t\t\t\t\t\tportMatchInt := &ves_io_schema.PortMatcherType_NoPortMatch{}\n\t\t\t\t\t\t\t\t\tportMatchInt.NoPortMatch = &ves_io_schema.Empty{}\n\t\t\t\t\t\t\t\t\tincomingPort.PortMatch = portMatchInt\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif v, ok := incomingPortMapStrToI[\"port\"]; ok && !isIntfNil(v) && !portMatchTypeFound {\n\n\t\t\t\t\t\t\t\tportMatchTypeFound = true\n\t\t\t\t\t\t\t\tportMatchInt := &ves_io_schema.PortMatcherType_Port{}\n\n\t\t\t\t\t\t\t\tincomingPort.PortMatch = portMatchInt\n\n\t\t\t\t\t\t\t\tportMatchInt.Port = uint32(v.(int))\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif v, ok := incomingPortMapStrToI[\"port_ranges\"]; ok && !isIntfNil(v) && !portMatchTypeFound {\n\n\t\t\t\t\t\t\t\tportMatchTypeFound = true\n\t\t\t\t\t\t\t\tportMatchInt := &ves_io_schema.PortMatcherType_PortRanges{}\n\n\t\t\t\t\t\t\t\tincomingPort.PortMatch = portMatchInt\n\n\t\t\t\t\t\t\t\tportMatchInt.PortRanges = v.(string)\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := matchMapStrToI[\"path\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\t\t\tpath := &ves_io_schema.PathMatcherType{}\n\t\t\t\t\t\tmatch[i].Path = path\n\t\t\t\t\t\tfor _, set := range sl {\n\t\t\t\t\t\t\tpathMapStrToI := set.(map[string]interface{})\n\n\t\t\t\t\t\t\tpathMatchTypeFound := false\n\n\t\t\t\t\t\t\tif v, ok := pathMapStrToI[\"path\"]; ok && !isIntfNil(v) && !pathMatchTypeFound {\n\n\t\t\t\t\t\t\t\tpathMatchTypeFound = true\n\t\t\t\t\t\t\t\tpathMatchInt := &ves_io_schema.PathMatcherType_Path{}\n\n\t\t\t\t\t\t\t\tpath.PathMatch = pathMatchInt\n\n\t\t\t\t\t\t\t\tpathMatchInt.Path = v.(string)\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif v, ok := pathMapStrToI[\"prefix\"]; ok && !isIntfNil(v) && !pathMatchTypeFound {\n\n\t\t\t\t\t\t\t\tpathMatchTypeFound = true\n\t\t\t\t\t\t\t\tpathMatchInt := &ves_io_schema.PathMatcherType_Prefix{}\n\n\t\t\t\t\t\t\t\tpath.PathMatch = pathMatchInt\n\n\t\t\t\t\t\t\t\tpathMatchInt.Prefix = v.(string)\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif v, ok := pathMapStrToI[\"regex\"]; ok && !isIntfNil(v) && !pathMatchTypeFound {\n\n\t\t\t\t\t\t\t\tpathMatchTypeFound = true\n\t\t\t\t\t\t\t\tpathMatchInt := &ves_io_schema.PathMatcherType_Regex{}\n\n\t\t\t\t\t\t\t\tpath.PathMatch = pathMatchInt\n\n\t\t\t\t\t\t\t\tpathMatchInt.Regex = v.(string)\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := matchMapStrToI[\"query_params\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\tsl := v.([]interface{})\n\t\t\t\t\t\tqueryParams := make([]*ves_io_schema.QueryParameterMatcherType, len(sl))\n\t\t\t\t\t\tmatch[i].QueryParams = queryParams\n\t\t\t\t\t\tfor i, set := range sl {\n\t\t\t\t\t\t\tqueryParams[i] = &ves_io_schema.QueryParameterMatcherType{}\n\t\t\t\t\t\t\tqueryParamsMapStrToI := set.(map[string]interface{})\n\n\t\t\t\t\t\t\tif w, ok := queryParamsMapStrToI[\"key\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\tqueryParams[i].Key = w.(string)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tvalueMatchTypeFound := false\n\n\t\t\t\t\t\t\tif v, ok := queryParamsMapStrToI[\"exact\"]; ok && !isIntfNil(v) && !valueMatchTypeFound {\n\n\t\t\t\t\t\t\t\tvalueMatchTypeFound = true\n\t\t\t\t\t\t\t\tvalueMatchInt := &ves_io_schema.QueryParameterMatcherType_Exact{}\n\n\t\t\t\t\t\t\t\tqueryParams[i].ValueMatch = valueMatchInt\n\n\t\t\t\t\t\t\t\tvalueMatchInt.Exact = v.(string)\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif v, ok := queryParamsMapStrToI[\"regex\"]; ok && !isIntfNil(v) && !valueMatchTypeFound {\n\n\t\t\t\t\t\t\t\tvalueMatchTypeFound = true\n\t\t\t\t\t\t\t\tvalueMatchInt := &ves_io_schema.QueryParameterMatcherType_Regex{}\n\n\t\t\t\t\t\t\t\tqueryParams[i].ValueMatch = valueMatchInt\n\n\t\t\t\t\t\t\t\tvalueMatchInt.Regex = v.(string)\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif v, ok := routesMapStrToI[\"request_headers_to_add\"]; ok && !isIntfNil(v) {\n\n\t\t\t\tsl := v.([]interface{})\n\t\t\t\trequestHeadersToAdd := make([]*ves_io_schema.HeaderManipulationOptionType, len(sl))\n\t\t\t\troutes[i].RequestHeadersToAdd = requestHeadersToAdd\n\t\t\t\tfor i, set := range sl {\n\t\t\t\t\trequestHeadersToAdd[i] = &ves_io_schema.HeaderManipulationOptionType{}\n\t\t\t\t\trequestHeadersToAddMapStrToI := set.(map[string]interface{})\n\n\t\t\t\t\tif w, ok := requestHeadersToAddMapStrToI[\"append\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\trequestHeadersToAdd[i].Append = w.(bool)\n\t\t\t\t\t}\n\n\t\t\t\t\tif w, ok := requestHeadersToAddMapStrToI[\"name\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\trequestHeadersToAdd[i].Name = w.(string)\n\t\t\t\t\t}\n\n\t\t\t\t\tvalueChoiceTypeFound := false\n\n\t\t\t\t\tif v, ok := requestHeadersToAddMapStrToI[\"secret_value\"]; ok && !isIntfNil(v) && !valueChoiceTypeFound {\n\n\t\t\t\t\t\tvalueChoiceTypeFound = true\n\t\t\t\t\t\tvalueChoiceInt := &ves_io_schema.HeaderManipulationOptionType_SecretValue{}\n\t\t\t\t\t\tvalueChoiceInt.SecretValue = &ves_io_schema.SecretType{}\n\t\t\t\t\t\trequestHeadersToAdd[i].ValueChoice = valueChoiceInt\n\n\t\t\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\t\t\tfor _, set := range sl {\n\t\t\t\t\t\t\tcs := set.(map[string]interface{})\n\n\t\t\t\t\t\t\tif v, ok := cs[\"blindfold_secret_info_internal\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\t\t\t\t\tblindfoldSecretInfoInternal := &ves_io_schema.BlindfoldSecretInfoType{}\n\t\t\t\t\t\t\t\tvalueChoiceInt.SecretValue.BlindfoldSecretInfoInternal = blindfoldSecretInfoInternal\n\t\t\t\t\t\t\t\tfor _, set := range sl {\n\t\t\t\t\t\t\t\t\tblindfoldSecretInfoInternalMapStrToI := set.(map[string]interface{})\n\n\t\t\t\t\t\t\t\t\tif w, ok := blindfoldSecretInfoInternalMapStrToI[\"decryption_provider\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\t\t\tblindfoldSecretInfoInternal.DecryptionProvider = w.(string)\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif w, ok := blindfoldSecretInfoInternalMapStrToI[\"location\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\t\t\tblindfoldSecretInfoInternal.Location = w.(string)\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif w, ok := blindfoldSecretInfoInternalMapStrToI[\"store_provider\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\t\t\tblindfoldSecretInfoInternal.StoreProvider = w.(string)\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif v, ok := cs[\"secret_encoding_type\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\tvalueChoiceInt.SecretValue.SecretEncodingType = ves_io_schema.SecretEncodingType(ves_io_schema.SecretEncodingType_value[v.(string)])\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tsecretInfoOneofTypeFound := false\n\n\t\t\t\t\t\t\tif v, ok := cs[\"blindfold_secret_info\"]; ok && !isIntfNil(v) && !secretInfoOneofTypeFound {\n\n\t\t\t\t\t\t\t\tsecretInfoOneofTypeFound = true\n\t\t\t\t\t\t\t\tsecretInfoOneofInt := &ves_io_schema.SecretType_BlindfoldSecretInfo{}\n\t\t\t\t\t\t\t\tsecretInfoOneofInt.BlindfoldSecretInfo = &ves_io_schema.BlindfoldSecretInfoType{}\n\t\t\t\t\t\t\t\tvalueChoiceInt.SecretValue.SecretInfoOneof = secretInfoOneofInt\n\n\t\t\t\t\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\t\t\t\t\tfor _, set := range sl {\n\t\t\t\t\t\t\t\t\tcs := set.(map[string]interface{})\n\n\t\t\t\t\t\t\t\t\tif v, ok := cs[\"decryption_provider\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\t\t\tsecretInfoOneofInt.BlindfoldSecretInfo.DecryptionProvider = v.(string)\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif v, ok := cs[\"location\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\t\t\tsecretInfoOneofInt.BlindfoldSecretInfo.Location = v.(string)\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif v, ok := cs[\"store_provider\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\t\t\tsecretInfoOneofInt.BlindfoldSecretInfo.StoreProvider = v.(string)\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif v, ok := cs[\"clear_secret_info\"]; ok && !isIntfNil(v) && !secretInfoOneofTypeFound {\n\n\t\t\t\t\t\t\t\tsecretInfoOneofTypeFound = true\n\t\t\t\t\t\t\t\tsecretInfoOneofInt := &ves_io_schema.SecretType_ClearSecretInfo{}\n\t\t\t\t\t\t\t\tsecretInfoOneofInt.ClearSecretInfo = &ves_io_schema.ClearSecretInfoType{}\n\t\t\t\t\t\t\t\tvalueChoiceInt.SecretValue.SecretInfoOneof = secretInfoOneofInt\n\n\t\t\t\t\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\t\t\t\t\tfor _, set := range sl {\n\t\t\t\t\t\t\t\t\tcs := set.(map[string]interface{})\n\n\t\t\t\t\t\t\t\t\tif v, ok := cs[\"provider\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\t\t\tsecretInfoOneofInt.ClearSecretInfo.Provider = v.(string)\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif v, ok := cs[\"url\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\t\t\tsecretInfoOneofInt.ClearSecretInfo.Url = v.(string)\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif v, ok := cs[\"vault_secret_info\"]; ok && !isIntfNil(v) && !secretInfoOneofTypeFound {\n\n\t\t\t\t\t\t\t\tsecretInfoOneofTypeFound = true\n\t\t\t\t\t\t\t\tsecretInfoOneofInt := &ves_io_schema.SecretType_VaultSecretInfo{}\n\t\t\t\t\t\t\t\tsecretInfoOneofInt.VaultSecretInfo = &ves_io_schema.VaultSecretInfoType{}\n\t\t\t\t\t\t\t\tvalueChoiceInt.SecretValue.SecretInfoOneof = secretInfoOneofInt\n\n\t\t\t\t\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\t\t\t\t\tfor _, set := range sl {\n\t\t\t\t\t\t\t\t\tcs := set.(map[string]interface{})\n\n\t\t\t\t\t\t\t\t\tif v, ok := cs[\"key\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\t\t\tsecretInfoOneofInt.VaultSecretInfo.Key = v.(string)\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif v, ok := cs[\"location\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\t\t\tsecretInfoOneofInt.VaultSecretInfo.Location = v.(string)\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif v, ok := cs[\"provider\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\t\t\tsecretInfoOneofInt.VaultSecretInfo.Provider = v.(string)\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif v, ok := cs[\"secret_encoding\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\t\t\tsecretInfoOneofInt.VaultSecretInfo.SecretEncoding = ves_io_schema.SecretEncodingType(ves_io_schema.SecretEncodingType_value[v.(string)])\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif v, ok := cs[\"version\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\t\t\tsecretInfoOneofInt.VaultSecretInfo.Version = uint32(v.(int))\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif v, ok := cs[\"wingman_secret_info\"]; ok && !isIntfNil(v) && !secretInfoOneofTypeFound {\n\n\t\t\t\t\t\t\t\tsecretInfoOneofTypeFound = true\n\t\t\t\t\t\t\t\tsecretInfoOneofInt := &ves_io_schema.SecretType_WingmanSecretInfo{}\n\t\t\t\t\t\t\t\tsecretInfoOneofInt.WingmanSecretInfo = &ves_io_schema.WingmanSecretInfoType{}\n\t\t\t\t\t\t\t\tvalueChoiceInt.SecretValue.SecretInfoOneof = secretInfoOneofInt\n\n\t\t\t\t\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\t\t\t\t\tfor _, set := range sl {\n\t\t\t\t\t\t\t\t\tcs := set.(map[string]interface{})\n\n\t\t\t\t\t\t\t\t\tif v, ok := cs[\"name\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\t\t\tsecretInfoOneofInt.WingmanSecretInfo.Name = v.(string)\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := requestHeadersToAddMapStrToI[\"value\"]; ok && !isIntfNil(v) && !valueChoiceTypeFound {\n\n\t\t\t\t\t\tvalueChoiceTypeFound = true\n\t\t\t\t\t\tvalueChoiceInt := &ves_io_schema.HeaderManipulationOptionType_Value{}\n\n\t\t\t\t\t\trequestHeadersToAdd[i].ValueChoice = valueChoiceInt\n\n\t\t\t\t\t\tvalueChoiceInt.Value = v.(string)\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif w, ok := routesMapStrToI[\"request_headers_to_remove\"]; ok && !isIntfNil(w) {\n\t\t\t\tls := make([]string, len(w.([]interface{})))\n\t\t\t\tfor i, v := range w.([]interface{}) {\n\t\t\t\t\tls[i] = v.(string)\n\t\t\t\t}\n\t\t\t\troutes[i].RequestHeadersToRemove = ls\n\t\t\t}\n\n\t\t\tif v, ok := routesMapStrToI[\"response_headers_to_add\"]; ok && !isIntfNil(v) {\n\n\t\t\t\tsl := v.([]interface{})\n\t\t\t\tresponseHeadersToAdd := make([]*ves_io_schema.HeaderManipulationOptionType, len(sl))\n\t\t\t\troutes[i].ResponseHeadersToAdd = responseHeadersToAdd\n\t\t\t\tfor i, set := range sl {\n\t\t\t\t\tresponseHeadersToAdd[i] = &ves_io_schema.HeaderManipulationOptionType{}\n\t\t\t\t\tresponseHeadersToAddMapStrToI := set.(map[string]interface{})\n\n\t\t\t\t\tif w, ok := responseHeadersToAddMapStrToI[\"append\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\tresponseHeadersToAdd[i].Append = w.(bool)\n\t\t\t\t\t}\n\n\t\t\t\t\tif w, ok := responseHeadersToAddMapStrToI[\"name\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\tresponseHeadersToAdd[i].Name = w.(string)\n\t\t\t\t\t}\n\n\t\t\t\t\tvalueChoiceTypeFound := false\n\n\t\t\t\t\tif v, ok := responseHeadersToAddMapStrToI[\"secret_value\"]; ok && !isIntfNil(v) && !valueChoiceTypeFound {\n\n\t\t\t\t\t\tvalueChoiceTypeFound = true\n\t\t\t\t\t\tvalueChoiceInt := &ves_io_schema.HeaderManipulationOptionType_SecretValue{}\n\t\t\t\t\t\tvalueChoiceInt.SecretValue = &ves_io_schema.SecretType{}\n\t\t\t\t\t\tresponseHeadersToAdd[i].ValueChoice = valueChoiceInt\n\n\t\t\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\t\t\tfor _, set := range sl {\n\t\t\t\t\t\t\tcs := set.(map[string]interface{})\n\n\t\t\t\t\t\t\tif v, ok := cs[\"blindfold_secret_info_internal\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\t\t\t\t\tblindfoldSecretInfoInternal := &ves_io_schema.BlindfoldSecretInfoType{}\n\t\t\t\t\t\t\t\tvalueChoiceInt.SecretValue.BlindfoldSecretInfoInternal = blindfoldSecretInfoInternal\n\t\t\t\t\t\t\t\tfor _, set := range sl {\n\t\t\t\t\t\t\t\t\tblindfoldSecretInfoInternalMapStrToI := set.(map[string]interface{})\n\n\t\t\t\t\t\t\t\t\tif w, ok := blindfoldSecretInfoInternalMapStrToI[\"decryption_provider\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\t\t\tblindfoldSecretInfoInternal.DecryptionProvider = w.(string)\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif w, ok := blindfoldSecretInfoInternalMapStrToI[\"location\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\t\t\tblindfoldSecretInfoInternal.Location = w.(string)\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif w, ok := blindfoldSecretInfoInternalMapStrToI[\"store_provider\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\t\t\tblindfoldSecretInfoInternal.StoreProvider = w.(string)\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif v, ok := cs[\"secret_encoding_type\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\tvalueChoiceInt.SecretValue.SecretEncodingType = ves_io_schema.SecretEncodingType(ves_io_schema.SecretEncodingType_value[v.(string)])\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tsecretInfoOneofTypeFound := false\n\n\t\t\t\t\t\t\tif v, ok := cs[\"blindfold_secret_info\"]; ok && !isIntfNil(v) && !secretInfoOneofTypeFound {\n\n\t\t\t\t\t\t\t\tsecretInfoOneofTypeFound = true\n\t\t\t\t\t\t\t\tsecretInfoOneofInt := &ves_io_schema.SecretType_BlindfoldSecretInfo{}\n\t\t\t\t\t\t\t\tsecretInfoOneofInt.BlindfoldSecretInfo = &ves_io_schema.BlindfoldSecretInfoType{}\n\t\t\t\t\t\t\t\tvalueChoiceInt.SecretValue.SecretInfoOneof = secretInfoOneofInt\n\n\t\t\t\t\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\t\t\t\t\tfor _, set := range sl {\n\t\t\t\t\t\t\t\t\tcs := set.(map[string]interface{})\n\n\t\t\t\t\t\t\t\t\tif v, ok := cs[\"decryption_provider\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\t\t\tsecretInfoOneofInt.BlindfoldSecretInfo.DecryptionProvider = v.(string)\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif v, ok := cs[\"location\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\t\t\tsecretInfoOneofInt.BlindfoldSecretInfo.Location = v.(string)\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif v, ok := cs[\"store_provider\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\t\t\tsecretInfoOneofInt.BlindfoldSecretInfo.StoreProvider = v.(string)\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif v, ok := cs[\"clear_secret_info\"]; ok && !isIntfNil(v) && !secretInfoOneofTypeFound {\n\n\t\t\t\t\t\t\t\tsecretInfoOneofTypeFound = true\n\t\t\t\t\t\t\t\tsecretInfoOneofInt := &ves_io_schema.SecretType_ClearSecretInfo{}\n\t\t\t\t\t\t\t\tsecretInfoOneofInt.ClearSecretInfo = &ves_io_schema.ClearSecretInfoType{}\n\t\t\t\t\t\t\t\tvalueChoiceInt.SecretValue.SecretInfoOneof = secretInfoOneofInt\n\n\t\t\t\t\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\t\t\t\t\tfor _, set := range sl {\n\t\t\t\t\t\t\t\t\tcs := set.(map[string]interface{})\n\n\t\t\t\t\t\t\t\t\tif v, ok := cs[\"provider\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\t\t\tsecretInfoOneofInt.ClearSecretInfo.Provider = v.(string)\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif v, ok := cs[\"url\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\t\t\tsecretInfoOneofInt.ClearSecretInfo.Url = v.(string)\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif v, ok := cs[\"vault_secret_info\"]; ok && !isIntfNil(v) && !secretInfoOneofTypeFound {\n\n\t\t\t\t\t\t\t\tsecretInfoOneofTypeFound = true\n\t\t\t\t\t\t\t\tsecretInfoOneofInt := &ves_io_schema.SecretType_VaultSecretInfo{}\n\t\t\t\t\t\t\t\tsecretInfoOneofInt.VaultSecretInfo = &ves_io_schema.VaultSecretInfoType{}\n\t\t\t\t\t\t\t\tvalueChoiceInt.SecretValue.SecretInfoOneof = secretInfoOneofInt\n\n\t\t\t\t\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\t\t\t\t\tfor _, set := range sl {\n\t\t\t\t\t\t\t\t\tcs := set.(map[string]interface{})\n\n\t\t\t\t\t\t\t\t\tif v, ok := cs[\"key\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\t\t\tsecretInfoOneofInt.VaultSecretInfo.Key = v.(string)\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif v, ok := cs[\"location\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\t\t\tsecretInfoOneofInt.VaultSecretInfo.Location = v.(string)\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif v, ok := cs[\"provider\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\t\t\tsecretInfoOneofInt.VaultSecretInfo.Provider = v.(string)\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif v, ok := cs[\"secret_encoding\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\t\t\tsecretInfoOneofInt.VaultSecretInfo.SecretEncoding = ves_io_schema.SecretEncodingType(ves_io_schema.SecretEncodingType_value[v.(string)])\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif v, ok := cs[\"version\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\t\t\tsecretInfoOneofInt.VaultSecretInfo.Version = uint32(v.(int))\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif v, ok := cs[\"wingman_secret_info\"]; ok && !isIntfNil(v) && !secretInfoOneofTypeFound {\n\n\t\t\t\t\t\t\t\tsecretInfoOneofTypeFound = true\n\t\t\t\t\t\t\t\tsecretInfoOneofInt := &ves_io_schema.SecretType_WingmanSecretInfo{}\n\t\t\t\t\t\t\t\tsecretInfoOneofInt.WingmanSecretInfo = &ves_io_schema.WingmanSecretInfoType{}\n\t\t\t\t\t\t\t\tvalueChoiceInt.SecretValue.SecretInfoOneof = secretInfoOneofInt\n\n\t\t\t\t\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\t\t\t\t\tfor _, set := range sl {\n\t\t\t\t\t\t\t\t\tcs := set.(map[string]interface{})\n\n\t\t\t\t\t\t\t\t\tif v, ok := cs[\"name\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\t\t\tsecretInfoOneofInt.WingmanSecretInfo.Name = v.(string)\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := responseHeadersToAddMapStrToI[\"value\"]; ok && !isIntfNil(v) && !valueChoiceTypeFound {\n\n\t\t\t\t\t\tvalueChoiceTypeFound = true\n\t\t\t\t\t\tvalueChoiceInt := &ves_io_schema.HeaderManipulationOptionType_Value{}\n\n\t\t\t\t\t\tresponseHeadersToAdd[i].ValueChoice = valueChoiceInt\n\n\t\t\t\t\t\tvalueChoiceInt.Value = v.(string)\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif w, ok := routesMapStrToI[\"response_headers_to_remove\"]; ok && !isIntfNil(w) {\n\t\t\t\tls := make([]string, len(w.([]interface{})))\n\t\t\t\tfor i, v := range w.([]interface{}) {\n\t\t\t\t\tls[i] = v.(string)\n\t\t\t\t}\n\t\t\t\troutes[i].ResponseHeadersToRemove = ls\n\t\t\t}\n\n\t\t\trouteActionTypeFound := false\n\n\t\t\tif v, ok := routesMapStrToI[\"route_destination\"]; ok && !isIntfNil(v) && !routeActionTypeFound {\n\n\t\t\t\trouteActionTypeFound = true\n\t\t\t\trouteActionInt := &ves_io_schema_route.RouteType_RouteDestination{}\n\t\t\t\trouteActionInt.RouteDestination = &ves_io_schema_route.RouteDestinationList{}\n\t\t\t\troutes[i].RouteAction = routeActionInt\n\n\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\tfor _, set := range sl {\n\t\t\t\t\tcs := set.(map[string]interface{})\n\n\t\t\t\t\tif v, ok := cs[\"buffer_policy\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\t\t\tbufferPolicy := &ves_io_schema.BufferConfigType{}\n\t\t\t\t\t\trouteActionInt.RouteDestination.BufferPolicy = bufferPolicy\n\t\t\t\t\t\tfor _, set := range sl {\n\t\t\t\t\t\t\tbufferPolicyMapStrToI := set.(map[string]interface{})\n\n\t\t\t\t\t\t\tif w, ok := bufferPolicyMapStrToI[\"disabled\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\tbufferPolicy.Disabled = w.(bool)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif w, ok := bufferPolicyMapStrToI[\"max_request_bytes\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\tbufferPolicy.MaxRequestBytes = uint32(w.(int))\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif w, ok := bufferPolicyMapStrToI[\"max_request_time\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\tbufferPolicy.MaxRequestTime = uint32(w.(int))\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tclusterRetractChoiceTypeFound := false\n\n\t\t\t\t\tif v, ok := cs[\"do_not_retract_cluster\"]; ok && !isIntfNil(v) && !clusterRetractChoiceTypeFound {\n\n\t\t\t\t\t\tclusterRetractChoiceTypeFound = true\n\n\t\t\t\t\t\tif v.(bool) {\n\t\t\t\t\t\t\tclusterRetractChoiceInt := &ves_io_schema_route.RouteDestinationList_DoNotRetractCluster{}\n\t\t\t\t\t\t\tclusterRetractChoiceInt.DoNotRetractCluster = &ves_io_schema.Empty{}\n\t\t\t\t\t\t\trouteActionInt.RouteDestination.ClusterRetractChoice = clusterRetractChoiceInt\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := cs[\"retract_cluster\"]; ok && !isIntfNil(v) && !clusterRetractChoiceTypeFound {\n\n\t\t\t\t\t\tclusterRetractChoiceTypeFound = true\n\n\t\t\t\t\t\tif v.(bool) {\n\t\t\t\t\t\t\tclusterRetractChoiceInt := &ves_io_schema_route.RouteDestinationList_RetractCluster{}\n\t\t\t\t\t\t\tclusterRetractChoiceInt.RetractCluster = &ves_io_schema.Empty{}\n\t\t\t\t\t\t\trouteActionInt.RouteDestination.ClusterRetractChoice = clusterRetractChoiceInt\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := cs[\"cors_policy\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\t\t\tcorsPolicy := &ves_io_schema.CorsPolicy{}\n\t\t\t\t\t\trouteActionInt.RouteDestination.CorsPolicy = corsPolicy\n\t\t\t\t\t\tfor _, set := range sl {\n\t\t\t\t\t\t\tcorsPolicyMapStrToI := set.(map[string]interface{})\n\n\t\t\t\t\t\t\tif w, ok := corsPolicyMapStrToI[\"allow_credentials\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\tcorsPolicy.AllowCredentials = w.(bool)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif w, ok := corsPolicyMapStrToI[\"allow_headers\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\tcorsPolicy.AllowHeaders = w.(string)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif w, ok := corsPolicyMapStrToI[\"allow_methods\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\tcorsPolicy.AllowMethods = w.(string)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif w, ok := corsPolicyMapStrToI[\"allow_origin\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\tls := make([]string, len(w.([]interface{})))\n\t\t\t\t\t\t\t\tfor i, v := range w.([]interface{}) {\n\t\t\t\t\t\t\t\t\tls[i] = v.(string)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tcorsPolicy.AllowOrigin = ls\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif w, ok := corsPolicyMapStrToI[\"allow_origin_regex\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\tls := make([]string, len(w.([]interface{})))\n\t\t\t\t\t\t\t\tfor i, v := range w.([]interface{}) {\n\t\t\t\t\t\t\t\t\tls[i] = v.(string)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tcorsPolicy.AllowOriginRegex = ls\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif w, ok := corsPolicyMapStrToI[\"disabled\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\tcorsPolicy.Disabled = w.(bool)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif w, ok := corsPolicyMapStrToI[\"expose_headers\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\tcorsPolicy.ExposeHeaders = w.(string)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif w, ok := corsPolicyMapStrToI[\"max_age\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\tcorsPolicy.MaxAge = w.(string)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif w, ok := corsPolicyMapStrToI[\"maximum_age\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\tcorsPolicy.MaximumAge = int32(w.(int))\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := cs[\"destinations\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\tsl := v.([]interface{})\n\t\t\t\t\t\tdestinations := make([]*ves_io_schema_route.RouteDestination, len(sl))\n\t\t\t\t\t\trouteActionInt.RouteDestination.Destinations = destinations\n\t\t\t\t\t\tfor i, set := range sl {\n\t\t\t\t\t\t\tdestinations[i] = &ves_io_schema_route.RouteDestination{}\n\t\t\t\t\t\t\tdestinationsMapStrToI := set.(map[string]interface{})\n\n\t\t\t\t\t\t\tif v, ok := destinationsMapStrToI[\"cluster\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\tsl := v.([]interface{})\n\t\t\t\t\t\t\t\tclusterInt := make([]*ves_io_schema.ObjectRefType, len(sl))\n\t\t\t\t\t\t\t\tdestinations[i].Cluster = clusterInt\n\t\t\t\t\t\t\t\tfor i, ps := range sl {\n\n\t\t\t\t\t\t\t\t\tcMapToStrVal := ps.(map[string]interface{})\n\t\t\t\t\t\t\t\t\tclusterInt[i] = &ves_io_schema.ObjectRefType{}\n\n\t\t\t\t\t\t\t\t\tclusterInt[i].Kind = \"cluster\"\n\n\t\t\t\t\t\t\t\t\tif v, ok := cMapToStrVal[\"name\"]; ok && !isIntfNil(v) {\n\t\t\t\t\t\t\t\t\t\tclusterInt[i].Name = v.(string)\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif v, ok := cMapToStrVal[\"namespace\"]; ok && !isIntfNil(v) {\n\t\t\t\t\t\t\t\t\t\tclusterInt[i].Namespace = v.(string)\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif v, ok := cMapToStrVal[\"tenant\"]; ok && !isIntfNil(v) {\n\t\t\t\t\t\t\t\t\t\tclusterInt[i].Tenant = v.(string)\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif v, ok := cMapToStrVal[\"uid\"]; ok && !isIntfNil(v) {\n\t\t\t\t\t\t\t\t\t\tclusterInt[i].Uid = v.(string)\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif w, ok := destinationsMapStrToI[\"endpoint_subsets\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\tms := map[string]string{}\n\t\t\t\t\t\t\t\tfor k, v := range w.(map[string]interface{}) {\n\t\t\t\t\t\t\t\t\tms[k] = v.(string)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tdestinations[i].EndpointSubsets = ms\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif w, ok := destinationsMapStrToI[\"priority\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\tdestinations[i].Priority = uint32(w.(int))\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif w, ok := destinationsMapStrToI[\"weight\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\tdestinations[i].Weight = uint32(w.(int))\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := cs[\"endpoint_subsets\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\tms := map[string]string{}\n\t\t\t\t\t\tfor k, v := range v.(map[string]interface{}) {\n\t\t\t\t\t\t\tms[k] = v.(string)\n\t\t\t\t\t\t}\n\t\t\t\t\t\trouteActionInt.RouteDestination.EndpointSubsets = ms\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := cs[\"hash_policy\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\tsl := v.([]interface{})\n\t\t\t\t\t\thashPolicy := make([]*ves_io_schema_route.HashPolicyType, len(sl))\n\t\t\t\t\t\trouteActionInt.RouteDestination.HashPolicy = hashPolicy\n\t\t\t\t\t\tfor i, set := range sl {\n\t\t\t\t\t\t\thashPolicy[i] = &ves_io_schema_route.HashPolicyType{}\n\t\t\t\t\t\t\thashPolicyMapStrToI := set.(map[string]interface{})\n\n\t\t\t\t\t\t\tpolicySpecifierTypeFound := false\n\n\t\t\t\t\t\t\tif v, ok := hashPolicyMapStrToI[\"cookie\"]; ok && !isIntfNil(v) && !policySpecifierTypeFound {\n\n\t\t\t\t\t\t\t\tpolicySpecifierTypeFound = true\n\t\t\t\t\t\t\t\tpolicySpecifierInt := &ves_io_schema_route.HashPolicyType_Cookie{}\n\t\t\t\t\t\t\t\tpolicySpecifierInt.Cookie = &ves_io_schema_route.CookieForHashing{}\n\t\t\t\t\t\t\t\thashPolicy[i].PolicySpecifier = policySpecifierInt\n\n\t\t\t\t\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\t\t\t\t\tfor _, set := range sl {\n\t\t\t\t\t\t\t\t\tcs := set.(map[string]interface{})\n\n\t\t\t\t\t\t\t\t\thttponlyTypeFound := false\n\n\t\t\t\t\t\t\t\t\tif v, ok := cs[\"add_httponly\"]; ok && !isIntfNil(v) && !httponlyTypeFound {\n\n\t\t\t\t\t\t\t\t\t\thttponlyTypeFound = true\n\n\t\t\t\t\t\t\t\t\t\tif v.(bool) {\n\t\t\t\t\t\t\t\t\t\t\thttponlyInt := &ves_io_schema_route.CookieForHashing_AddHttponly{}\n\t\t\t\t\t\t\t\t\t\t\thttponlyInt.AddHttponly = &ves_io_schema.Empty{}\n\t\t\t\t\t\t\t\t\t\t\tpolicySpecifierInt.Cookie.Httponly = httponlyInt\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif v, ok := cs[\"ignore_httponly\"]; ok && !isIntfNil(v) && !httponlyTypeFound {\n\n\t\t\t\t\t\t\t\t\t\thttponlyTypeFound = true\n\n\t\t\t\t\t\t\t\t\t\tif v.(bool) {\n\t\t\t\t\t\t\t\t\t\t\thttponlyInt := &ves_io_schema_route.CookieForHashing_IgnoreHttponly{}\n\t\t\t\t\t\t\t\t\t\t\thttponlyInt.IgnoreHttponly = &ves_io_schema.Empty{}\n\t\t\t\t\t\t\t\t\t\t\tpolicySpecifierInt.Cookie.Httponly = httponlyInt\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif v, ok := cs[\"name\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\t\t\tpolicySpecifierInt.Cookie.Name = v.(string)\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif v, ok := cs[\"path\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\t\t\tpolicySpecifierInt.Cookie.Path = v.(string)\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tsamesiteTypeFound := false\n\n\t\t\t\t\t\t\t\t\tif v, ok := cs[\"ignore_samesite\"]; ok && !isIntfNil(v) && !samesiteTypeFound {\n\n\t\t\t\t\t\t\t\t\t\tsamesiteTypeFound = true\n\n\t\t\t\t\t\t\t\t\t\tif v.(bool) {\n\t\t\t\t\t\t\t\t\t\t\tsamesiteInt := &ves_io_schema_route.CookieForHashing_IgnoreSamesite{}\n\t\t\t\t\t\t\t\t\t\t\tsamesiteInt.IgnoreSamesite = &ves_io_schema.Empty{}\n\t\t\t\t\t\t\t\t\t\t\tpolicySpecifierInt.Cookie.Samesite = samesiteInt\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif v, ok := cs[\"samesite_lax\"]; ok && !isIntfNil(v) && !samesiteTypeFound {\n\n\t\t\t\t\t\t\t\t\t\tsamesiteTypeFound = true\n\n\t\t\t\t\t\t\t\t\t\tif v.(bool) {\n\t\t\t\t\t\t\t\t\t\t\tsamesiteInt := &ves_io_schema_route.CookieForHashing_SamesiteLax{}\n\t\t\t\t\t\t\t\t\t\t\tsamesiteInt.SamesiteLax = &ves_io_schema.Empty{}\n\t\t\t\t\t\t\t\t\t\t\tpolicySpecifierInt.Cookie.Samesite = samesiteInt\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif v, ok := cs[\"samesite_none\"]; ok && !isIntfNil(v) && !samesiteTypeFound {\n\n\t\t\t\t\t\t\t\t\t\tsamesiteTypeFound = true\n\n\t\t\t\t\t\t\t\t\t\tif v.(bool) {\n\t\t\t\t\t\t\t\t\t\t\tsamesiteInt := &ves_io_schema_route.CookieForHashing_SamesiteNone{}\n\t\t\t\t\t\t\t\t\t\t\tsamesiteInt.SamesiteNone = &ves_io_schema.Empty{}\n\t\t\t\t\t\t\t\t\t\t\tpolicySpecifierInt.Cookie.Samesite = samesiteInt\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif v, ok := cs[\"samesite_strict\"]; ok && !isIntfNil(v) && !samesiteTypeFound {\n\n\t\t\t\t\t\t\t\t\t\tsamesiteTypeFound = true\n\n\t\t\t\t\t\t\t\t\t\tif v.(bool) {\n\t\t\t\t\t\t\t\t\t\t\tsamesiteInt := &ves_io_schema_route.CookieForHashing_SamesiteStrict{}\n\t\t\t\t\t\t\t\t\t\t\tsamesiteInt.SamesiteStrict = &ves_io_schema.Empty{}\n\t\t\t\t\t\t\t\t\t\t\tpolicySpecifierInt.Cookie.Samesite = samesiteInt\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tsecureTypeFound := false\n\n\t\t\t\t\t\t\t\t\tif v, ok := cs[\"add_secure\"]; ok && !isIntfNil(v) && !secureTypeFound {\n\n\t\t\t\t\t\t\t\t\t\tsecureTypeFound = true\n\n\t\t\t\t\t\t\t\t\t\tif v.(bool) {\n\t\t\t\t\t\t\t\t\t\t\tsecureInt := &ves_io_schema_route.CookieForHashing_AddSecure{}\n\t\t\t\t\t\t\t\t\t\t\tsecureInt.AddSecure = &ves_io_schema.Empty{}\n\t\t\t\t\t\t\t\t\t\t\tpolicySpecifierInt.Cookie.Secure = secureInt\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif v, ok := cs[\"ignore_secure\"]; ok && !isIntfNil(v) && !secureTypeFound {\n\n\t\t\t\t\t\t\t\t\t\tsecureTypeFound = true\n\n\t\t\t\t\t\t\t\t\t\tif v.(bool) {\n\t\t\t\t\t\t\t\t\t\t\tsecureInt := &ves_io_schema_route.CookieForHashing_IgnoreSecure{}\n\t\t\t\t\t\t\t\t\t\t\tsecureInt.IgnoreSecure = &ves_io_schema.Empty{}\n\t\t\t\t\t\t\t\t\t\t\tpolicySpecifierInt.Cookie.Secure = secureInt\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif v, ok := cs[\"ttl\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\t\t\tpolicySpecifierInt.Cookie.Ttl = uint32(v.(int))\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif v, ok := hashPolicyMapStrToI[\"header_name\"]; ok && !isIntfNil(v) && !policySpecifierTypeFound {\n\n\t\t\t\t\t\t\t\tpolicySpecifierTypeFound = true\n\t\t\t\t\t\t\t\tpolicySpecifierInt := &ves_io_schema_route.HashPolicyType_HeaderName{}\n\n\t\t\t\t\t\t\t\thashPolicy[i].PolicySpecifier = policySpecifierInt\n\n\t\t\t\t\t\t\t\tpolicySpecifierInt.HeaderName = v.(string)\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif v, ok := hashPolicyMapStrToI[\"source_ip\"]; ok && !isIntfNil(v) && !policySpecifierTypeFound {\n\n\t\t\t\t\t\t\t\tpolicySpecifierTypeFound = true\n\t\t\t\t\t\t\t\tpolicySpecifierInt := &ves_io_schema_route.HashPolicyType_SourceIp{}\n\n\t\t\t\t\t\t\t\thashPolicy[i].PolicySpecifier = policySpecifierInt\n\n\t\t\t\t\t\t\t\tpolicySpecifierInt.SourceIp = v.(bool)\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif w, ok := hashPolicyMapStrToI[\"terminal\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\thashPolicy[i].Terminal = w.(bool)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\thostRewriteParamsTypeFound := false\n\n\t\t\t\t\tif v, ok := cs[\"auto_host_rewrite\"]; ok && !isIntfNil(v) && !hostRewriteParamsTypeFound {\n\n\t\t\t\t\t\thostRewriteParamsTypeFound = true\n\t\t\t\t\t\thostRewriteParamsInt := &ves_io_schema_route.RouteDestinationList_AutoHostRewrite{}\n\n\t\t\t\t\t\trouteActionInt.RouteDestination.HostRewriteParams = hostRewriteParamsInt\n\n\t\t\t\t\t\thostRewriteParamsInt.AutoHostRewrite = v.(bool)\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := cs[\"host_rewrite\"]; ok && !isIntfNil(v) && !hostRewriteParamsTypeFound {\n\n\t\t\t\t\t\thostRewriteParamsTypeFound = true\n\t\t\t\t\t\thostRewriteParamsInt := &ves_io_schema_route.RouteDestinationList_HostRewrite{}\n\n\t\t\t\t\t\trouteActionInt.RouteDestination.HostRewriteParams = hostRewriteParamsInt\n\n\t\t\t\t\t\thostRewriteParamsInt.HostRewrite = v.(string)\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := cs[\"mirror_policy\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\t\t\tmirrorPolicy := &ves_io_schema_route.MirrorPolicyType{}\n\t\t\t\t\t\trouteActionInt.RouteDestination.MirrorPolicy = mirrorPolicy\n\t\t\t\t\t\tfor _, set := range sl {\n\t\t\t\t\t\t\tmirrorPolicyMapStrToI := set.(map[string]interface{})\n\n\t\t\t\t\t\t\tif v, ok := mirrorPolicyMapStrToI[\"cluster\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\tsl := v.([]interface{})\n\t\t\t\t\t\t\t\tclusterInt := make([]*ves_io_schema.ObjectRefType, len(sl))\n\t\t\t\t\t\t\t\tmirrorPolicy.Cluster = clusterInt\n\t\t\t\t\t\t\t\tfor i, ps := range sl {\n\n\t\t\t\t\t\t\t\t\tcMapToStrVal := ps.(map[string]interface{})\n\t\t\t\t\t\t\t\t\tclusterInt[i] = &ves_io_schema.ObjectRefType{}\n\n\t\t\t\t\t\t\t\t\tclusterInt[i].Kind = \"cluster\"\n\n\t\t\t\t\t\t\t\t\tif v, ok := cMapToStrVal[\"name\"]; ok && !isIntfNil(v) {\n\t\t\t\t\t\t\t\t\t\tclusterInt[i].Name = v.(string)\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif v, ok := cMapToStrVal[\"namespace\"]; ok && !isIntfNil(v) {\n\t\t\t\t\t\t\t\t\t\tclusterInt[i].Namespace = v.(string)\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif v, ok := cMapToStrVal[\"tenant\"]; ok && !isIntfNil(v) {\n\t\t\t\t\t\t\t\t\t\tclusterInt[i].Tenant = v.(string)\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif v, ok := cMapToStrVal[\"uid\"]; ok && !isIntfNil(v) {\n\t\t\t\t\t\t\t\t\t\tclusterInt[i].Uid = v.(string)\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif v, ok := mirrorPolicyMapStrToI[\"percent\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\t\t\t\t\tpercent := &ves_io_schema.FractionalPercent{}\n\t\t\t\t\t\t\t\tmirrorPolicy.Percent = percent\n\t\t\t\t\t\t\t\tfor _, set := range sl {\n\t\t\t\t\t\t\t\t\tpercentMapStrToI := set.(map[string]interface{})\n\n\t\t\t\t\t\t\t\t\tif v, ok := percentMapStrToI[\"denominator\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\t\t\tpercent.Denominator = ves_io_schema.DenominatorType(ves_io_schema.DenominatorType_value[v.(string)])\n\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif w, ok := percentMapStrToI[\"numerator\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\t\t\tpercent.Numerator = uint32(w.(int))\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := cs[\"prefix_rewrite\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\trouteActionInt.RouteDestination.PrefixRewrite = v.(string)\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := cs[\"priority\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\trouteActionInt.RouteDestination.Priority = ves_io_schema.RoutingPriority(ves_io_schema.RoutingPriority_value[v.(string)])\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := cs[\"retry_policy\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\t\t\tretryPolicy := &ves_io_schema.RetryPolicyType{}\n\t\t\t\t\t\trouteActionInt.RouteDestination.RetryPolicy = retryPolicy\n\t\t\t\t\t\tfor _, set := range sl {\n\t\t\t\t\t\t\tretryPolicyMapStrToI := set.(map[string]interface{})\n\n\t\t\t\t\t\t\tif v, ok := retryPolicyMapStrToI[\"back_off\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\t\t\t\t\tbackOff := &ves_io_schema.RetryBackOff{}\n\t\t\t\t\t\t\t\tretryPolicy.BackOff = backOff\n\t\t\t\t\t\t\t\tfor _, set := range sl {\n\t\t\t\t\t\t\t\t\tbackOffMapStrToI := set.(map[string]interface{})\n\n\t\t\t\t\t\t\t\t\tif w, ok := backOffMapStrToI[\"base_interval\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\t\t\tbackOff.BaseInterval = uint32(w.(int))\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif w, ok := backOffMapStrToI[\"max_interval\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\t\t\tbackOff.MaxInterval = uint32(w.(int))\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif w, ok := retryPolicyMapStrToI[\"num_retries\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\tretryPolicy.NumRetries = uint32(w.(int))\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif w, ok := retryPolicyMapStrToI[\"per_try_timeout\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\tretryPolicy.PerTryTimeout = uint32(w.(int))\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif w, ok := retryPolicyMapStrToI[\"retriable_status_codes\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\tls := make([]uint32, len(w.([]interface{})))\n\t\t\t\t\t\t\t\tfor i, v := range w.([]interface{}) {\n\t\t\t\t\t\t\t\t\tls[i] = uint32(v.(int))\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tretryPolicy.RetriableStatusCodes = ls\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif w, ok := retryPolicyMapStrToI[\"retry_condition\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\tls := make([]string, len(w.([]interface{})))\n\t\t\t\t\t\t\t\tfor i, v := range w.([]interface{}) {\n\t\t\t\t\t\t\t\t\tls[i] = v.(string)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tretryPolicy.RetryCondition = ls\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif w, ok := retryPolicyMapStrToI[\"retry_on\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\tretryPolicy.RetryOn = w.(string)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := cs[\"spdy_config\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\t\t\tspdyConfig := &ves_io_schema_route.SpdyConfigType{}\n\t\t\t\t\t\trouteActionInt.RouteDestination.SpdyConfig = spdyConfig\n\t\t\t\t\t\tfor _, set := range sl {\n\t\t\t\t\t\t\tspdyConfigMapStrToI := set.(map[string]interface{})\n\n\t\t\t\t\t\t\tif w, ok := spdyConfigMapStrToI[\"use_spdy\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\tspdyConfig.UseSpdy = w.(bool)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := cs[\"timeout\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\trouteActionInt.RouteDestination.Timeout = uint32(v.(int))\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := cs[\"web_socket_config\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\t\t\twebSocketConfig := &ves_io_schema_route.WebsocketConfigType{}\n\t\t\t\t\t\trouteActionInt.RouteDestination.WebSocketConfig = webSocketConfig\n\t\t\t\t\t\tfor _, set := range sl {\n\t\t\t\t\t\t\twebSocketConfigMapStrToI := set.(map[string]interface{})\n\n\t\t\t\t\t\t\tif w, ok := webSocketConfigMapStrToI[\"idle_timeout\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\twebSocketConfig.IdleTimeout = uint32(w.(int))\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif w, ok := webSocketConfigMapStrToI[\"max_connect_attempts\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\twebSocketConfig.MaxConnectAttempts = uint32(w.(int))\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif w, ok := webSocketConfigMapStrToI[\"use_websocket\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\t\t\twebSocketConfig.UseWebsocket = w.(bool)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif v, ok := routesMapStrToI[\"route_direct_response\"]; ok && !isIntfNil(v) && !routeActionTypeFound {\n\n\t\t\t\trouteActionTypeFound = true\n\t\t\t\trouteActionInt := &ves_io_schema_route.RouteType_RouteDirectResponse{}\n\t\t\t\trouteActionInt.RouteDirectResponse = &ves_io_schema_route.RouteDirectResponse{}\n\t\t\t\troutes[i].RouteAction = routeActionInt\n\n\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\tfor _, set := range sl {\n\t\t\t\t\tcs := set.(map[string]interface{})\n\n\t\t\t\t\tif v, ok := cs[\"response_body\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\trouteActionInt.RouteDirectResponse.ResponseBody = v.(string)\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := cs[\"response_code\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\trouteActionInt.RouteDirectResponse.ResponseCode = uint32(v.(int))\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif v, ok := routesMapStrToI[\"route_redirect\"]; ok && !isIntfNil(v) && !routeActionTypeFound {\n\n\t\t\t\trouteActionTypeFound = true\n\t\t\t\trouteActionInt := &ves_io_schema_route.RouteType_RouteRedirect{}\n\t\t\t\trouteActionInt.RouteRedirect = &ves_io_schema_route.RouteRedirect{}\n\t\t\t\troutes[i].RouteAction = routeActionInt\n\n\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\tfor _, set := range sl {\n\t\t\t\t\tcs := set.(map[string]interface{})\n\n\t\t\t\t\tif v, ok := cs[\"host_redirect\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\trouteActionInt.RouteRedirect.HostRedirect = v.(string)\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := cs[\"port_redirect\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\trouteActionInt.RouteRedirect.PortRedirect = uint32(v.(int))\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := cs[\"proto_redirect\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\trouteActionInt.RouteRedirect.ProtoRedirect = v.(string)\n\n\t\t\t\t\t}\n\n\t\t\t\t\tqueryParamsTypeFound := false\n\n\t\t\t\t\tif v, ok := cs[\"all_params\"]; ok && !isIntfNil(v) && !queryParamsTypeFound {\n\n\t\t\t\t\t\tqueryParamsTypeFound = true\n\t\t\t\t\t\tqueryParamsInt := &ves_io_schema_route.RouteRedirect_AllParams{}\n\n\t\t\t\t\t\trouteActionInt.RouteRedirect.QueryParams = queryParamsInt\n\n\t\t\t\t\t\tqueryParamsInt.AllParams = v.(bool)\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := cs[\"remove_all_params\"]; ok && !isIntfNil(v) && !queryParamsTypeFound {\n\n\t\t\t\t\t\tqueryParamsTypeFound = true\n\n\t\t\t\t\t\tif v.(bool) {\n\t\t\t\t\t\t\tqueryParamsInt := &ves_io_schema_route.RouteRedirect_RemoveAllParams{}\n\t\t\t\t\t\t\tqueryParamsInt.RemoveAllParams = &ves_io_schema.Empty{}\n\t\t\t\t\t\t\trouteActionInt.RouteRedirect.QueryParams = queryParamsInt\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := cs[\"replace_params\"]; ok && !isIntfNil(v) && !queryParamsTypeFound {\n\n\t\t\t\t\t\tqueryParamsTypeFound = true\n\t\t\t\t\t\tqueryParamsInt := &ves_io_schema_route.RouteRedirect_ReplaceParams{}\n\n\t\t\t\t\t\trouteActionInt.RouteRedirect.QueryParams = queryParamsInt\n\n\t\t\t\t\t\tqueryParamsInt.ReplaceParams = v.(string)\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := cs[\"retain_all_params\"]; ok && !isIntfNil(v) && !queryParamsTypeFound {\n\n\t\t\t\t\t\tqueryParamsTypeFound = true\n\n\t\t\t\t\t\tif v.(bool) {\n\t\t\t\t\t\t\tqueryParamsInt := &ves_io_schema_route.RouteRedirect_RetainAllParams{}\n\t\t\t\t\t\t\tqueryParamsInt.RetainAllParams = &ves_io_schema.Empty{}\n\t\t\t\t\t\t\trouteActionInt.RouteRedirect.QueryParams = queryParamsInt\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := cs[\"strip_query_params\"]; ok && !isIntfNil(v) && !queryParamsTypeFound {\n\n\t\t\t\t\t\tqueryParamsTypeFound = true\n\t\t\t\t\t\tqueryParamsInt := &ves_io_schema_route.RouteRedirect_StripQueryParams{}\n\t\t\t\t\t\tqueryParamsInt.StripQueryParams = &ves_io_schema_route.RouteQueryParams{}\n\t\t\t\t\t\trouteActionInt.RouteRedirect.QueryParams = queryParamsInt\n\n\t\t\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\t\t\tfor _, set := range sl {\n\t\t\t\t\t\t\tcs := set.(map[string]interface{})\n\n\t\t\t\t\t\t\tif v, ok := cs[\"query_params\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\tls := make([]string, len(v.([]interface{})))\n\t\t\t\t\t\t\t\tfor i, v := range v.([]interface{}) {\n\t\t\t\t\t\t\t\t\tls[i] = v.(string)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tqueryParamsInt.StripQueryParams.QueryParams = ls\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tredirectPathChoiceTypeFound := false\n\n\t\t\t\t\tif v, ok := cs[\"path_redirect\"]; ok && !isIntfNil(v) && !redirectPathChoiceTypeFound {\n\n\t\t\t\t\t\tredirectPathChoiceTypeFound = true\n\t\t\t\t\t\tredirectPathChoiceInt := &ves_io_schema_route.RouteRedirect_PathRedirect{}\n\n\t\t\t\t\t\trouteActionInt.RouteRedirect.RedirectPathChoice = redirectPathChoiceInt\n\n\t\t\t\t\t\tredirectPathChoiceInt.PathRedirect = v.(string)\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := cs[\"prefix_rewrite\"]; ok && !isIntfNil(v) && !redirectPathChoiceTypeFound {\n\n\t\t\t\t\t\tredirectPathChoiceTypeFound = true\n\t\t\t\t\t\tredirectPathChoiceInt := &ves_io_schema_route.RouteRedirect_PrefixRewrite{}\n\n\t\t\t\t\t\trouteActionInt.RouteRedirect.RedirectPathChoice = redirectPathChoiceInt\n\n\t\t\t\t\t\tredirectPathChoiceInt.PrefixRewrite = v.(string)\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := cs[\"response_code\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\trouteActionInt.RouteRedirect.ResponseCode = uint32(v.(int))\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif v, ok := routesMapStrToI[\"service_policy\"]; ok && !isIntfNil(v) {\n\n\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\tservicePolicy := &ves_io_schema_route.ServicePolicyInfo{}\n\t\t\t\troutes[i].ServicePolicy = servicePolicy\n\t\t\t\tfor _, set := range sl {\n\t\t\t\t\tservicePolicyMapStrToI := set.(map[string]interface{})\n\n\t\t\t\t\tservicePolicyChoiceTypeFound := false\n\n\t\t\t\t\tif v, ok := servicePolicyMapStrToI[\"context_extensions\"]; ok && !isIntfNil(v) && !servicePolicyChoiceTypeFound {\n\n\t\t\t\t\t\tservicePolicyChoiceTypeFound = true\n\t\t\t\t\t\tservicePolicyChoiceInt := &ves_io_schema_route.ServicePolicyInfo_ContextExtensions{}\n\t\t\t\t\t\tservicePolicyChoiceInt.ContextExtensions = &ves_io_schema_route.ContextExtensionInfo{}\n\t\t\t\t\t\tservicePolicy.ServicePolicyChoice = servicePolicyChoiceInt\n\n\t\t\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\t\t\tfor _, set := range sl {\n\t\t\t\t\t\t\tcs := set.(map[string]interface{})\n\n\t\t\t\t\t\t\tif v, ok := cs[\"context_extensions\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\tms := map[string]string{}\n\t\t\t\t\t\t\t\tfor k, v := range v.(map[string]interface{}) {\n\t\t\t\t\t\t\t\t\tms[k] = v.(string)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tservicePolicyChoiceInt.ContextExtensions.ContextExtensions = ms\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := servicePolicyMapStrToI[\"disable\"]; ok && !isIntfNil(v) && !servicePolicyChoiceTypeFound {\n\n\t\t\t\t\t\tservicePolicyChoiceTypeFound = true\n\t\t\t\t\t\tservicePolicyChoiceInt := &ves_io_schema_route.ServicePolicyInfo_Disable{}\n\n\t\t\t\t\t\tservicePolicy.ServicePolicyChoice = servicePolicyChoiceInt\n\n\t\t\t\t\t\tservicePolicyChoiceInt.Disable = v.(bool)\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif w, ok := routesMapStrToI[\"skip_lb_override\"]; ok && !isIntfNil(w) {\n\t\t\t\troutes[i].SkipLbOverride = w.(bool)\n\t\t\t}\n\n\t\t\tif v, ok := routesMapStrToI[\"waf_type\"]; ok && !isIntfNil(v) {\n\n\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\twafType := &ves_io_schema.WafType{}\n\t\t\t\troutes[i].WafType = wafType\n\t\t\t\tfor _, set := range sl {\n\t\t\t\t\twafTypeMapStrToI := set.(map[string]interface{})\n\n\t\t\t\t\trefTypeTypeFound := false\n\n\t\t\t\t\tif v, ok := wafTypeMapStrToI[\"app_firewall\"]; ok && !isIntfNil(v) && !refTypeTypeFound {\n\n\t\t\t\t\t\trefTypeTypeFound = true\n\t\t\t\t\t\trefTypeInt := &ves_io_schema.WafType_AppFirewall{}\n\t\t\t\t\t\trefTypeInt.AppFirewall = &ves_io_schema.AppFirewallRefType{}\n\t\t\t\t\t\twafType.RefType = refTypeInt\n\n\t\t\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\t\t\tfor _, set := range sl {\n\t\t\t\t\t\t\tcs := set.(map[string]interface{})\n\n\t\t\t\t\t\t\tif v, ok := cs[\"app_firewall\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\tsl := v.([]interface{})\n\t\t\t\t\t\t\t\tappFirewallInt := make([]*ves_io_schema.ObjectRefType, len(sl))\n\t\t\t\t\t\t\t\trefTypeInt.AppFirewall.AppFirewall = appFirewallInt\n\t\t\t\t\t\t\t\tfor i, ps := range sl {\n\n\t\t\t\t\t\t\t\t\tafMapToStrVal := ps.(map[string]interface{})\n\t\t\t\t\t\t\t\t\tappFirewallInt[i] = &ves_io_schema.ObjectRefType{}\n\n\t\t\t\t\t\t\t\t\tappFirewallInt[i].Kind = \"app_firewall\"\n\n\t\t\t\t\t\t\t\t\tif v, ok := afMapToStrVal[\"name\"]; ok && !isIntfNil(v) {\n\t\t\t\t\t\t\t\t\t\tappFirewallInt[i].Name = v.(string)\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif v, ok := afMapToStrVal[\"namespace\"]; ok && !isIntfNil(v) {\n\t\t\t\t\t\t\t\t\t\tappFirewallInt[i].Namespace = v.(string)\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif v, ok := afMapToStrVal[\"tenant\"]; ok && !isIntfNil(v) {\n\t\t\t\t\t\t\t\t\t\tappFirewallInt[i].Tenant = v.(string)\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tif v, ok := afMapToStrVal[\"uid\"]; ok && !isIntfNil(v) {\n\t\t\t\t\t\t\t\t\t\tappFirewallInt[i].Uid = v.(string)\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := wafTypeMapStrToI[\"disable_waf\"]; ok && !isIntfNil(v) && !refTypeTypeFound {\n\n\t\t\t\t\t\trefTypeTypeFound = true\n\n\t\t\t\t\t\tif v.(bool) {\n\t\t\t\t\t\t\trefTypeInt := &ves_io_schema.WafType_DisableWaf{}\n\t\t\t\t\t\t\trefTypeInt.DisableWaf = &ves_io_schema.Empty{}\n\t\t\t\t\t\t\twafType.RefType = refTypeInt\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := wafTypeMapStrToI[\"inherit_waf\"]; ok && !isIntfNil(v) && !refTypeTypeFound {\n\n\t\t\t\t\t\trefTypeTypeFound = true\n\n\t\t\t\t\t\tif v.(bool) {\n\t\t\t\t\t\t\trefTypeInt := &ves_io_schema.WafType_InheritWaf{}\n\t\t\t\t\t\t\trefTypeInt.InheritWaf = &ves_io_schema.Empty{}\n\t\t\t\t\t\t\twafType.RefType = refTypeInt\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tlog.Printf(\"[DEBUG] Updating Volterra Route obj with struct: %+v\", updateReq)\n\n\terr := client.ReplaceObject(context.Background(), ves_io_schema_route.ObjectType, updateReq)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error updating Route: %s\", err)\n\t}\n\n\treturn resourceVolterraRouteRead(d, meta)\n}",
"func resourceVolterraDnsLoadBalancerUpdate(d *schema.ResourceData, meta interface{}) error {\n\tclient := meta.(*APIClient)\n\n\tupdateMeta := &ves_io_schema.ObjectReplaceMetaType{}\n\tupdateSpec := &ves_io_schema_dns_load_balancer.ReplaceSpecType{}\n\tupdateReq := &ves_io_schema_dns_load_balancer.ReplaceRequest{\n\t\tMetadata: updateMeta,\n\t\tSpec: updateSpec,\n\t}\n\tif v, ok := d.GetOk(\"annotations\"); ok && !isIntfNil(v) {\n\n\t\tms := map[string]string{}\n\n\t\tfor k, v := range v.(map[string]interface{}) {\n\t\t\tval := v.(string)\n\t\t\tms[k] = val\n\t\t}\n\t\tupdateMeta.Annotations = ms\n\t}\n\n\tif v, ok := d.GetOk(\"description\"); ok && !isIntfNil(v) {\n\t\tupdateMeta.Description =\n\t\t\tv.(string)\n\t}\n\n\tif v, ok := d.GetOk(\"disable\"); ok && !isIntfNil(v) {\n\t\tupdateMeta.Disable =\n\t\t\tv.(bool)\n\t}\n\n\tif v, ok := d.GetOk(\"labels\"); ok && !isIntfNil(v) {\n\n\t\tms := map[string]string{}\n\n\t\tfor k, v := range v.(map[string]interface{}) {\n\t\t\tval := v.(string)\n\t\t\tms[k] = val\n\t\t}\n\t\tupdateMeta.Labels = ms\n\t}\n\n\tif v, ok := d.GetOk(\"name\"); ok && !isIntfNil(v) {\n\t\tupdateMeta.Name =\n\t\t\tv.(string)\n\t}\n\n\tif v, ok := d.GetOk(\"namespace\"); ok && !isIntfNil(v) {\n\t\tupdateMeta.Namespace =\n\t\t\tv.(string)\n\t}\n\n\tif v, ok := d.GetOk(\"record_type\"); ok && !isIntfNil(v) {\n\n\t\tupdateSpec.RecordType = ves_io_schema_dns_load_balancer.ResourceRecordType(ves_io_schema_dns_load_balancer.ResourceRecordType_value[v.(string)])\n\n\t}\n\n\tif v, ok := d.GetOk(\"response_cache\"); ok && !isIntfNil(v) {\n\n\t\tsl := v.(*schema.Set).List()\n\t\tresponseCache := &ves_io_schema_dns_load_balancer.ResponseCache{}\n\t\tupdateSpec.ResponseCache = responseCache\n\t\tfor _, set := range sl {\n\t\t\tresponseCacheMapStrToI := set.(map[string]interface{})\n\n\t\t\tresponseCacheParametersChoiceTypeFound := false\n\n\t\t\tif v, ok := responseCacheMapStrToI[\"default_response_cache_parameters\"]; ok && !isIntfNil(v) && !responseCacheParametersChoiceTypeFound {\n\n\t\t\t\tresponseCacheParametersChoiceTypeFound = true\n\n\t\t\t\tif v.(bool) {\n\t\t\t\t\tresponseCacheParametersChoiceInt := &ves_io_schema_dns_load_balancer.ResponseCache_DefaultResponseCacheParameters{}\n\t\t\t\t\tresponseCacheParametersChoiceInt.DefaultResponseCacheParameters = &ves_io_schema.Empty{}\n\t\t\t\t\tresponseCache.ResponseCacheParametersChoice = responseCacheParametersChoiceInt\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif v, ok := responseCacheMapStrToI[\"disable\"]; ok && !isIntfNil(v) && !responseCacheParametersChoiceTypeFound {\n\n\t\t\t\tresponseCacheParametersChoiceTypeFound = true\n\n\t\t\t\tif v.(bool) {\n\t\t\t\t\tresponseCacheParametersChoiceInt := &ves_io_schema_dns_load_balancer.ResponseCache_Disable{}\n\t\t\t\t\tresponseCacheParametersChoiceInt.Disable = &ves_io_schema.Empty{}\n\t\t\t\t\tresponseCache.ResponseCacheParametersChoice = responseCacheParametersChoiceInt\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif v, ok := responseCacheMapStrToI[\"response_cache_parameters\"]; ok && !isIntfNil(v) && !responseCacheParametersChoiceTypeFound {\n\n\t\t\t\tresponseCacheParametersChoiceTypeFound = true\n\t\t\t\tresponseCacheParametersChoiceInt := &ves_io_schema_dns_load_balancer.ResponseCache_ResponseCacheParameters{}\n\t\t\t\tresponseCacheParametersChoiceInt.ResponseCacheParameters = &ves_io_schema_dns_load_balancer.ResponseCacheParameters{}\n\t\t\t\tresponseCache.ResponseCacheParametersChoice = responseCacheParametersChoiceInt\n\n\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\tfor _, set := range sl {\n\t\t\t\t\tcs := set.(map[string]interface{})\n\n\t\t\t\t\tif v, ok := cs[\"cache_cidr_ipv4\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\tresponseCacheParametersChoiceInt.ResponseCacheParameters.CacheCidrIpv4 = uint32(v.(int))\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := cs[\"cache_cidr_ipv6\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\tresponseCacheParametersChoiceInt.ResponseCacheParameters.CacheCidrIpv6 = uint32(v.(int))\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := cs[\"cache_ttl\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\tresponseCacheParametersChoiceInt.ResponseCacheParameters.CacheTtl = uint32(v.(int))\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tif v, ok := d.GetOk(\"rule_list\"); ok && !isIntfNil(v) {\n\n\t\tsl := v.(*schema.Set).List()\n\t\truleList := &ves_io_schema_dns_load_balancer.LoadBalancingRuleList{}\n\t\tupdateSpec.RuleList = ruleList\n\t\tfor _, set := range sl {\n\t\t\truleListMapStrToI := set.(map[string]interface{})\n\n\t\t\tif v, ok := ruleListMapStrToI[\"rules\"]; ok && !isIntfNil(v) {\n\n\t\t\t\tsl := v.([]interface{})\n\t\t\t\trules := make([]*ves_io_schema_dns_load_balancer.LoadBalancingRule, len(sl))\n\t\t\t\truleList.Rules = rules\n\t\t\t\tfor i, set := range sl {\n\t\t\t\t\trules[i] = &ves_io_schema_dns_load_balancer.LoadBalancingRule{}\n\t\t\t\t\trulesMapStrToI := set.(map[string]interface{})\n\n\t\t\t\t\tactionChoiceTypeFound := false\n\n\t\t\t\t\tif v, ok := rulesMapStrToI[\"nxdomain\"]; ok && !isIntfNil(v) && !actionChoiceTypeFound {\n\n\t\t\t\t\t\tactionChoiceTypeFound = true\n\n\t\t\t\t\t\tif v.(bool) {\n\t\t\t\t\t\t\tactionChoiceInt := &ves_io_schema_dns_load_balancer.LoadBalancingRule_Nxdomain{}\n\t\t\t\t\t\t\tactionChoiceInt.Nxdomain = &ves_io_schema.Empty{}\n\t\t\t\t\t\t\trules[i].ActionChoice = actionChoiceInt\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := rulesMapStrToI[\"pool\"]; ok && !isIntfNil(v) && !actionChoiceTypeFound {\n\n\t\t\t\t\t\tactionChoiceTypeFound = true\n\t\t\t\t\t\tactionChoiceInt := &ves_io_schema_dns_load_balancer.LoadBalancingRule_Pool{}\n\t\t\t\t\t\tactionChoiceInt.Pool = &ves_io_schema_views.ObjectRefType{}\n\t\t\t\t\t\trules[i].ActionChoice = actionChoiceInt\n\n\t\t\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\t\t\tfor _, set := range sl {\n\t\t\t\t\t\t\tcs := set.(map[string]interface{})\n\n\t\t\t\t\t\t\tif v, ok := cs[\"name\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\tactionChoiceInt.Pool.Name = v.(string)\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif v, ok := cs[\"namespace\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\tactionChoiceInt.Pool.Namespace = v.(string)\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif v, ok := cs[\"tenant\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\tactionChoiceInt.Pool.Tenant = v.(string)\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tgeoLocationChoiceTypeFound := false\n\n\t\t\t\t\tif v, ok := rulesMapStrToI[\"geo_location_label_selector\"]; ok && !isIntfNil(v) && !geoLocationChoiceTypeFound {\n\n\t\t\t\t\t\tgeoLocationChoiceTypeFound = true\n\t\t\t\t\t\tgeoLocationChoiceInt := &ves_io_schema_dns_load_balancer.LoadBalancingRule_GeoLocationLabelSelector{}\n\t\t\t\t\t\tgeoLocationChoiceInt.GeoLocationLabelSelector = &ves_io_schema.LabelSelectorType{}\n\t\t\t\t\t\trules[i].GeoLocationChoice = geoLocationChoiceInt\n\n\t\t\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\t\t\tfor _, set := range sl {\n\t\t\t\t\t\t\tcs := set.(map[string]interface{})\n\n\t\t\t\t\t\t\tif v, ok := cs[\"expressions\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\tls := make([]string, len(v.([]interface{})))\n\t\t\t\t\t\t\t\tfor i, v := range v.([]interface{}) {\n\t\t\t\t\t\t\t\t\tls[i] = v.(string)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tgeoLocationChoiceInt.GeoLocationLabelSelector.Expressions = ls\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := rulesMapStrToI[\"geo_location_set\"]; ok && !isIntfNil(v) && !geoLocationChoiceTypeFound {\n\n\t\t\t\t\t\tgeoLocationChoiceTypeFound = true\n\t\t\t\t\t\tgeoLocationChoiceInt := &ves_io_schema_dns_load_balancer.LoadBalancingRule_GeoLocationSet{}\n\t\t\t\t\t\tgeoLocationChoiceInt.GeoLocationSet = &ves_io_schema_views.ObjectRefType{}\n\t\t\t\t\t\trules[i].GeoLocationChoice = geoLocationChoiceInt\n\n\t\t\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\t\t\tfor _, set := range sl {\n\t\t\t\t\t\t\tcs := set.(map[string]interface{})\n\n\t\t\t\t\t\t\tif v, ok := cs[\"name\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\tgeoLocationChoiceInt.GeoLocationSet.Name = v.(string)\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif v, ok := cs[\"namespace\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\tgeoLocationChoiceInt.GeoLocationSet.Namespace = v.(string)\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif v, ok := cs[\"tenant\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\t\t\tgeoLocationChoiceInt.GeoLocationSet.Tenant = v.(string)\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif w, ok := rulesMapStrToI[\"score\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\trules[i].Score = uint32(w.(int))\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tlog.Printf(\"[DEBUG] Updating Volterra DnsLoadBalancer obj with struct: %+v\", updateReq)\n\n\terr := client.ReplaceObject(context.Background(), ves_io_schema_dns_load_balancer.ObjectType, updateReq)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error updating DnsLoadBalancer: %s\", err)\n\t}\n\n\treturn resourceVolterraDnsLoadBalancerRead(d, meta)\n}",
"func autoScaleSetRule(w http.ResponseWriter, r *http.Request, t auth.Token) (err error) {\n\tallowedSetRule := permission.Check(t, permission.PermNodeAutoscaleUpdate)\n\tif !allowedSetRule {\n\t\treturn permission.ErrUnauthorized\n\t}\n\terr = r.ParseForm()\n\tif err != nil {\n\t\treturn &tsuruErrors.HTTP{Code: http.StatusBadRequest, Message: err.Error()}\n\t}\n\tvar rule autoScaleRule\n\tdec := form.NewDecoder(nil)\n\tdec.IgnoreUnknownKeys(true)\n\terr = dec.DecodeValues(&rule, r.Form)\n\tif err != nil {\n\t\treturn &tsuruErrors.HTTP{Code: http.StatusBadRequest, Message: err.Error()}\n\t}\n\tvar ctxs []permission.PermissionContext\n\tif rule.MetadataFilter != \"\" {\n\t\tctxs = append(ctxs, permission.Context(permission.CtxPool, rule.MetadataFilter))\n\t}\n\tevt, err := event.New(&event.Opts{\n\t\tTarget: event.Target{Type: event.TargetTypePool, Value: rule.MetadataFilter},\n\t\tKind: permission.PermNodeAutoscaleUpdate,\n\t\tOwner: t,\n\t\tCustomData: event.FormToCustomData(r.Form),\n\t\tAllowed: event.Allowed(permission.PermPoolReadEvents, ctxs...),\n\t})\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer func() { evt.Done(err) }()\n\treturn rule.update()\n}",
"func resourceVolterraDnsLbPoolUpdate(d *schema.ResourceData, meta interface{}) error {\n\tclient := meta.(*APIClient)\n\n\tupdateMeta := &ves_io_schema.ObjectReplaceMetaType{}\n\tupdateSpec := &ves_io_schema_dns_lb_pool.ReplaceSpecType{}\n\tupdateReq := &ves_io_schema_dns_lb_pool.ReplaceRequest{\n\t\tMetadata: updateMeta,\n\t\tSpec: updateSpec,\n\t}\n\tif v, ok := d.GetOk(\"annotations\"); ok && !isIntfNil(v) {\n\n\t\tms := map[string]string{}\n\n\t\tfor k, v := range v.(map[string]interface{}) {\n\t\t\tval := v.(string)\n\t\t\tms[k] = val\n\t\t}\n\t\tupdateMeta.Annotations = ms\n\t}\n\n\tif v, ok := d.GetOk(\"description\"); ok && !isIntfNil(v) {\n\t\tupdateMeta.Description =\n\t\t\tv.(string)\n\t}\n\n\tif v, ok := d.GetOk(\"disable\"); ok && !isIntfNil(v) {\n\t\tupdateMeta.Disable =\n\t\t\tv.(bool)\n\t}\n\n\tif v, ok := d.GetOk(\"labels\"); ok && !isIntfNil(v) {\n\n\t\tms := map[string]string{}\n\n\t\tfor k, v := range v.(map[string]interface{}) {\n\t\t\tval := v.(string)\n\t\t\tms[k] = val\n\t\t}\n\t\tupdateMeta.Labels = ms\n\t}\n\n\tif v, ok := d.GetOk(\"name\"); ok && !isIntfNil(v) {\n\t\tupdateMeta.Name =\n\t\t\tv.(string)\n\t}\n\n\tif v, ok := d.GetOk(\"namespace\"); ok && !isIntfNil(v) {\n\t\tupdateMeta.Namespace =\n\t\t\tv.(string)\n\t}\n\n\tif v, ok := d.GetOk(\"load_balancing_mode\"); ok && !isIntfNil(v) {\n\n\t\tupdateSpec.LoadBalancingMode = ves_io_schema_dns_lb_pool.LoadBalancingMode(ves_io_schema_dns_lb_pool.LoadBalancingMode_value[v.(string)])\n\n\t}\n\n\tpoolTypeChoiceTypeFound := false\n\n\tif v, ok := d.GetOk(\"a_pool\"); ok && !poolTypeChoiceTypeFound {\n\n\t\tpoolTypeChoiceTypeFound = true\n\t\tpoolTypeChoiceInt := &ves_io_schema_dns_lb_pool.ReplaceSpecType_APool{}\n\t\tpoolTypeChoiceInt.APool = &ves_io_schema_dns_lb_pool.APool{}\n\t\tupdateSpec.PoolTypeChoice = poolTypeChoiceInt\n\n\t\tsl := v.(*schema.Set).List()\n\t\tfor _, set := range sl {\n\t\t\tcs := set.(map[string]interface{})\n\n\t\t\thealthCheckChoiceTypeFound := false\n\n\t\t\tif v, ok := cs[\"disable_health_check\"]; ok && !isIntfNil(v) && !healthCheckChoiceTypeFound {\n\n\t\t\t\thealthCheckChoiceTypeFound = true\n\n\t\t\t\tif v.(bool) {\n\t\t\t\t\thealthCheckChoiceInt := &ves_io_schema_dns_lb_pool.APool_DisableHealthCheck{}\n\t\t\t\t\thealthCheckChoiceInt.DisableHealthCheck = &ves_io_schema.Empty{}\n\t\t\t\t\tpoolTypeChoiceInt.APool.HealthCheckChoice = healthCheckChoiceInt\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif v, ok := cs[\"health_check\"]; ok && !isIntfNil(v) && !healthCheckChoiceTypeFound {\n\n\t\t\t\thealthCheckChoiceTypeFound = true\n\t\t\t\thealthCheckChoiceInt := &ves_io_schema_dns_lb_pool.APool_HealthCheck{}\n\t\t\t\thealthCheckChoiceInt.HealthCheck = &ves_io_schema_views.ObjectRefType{}\n\t\t\t\tpoolTypeChoiceInt.APool.HealthCheckChoice = healthCheckChoiceInt\n\n\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\tfor _, set := range sl {\n\t\t\t\t\tcs := set.(map[string]interface{})\n\n\t\t\t\t\tif v, ok := cs[\"name\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\thealthCheckChoiceInt.HealthCheck.Name = v.(string)\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := cs[\"namespace\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\thealthCheckChoiceInt.HealthCheck.Namespace = v.(string)\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := cs[\"tenant\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\thealthCheckChoiceInt.HealthCheck.Tenant = v.(string)\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif v, ok := cs[\"max_answers\"]; ok && !isIntfNil(v) {\n\n\t\t\t\tpoolTypeChoiceInt.APool.MaxAnswers = uint32(v.(int))\n\n\t\t\t}\n\n\t\t\tif v, ok := cs[\"members\"]; ok && !isIntfNil(v) {\n\n\t\t\t\tsl := v.([]interface{})\n\t\t\t\tmembers := make([]*ves_io_schema_dns_lb_pool.AddressMember, len(sl))\n\t\t\t\tpoolTypeChoiceInt.APool.Members = members\n\t\t\t\tfor i, set := range sl {\n\t\t\t\t\tmembers[i] = &ves_io_schema_dns_lb_pool.AddressMember{}\n\t\t\t\t\tmembersMapStrToI := set.(map[string]interface{})\n\n\t\t\t\t\tif w, ok := membersMapStrToI[\"disable\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\tmembers[i].Disable = w.(bool)\n\t\t\t\t\t}\n\n\t\t\t\t\tif w, ok := membersMapStrToI[\"ip_endpoint\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\tmembers[i].IpEndpoint = w.(string)\n\t\t\t\t\t}\n\n\t\t\t\t\tif w, ok := membersMapStrToI[\"name\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\tmembers[i].Name = w.(string)\n\t\t\t\t\t}\n\n\t\t\t\t\tif w, ok := membersMapStrToI[\"priority\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\tmembers[i].Priority = uint32(w.(int))\n\t\t\t\t\t}\n\n\t\t\t\t\tif w, ok := membersMapStrToI[\"ratio\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\tmembers[i].Ratio = uint32(w.(int))\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tif v, ok := d.GetOk(\"aaaa_pool\"); ok && !poolTypeChoiceTypeFound {\n\n\t\tpoolTypeChoiceTypeFound = true\n\t\tpoolTypeChoiceInt := &ves_io_schema_dns_lb_pool.ReplaceSpecType_AaaaPool{}\n\t\tpoolTypeChoiceInt.AaaaPool = &ves_io_schema_dns_lb_pool.AAAAPool{}\n\t\tupdateSpec.PoolTypeChoice = poolTypeChoiceInt\n\n\t\tsl := v.(*schema.Set).List()\n\t\tfor _, set := range sl {\n\t\t\tcs := set.(map[string]interface{})\n\n\t\t\tif v, ok := cs[\"max_answers\"]; ok && !isIntfNil(v) {\n\n\t\t\t\tpoolTypeChoiceInt.AaaaPool.MaxAnswers = uint32(v.(int))\n\n\t\t\t}\n\n\t\t\tif v, ok := cs[\"members\"]; ok && !isIntfNil(v) {\n\n\t\t\t\tsl := v.([]interface{})\n\t\t\t\tmembers := make([]*ves_io_schema_dns_lb_pool.AddressMember, len(sl))\n\t\t\t\tpoolTypeChoiceInt.AaaaPool.Members = members\n\t\t\t\tfor i, set := range sl {\n\t\t\t\t\tmembers[i] = &ves_io_schema_dns_lb_pool.AddressMember{}\n\t\t\t\t\tmembersMapStrToI := set.(map[string]interface{})\n\n\t\t\t\t\tif w, ok := membersMapStrToI[\"disable\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\tmembers[i].Disable = w.(bool)\n\t\t\t\t\t}\n\n\t\t\t\t\tif w, ok := membersMapStrToI[\"ip_endpoint\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\tmembers[i].IpEndpoint = w.(string)\n\t\t\t\t\t}\n\n\t\t\t\t\tif w, ok := membersMapStrToI[\"name\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\tmembers[i].Name = w.(string)\n\t\t\t\t\t}\n\n\t\t\t\t\tif w, ok := membersMapStrToI[\"priority\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\tmembers[i].Priority = uint32(w.(int))\n\t\t\t\t\t}\n\n\t\t\t\t\tif w, ok := membersMapStrToI[\"ratio\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\tmembers[i].Ratio = uint32(w.(int))\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tif v, ok := d.GetOk(\"cname_pool\"); ok && !poolTypeChoiceTypeFound {\n\n\t\tpoolTypeChoiceTypeFound = true\n\t\tpoolTypeChoiceInt := &ves_io_schema_dns_lb_pool.ReplaceSpecType_CnamePool{}\n\t\tpoolTypeChoiceInt.CnamePool = &ves_io_schema_dns_lb_pool.CNAMEPool{}\n\t\tupdateSpec.PoolTypeChoice = poolTypeChoiceInt\n\n\t\tsl := v.(*schema.Set).List()\n\t\tfor _, set := range sl {\n\t\t\tcs := set.(map[string]interface{})\n\n\t\t\tif v, ok := cs[\"members\"]; ok && !isIntfNil(v) {\n\n\t\t\t\tsl := v.([]interface{})\n\t\t\t\tmembers := make([]*ves_io_schema_dns_lb_pool.CNAMEMember, len(sl))\n\t\t\t\tpoolTypeChoiceInt.CnamePool.Members = members\n\t\t\t\tfor i, set := range sl {\n\t\t\t\t\tmembers[i] = &ves_io_schema_dns_lb_pool.CNAMEMember{}\n\t\t\t\t\tmembersMapStrToI := set.(map[string]interface{})\n\n\t\t\t\t\tif w, ok := membersMapStrToI[\"domain\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\tmembers[i].Domain = w.(string)\n\t\t\t\t\t}\n\n\t\t\t\t\tif w, ok := membersMapStrToI[\"final_translation\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\tmembers[i].FinalTranslation = w.(bool)\n\t\t\t\t\t}\n\n\t\t\t\t\tif w, ok := membersMapStrToI[\"name\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\tmembers[i].Name = w.(string)\n\t\t\t\t\t}\n\n\t\t\t\t\tif w, ok := membersMapStrToI[\"ratio\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\tmembers[i].Ratio = uint32(w.(int))\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tif v, ok := d.GetOk(\"mx_pool\"); ok && !poolTypeChoiceTypeFound {\n\n\t\tpoolTypeChoiceTypeFound = true\n\t\tpoolTypeChoiceInt := &ves_io_schema_dns_lb_pool.ReplaceSpecType_MxPool{}\n\t\tpoolTypeChoiceInt.MxPool = &ves_io_schema_dns_lb_pool.MXPool{}\n\t\tupdateSpec.PoolTypeChoice = poolTypeChoiceInt\n\n\t\tsl := v.(*schema.Set).List()\n\t\tfor _, set := range sl {\n\t\t\tcs := set.(map[string]interface{})\n\n\t\t\tif v, ok := cs[\"max_answers\"]; ok && !isIntfNil(v) {\n\n\t\t\t\tpoolTypeChoiceInt.MxPool.MaxAnswers = uint32(v.(int))\n\n\t\t\t}\n\n\t\t\tif v, ok := cs[\"members\"]; ok && !isIntfNil(v) {\n\n\t\t\t\tsl := v.([]interface{})\n\t\t\t\tmembers := make([]*ves_io_schema_dns_lb_pool.MXMember, len(sl))\n\t\t\t\tpoolTypeChoiceInt.MxPool.Members = members\n\t\t\t\tfor i, set := range sl {\n\t\t\t\t\tmembers[i] = &ves_io_schema_dns_lb_pool.MXMember{}\n\t\t\t\t\tmembersMapStrToI := set.(map[string]interface{})\n\n\t\t\t\t\tif w, ok := membersMapStrToI[\"domain\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\tmembers[i].Domain = w.(string)\n\t\t\t\t\t}\n\n\t\t\t\t\tif w, ok := membersMapStrToI[\"name\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\tmembers[i].Name = w.(string)\n\t\t\t\t\t}\n\n\t\t\t\t\tif w, ok := membersMapStrToI[\"priority\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\tmembers[i].Priority = uint32(w.(int))\n\t\t\t\t\t}\n\n\t\t\t\t\tif w, ok := membersMapStrToI[\"ratio\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\tmembers[i].Ratio = uint32(w.(int))\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tttlChoiceTypeFound := false\n\n\tif v, ok := d.GetOk(\"ttl\"); ok && !ttlChoiceTypeFound {\n\n\t\tttlChoiceTypeFound = true\n\t\tttlChoiceInt := &ves_io_schema_dns_lb_pool.ReplaceSpecType_Ttl{}\n\n\t\tupdateSpec.TtlChoice = ttlChoiceInt\n\n\t\tttlChoiceInt.Ttl = uint32(v.(int))\n\n\t}\n\n\tif v, ok := d.GetOk(\"use_rrset_ttl\"); ok && !ttlChoiceTypeFound {\n\n\t\tttlChoiceTypeFound = true\n\n\t\tif v.(bool) {\n\t\t\tttlChoiceInt := &ves_io_schema_dns_lb_pool.ReplaceSpecType_UseRrsetTtl{}\n\t\t\tttlChoiceInt.UseRrsetTtl = &ves_io_schema.Empty{}\n\t\t\tupdateSpec.TtlChoice = ttlChoiceInt\n\t\t}\n\n\t}\n\n\tlog.Printf(\"[DEBUG] Updating Volterra DnsLbPool obj with struct: %+v\", updateReq)\n\n\terr := client.ReplaceObject(context.Background(), ves_io_schema_dns_lb_pool.ObjectType, updateReq)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error updating DnsLbPool: %s\", err)\n\t}\n\n\treturn resourceVolterraDnsLbPoolRead(d, meta)\n}",
"func autoScaleSetRule(w http.ResponseWriter, r *http.Request, t auth.Token) (err error) {\n\tallowedSetRule := permission.Check(t, permission.PermNodeAutoscaleUpdate)\n\tif !allowedSetRule {\n\t\treturn permission.ErrUnauthorized\n\t}\n\terr = r.ParseForm()\n\tif err != nil {\n\t\treturn &errors.HTTP{Code: http.StatusBadRequest, Message: err.Error()}\n\t}\n\tvar rule autoScaleRule\n\tdec := form.NewDecoder(nil)\n\tdec.IgnoreUnknownKeys(true)\n\terr = dec.DecodeValues(&rule, r.Form)\n\tif err != nil {\n\t\treturn &errors.HTTP{Code: http.StatusBadRequest, Message: err.Error()}\n\t}\n\tvar ctxs []permission.PermissionContext\n\tif rule.MetadataFilter != \"\" {\n\t\tctxs = append(ctxs, permission.Context(permission.CtxPool, rule.MetadataFilter))\n\t}\n\tevt, err := event.New(&event.Opts{\n\t\tTarget: event.Target{Type: event.TargetTypePool, Value: rule.MetadataFilter},\n\t\tKind: permission.PermNodeAutoscaleUpdate,\n\t\tOwner: t,\n\t\tCustomData: event.FormToCustomData(r.Form),\n\t\tAllowed: event.Allowed(permission.PermPoolReadEvents, ctxs...),\n\t})\n\tif err != nil {\n\t\treturn err\n\t}\n\tdefer func() { evt.Done(err) }()\n\treturn rule.update()\n}",
"func (p *provider) createOrUpdateVMAntiAffinityRule(ctx context.Context, session *Session, name string, config *Config) error {\n\tp.mutex.Lock()\n\tdefer p.mutex.Unlock()\n\n\tcluster, err := session.Finder.ClusterComputeResource(ctx, config.Cluster)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tvmsInFolder, err := session.Finder.VirtualMachineList(ctx, strings.Join([]string{config.Folder, \"*\"}, \"/\"))\n\tif err != nil {\n\t\tif errors.Is(err, &find.NotFoundError{}) {\n\t\t\treturn removeVMAntiAffinityRule(ctx, session, config.Cluster, name)\n\t\t}\n\t\treturn err\n\t}\n\n\tvar ruleVMRef []types.ManagedObjectReference\n\tfor _, vm := range vmsInFolder {\n\t\tif strings.HasPrefix(vm.Name(), name) {\n\t\t\truleVMRef = append(ruleVMRef, vm.Reference())\n\t\t}\n\t}\n\n\t// minimum of two vms required\n\tif len(ruleVMRef) < 2 {\n\t\treturn removeVMAntiAffinityRule(ctx, session, config.Cluster, name)\n\t}\n\n\tinfo, err := findClusterAntiAffinityRuleByName(ctx, cluster, name)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\toperation := types.ArrayUpdateOperationEdit\n\n\t//create new rule\n\tif info == nil {\n\t\tinfo = &types.ClusterAntiAffinityRuleSpec{\n\t\t\tClusterRuleInfo: types.ClusterRuleInfo{\n\t\t\t\tEnabled: ptr.Bool(true),\n\t\t\t\tMandatory: ptr.Bool(false),\n\t\t\t\tName: name,\n\t\t\t\tUserCreated: ptr.Bool(true),\n\t\t\t},\n\t\t}\n\t\toperation = types.ArrayUpdateOperationAdd\n\t}\n\n\tinfo.Vm = ruleVMRef\n\tspec := &types.ClusterConfigSpecEx{\n\t\tRulesSpec: []types.ClusterRuleSpec{\n\t\t\t{\n\t\t\t\tArrayUpdateSpec: types.ArrayUpdateSpec{\n\t\t\t\t\tOperation: operation,\n\t\t\t\t},\n\t\t\t\tInfo: info,\n\t\t\t},\n\t\t},\n\t}\n\n\ttask, err := cluster.Reconfigure(ctx, spec, true)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\terr = task.Wait(ctx)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn waitForRule(ctx, cluster, info)\n}",
"func (f *fabricFactory) updateResource(ctx context.Context, plugin smodel.Plugin, url string, body *json.RawMessage, ch chan response.RPC) {\n\treq, errResp, err := f.createChassisRequest(ctx, plugin, url, http.MethodPatch, body)\n\tif errResp != nil {\n\t\tl.LogWithFields(ctx).Warn(\"while trying to create fabric plugin request for \" + plugin.ID + \", got \" + err.Error())\n\t\tch <- *errResp\n\t\treturn\n\t}\n\tch <- patchResource(ctx, f, req)\n}",
"func (h *defaultNetworkControllerEventHandler) UpdateResource(oldObj, newObj interface{}, inRetryCache bool) error {\n\tswitch h.objType {\n\tcase factory.PodType:\n\t\toldPod := oldObj.(*kapi.Pod)\n\t\tnewPod := newObj.(*kapi.Pod)\n\n\t\treturn h.oc.ensurePod(oldPod, newPod, inRetryCache || util.PodScheduled(oldPod) != util.PodScheduled(newPod))\n\n\tcase factory.NodeType:\n\t\tnewNode, ok := newObj.(*kapi.Node)\n\t\tif !ok {\n\t\t\treturn fmt.Errorf(\"could not cast newObj of type %T to *kapi.Node\", newObj)\n\t\t}\n\t\toldNode, ok := oldObj.(*kapi.Node)\n\t\tif !ok {\n\t\t\treturn fmt.Errorf(\"could not cast oldObj of type %T to *kapi.Node\", oldObj)\n\t\t}\n\t\t// determine what actually changed in this update\n\t\t_, nodeSync := h.oc.addNodeFailed.Load(newNode.Name)\n\t\t_, failed := h.oc.nodeClusterRouterPortFailed.Load(newNode.Name)\n\t\tclusterRtrSync := failed || nodeChassisChanged(oldNode, newNode) || nodeSubnetChanged(oldNode, newNode)\n\t\t_, failed = h.oc.mgmtPortFailed.Load(newNode.Name)\n\t\tmgmtSync := failed || macAddressChanged(oldNode, newNode) || nodeSubnetChanged(oldNode, newNode)\n\t\t_, failed = h.oc.gatewaysFailed.Load(newNode.Name)\n\t\tgwSync := (failed || gatewayChanged(oldNode, newNode) ||\n\t\t\tnodeSubnetChanged(oldNode, newNode) || hostAddressesChanged(oldNode, newNode) ||\n\t\t\tnodeGatewayMTUSupportChanged(oldNode, newNode))\n\t\t_, hoSync := h.oc.hybridOverlayFailed.Load(newNode.Name)\n\n\t\treturn h.oc.addUpdateNodeEvent(newNode, &nodeSyncs{nodeSync, clusterRtrSync, mgmtSync, gwSync, hoSync})\n\n\tcase factory.PeerPodSelectorType:\n\t\textraParameters := h.extraParameters.(*NetworkPolicyExtraParameters)\n\t\treturn h.oc.handlePeerPodSelectorAddUpdate(extraParameters.np, extraParameters.gp, newObj)\n\n\tcase factory.PeerPodForNamespaceAndPodSelectorType:\n\t\textraParameters := h.extraParameters.(*NetworkPolicyExtraParameters)\n\t\treturn h.oc.handlePeerPodSelectorAddUpdate(extraParameters.np, extraParameters.gp, newObj)\n\n\tcase factory.LocalPodSelectorType:\n\t\textraParameters := h.extraParameters.(*NetworkPolicyExtraParameters)\n\t\treturn h.oc.handleLocalPodSelectorAddFunc(\n\t\t\textraParameters.np,\n\t\t\tnewObj)\n\n\tcase factory.EgressIPType:\n\t\toldEIP := oldObj.(*egressipv1.EgressIP)\n\t\tnewEIP := newObj.(*egressipv1.EgressIP)\n\t\treturn h.oc.reconcileEgressIP(oldEIP, newEIP)\n\n\tcase factory.EgressIPNamespaceType:\n\t\toldNamespace := oldObj.(*kapi.Namespace)\n\t\tnewNamespace := newObj.(*kapi.Namespace)\n\t\treturn h.oc.reconcileEgressIPNamespace(oldNamespace, newNamespace)\n\n\tcase factory.EgressIPPodType:\n\t\toldPod := oldObj.(*kapi.Pod)\n\t\tnewPod := newObj.(*kapi.Pod)\n\t\treturn h.oc.reconcileEgressIPPod(oldPod, newPod)\n\n\tcase factory.EgressNodeType:\n\t\toldNode := oldObj.(*kapi.Node)\n\t\tnewNode := newObj.(*kapi.Node)\n\n\t\t// Check if the node's internal addresses changed. If so,\n\t\t// delete and readd the node for egress to update LR policies.\n\t\t// We are only interested in the IPs here, not the subnet information.\n\t\toldV4Addr, oldV6Addr := util.GetNodeInternalAddrs(oldNode)\n\t\tnewV4Addr, newV6Addr := util.GetNodeInternalAddrs(newNode)\n\t\tif !oldV4Addr.Equal(newV4Addr) || !oldV6Addr.Equal(newV6Addr) {\n\t\t\tklog.Infof(\"Egress IP detected IP address change. Recreating node %s for Egress IP.\", newNode.Name)\n\t\t\tif err := h.oc.deleteNodeForEgress(oldNode); err != nil {\n\t\t\t\tklog.Error(err)\n\t\t\t}\n\t\t\tif err := h.oc.setupNodeForEgress(newNode); err != nil {\n\t\t\t\tklog.Error(err)\n\t\t\t}\n\t\t}\n\n\t\t// Initialize the allocator on every update,\n\t\t// ovnkube-node/cloud-network-config-controller will make sure to\n\t\t// annotate the node with the egressIPConfig, but that might have\n\t\t// happened after we processed the ADD for that object, hence keep\n\t\t// retrying for all UPDATEs.\n\t\tif err := h.oc.initEgressIPAllocator(newNode); err != nil {\n\t\t\tklog.Warningf(\"Egress node initialization error: %v\", err)\n\t\t}\n\t\tnodeEgressLabel := util.GetNodeEgressLabel()\n\t\toldLabels := oldNode.GetLabels()\n\t\tnewLabels := newNode.GetLabels()\n\t\t_, oldHadEgressLabel := oldLabels[nodeEgressLabel]\n\t\t_, newHasEgressLabel := newLabels[nodeEgressLabel]\n\t\t// If the node is not labeled for egress assignment, just return\n\t\t// directly, we don't really need to set the ready / reachable\n\t\t// status on this node if the user doesn't care about using it.\n\t\tif !oldHadEgressLabel && !newHasEgressLabel {\n\t\t\treturn nil\n\t\t}\n\t\th.oc.setNodeEgressAssignable(newNode.Name, newHasEgressLabel)\n\t\tif oldHadEgressLabel && !newHasEgressLabel {\n\t\t\tklog.Infof(\"Node: %s has been un-labeled, deleting it from egress assignment\", newNode.Name)\n\t\t\treturn h.oc.deleteEgressNode(oldNode.Name)\n\t\t}\n\t\tisOldReady := h.oc.isEgressNodeReady(oldNode)\n\t\tisNewReady := h.oc.isEgressNodeReady(newNode)\n\t\tisNewReachable := h.oc.isEgressNodeReachable(newNode)\n\t\th.oc.setNodeEgressReady(newNode.Name, isNewReady)\n\t\tif !oldHadEgressLabel && newHasEgressLabel {\n\t\t\tklog.Infof(\"Node: %s has been labeled, adding it for egress assignment\", newNode.Name)\n\t\t\tif isNewReady && isNewReachable {\n\t\t\t\th.oc.setNodeEgressReachable(newNode.Name, isNewReachable)\n\t\t\t\tif err := h.oc.addEgressNode(newNode.Name); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tklog.Warningf(\"Node: %s has been labeled, but node is not ready\"+\n\t\t\t\t\t\" and reachable, cannot use it for egress assignment\", newNode.Name)\n\t\t\t}\n\t\t\treturn nil\n\t\t}\n\t\tif isOldReady == isNewReady {\n\t\t\treturn nil\n\t\t}\n\t\tif !isNewReady {\n\t\t\tklog.Warningf(\"Node: %s is not ready, deleting it from egress assignment\", newNode.Name)\n\t\t\tif err := h.oc.deleteEgressNode(newNode.Name); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t} else if isNewReady && isNewReachable {\n\t\t\tklog.Infof(\"Node: %s is ready and reachable, adding it for egress assignment\", newNode.Name)\n\t\t\th.oc.setNodeEgressReachable(newNode.Name, isNewReachable)\n\t\t\tif err := h.oc.addEgressNode(newNode.Name); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t\treturn nil\n\n\tcase factory.EgressFwNodeType:\n\t\toldNode := oldObj.(*kapi.Node)\n\t\tnewNode := newObj.(*kapi.Node)\n\t\treturn h.oc.updateEgressFirewallForNode(oldNode, newNode)\n\n\tcase factory.CloudPrivateIPConfigType:\n\t\toldCloudPrivateIPConfig := oldObj.(*ocpcloudnetworkapi.CloudPrivateIPConfig)\n\t\tnewCloudPrivateIPConfig := newObj.(*ocpcloudnetworkapi.CloudPrivateIPConfig)\n\t\treturn h.oc.reconcileCloudPrivateIPConfig(oldCloudPrivateIPConfig, newCloudPrivateIPConfig)\n\n\tcase factory.NamespaceType:\n\t\toldNs, newNs := oldObj.(*kapi.Namespace), newObj.(*kapi.Namespace)\n\t\treturn h.oc.updateNamespace(oldNs, newNs)\n\t}\n\treturn fmt.Errorf(\"no update function for object type %s\", h.objType)\n}",
"func (g *GCEAlphaRegionNetworkFirewallPolicies) PatchRule(ctx context.Context, key *meta.Key, arg0 *alpha.FirewallPolicyRule) error {\n\tklog.V(5).Infof(\"GCEAlphaRegionNetworkFirewallPolicies.PatchRule(%v, %v, ...): called\", ctx, key)\n\n\tif !key.Valid() {\n\t\tklog.V(2).Infof(\"GCEAlphaRegionNetworkFirewallPolicies.PatchRule(%v, %v, ...): key is invalid (%#v)\", ctx, key, key)\n\t\treturn fmt.Errorf(\"invalid GCE key (%+v)\", key)\n\t}\n\tprojectID := g.s.ProjectRouter.ProjectID(ctx, \"alpha\", \"RegionNetworkFirewallPolicies\")\n\trk := &RateLimitKey{\n\t\tProjectID: projectID,\n\t\tOperation: \"PatchRule\",\n\t\tVersion: meta.Version(\"alpha\"),\n\t\tService: \"RegionNetworkFirewallPolicies\",\n\t}\n\tklog.V(5).Infof(\"GCEAlphaRegionNetworkFirewallPolicies.PatchRule(%v, %v, ...): projectID = %v, rk = %+v\", ctx, key, projectID, rk)\n\n\tif err := g.s.RateLimiter.Accept(ctx, rk); err != nil {\n\t\tklog.V(4).Infof(\"GCEAlphaRegionNetworkFirewallPolicies.PatchRule(%v, %v, ...): RateLimiter error: %v\", ctx, key, err)\n\t\treturn err\n\t}\n\tcall := g.s.Alpha.RegionNetworkFirewallPolicies.PatchRule(projectID, key.Region, key.Name, arg0)\n\tcall.Context(ctx)\n\top, err := call.Do()\n\tif err != nil {\n\t\tklog.V(4).Infof(\"GCEAlphaRegionNetworkFirewallPolicies.PatchRule(%v, %v, ...) = %+v\", ctx, key, err)\n\t\treturn err\n\t}\n\terr = g.s.WaitForCompletion(ctx, op)\n\tklog.V(4).Infof(\"GCEAlphaRegionNetworkFirewallPolicies.PatchRule(%v, %v, ...) = %+v\", ctx, key, err)\n\treturn err\n}",
"func AddEndpointUpdateRule(nfti *NFTInterface, tableFamily nftables.TableFamily, chain string, index int, svcID string, timeout int) ([]uint64, error) {\n\tci := ciForTableFamily(nfti, tableFamily)\n\tsi := nfti.SIv4\n\tif tableFamily == nftables.TableFamilyIPv6 {\n\t\tsi = nfti.SIv6\n\t}\n\ts, err := si.Sets().GetSetByName(K8sAffinityMap + svcID)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\trules := []nftableslib.Rule{\n\t\t{\n\t\t\tDynamic: &nftableslib.Dynamic{\n\t\t\t\tMatch: nftableslib.MatchTypeL3Src,\n\t\t\t\tOp: unix.NFT_DYNSET_OP_UPDATE,\n\t\t\t\tKey: uint32(index),\n\t\t\t\tSetRef: &nftableslib.SetRef{\n\t\t\t\t\tName: s.Name,\n\t\t\t\t\tID: s.ID,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}\n\n\tif err := ci.Chains().CreateImm(chain, nil); err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to create endpoint chain %s with error: %+v\", chain, err)\n\t}\n\tri, err := ci.Chains().Chain(chain)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"fail to get rules' interface for endpoint chain %s with error: %+v\", chain, err)\n\t}\n\trules[0].Position = 0\n\tid, err := ri.Rules().InsertImm(&rules[0])\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"fail to insert Update rule program endpoints rules for service chain %s with error: %+v\", chain, err)\n\t}\n\n\treturn []uint64{id}, nil\n}",
"func resourceVolterraNetworkPolicyViewUpdate(d *schema.ResourceData, meta interface{}) error {\n\tclient := meta.(*APIClient)\n\n\tupdateMeta := &ves_io_schema.ObjectReplaceMetaType{}\n\tupdateSpec := &ves_io_schema_views_network_policy_view.ReplaceSpecType{}\n\tupdateReq := &ves_io_schema_views_network_policy_view.ReplaceRequest{\n\t\tMetadata: updateMeta,\n\t\tSpec: updateSpec,\n\t}\n\tif v, ok := d.GetOk(\"annotations\"); ok && !isIntfNil(v) {\n\n\t\tms := map[string]string{}\n\n\t\tfor k, v := range v.(map[string]interface{}) {\n\t\t\tval := v.(string)\n\t\t\tms[k] = val\n\t\t}\n\t\tupdateMeta.Annotations = ms\n\t}\n\n\tif v, ok := d.GetOk(\"description\"); ok && !isIntfNil(v) {\n\t\tupdateMeta.Description =\n\t\t\tv.(string)\n\t}\n\n\tif v, ok := d.GetOk(\"disable\"); ok && !isIntfNil(v) {\n\t\tupdateMeta.Disable =\n\t\t\tv.(bool)\n\t}\n\n\tif v, ok := d.GetOk(\"labels\"); ok && !isIntfNil(v) {\n\n\t\tms := map[string]string{}\n\n\t\tfor k, v := range v.(map[string]interface{}) {\n\t\t\tval := v.(string)\n\t\t\tms[k] = val\n\t\t}\n\t\tupdateMeta.Labels = ms\n\t}\n\n\tif v, ok := d.GetOk(\"name\"); ok && !isIntfNil(v) {\n\t\tupdateMeta.Name =\n\t\t\tv.(string)\n\t}\n\n\tif v, ok := d.GetOk(\"namespace\"); ok && !isIntfNil(v) {\n\t\tupdateMeta.Namespace =\n\t\t\tv.(string)\n\t}\n\n\tif v, ok := d.GetOk(\"egress_rules\"); ok && !isIntfNil(v) {\n\n\t\tsl := v.([]interface{})\n\t\tegressRules := make([]*ves_io_schema_network_policy.NetworkPolicyRuleType, len(sl))\n\t\tupdateSpec.EgressRules = egressRules\n\t\tfor i, set := range sl {\n\t\t\tegressRules[i] = &ves_io_schema_network_policy.NetworkPolicyRuleType{}\n\t\t\tegressRulesMapStrToI := set.(map[string]interface{})\n\n\t\t\tif v, ok := egressRulesMapStrToI[\"action\"]; ok && !isIntfNil(v) {\n\n\t\t\t\tegressRules[i].Action = ves_io_schema_network_policy_rule.NetworkPolicyRuleAction(ves_io_schema_network_policy_rule.NetworkPolicyRuleAction_value[v.(string)])\n\n\t\t\t}\n\n\t\t\tif w, ok := egressRulesMapStrToI[\"keys\"]; ok && !isIntfNil(w) {\n\t\t\t\tls := make([]string, len(w.([]interface{})))\n\t\t\t\tfor i, v := range w.([]interface{}) {\n\t\t\t\t\tls[i] = v.(string)\n\t\t\t\t}\n\t\t\t\tegressRules[i].Keys = ls\n\t\t\t}\n\n\t\t\tif v, ok := egressRulesMapStrToI[\"label_matcher\"]; ok && !isIntfNil(v) {\n\n\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\tlabelMatcher := &ves_io_schema.LabelMatcherType{}\n\t\t\t\tegressRules[i].LabelMatcher = labelMatcher\n\t\t\t\tfor _, set := range sl {\n\t\t\t\t\tlabelMatcherMapStrToI := set.(map[string]interface{})\n\n\t\t\t\t\tif w, ok := labelMatcherMapStrToI[\"keys\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\tls := make([]string, len(w.([]interface{})))\n\t\t\t\t\t\tfor i, v := range w.([]interface{}) {\n\t\t\t\t\t\t\tls[i] = v.(string)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlabelMatcher.Keys = ls\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif v, ok := egressRulesMapStrToI[\"metadata\"]; ok && !isIntfNil(v) {\n\n\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\tmetadata := &ves_io_schema.MessageMetaType{}\n\t\t\t\tegressRules[i].Metadata = metadata\n\t\t\t\tfor _, set := range sl {\n\t\t\t\t\tmetadataMapStrToI := set.(map[string]interface{})\n\n\t\t\t\t\tif w, ok := metadataMapStrToI[\"description\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\tmetadata.Description = w.(string)\n\t\t\t\t\t}\n\n\t\t\t\t\tif w, ok := metadataMapStrToI[\"disable\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\tmetadata.Disable = w.(bool)\n\t\t\t\t\t}\n\n\t\t\t\t\tif w, ok := metadataMapStrToI[\"name\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\tmetadata.Name = w.(string)\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\totherEndpointTypeFound := false\n\n\t\t\tif v, ok := egressRulesMapStrToI[\"any\"]; ok && !isIntfNil(v) && !otherEndpointTypeFound {\n\n\t\t\t\totherEndpointTypeFound = true\n\n\t\t\t\tif v.(bool) {\n\t\t\t\t\totherEndpointInt := &ves_io_schema_network_policy.NetworkPolicyRuleType_Any{}\n\t\t\t\t\totherEndpointInt.Any = &ves_io_schema.Empty{}\n\t\t\t\t\tegressRules[i].OtherEndpoint = otherEndpointInt\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif v, ok := egressRulesMapStrToI[\"inside_endpoints\"]; ok && !isIntfNil(v) && !otherEndpointTypeFound {\n\n\t\t\t\totherEndpointTypeFound = true\n\n\t\t\t\tif v.(bool) {\n\t\t\t\t\totherEndpointInt := &ves_io_schema_network_policy.NetworkPolicyRuleType_InsideEndpoints{}\n\t\t\t\t\totherEndpointInt.InsideEndpoints = &ves_io_schema.Empty{}\n\t\t\t\t\tegressRules[i].OtherEndpoint = otherEndpointInt\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif v, ok := egressRulesMapStrToI[\"ip_prefix_set\"]; ok && !isIntfNil(v) && !otherEndpointTypeFound {\n\n\t\t\t\totherEndpointTypeFound = true\n\t\t\t\totherEndpointInt := &ves_io_schema_network_policy.NetworkPolicyRuleType_IpPrefixSet{}\n\t\t\t\totherEndpointInt.IpPrefixSet = &ves_io_schema.IpPrefixSetRefType{}\n\t\t\t\tegressRules[i].OtherEndpoint = otherEndpointInt\n\n\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\tfor _, set := range sl {\n\t\t\t\t\tcs := set.(map[string]interface{})\n\n\t\t\t\t\tif v, ok := cs[\"ref\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\tsl := v.([]interface{})\n\t\t\t\t\t\trefInt := make([]*ves_io_schema.ObjectRefType, len(sl))\n\t\t\t\t\t\totherEndpointInt.IpPrefixSet.Ref = refInt\n\t\t\t\t\t\tfor i, ps := range sl {\n\n\t\t\t\t\t\t\trMapToStrVal := ps.(map[string]interface{})\n\t\t\t\t\t\t\trefInt[i] = &ves_io_schema.ObjectRefType{}\n\n\t\t\t\t\t\t\trefInt[i].Kind = \"ip_prefix_set\"\n\n\t\t\t\t\t\t\tif v, ok := rMapToStrVal[\"name\"]; ok && !isIntfNil(v) {\n\t\t\t\t\t\t\t\trefInt[i].Name = v.(string)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif v, ok := rMapToStrVal[\"namespace\"]; ok && !isIntfNil(v) {\n\t\t\t\t\t\t\t\trefInt[i].Namespace = v.(string)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif v, ok := rMapToStrVal[\"tenant\"]; ok && !isIntfNil(v) {\n\t\t\t\t\t\t\t\trefInt[i].Tenant = v.(string)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif v, ok := rMapToStrVal[\"uid\"]; ok && !isIntfNil(v) {\n\t\t\t\t\t\t\t\trefInt[i].Uid = v.(string)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif v, ok := egressRulesMapStrToI[\"label_selector\"]; ok && !isIntfNil(v) && !otherEndpointTypeFound {\n\n\t\t\t\totherEndpointTypeFound = true\n\t\t\t\totherEndpointInt := &ves_io_schema_network_policy.NetworkPolicyRuleType_LabelSelector{}\n\t\t\t\totherEndpointInt.LabelSelector = &ves_io_schema.LabelSelectorType{}\n\t\t\t\tegressRules[i].OtherEndpoint = otherEndpointInt\n\n\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\tfor _, set := range sl {\n\t\t\t\t\tcs := set.(map[string]interface{})\n\n\t\t\t\t\tif v, ok := cs[\"expressions\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\tls := make([]string, len(v.([]interface{})))\n\t\t\t\t\t\tfor i, v := range v.([]interface{}) {\n\t\t\t\t\t\t\tls[i] = v.(string)\n\t\t\t\t\t\t}\n\t\t\t\t\t\totherEndpointInt.LabelSelector.Expressions = ls\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif v, ok := egressRulesMapStrToI[\"namespace\"]; ok && !isIntfNil(v) && !otherEndpointTypeFound {\n\n\t\t\t\totherEndpointTypeFound = true\n\t\t\t\totherEndpointInt := &ves_io_schema_network_policy.NetworkPolicyRuleType_Namespace{}\n\n\t\t\t\tegressRules[i].OtherEndpoint = otherEndpointInt\n\n\t\t\t\totherEndpointInt.Namespace = v.(string)\n\n\t\t\t}\n\n\t\t\tif v, ok := egressRulesMapStrToI[\"outside_endpoints\"]; ok && !isIntfNil(v) && !otherEndpointTypeFound {\n\n\t\t\t\totherEndpointTypeFound = true\n\n\t\t\t\tif v.(bool) {\n\t\t\t\t\totherEndpointInt := &ves_io_schema_network_policy.NetworkPolicyRuleType_OutsideEndpoints{}\n\t\t\t\t\totherEndpointInt.OutsideEndpoints = &ves_io_schema.Empty{}\n\t\t\t\t\tegressRules[i].OtherEndpoint = otherEndpointInt\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif v, ok := egressRulesMapStrToI[\"prefix_list\"]; ok && !isIntfNil(v) && !otherEndpointTypeFound {\n\n\t\t\t\totherEndpointTypeFound = true\n\t\t\t\totherEndpointInt := &ves_io_schema_network_policy.NetworkPolicyRuleType_PrefixList{}\n\t\t\t\totherEndpointInt.PrefixList = &ves_io_schema_views.PrefixStringListType{}\n\t\t\t\tegressRules[i].OtherEndpoint = otherEndpointInt\n\n\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\tfor _, set := range sl {\n\t\t\t\t\tcs := set.(map[string]interface{})\n\n\t\t\t\t\tif v, ok := cs[\"prefixes\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\tls := make([]string, len(v.([]interface{})))\n\t\t\t\t\t\tfor i, v := range v.([]interface{}) {\n\t\t\t\t\t\t\tls[i] = v.(string)\n\t\t\t\t\t\t}\n\t\t\t\t\t\totherEndpointInt.PrefixList.Prefixes = ls\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif w, ok := egressRulesMapStrToI[\"rule_description\"]; ok && !isIntfNil(w) {\n\t\t\t\tegressRules[i].RuleDescription = w.(string)\n\t\t\t}\n\n\t\t\tif w, ok := egressRulesMapStrToI[\"rule_name\"]; ok && !isIntfNil(w) {\n\t\t\t\tegressRules[i].RuleName = w.(string)\n\t\t\t}\n\n\t\t\ttrafficChoiceTypeFound := false\n\n\t\t\tif v, ok := egressRulesMapStrToI[\"all_tcp_traffic\"]; ok && !isIntfNil(v) && !trafficChoiceTypeFound {\n\n\t\t\t\ttrafficChoiceTypeFound = true\n\n\t\t\t\tif v.(bool) {\n\t\t\t\t\ttrafficChoiceInt := &ves_io_schema_network_policy.NetworkPolicyRuleType_AllTcpTraffic{}\n\t\t\t\t\ttrafficChoiceInt.AllTcpTraffic = &ves_io_schema.Empty{}\n\t\t\t\t\tegressRules[i].TrafficChoice = trafficChoiceInt\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif v, ok := egressRulesMapStrToI[\"all_traffic\"]; ok && !isIntfNil(v) && !trafficChoiceTypeFound {\n\n\t\t\t\ttrafficChoiceTypeFound = true\n\n\t\t\t\tif v.(bool) {\n\t\t\t\t\ttrafficChoiceInt := &ves_io_schema_network_policy.NetworkPolicyRuleType_AllTraffic{}\n\t\t\t\t\ttrafficChoiceInt.AllTraffic = &ves_io_schema.Empty{}\n\t\t\t\t\tegressRules[i].TrafficChoice = trafficChoiceInt\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif v, ok := egressRulesMapStrToI[\"all_udp_traffic\"]; ok && !isIntfNil(v) && !trafficChoiceTypeFound {\n\n\t\t\t\ttrafficChoiceTypeFound = true\n\n\t\t\t\tif v.(bool) {\n\t\t\t\t\ttrafficChoiceInt := &ves_io_schema_network_policy.NetworkPolicyRuleType_AllUdpTraffic{}\n\t\t\t\t\ttrafficChoiceInt.AllUdpTraffic = &ves_io_schema.Empty{}\n\t\t\t\t\tegressRules[i].TrafficChoice = trafficChoiceInt\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif v, ok := egressRulesMapStrToI[\"applications\"]; ok && !isIntfNil(v) && !trafficChoiceTypeFound {\n\n\t\t\t\ttrafficChoiceTypeFound = true\n\t\t\t\ttrafficChoiceInt := &ves_io_schema_network_policy.NetworkPolicyRuleType_Applications{}\n\t\t\t\ttrafficChoiceInt.Applications = &ves_io_schema_network_policy.ApplicationsType{}\n\t\t\t\tegressRules[i].TrafficChoice = trafficChoiceInt\n\n\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\tfor _, set := range sl {\n\t\t\t\t\tcs := set.(map[string]interface{})\n\n\t\t\t\t\tif v, ok := cs[\"applications\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\tapplicationsList := []ves_io_schema_network_policy.ApplicationEnumType{}\n\t\t\t\t\t\tfor _, j := range v.([]interface{}) {\n\t\t\t\t\t\t\tapplicationsList = append(applicationsList, ves_io_schema_network_policy.ApplicationEnumType(ves_io_schema_network_policy.ApplicationEnumType_value[j.(string)]))\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttrafficChoiceInt.Applications.Applications = applicationsList\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif v, ok := egressRulesMapStrToI[\"protocol_port_range\"]; ok && !isIntfNil(v) && !trafficChoiceTypeFound {\n\n\t\t\t\ttrafficChoiceTypeFound = true\n\t\t\t\ttrafficChoiceInt := &ves_io_schema_network_policy.NetworkPolicyRuleType_ProtocolPortRange{}\n\t\t\t\ttrafficChoiceInt.ProtocolPortRange = &ves_io_schema_network_policy.ProtocolPortType{}\n\t\t\t\tegressRules[i].TrafficChoice = trafficChoiceInt\n\n\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\tfor _, set := range sl {\n\t\t\t\t\tcs := set.(map[string]interface{})\n\n\t\t\t\t\tif v, ok := cs[\"port_ranges\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\tls := make([]string, len(v.([]interface{})))\n\t\t\t\t\t\tfor i, v := range v.([]interface{}) {\n\t\t\t\t\t\t\tls[i] = v.(string)\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttrafficChoiceInt.ProtocolPortRange.PortRanges = ls\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := cs[\"protocol\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\ttrafficChoiceInt.ProtocolPortRange.Protocol = v.(string)\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tif v, ok := d.GetOk(\"endpoint\"); ok && !isIntfNil(v) {\n\n\t\tsl := v.(*schema.Set).List()\n\t\tendpoint := &ves_io_schema_network_policy.EndpointChoiceType{}\n\t\tupdateSpec.Endpoint = endpoint\n\t\tfor _, set := range sl {\n\t\t\tendpointMapStrToI := set.(map[string]interface{})\n\n\t\t\tendpointChoiceTypeFound := false\n\n\t\t\tif v, ok := endpointMapStrToI[\"any\"]; ok && !isIntfNil(v) && !endpointChoiceTypeFound {\n\n\t\t\t\tendpointChoiceTypeFound = true\n\n\t\t\t\tif v.(bool) {\n\t\t\t\t\tendpointChoiceInt := &ves_io_schema_network_policy.EndpointChoiceType_Any{}\n\t\t\t\t\tendpointChoiceInt.Any = &ves_io_schema.Empty{}\n\t\t\t\t\tendpoint.EndpointChoice = endpointChoiceInt\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif v, ok := endpointMapStrToI[\"inside_endpoints\"]; ok && !isIntfNil(v) && !endpointChoiceTypeFound {\n\n\t\t\t\tendpointChoiceTypeFound = true\n\n\t\t\t\tif v.(bool) {\n\t\t\t\t\tendpointChoiceInt := &ves_io_schema_network_policy.EndpointChoiceType_InsideEndpoints{}\n\t\t\t\t\tendpointChoiceInt.InsideEndpoints = &ves_io_schema.Empty{}\n\t\t\t\t\tendpoint.EndpointChoice = endpointChoiceInt\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif v, ok := endpointMapStrToI[\"interface\"]; ok && !isIntfNil(v) && !endpointChoiceTypeFound {\n\n\t\t\t\tendpointChoiceTypeFound = true\n\t\t\t\tendpointChoiceInt := &ves_io_schema_network_policy.EndpointChoiceType_Interface{}\n\t\t\t\tendpointChoiceInt.Interface = &ves_io_schema_views.ObjectRefType{}\n\t\t\t\tendpoint.EndpointChoice = endpointChoiceInt\n\n\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\tfor _, set := range sl {\n\t\t\t\t\tcs := set.(map[string]interface{})\n\n\t\t\t\t\tif v, ok := cs[\"name\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\tendpointChoiceInt.Interface.Name = v.(string)\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := cs[\"namespace\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\tendpointChoiceInt.Interface.Namespace = v.(string)\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := cs[\"tenant\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\tendpointChoiceInt.Interface.Tenant = v.(string)\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif v, ok := endpointMapStrToI[\"label_selector\"]; ok && !isIntfNil(v) && !endpointChoiceTypeFound {\n\n\t\t\t\tendpointChoiceTypeFound = true\n\t\t\t\tendpointChoiceInt := &ves_io_schema_network_policy.EndpointChoiceType_LabelSelector{}\n\t\t\t\tendpointChoiceInt.LabelSelector = &ves_io_schema.LabelSelectorType{}\n\t\t\t\tendpoint.EndpointChoice = endpointChoiceInt\n\n\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\tfor _, set := range sl {\n\t\t\t\t\tcs := set.(map[string]interface{})\n\n\t\t\t\t\tif v, ok := cs[\"expressions\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\tls := make([]string, len(v.([]interface{})))\n\t\t\t\t\t\tfor i, v := range v.([]interface{}) {\n\t\t\t\t\t\t\tls[i] = v.(string)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tendpointChoiceInt.LabelSelector.Expressions = ls\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif v, ok := endpointMapStrToI[\"namespace\"]; ok && !isIntfNil(v) && !endpointChoiceTypeFound {\n\n\t\t\t\tendpointChoiceTypeFound = true\n\t\t\t\tendpointChoiceInt := &ves_io_schema_network_policy.EndpointChoiceType_Namespace{}\n\n\t\t\t\tendpoint.EndpointChoice = endpointChoiceInt\n\n\t\t\t\tendpointChoiceInt.Namespace = v.(string)\n\n\t\t\t}\n\n\t\t\tif v, ok := endpointMapStrToI[\"outside_endpoints\"]; ok && !isIntfNil(v) && !endpointChoiceTypeFound {\n\n\t\t\t\tendpointChoiceTypeFound = true\n\n\t\t\t\tif v.(bool) {\n\t\t\t\t\tendpointChoiceInt := &ves_io_schema_network_policy.EndpointChoiceType_OutsideEndpoints{}\n\t\t\t\t\tendpointChoiceInt.OutsideEndpoints = &ves_io_schema.Empty{}\n\t\t\t\t\tendpoint.EndpointChoice = endpointChoiceInt\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif v, ok := endpointMapStrToI[\"prefix_list\"]; ok && !isIntfNil(v) && !endpointChoiceTypeFound {\n\n\t\t\t\tendpointChoiceTypeFound = true\n\t\t\t\tendpointChoiceInt := &ves_io_schema_network_policy.EndpointChoiceType_PrefixList{}\n\t\t\t\tendpointChoiceInt.PrefixList = &ves_io_schema_views.PrefixStringListType{}\n\t\t\t\tendpoint.EndpointChoice = endpointChoiceInt\n\n\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\tfor _, set := range sl {\n\t\t\t\t\tcs := set.(map[string]interface{})\n\n\t\t\t\t\tif v, ok := cs[\"prefixes\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\tls := make([]string, len(v.([]interface{})))\n\t\t\t\t\t\tfor i, v := range v.([]interface{}) {\n\t\t\t\t\t\t\tls[i] = v.(string)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tendpointChoiceInt.PrefixList.Prefixes = ls\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tif v, ok := d.GetOk(\"ingress_rules\"); ok && !isIntfNil(v) {\n\n\t\tsl := v.([]interface{})\n\t\tingressRules := make([]*ves_io_schema_network_policy.NetworkPolicyRuleType, len(sl))\n\t\tupdateSpec.IngressRules = ingressRules\n\t\tfor i, set := range sl {\n\t\t\tingressRules[i] = &ves_io_schema_network_policy.NetworkPolicyRuleType{}\n\t\t\tingressRulesMapStrToI := set.(map[string]interface{})\n\n\t\t\tif v, ok := ingressRulesMapStrToI[\"action\"]; ok && !isIntfNil(v) {\n\n\t\t\t\tingressRules[i].Action = ves_io_schema_network_policy_rule.NetworkPolicyRuleAction(ves_io_schema_network_policy_rule.NetworkPolicyRuleAction_value[v.(string)])\n\n\t\t\t}\n\n\t\t\tif w, ok := ingressRulesMapStrToI[\"keys\"]; ok && !isIntfNil(w) {\n\t\t\t\tls := make([]string, len(w.([]interface{})))\n\t\t\t\tfor i, v := range w.([]interface{}) {\n\t\t\t\t\tls[i] = v.(string)\n\t\t\t\t}\n\t\t\t\tingressRules[i].Keys = ls\n\t\t\t}\n\n\t\t\tif v, ok := ingressRulesMapStrToI[\"label_matcher\"]; ok && !isIntfNil(v) {\n\n\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\tlabelMatcher := &ves_io_schema.LabelMatcherType{}\n\t\t\t\tingressRules[i].LabelMatcher = labelMatcher\n\t\t\t\tfor _, set := range sl {\n\t\t\t\t\tlabelMatcherMapStrToI := set.(map[string]interface{})\n\n\t\t\t\t\tif w, ok := labelMatcherMapStrToI[\"keys\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\tls := make([]string, len(w.([]interface{})))\n\t\t\t\t\t\tfor i, v := range w.([]interface{}) {\n\t\t\t\t\t\t\tls[i] = v.(string)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlabelMatcher.Keys = ls\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif v, ok := ingressRulesMapStrToI[\"metadata\"]; ok && !isIntfNil(v) {\n\n\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\tmetadata := &ves_io_schema.MessageMetaType{}\n\t\t\t\tingressRules[i].Metadata = metadata\n\t\t\t\tfor _, set := range sl {\n\t\t\t\t\tmetadataMapStrToI := set.(map[string]interface{})\n\n\t\t\t\t\tif w, ok := metadataMapStrToI[\"description\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\tmetadata.Description = w.(string)\n\t\t\t\t\t}\n\n\t\t\t\t\tif w, ok := metadataMapStrToI[\"disable\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\tmetadata.Disable = w.(bool)\n\t\t\t\t\t}\n\n\t\t\t\t\tif w, ok := metadataMapStrToI[\"name\"]; ok && !isIntfNil(w) {\n\t\t\t\t\t\tmetadata.Name = w.(string)\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\totherEndpointTypeFound := false\n\n\t\t\tif v, ok := ingressRulesMapStrToI[\"any\"]; ok && !isIntfNil(v) && !otherEndpointTypeFound {\n\n\t\t\t\totherEndpointTypeFound = true\n\n\t\t\t\tif v.(bool) {\n\t\t\t\t\totherEndpointInt := &ves_io_schema_network_policy.NetworkPolicyRuleType_Any{}\n\t\t\t\t\totherEndpointInt.Any = &ves_io_schema.Empty{}\n\t\t\t\t\tingressRules[i].OtherEndpoint = otherEndpointInt\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif v, ok := ingressRulesMapStrToI[\"inside_endpoints\"]; ok && !isIntfNil(v) && !otherEndpointTypeFound {\n\n\t\t\t\totherEndpointTypeFound = true\n\n\t\t\t\tif v.(bool) {\n\t\t\t\t\totherEndpointInt := &ves_io_schema_network_policy.NetworkPolicyRuleType_InsideEndpoints{}\n\t\t\t\t\totherEndpointInt.InsideEndpoints = &ves_io_schema.Empty{}\n\t\t\t\t\tingressRules[i].OtherEndpoint = otherEndpointInt\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif v, ok := ingressRulesMapStrToI[\"ip_prefix_set\"]; ok && !isIntfNil(v) && !otherEndpointTypeFound {\n\n\t\t\t\totherEndpointTypeFound = true\n\t\t\t\totherEndpointInt := &ves_io_schema_network_policy.NetworkPolicyRuleType_IpPrefixSet{}\n\t\t\t\totherEndpointInt.IpPrefixSet = &ves_io_schema.IpPrefixSetRefType{}\n\t\t\t\tingressRules[i].OtherEndpoint = otherEndpointInt\n\n\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\tfor _, set := range sl {\n\t\t\t\t\tcs := set.(map[string]interface{})\n\n\t\t\t\t\tif v, ok := cs[\"ref\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\tsl := v.([]interface{})\n\t\t\t\t\t\trefInt := make([]*ves_io_schema.ObjectRefType, len(sl))\n\t\t\t\t\t\totherEndpointInt.IpPrefixSet.Ref = refInt\n\t\t\t\t\t\tfor i, ps := range sl {\n\n\t\t\t\t\t\t\trMapToStrVal := ps.(map[string]interface{})\n\t\t\t\t\t\t\trefInt[i] = &ves_io_schema.ObjectRefType{}\n\n\t\t\t\t\t\t\trefInt[i].Kind = \"ip_prefix_set\"\n\n\t\t\t\t\t\t\tif v, ok := rMapToStrVal[\"name\"]; ok && !isIntfNil(v) {\n\t\t\t\t\t\t\t\trefInt[i].Name = v.(string)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif v, ok := rMapToStrVal[\"namespace\"]; ok && !isIntfNil(v) {\n\t\t\t\t\t\t\t\trefInt[i].Namespace = v.(string)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif v, ok := rMapToStrVal[\"tenant\"]; ok && !isIntfNil(v) {\n\t\t\t\t\t\t\t\trefInt[i].Tenant = v.(string)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif v, ok := rMapToStrVal[\"uid\"]; ok && !isIntfNil(v) {\n\t\t\t\t\t\t\t\trefInt[i].Uid = v.(string)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif v, ok := ingressRulesMapStrToI[\"label_selector\"]; ok && !isIntfNil(v) && !otherEndpointTypeFound {\n\n\t\t\t\totherEndpointTypeFound = true\n\t\t\t\totherEndpointInt := &ves_io_schema_network_policy.NetworkPolicyRuleType_LabelSelector{}\n\t\t\t\totherEndpointInt.LabelSelector = &ves_io_schema.LabelSelectorType{}\n\t\t\t\tingressRules[i].OtherEndpoint = otherEndpointInt\n\n\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\tfor _, set := range sl {\n\t\t\t\t\tcs := set.(map[string]interface{})\n\n\t\t\t\t\tif v, ok := cs[\"expressions\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\tls := make([]string, len(v.([]interface{})))\n\t\t\t\t\t\tfor i, v := range v.([]interface{}) {\n\t\t\t\t\t\t\tls[i] = v.(string)\n\t\t\t\t\t\t}\n\t\t\t\t\t\totherEndpointInt.LabelSelector.Expressions = ls\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif v, ok := ingressRulesMapStrToI[\"namespace\"]; ok && !isIntfNil(v) && !otherEndpointTypeFound {\n\n\t\t\t\totherEndpointTypeFound = true\n\t\t\t\totherEndpointInt := &ves_io_schema_network_policy.NetworkPolicyRuleType_Namespace{}\n\n\t\t\t\tingressRules[i].OtherEndpoint = otherEndpointInt\n\n\t\t\t\totherEndpointInt.Namespace = v.(string)\n\n\t\t\t}\n\n\t\t\tif v, ok := ingressRulesMapStrToI[\"outside_endpoints\"]; ok && !isIntfNil(v) && !otherEndpointTypeFound {\n\n\t\t\t\totherEndpointTypeFound = true\n\n\t\t\t\tif v.(bool) {\n\t\t\t\t\totherEndpointInt := &ves_io_schema_network_policy.NetworkPolicyRuleType_OutsideEndpoints{}\n\t\t\t\t\totherEndpointInt.OutsideEndpoints = &ves_io_schema.Empty{}\n\t\t\t\t\tingressRules[i].OtherEndpoint = otherEndpointInt\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif v, ok := ingressRulesMapStrToI[\"prefix_list\"]; ok && !isIntfNil(v) && !otherEndpointTypeFound {\n\n\t\t\t\totherEndpointTypeFound = true\n\t\t\t\totherEndpointInt := &ves_io_schema_network_policy.NetworkPolicyRuleType_PrefixList{}\n\t\t\t\totherEndpointInt.PrefixList = &ves_io_schema_views.PrefixStringListType{}\n\t\t\t\tingressRules[i].OtherEndpoint = otherEndpointInt\n\n\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\tfor _, set := range sl {\n\t\t\t\t\tcs := set.(map[string]interface{})\n\n\t\t\t\t\tif v, ok := cs[\"prefixes\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\tls := make([]string, len(v.([]interface{})))\n\t\t\t\t\t\tfor i, v := range v.([]interface{}) {\n\t\t\t\t\t\t\tls[i] = v.(string)\n\t\t\t\t\t\t}\n\t\t\t\t\t\totherEndpointInt.PrefixList.Prefixes = ls\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif w, ok := ingressRulesMapStrToI[\"rule_description\"]; ok && !isIntfNil(w) {\n\t\t\t\tingressRules[i].RuleDescription = w.(string)\n\t\t\t}\n\n\t\t\tif w, ok := ingressRulesMapStrToI[\"rule_name\"]; ok && !isIntfNil(w) {\n\t\t\t\tingressRules[i].RuleName = w.(string)\n\t\t\t}\n\n\t\t\ttrafficChoiceTypeFound := false\n\n\t\t\tif v, ok := ingressRulesMapStrToI[\"all_tcp_traffic\"]; ok && !isIntfNil(v) && !trafficChoiceTypeFound {\n\n\t\t\t\ttrafficChoiceTypeFound = true\n\n\t\t\t\tif v.(bool) {\n\t\t\t\t\ttrafficChoiceInt := &ves_io_schema_network_policy.NetworkPolicyRuleType_AllTcpTraffic{}\n\t\t\t\t\ttrafficChoiceInt.AllTcpTraffic = &ves_io_schema.Empty{}\n\t\t\t\t\tingressRules[i].TrafficChoice = trafficChoiceInt\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif v, ok := ingressRulesMapStrToI[\"all_traffic\"]; ok && !isIntfNil(v) && !trafficChoiceTypeFound {\n\n\t\t\t\ttrafficChoiceTypeFound = true\n\n\t\t\t\tif v.(bool) {\n\t\t\t\t\ttrafficChoiceInt := &ves_io_schema_network_policy.NetworkPolicyRuleType_AllTraffic{}\n\t\t\t\t\ttrafficChoiceInt.AllTraffic = &ves_io_schema.Empty{}\n\t\t\t\t\tingressRules[i].TrafficChoice = trafficChoiceInt\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif v, ok := ingressRulesMapStrToI[\"all_udp_traffic\"]; ok && !isIntfNil(v) && !trafficChoiceTypeFound {\n\n\t\t\t\ttrafficChoiceTypeFound = true\n\n\t\t\t\tif v.(bool) {\n\t\t\t\t\ttrafficChoiceInt := &ves_io_schema_network_policy.NetworkPolicyRuleType_AllUdpTraffic{}\n\t\t\t\t\ttrafficChoiceInt.AllUdpTraffic = &ves_io_schema.Empty{}\n\t\t\t\t\tingressRules[i].TrafficChoice = trafficChoiceInt\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif v, ok := ingressRulesMapStrToI[\"applications\"]; ok && !isIntfNil(v) && !trafficChoiceTypeFound {\n\n\t\t\t\ttrafficChoiceTypeFound = true\n\t\t\t\ttrafficChoiceInt := &ves_io_schema_network_policy.NetworkPolicyRuleType_Applications{}\n\t\t\t\ttrafficChoiceInt.Applications = &ves_io_schema_network_policy.ApplicationsType{}\n\t\t\t\tingressRules[i].TrafficChoice = trafficChoiceInt\n\n\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\tfor _, set := range sl {\n\t\t\t\t\tcs := set.(map[string]interface{})\n\n\t\t\t\t\tif v, ok := cs[\"applications\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\tapplicationsList := []ves_io_schema_network_policy.ApplicationEnumType{}\n\t\t\t\t\t\tfor _, j := range v.([]interface{}) {\n\t\t\t\t\t\t\tapplicationsList = append(applicationsList, ves_io_schema_network_policy.ApplicationEnumType(ves_io_schema_network_policy.ApplicationEnumType_value[j.(string)]))\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttrafficChoiceInt.Applications.Applications = applicationsList\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif v, ok := ingressRulesMapStrToI[\"protocol_port_range\"]; ok && !isIntfNil(v) && !trafficChoiceTypeFound {\n\n\t\t\t\ttrafficChoiceTypeFound = true\n\t\t\t\ttrafficChoiceInt := &ves_io_schema_network_policy.NetworkPolicyRuleType_ProtocolPortRange{}\n\t\t\t\ttrafficChoiceInt.ProtocolPortRange = &ves_io_schema_network_policy.ProtocolPortType{}\n\t\t\t\tingressRules[i].TrafficChoice = trafficChoiceInt\n\n\t\t\t\tsl := v.(*schema.Set).List()\n\t\t\t\tfor _, set := range sl {\n\t\t\t\t\tcs := set.(map[string]interface{})\n\n\t\t\t\t\tif v, ok := cs[\"port_ranges\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\tls := make([]string, len(v.([]interface{})))\n\t\t\t\t\t\tfor i, v := range v.([]interface{}) {\n\t\t\t\t\t\t\tls[i] = v.(string)\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttrafficChoiceInt.ProtocolPortRange.PortRanges = ls\n\n\t\t\t\t\t}\n\n\t\t\t\t\tif v, ok := cs[\"protocol\"]; ok && !isIntfNil(v) {\n\n\t\t\t\t\t\ttrafficChoiceInt.ProtocolPortRange.Protocol = v.(string)\n\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t}\n\n\t}\n\n\tlog.Printf(\"[DEBUG] Updating Volterra NetworkPolicyView obj with struct: %+v\", updateReq)\n\n\terr := client.ReplaceObject(context.Background(), ves_io_schema_views_network_policy_view.ObjectType, updateReq)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error updating NetworkPolicyView: %s\", err)\n\t}\n\n\treturn resourceVolterraNetworkPolicyViewRead(d, meta)\n}",
"func UpdatePriorityAcl(session *xorm.Session, lenNewAcl int, pointPriority int) (err error) {\n _, err = session.Exec(\"Update data_acls set priority = priority + ? where priority >= ?\", lenNewAcl, pointPriority)\n return\n}",
"func (s *natsServer) updateResource(msg *nats.Msg) wyc.Marshalable {\n\treturn s.genericUpdateFacets(msg, s.handler.UpdateResourceFacets)\n}",
"func updateResource(ctx context.Context, r *podops.Resource) error {\n\tif _, err := ds.DataStore().Put(ctx, resourceKey(r.GUID), r); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}",
"func (g *GCEAlphaNetworkFirewallPolicies) PatchRule(ctx context.Context, key *meta.Key, arg0 *alpha.FirewallPolicyRule) error {\n\tklog.V(5).Infof(\"GCEAlphaNetworkFirewallPolicies.PatchRule(%v, %v, ...): called\", ctx, key)\n\n\tif !key.Valid() {\n\t\tklog.V(2).Infof(\"GCEAlphaNetworkFirewallPolicies.PatchRule(%v, %v, ...): key is invalid (%#v)\", ctx, key, key)\n\t\treturn fmt.Errorf(\"invalid GCE key (%+v)\", key)\n\t}\n\tprojectID := g.s.ProjectRouter.ProjectID(ctx, \"alpha\", \"NetworkFirewallPolicies\")\n\trk := &RateLimitKey{\n\t\tProjectID: projectID,\n\t\tOperation: \"PatchRule\",\n\t\tVersion: meta.Version(\"alpha\"),\n\t\tService: \"NetworkFirewallPolicies\",\n\t}\n\tklog.V(5).Infof(\"GCEAlphaNetworkFirewallPolicies.PatchRule(%v, %v, ...): projectID = %v, rk = %+v\", ctx, key, projectID, rk)\n\n\tif err := g.s.RateLimiter.Accept(ctx, rk); err != nil {\n\t\tklog.V(4).Infof(\"GCEAlphaNetworkFirewallPolicies.PatchRule(%v, %v, ...): RateLimiter error: %v\", ctx, key, err)\n\t\treturn err\n\t}\n\tcall := g.s.Alpha.NetworkFirewallPolicies.PatchRule(projectID, key.Name, arg0)\n\tcall.Context(ctx)\n\top, err := call.Do()\n\tif err != nil {\n\t\tklog.V(4).Infof(\"GCEAlphaNetworkFirewallPolicies.PatchRule(%v, %v, ...) = %+v\", ctx, key, err)\n\t\treturn err\n\t}\n\terr = g.s.WaitForCompletion(ctx, op)\n\tklog.V(4).Infof(\"GCEAlphaNetworkFirewallPolicies.PatchRule(%v, %v, ...) = %+v\", ctx, key, err)\n\treturn err\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
HandleConnectAccountRequest handle connect account requests
|
func HandleConnectAccountRequest(r api.APIRequest) (api.APIResponse, error) {
var method = strings.ToUpper(r.HTTPMethod)
bID, err := shared.ParseBusinessID(r.GetPathParam("businessId"))
if err != nil {
return api.BadRequestError(r, err)
}
switch method {
case http.MethodPost:
return connectBankAccount(r, bID)
default:
return api.NotSupported(r)
}
}
|
[
"func (ap *HttpHandler) ConnectHandler(w http.ResponseWriter, r *http.Request) {\n\tvar creds WpaCredentials\n\tmarshallPost(w, r, &creds)\n\n\tlog.Info(\"Connect Handler Got: ssid:|%s| psk:|redacted|\", creds.Ssid)\n\n\tgo ap.wpacfg.ConnectNetwork(creds)\n\n\tapiReturn := &ApiReturn{\n\t\tStatus: \"OK\",\n\t\tMessage: \"Connection\",\n\t\tPayload: \"Attempting to connect to \" + creds.Ssid,\n\t}\n\n\tret, err := json.Marshal(apiReturn)\n\tif err != nil {\n\t\tretError(w, err)\n\t\treturn\n\t}\n\n\tw.Header().Set(\"Content-Type\", \"application/json\")\n\tw.Write(ret)\n\tap.signal <- \"CL\"\n}",
"func (conn *Conn) handleConnectionRequest(b *bytes.Buffer) error {\n\tpacket := &connectionRequest{}\n\tif err := binary.Read(b, binary.BigEndian, packet); err != nil {\n\t\treturn fmt.Errorf(\"error reading connection request: %v\", err)\n\t}\n\tb.Reset()\n\n\tif err := b.WriteByte(idConnectionRequestAccepted); err != nil {\n\t\treturn fmt.Errorf(\"error writing connection request accepted ID: %v\", err)\n\t}\n\taddr := rakAddr(*conn.addr.(*net.UDPAddr))\n\tdata, err := (&addr).MarshalBinary()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error encoding connection request accepted client address: %v\", err)\n\t}\n\tif _, err := b.Write(data); err != nil {\n\t\treturn fmt.Errorf(\"error writing connection request accepted client address: %v\", err)\n\t}\n\t_ = binary.Write(b, binary.BigEndian, int16(0))\n\tfor i := 0; i < 20; i++ {\n\t\t// The middle of the connection request accepted packet has 20 system addresses. We write these\n\t\t// separately.\n\t\tvar addr *rakAddr\n\t\tencodedAddr, err := addr.MarshalBinary()\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"error encoding connection request accepted system address: %v\", err)\n\t\t}\n\t\tif _, err := b.Write(encodedAddr); err != nil {\n\t\t\treturn fmt.Errorf(\"error writing connection request accepted system address: %v\", err)\n\t\t}\n\t}\n\tresponse := &connectionRequestAccepted{RequestTimestamp: packet.RequestTimestamp, AcceptedTimestamp: timestamp()}\n\tif err := binary.Write(b, binary.BigEndian, response); err != nil {\n\t\treturn fmt.Errorf(\"error writing connection request accepted: %v\", err)\n\t}\n\tif _, err := conn.Write(b.Bytes()); err != nil {\n\t\treturn fmt.Errorf(\"error sending connection request accepted: %v\", err)\n\t}\n\n\treturn nil\n}",
"func HandleAccount(cf cfg.Cfg) http.HandlerFunc {\n\treturn func(w http.ResponseWriter, r *http.Request) {\n\t\taddr := bone.GetValue(r, \"address\")\n\t\taddrs := []string{addr}\n\t\tprocessAccounts(w, cf.Node, addrs)\n\t}\n}",
"func QueryAccountHandler(w http.ResponseWriter, r *http.Request) {\n\tvars := mux.Vars(r)\n\tchain, err := config.Chains.Get(vars[\"chain-id\"])\n\tif err != nil {\n\t\thelpers.WriteErrorResponse(http.StatusBadRequest, err, w)\n\t\treturn\n\t}\n\n\tres, err := authtypes.NewQueryClient(chain.CLIContext(0)).Account(\n\t\tcontext.Background(),\n\t\t&authtypes.QueryAccountRequest{\n\t\t\tAddress: vars[\"address\"],\n\t\t})\n\tif err != nil {\n\t\thelpers.WriteErrorResponse(http.StatusInternalServerError, err, w)\n\t\treturn\n\t}\n\thelpers.SuccessProtoResponse(http.StatusOK, chain, res, w)\n}",
"func (sc *SamsClub) handleAccount(a *Account) {\n\tvar err error\n\n\tfor {\n\t\ttime.Sleep(time.Second)\n\n\t\tif len(sc.ProxyList) == 0 {\n\t\t\tcontinue\n\t\t}\n\n\t\tlog.Printf(\"%s:%s\\n\", a.Email, a.Password)\n\t\ta.GenerateUserAgent()\n\n\t\tif err = a.ConnectToProxy(sc.ProxyList); err != nil {\n\t\t\tcontinue\n\t\t}\n\n\t\tif err = a.GenerateToken(sc.ExecPath); err != nil {\n\t\t\tcontinue\n\t\t}\n\n\t\tif err = a.Authenticate(); err != nil {\n\t\t\tcontinue\n\t\t}\n\n\t\tif a.Valid {\n\t\t\tif err = a.ListCards(); err != nil {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\n\t\tsc.Accounts <- a\n\t\tbreak\n\t}\n}",
"func handleLinkChainAccountPacketData(\n\tam AppModule, ctx sdk.Context, packet channeltypes.Packet,\n) (handled bool, ack channeltypes.Acknowledgement, err error) {\n\tvar packetData types.LinkChainAccountPacketData\n\tif err := types.ModuleCdc.UnmarshalJSON(packet.GetData(), &packetData); err != nil {\n\t\treturn false, channeltypes.Acknowledgement{}, nil\n\t}\n\n\tvar acknowledgement channeltypes.Acknowledgement\n\n\tpacketAck, err := am.keeper.OnRecvLinkChainAccountPacket(ctx, packetData)\n\tif err != nil {\n\t\tacknowledgement = channeltypes.NewErrorAcknowledgement(err.Error())\n\t} else {\n\t\t// Encode packet acknowledgment\n\t\tpacketAckBytes, err := packetAck.Marshal()\n\t\tif err != nil {\n\t\t\treturn true, channeltypes.Acknowledgement{}, sdkerrors.Wrap(sdkerrors.ErrJSONMarshal, err.Error())\n\t\t}\n\t\tacknowledgement = channeltypes.NewResultAcknowledgement(packetAckBytes)\n\t}\n\n\taddress, err := types.UnpackAddressData(am.cdc, packetData.SourceAddress)\n\tif err != nil {\n\t\treturn true, channeltypes.Acknowledgement{}, err\n\t}\n\n\tctx.EventManager().EmitEvent(\n\t\tsdk.NewEvent(\n\t\t\ttypes.EventTypeLinkChainAccountPacket,\n\t\t\tsdk.NewAttribute(sdk.AttributeKeyModule, types.ModuleName),\n\t\t\tsdk.NewAttribute(types.AttributeChainLinkSourceAddress, address.GetValue()),\n\t\t\tsdk.NewAttribute(types.AttributeChainLinkSourceChainName, packetData.SourceChainConfig.Name),\n\t\t\tsdk.NewAttribute(types.AttributeChainLinkDestinationAddress, packetData.DestinationAddress),\n\t\t\tsdk.NewAttribute(types.AttributeKeyAckSuccess, fmt.Sprintf(\"%t\", true)),\n\t\t),\n\t)\n\n\treturn true, acknowledgement, nil\n}",
"func (coord *Coordinator) handleConnectDone(conn net.Conn) {\n\treallog.Print(\"Receive Conformation shard is connected sucessfuly\")\n\tcoord.ConnectedOut <- true\n}",
"func (receiver *storageRPCReceiver) Connect(args *AuthArgs, reply *VoidReply) (err error) {\n\treturn args.Authenticate()\n}",
"func (p *Proxy) handleConnect(w http.ResponseWriter) {\n\thj, ok := w.(http.Hijacker)\n\tif !ok {\n\t\tp.logger.Errorw(\"ResponseWriter is not a http.Hijacker.\",\n\t\t\t\"type\", fmt.Sprintf(\"%T\", w))\n\t\twriteError(w, http.StatusServiceUnavailable)\n\n\t\treturn\n\t}\n\n\tw.WriteHeader(http.StatusOK)\n\n\tclientConn, _, err := hj.Hijack()\n\tif err != nil {\n\t\tp.logger.Errorw(\"Hijacking client connection failed.\",\n\t\t\t\"error\", err)\n\t\twriteError(w, http.StatusServiceUnavailable)\n\n\t\treturn\n\t}\n\tdefer clientConn.Close()\n\n\t// Secure connection to client.\n\ttlsConn, err := p.clientTLSConn(clientConn)\n\tif err != nil {\n\t\tp.logger.Errorw(\"Securing client connection failed.\",\n\t\t\t\"error\", err,\n\t\t\t\"remoteAddr\", clientConn.RemoteAddr().String())\n\n\t\treturn\n\t}\n\n\tclientConnNotify := ConnNotify{tlsConn, make(chan struct{})}\n\tl := &OnceAcceptListener{clientConnNotify.Conn}\n\n\terr = http.Serve(l, p)\n\tif err != nil && !errors.Is(err, ErrAlreadyAccepted) {\n\t\tp.logger.Errorw(\"Serving HTTP request failed.\",\n\t\t\t\"error\", err)\n\t}\n\n\t<-clientConnNotify.closed\n}",
"func (r User_Customer_OpenIdConnect) GetAccount() (resp datatypes.Account, err error) {\n\terr = r.Session.DoRequest(\"SoftLayer_User_Customer_OpenIdConnect\", \"getAccount\", nil, &r.Options, &resp)\n\treturn\n}",
"func Connect(req ConnectRequest) (ConnectResponse, error) {\n\tg, err := getOrCreateGame(req.Token, req.GameName, req.NoOfPlayers, req.TotalRounds)\n\tif err != nil {\n\t\treturn ConnectResponse{}, errors.Wrap(err, \"could not connect to game\")\n\t}\n\tlogger.Infof(\"Game with id %s was created\", g.id.String())\n\tp := getOrCreatePlayer(req.PlayerName, req.EventCallback)\n\tif len(g.players) >= g.numberOfPlayers {\n\t\terr := errors.New(\"all players are already connected\")\n\t\treturn ConnectResponse{}, errors.Wrap(err, \"could not connect to game\")\n\t}\n\tg.players[p.ID] = p\n\tlogger.Infof(\"Player with id %s joined the game with id %s\", p.ID.String(), g.id.String())\n\tif len(g.players) == g.numberOfPlayers {\n\t\tgo tryStartGame(g)\n\t}\n\treturn ConnectResponse{GameID: g.id, Player: *p, Rounds: g.totalRounds}, nil\n}",
"func (conn *Conn) handleConnectionRequestAccepted(b *bytes.Buffer) error {\n\tb.Reset()\n\n\tif err := b.WriteByte(idNewIncomingConnection); err != nil {\n\t\treturn fmt.Errorf(\"error writing new incoming connection ID: %v\", err)\n\t}\n\taddr := rakAddr(*conn.addr.(*net.UDPAddr))\n\tdata, err := (&addr).MarshalBinary()\n\tif err != nil {\n\t\treturn fmt.Errorf(\"error encoding new incoming ocnnection server address: %v\", err)\n\t}\n\tif _, err := b.Write(data); err != nil {\n\t\treturn fmt.Errorf(\"error writing new incoming connection server address: %v\", err)\n\t}\n\tfor i := 0; i < 20; i++ {\n\t\t// The middle of the connection request accepted packet has 20 system addresses. We write these\n\t\t// separately.\n\t\tvar addr *rakAddr\n\t\tencodedAddr, err := addr.MarshalBinary()\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"error encoding new incoming connection system address: %v\", err)\n\t\t}\n\t\tif _, err := b.Write(encodedAddr); err != nil {\n\t\t\treturn fmt.Errorf(\"error writing new incoming connection system address: %v\", err)\n\t\t}\n\t}\n\t// We fill out nonsense timestamps as RakNet doesn't REALLY care about these.\n\tresponse := &newIncomingConnection{RequestTimestamp: timestamp(), AcceptedTimestamp: timestamp()}\n\tif err := binary.Write(b, binary.BigEndian, response); err != nil {\n\t\treturn fmt.Errorf(\"error writing new incoming connection: %v\", err)\n\t}\n\tif _, err := conn.Write(b.Bytes()); err != nil {\n\t\treturn fmt.Errorf(\"error sending new incoming connection: %v\", err)\n\t}\n\n\tconn.finishSequence()\n\treturn nil\n}",
"func (*Service) Connect(ctx context.Context, req *ConnectionRequest) (*ConnectionResponse, error) {\n\tdata := req.GetData()\n\tnetworkConfig := data.GetNetworkConfig()\n\tpatternMatchers := data.GetPattenMatchers()\n\tif networkConfig == \"\" {\n\t\tnetworkConfig = defaultConfig.NetworkConfig\n\t\tif patternMatchers == \"\" {\n\t\t\tpatternMatchers = defaultConfig.PattenMatchers\n\t\t}\n\t}\n\tchannelID := data.GetChannelId()\n\tif channelID == \"\" {\n\t\tchannelID = defaultConfig.ChannelId\n\t}\n\tuserName := data.GetUserName()\n\tif userName == \"\" {\n\t\tuserName = defaultConfig.UserName\n\t}\n\torgName := data.GetOrgName()\n\tif orgName == \"\" {\n\t\torgName = defaultConfig.OrgName\n\t}\n\n\tclient, err := NewNetworkClient(networkConfig, patternMatchers, channelID, userName, orgName)\n\tif err != nil {\n\t\tglog.Errorf(\"Failed Fabric connection for channel %s: %+v\", channelID, err)\n\t\treturn nil, err\n\t}\n\tglog.V(2).Infof(\"Return fabric connection id %d\", client.cid)\n\treturn &ConnectionResponse{\n\t\tCode: 200,\n\t\tConnectionId: client.cid,\n\t}, nil\n}",
"func connect(writer http.ResponseWriter, request *http.Request) {\n\thttp.Redirect(writer, request, services.GetAuthorizeUrl(), http.StatusFound)\n}",
"func (s *service) Connect(ctx context.Context, r *taskAPI.ConnectRequest) (_ *taskAPI.ConnectResponse, err error) {\n\tshimLog.WithField(\"container\", r.ID).Debug(\"Connect() start\")\n\tdefer shimLog.WithField(\"container\", r.ID).Debug(\"Connect() end\")\n\tspan, _ := katatrace.Trace(s.rootCtx, shimLog, \"Connect\", shimTracingTags)\n\tdefer span.End()\n\n\tstart := time.Now()\n\tdefer func() {\n\t\terr = toGRPC(err)\n\t\trpcDurationsHistogram.WithLabelValues(\"connect\").Observe(float64(time.Since(start).Nanoseconds() / int64(time.Millisecond)))\n\t}()\n\n\ts.mu.Lock()\n\tdefer s.mu.Unlock()\n\n\treturn &taskAPI.ConnectResponse{\n\t\tShimPid: s.pid,\n\t\t//Since kata cannot get the container's pid in VM, thus only return the hypervisor's pid.\n\t\tTaskPid: s.hpid,\n\t}, nil\n}",
"func (env *Env) ConnectHandler(w http.ResponseWriter, r *http.Request) {\n\tvars := mux.Vars(r)\n\tconversationID, err := strconv.ParseInt(vars[\"conversation_id\"], 10, 64)\n\tif err != nil {\n\t\terrMsg := \"Invalid conversation ID\"\n\t\tlog.Println(errMsg + \": \" + err.Error())\n\t\thttp.Error(w, errMsg, http.StatusBadRequest)\n\t\treturn\n\t}\n\n\tc, err := upgrader.Upgrade(w, r, nil)\n\tif err != nil {\n\t\tlog.Print(\"Upgrade to WebSocket failed: \", err)\n\t\treturn\n\t}\n\n\tgo env.WSBroker.StartClient(conversationID, c)\n}",
"func RegisterConnectCallback(callback ConnectHandlerFunc) {\n\tconnectCallback = callback\n}",
"func (a *MealPlanningApiService) ConnectUser(ctx context.Context) ApiConnectUserRequest {\n\treturn ApiConnectUserRequest{\n\t\tApiService: a,\n\t\tctx: ctx,\n\t}\n}",
"func (s *Server) processConnect(c *Client, pk packets.Packet) error {\n\ts.closeClient(c, true)\n\treturn nil\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
RefBool returns a pointer to a newly created bool.
|
func RefBool(value bool) *bool {
return &value
}
|
[
"func TestBoolPtr(b bool) *bool {\n\treturn &b\n}",
"func TruePtr() *bool {\n\tval := true\n\treturn &val\n}",
"func makeBoolPtr(b bool) *bool {\n\treturn &b\n}",
"func BoolAsPTR(value bool) *bool {\n\treturn &value\n}",
"func BoolPtr(literal bool) *bool {\n\treturn &literal\n}",
"func BoolToPointer(value bool) *bool {\n\treturn &value\n}",
"func (r *Reader) BoolPtr(v **bool) {\n\tsize := r.Alloc()\n\tif size == 0 {\n\t\treturn\n\t}\n\ti := r.decUint8s[0]\n\tval := false\n\tr.decUint8s = r.decUint8s[1:]\n\tif i == 1 {\n\t\tval = true\n\t}\n\t*v = &val\n}",
"func boolPointer(value bool) *bool {\n\tif value {\n\t\treturn truePointer\n\t}\n\treturn falsePointer\n}",
"func DerefBool(b *bool) bool {\n\tif b != nil {\n\t\treturn *b\n\t}\n\treturn false\n}",
"func newBool() *Bool {\n\tboolean := new(Bool)\n\tboolean.mtx = &sync.Mutex{}\n\treturn boolean\n}",
"func FalsePtr() *bool {\n\tval := false\n\treturn &val\n}",
"func BoolToPtr(g GenericCLIResult) *bool {\n\tif !g.IsSet() {\n\t\treturn nil\n\t}\n\tnewT := g.Value().(bool)\n\treturn &newT\n}",
"func NewBool() *Bool {\n\treturn &Bool{\n\t\tCreatedDate: time.Now(),\n\t\tModified: time.Now(),\n\t\tlock: &sync.Mutex{},\n\t}\n}",
"func newBool(f *kingpin.FlagClause, v interface{}) *bool {\n\tif v == nil {\n\t\tb := false\n\t\tf.BoolVar(&b)\n\t\treturn &b\n\t}\n\tb := v.(*bool)\n\tf.BoolVar(b)\n\treturn b\n}",
"func NewBool(v bool) *Bool {\n\treturn &Bool{v: v}\n}",
"func JSValueMakeBoolean(ctx JSContextRef, boolean bool) JSValueRef {\n\tcctx, cctxAllocMap := *(*C.JSContextRef)(unsafe.Pointer(&ctx)), cgoAllocsUnknown\n\tcboolean, cbooleanAllocMap := (C._Bool)(boolean), cgoAllocsUnknown\n\t__ret := C.JSValueMakeBoolean(cctx, cboolean)\n\truntime.KeepAlive(cbooleanAllocMap)\n\truntime.KeepAlive(cctxAllocMap)\n\t__v := *(*JSValueRef)(unsafe.Pointer(&__ret))\n\treturn __v\n}",
"func (c *TestConfig) GetBoolPtr(ns, key string) (*bool, error) {\n\tnskey := nskey(ns, key)\n\tif !c.v.IsSet(nskey) {\n\t\treturn nil, nil\n\t}\n\tval := c.v.GetBool(nskey)\n\treturn &val, nil\n}",
"func NewBool() *Coder {\n\treturn &Coder{Kind: Bool, T: typex.New(reflectx.Bool)}\n}",
"func (c *LiveConfig) GetBoolPtr(ns, key string) (*bool, error) {\n\tif !c.IsSet(key) {\n\t\treturn nil, nil\n\t}\n\tval := viper.GetBool(nskey(ns, key))\n\treturn &val, nil\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
RefUint returns a pointer to a newly created uint.
|
func RefUint(value uint) *uint {
return &value
}
|
[
"func RefUint64(value uint64) *uint64 {\n\treturn &value\n}",
"func RefUint32(value uint32) *uint32 {\n\treturn &value\n}",
"func Uint(name string, value uint, usage string) *uint",
"func NewUint64(u uint64) *uint64 { return &u }",
"func RefUint16(value uint16) *uint16 {\n\treturn &value\n}",
"func RefUint8(value uint8) *uint8 {\n\treturn &value\n}",
"func AddUintptrRelease(addr *uintptr, value uintptr) uintptr",
"func NewUint(value uint64) datamodel.Node {\n\treturn plainUint(value)\n}",
"func (r *Reader) UintPtr(v **uint) {\n\tsize := r.Alloc()\n\tif size == 0 {\n\t\treturn\n\t}\n\ti := r.decUints[0]\n\tr.decUints = r.decUints[1:]\n\t*v = &i\n}",
"func Uint(v *uint) uint {\n\tif v == nil {\n\t\treturn 0\n\t}\n\treturn *v\n}",
"func AddUintptrConsume(addr *uintptr, value uintptr) uintptr",
"func StoreUintptrRelease(addr *uintptr, val uintptr)",
"func LoadUintptrConsume(addr *uintptr) uintptr",
"func Uint(name string, value uint, usage string) *uint {\n\treturn Configuration.Uint(name, value, usage)\n}",
"func NewUintFlag(flagSet *pflag.FlagSet, name string, defaultValue uint, description string, apply func(values *charts.Values, value uint) error) *UintFlag {\n\tflag := UintFlag{\n\t\tname: name,\n\t\tflagSet: flagSet,\n\t\tapply: apply,\n\t}\n\tflagSet.UintVar(&flag.Value, name, defaultValue, description)\n\treturn &flag\n}",
"func Uint64ToPtrUint(uint64_ uint64) (ptr_uint_ *uint) {\n\tptr_uint_ = new(uint)\n\n\t*ptr_uint_ = uint(uint64_)\n\n\treturn\n}",
"func (v Uint) Uint() uint {\n\tif !v.Valid() {\n\t\treturn 0\n\t}\n\treturn uint(v.uint)\n}",
"func Uint(i *uint) uint {\n\treturn UintOrDefault(i, 0)\n}",
"func Uint16ToPtrUint(uint16_ uint16) (ptr_uint_ *uint) {\n\tptr_uint_ = new(uint)\n\n\t*ptr_uint_ = uint(uint16_)\n\n\treturn\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
RefUint8 returns a pointer to a newly created uint8.
|
func RefUint8(value uint8) *uint8 {
return &value
}
|
[
"func RefInt8(value int8) *int8 {\n\treturn &value\n}",
"func NewUint8(v uint8) Value {\n\treturn MakeTrusted(Uint8, strconv.AppendUint(nil, uint64(v), 10))\n}",
"func (r *Reader) Uint8Ptr(v **uint8) {\n\tsize := r.Alloc()\n\tif size == 0 {\n\t\treturn\n\t}\n\ti := r.decUint8s[0]\n\tr.decUint8s = r.decUint8s[1:]\n\t*v = &i\n}",
"func Uint8(from uint64, defaultValue ...uint8) Uint8Accessor {\n\tnv := &NullUint8{}\n\tif safe := isSafeUint(from, 8); !safe {\n\t\tnv.Error = ErrConvert\n\t\tif defaultUint8(nv, defaultValue...) {\n\t\t\treturn nv\n\t\t}\n\t}\n\tv := uint8(from)\n\tnv.P = &v\n\treturn nv\n}",
"func Uint8(v *uint8) uint8 {\n\tif v == nil {\n\t\treturn 0\n\t}\n\treturn *v\n}",
"func (seg *Segment) Uint8(offset int64) *uint8 {\n\treturn (*uint8)(unsafe.Pointer(seg.Pointer(offset, Uint8Size)))\n}",
"func (b *Buffer) GetUint8(offset int) uint8 {\n if b.err != nil { return 0 }\n if offset < 0 || offset >= len(b.buf) { b.err = ietools.ErrOffsetOutOfRange; return 0 }\n return b.buf[offset]\n}",
"func Uint8(macro Token, u uint8) Value {\n\treturn Value{macro, \"\", uint64(u), typeUint, nil}\n}",
"func Uint8(v uint8) Value {\n\treturn Value{bits: bits(TypeUint8) | bitsConst, vInt: int64(v)}\n}",
"func (d *Decoder) Uint8() (v uint8, err error) {\n\tv, err = decodeUint8(d.r)\n\treturn\n}",
"func (r *Decoder) Uint8() uint8 {\n\tb := r.buf[0]\n\tr.buf = r.buf[1:]\n\treturn b\n}",
"func RefUint(value uint) *uint {\n\treturn &value\n}",
"func FloatUint8(from float64, defaultValue ...uint8) Uint8Accessor {\n\tnv := &NullUint8{}\n\tif safe := isSafeFloatToUint(float64(from), 64, 8); !safe {\n\t\tnv.Error = ErrConvert\n\t\tif defaultUint8(nv, defaultValue...) {\n\t\t\treturn nv\n\t\t}\n\t}\n\tv := uint8(from)\n\tnv.P = &v\n\treturn nv\n}",
"func (l binaryFreeList) Uint8(r io.Reader) (uint8, error) {\n buf := l.Borrow()[:1]\n if _, err := io.ReadFull(r, buf); err != nil {\n l.Return(buf)\n\treturn 0, err\n }\n rv := buf[0]\n l.Return(buf)\n return rv, nil\n}",
"func FromUint8(value uint8) byte {\n\treturn FromUint(uint64(value), 1)[0]\n}",
"func (v *Uint8Value) Get() uint8\t{ return *(*uint8)(v.addr) }",
"func UintInt8(from uint64, defaultValue ...int8) Int8Accessor {\n\tnv := &NullInt8{}\n\tif safe := isSafeUintToInt(from, 8); !safe {\n\t\tnv.Error = ErrConvert\n\t\tif defaultInt8(nv, defaultValue...) {\n\t\t\treturn nv\n\t\t}\n\t}\n\tv := int8(from)\n\tnv.P = &v\n\treturn nv\n}",
"func (t *Table) GetUint8(off UOffsetT) uint8 {\n\treturn GetUint8(t.Bytes[off:])\n}",
"func StringUint8(from string, defaultValue ...uint8) Uint8Accessor {\n\tnv := &NullUint8{}\n\tpv, err := strconv.ParseUint(from, 0, 8)\n\tnv.Error = err\n\tif defaultUint8(nv, defaultValue...) {\n\t\treturn nv\n\t}\n\tv := uint8(pv)\n\tnv.P = &v\n\treturn nv\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
RefUint16 returns a pointer to a newly created uint16.
|
func RefUint16(value uint16) *uint16 {
return &value
}
|
[
"func RefInt16(value int16) *int16 {\n\treturn &value\n}",
"func Uint16ToPtrUint16(uint16_ uint16) (ptr_uint16_ *uint16) {\n\tptr_uint16_ = new(uint16)\n\n\t*ptr_uint16_ = uint16(uint16_)\n\n\treturn\n}",
"func (seg *Segment) Uint16(offset int64) *uint16 {\n\treturn (*uint16)(unsafe.Pointer(seg.Pointer(offset, Uint16Size)))\n}",
"func Uint16ToPtrUint(uint16_ uint16) (ptr_uint_ *uint) {\n\tptr_uint_ = new(uint)\n\n\t*ptr_uint_ = uint(uint16_)\n\n\treturn\n}",
"func Uint16(v *uint16) uint16 {\n\tif v == nil {\n\t\treturn 0\n\t}\n\treturn *v\n}",
"func (u Uint16) Ptr() *uint16 {\n\tif !u.Valid {\n\t\treturn nil\n\t}\n\treturn &u.Uint16\n}",
"func (put *PutBuffer) Uint16(val uint16) {\n\tput.vluEncode(uint64(val))\n}",
"func Uint16ToPtrInt16(uint16_ uint16) (ptr_int16_ *int16) {\n\tptr_int16_ = new(int16)\n\n\t*ptr_int16_ = int16(uint16_)\n\n\treturn\n}",
"func Uint16ToPtr(uint16_ uint16) (ptr_uint16_ *uint16) {\n\tptr_uint16_ = Uint16ToPtrUint16(uint16_)\n\n\treturn\n}",
"func NewUint16(v uint16) Value {\n\treturn MakeTrusted(Uint16, strconv.AppendUint(nil, uint64(v), 10))\n}",
"func (l binaryFreeList) Uint16(r io.Reader, byteOrder binary.ByteOrder) (uint16, error) {\n buf := l.Borrow()[:2]\n if _, err := io.ReadFull(r, buf); err != nil {\n l.Return(buf)\n return 0, err\n }\n rv := byteOrder.Uint16(buf)\n l.Return(buf)\n return rv, nil\n}",
"func Uint16(macro Token, u uint16) Value {\n\treturn Value{macro, \"\", uint64(u), typeUint, nil}\n}",
"func (get *GetBuffer) Uint16(val *uint16) {\n\tif get.err == nil {\n\t\tvar u uint64\n\t\tu, get.err = vluDecode(&get.buf)\n\t\tif get.err == nil {\n\t\t\t*val = uint16(u)\n\t\t}\n\t}\n}",
"func (r *Reader) Uint16(v *uint16) {\n\t*v = r.decUint16s[0]\n\tr.decUint16s = r.decUint16s[1:]\n}",
"func Uint16(v uint16) Value {\n\treturn Value{bits: bits(TypeUint16) | bitsConst, vInt: int64(v)}\n}",
"func (kb *KeyBuffer) Uint16(val uint16) {\n\tkb.write(KeyUint16(val))\n}",
"func FloatUint16(from float64, defaultValue ...uint16) Uint16Accessor {\n\tnv := &NullUint16{}\n\tif safe := isSafeFloatToUint(float64(from), 64, 16); !safe {\n\t\tnv.Error = ErrConvert\n\t\tif defaultUint16(nv, defaultValue...) {\n\t\t\treturn nv\n\t\t}\n\t}\n\tv := uint16(from)\n\tnv.P = &v\n\treturn nv\n}",
"func VariantNewUint16(value uint16) Variant {\n\tret0 := C.g_variant_new_uint16(C.guint16(value))\n\treturn wrapVariant(ret0)\n}",
"func (c Context) Uint16(key string, i uint16) Context {\n\tc.l.context = enc.AppendUint16(enc.AppendKey(c.l.context, key), i)\n\treturn c\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
RefUint32 returns a pointer to a newly created uint32.
|
func RefUint32(value uint32) *uint32 {
return &value
}
|
[
"func (u Uint32) Ptr() *uint32 {\n\tif !u.Valid {\n\t\treturn nil\n\t}\n\treturn &u.Uint32\n}",
"func AddUint32Release(addr *uint32, value uint32) uint32",
"func RefUint(value uint) *uint {\n\treturn &value\n}",
"func RefInt32(value int32) *int32 {\n\treturn &value\n}",
"func NewUint32FromPtr(v *uint32) Uint32 {\n\tif v == nil {\n\t\treturn Uint32{}\n\t}\n\treturn NewUint32(*v)\n}",
"func Uint32FromPtr(i *uint32) Uint32 {\n\tif i == nil {\n\t\treturn NewUint32(0, false)\n\t}\n\treturn NewUint32(*i, true)\n}",
"func (u Uint32) ToPtr() *uint32 {\n\tif !u.Present() {\n\t\treturn nil\n\t}\n\tv := *u.value\n\treturn &v\n}",
"func NewAtomicUint32(initialValue uint32) *AtomicUint32 {\n a := AtomicUint32(initialValue)\n return &a\n}",
"func OrUint32Release(addr *uint32, value uint32) uint32",
"func loadUint32(ptr unsafe.Pointer) (val uint32, sig int32)",
"func Uint32(v *uint32) uint32 {\n\tif v == nil {\n\t\treturn 0\n\t}\n\treturn *v\n}",
"func (seg *Segment) Uint32(offset int64) *uint32 {\n\treturn (*uint32)(unsafe.Pointer(seg.Pointer(offset, Uint32Size)))\n}",
"func AndUint32Release(addr *uint32, value uint32) uint32",
"func XorUint32Release(addr *uint32, value uint32) uint32",
"func StoreUint32Release(addr *uint32, val uint32)",
"func UInt32(val uint32) *wrappers.UInt32Value {\n\treturn &wrappers.UInt32Value{\n\t\tValue: val,\n\t}\n}",
"func NandUint32Release(addr *uint32, value uint32) uint32",
"func Uint16ToPtrUint32(uint16_ uint16) (ptr_uint32_ *uint32) {\n\tptr_uint32_ = new(uint32)\n\n\t*ptr_uint32_ = uint32(uint16_)\n\n\treturn\n}",
"func LoadUint32Acquire(addr *uint32) uint32"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
RefUint64 returns a pointer to a newly created uint64.
|
func RefUint64(value uint64) *uint64 {
return &value
}
|
[
"func NewUint64(u uint64) *uint64 { return &u }",
"func NewUint64(val uint64) *Uint64 {\n\treturn &Uint64{val: val}\n}",
"func AddUint64Release(addr *uint64, value uint64) uint64",
"func XorUint64Release(addr *uint64, value uint64) uint64",
"func Uint64ToPtrUint64(uint64_ uint64) (ptr_uint64_ *uint64) {\n\tptr_uint64_ = new(uint64)\n\n\t*ptr_uint64_ = uint64(uint64_)\n\n\treturn\n}",
"func NewUint64(u uint64) *Uint64 {\n\treturn &Uint64{Uint64: u, Valid: true}\n}",
"func (r *Reader) Uint64Ptr(v **uint64) {\n\tsize := r.Alloc()\n\tif size == 0 {\n\t\treturn\n\t}\n\ti := r.decUint64s[0]\n\tr.decUint64s = r.decUint64s[1:]\n\t*v = &i\n}",
"func Uint64ToPtrUint(uint64_ uint64) (ptr_uint_ *uint) {\n\tptr_uint_ = new(uint)\n\n\t*ptr_uint_ = uint(uint64_)\n\n\treturn\n}",
"func StoreUint64Release(addr *uint64, val uint64)",
"func Uint64FromPtr(i *uint64) Uint64 {\n\tif i == nil {\n\t\treturn NewUint64(0, false)\n\t}\n\treturn NewUint64(*i, true)\n}",
"func (u Uint64) Ptr() *uint64 {\n\tif !u.Valid {\n\t\treturn nil\n\t}\n\treturn &u.Uint64\n}",
"func NewAtomicUint64(initialValue uint64) *AtomicUint64 {\n a := AtomicUint64(initialValue)\n return &a\n}",
"func OrUint64Release(addr *uint64, value uint64) uint64",
"func RefUint(value uint) *uint {\n\treturn &value\n}",
"func Uint64(name string, value uint64, usage string) *uint64 {\n\treturn Configuration.Uint64(name, value, usage)\n}",
"func NandUint64Release(addr *uint64, value uint64) uint64",
"func FromUint64(v uint64) Uint64 {\n\tvar u Uint64\n\t*u.ptr() = v\n\treturn u\n}",
"func Uint64(v uint64) dgo.Uint64 {\n\treturn uintVal(v)\n}",
"func Uint64(v *uint64) uint64 {\n\tif v == nil {\n\t\treturn 0\n\t}\n\treturn *v\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
RefInt returns a pointer to a newly created int.
|
func RefInt(value int) *int {
return &value
}
|
[
"func RefFromInt(i int32) *int32 {\n\treturn &i\n}",
"func RefFromInt32(i int32) *int32 {\n\treturn &i\n}",
"func RefInt32(value int32) *int32 {\n\treturn &value\n}",
"func RefFromInt64(i int64) *int64 {\n\treturn &i\n}",
"func RefInt64(value int64) *int64 {\n\treturn &value\n}",
"func NewInt(ptr *int, def int) Int {\n\treturn Int{\n\t\tPointer: ptr,\n\t\tDefault: def,\n\t}\n}",
"func GetIntPointer(value int) *int {\n\treturn &value\n}",
"func RefInt8(value int8) *int8 {\n\treturn &value\n}",
"func IntPtr(n int) *int {\n\treturn &n\n}",
"func RefInt16(value int16) *int16 {\n\treturn &value\n}",
"func RefUint(value uint) *uint {\n\treturn &value\n}",
"func (s *Symbol) Ref(c int) (int, error) {\n\tif s.SectionId == VariableId || s.SectionId == ConstId {\n\t\ts.RefC += c\n\t\treturn s.RefC, nil\n\t}\n\treturn -1, fmt.Errorf(\"can't adjust reference counter on: %v %v\",\n\t\ts.Id, s.Name)\n}",
"func returnPointer() *int {\n\trp := 1\n\treturn &rp\n}",
"func TestInt32Ptr(i int32) *int32 {\n\treturn &i\n}",
"func (c *safeRefCounter) newRef(valptr interface{}) Ref {\n\tc.lock.Lock()\n\tdefer c.lock.Unlock()\n\tref := c.seq\n\tc.seq++\n\tc.refs[ref] = &refData{\n\t\tinstance: valptr,\n\t\tcount: 1,\n\t}\n\treturn ref\n}",
"func Int(v *int) int {\n\tif v == nil {\n\t\treturn 0\n\t}\n\treturn *v\n}",
"func newInt(f *kingpin.FlagClause, v interface{}) *int {\n\tif v == nil {\n\t\ti := 0\n\t\tf.IntVar(&i)\n\t\treturn &i\n\t}\n\ti := v.(*int)\n\tf.IntVar(i)\n\treturn i\n}",
"func NewInt(value int) Int {\n\treturn Int{value: value, specified: true}\n}",
"func NewInt(i int) Decimal { return decr(int64(i), 0) }"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
RefInt8 returns a pointer to a newly created int8.
|
func RefInt8(value int8) *int8 {
return &value
}
|
[
"func RefUint8(value uint8) *uint8 {\n\treturn &value\n}",
"func (r *Reader) Int8Ptr(v **int8) {\n\tsize := r.Alloc()\n\tif size == 0 {\n\t\treturn\n\t}\n\ti := r.decInt8s[0]\n\tr.decInt8s = r.decInt8s[1:]\n\t*v = &i\n}",
"func (seg *Segment) Int8(offset int64) *int8 {\n\treturn (*int8)(unsafe.Pointer(seg.Pointer(offset, Int8Size)))\n}",
"func (i *Inp) GetInt8(out *int8) {\n\ti.readUnsafe(out)\n}",
"func Int8(v int8) Value {\n\treturn Value{bits: bits(TypeInt8) | bitsConst, vInt: int64(v)}\n}",
"func Int8() (int8, error) {\n\ti, err := Uint8()\n\n\tif err != nil {\n\t\treturn int8(0), err\n\t}\n\n\treturn int8(i), nil\n}",
"func (d *Decoder) Int8() (v int8, err error) {\n\tv, err = decodeInt8(d.r)\n\treturn\n}",
"func (r *Reader) Int8(v *int8) {\n\t*v = r.decInt8s[0]\n\tr.decInt8s = r.decInt8s[1:]\n}",
"func (b *Buffer) GetInt8(offset int) int8 {\n return int8(b.GetUint8(offset))\n}",
"func (get *GetBuffer) Int8(val *int8) {\n\tif get.err == nil {\n\t\tvar b uint8\n\t\tb, get.err = get.buf.ReadByte()\n\t\tif get.err == nil {\n\t\t\t*val = int8(b)\n\t\t}\n\t}\n}",
"func UintInt8(from uint64, defaultValue ...int8) Int8Accessor {\n\tnv := &NullInt8{}\n\tif safe := isSafeUintToInt(from, 8); !safe {\n\t\tnv.Error = ErrConvert\n\t\tif defaultInt8(nv, defaultValue...) {\n\t\t\treturn nv\n\t\t}\n\t}\n\tv := int8(from)\n\tnv.P = &v\n\treturn nv\n}",
"func Int8Value(v *int8) int8 {\n\tif v != nil {\n\t\treturn *v\n\t}\n\treturn 0\n}",
"func (this *BinaryDecoder) GetInt8() (int8, error) {\n\tif this.Remaining() < 1 {\n\t\tthis.pos = len(this.raw)\n\t\treturn -1, EOF\n\t}\n\tvalue := int8(this.raw[this.pos])\n\tthis.pos += 1\n\treturn value, nil\n}",
"func (v *Int8Value) Get() int8\t{ return *(*int8)(v.addr) }",
"func Int8(macro Token, i int8) Value {\n\treturn Value{macro, \"\", uint64(int64(i)), typeInt, nil}\n}",
"func (kb *KeyBuffer) Int8(val int8) {\n\tkb.Uint8(KeyInt8(val))\n}",
"func (r *Reader) Uint8Ptr(v **uint8) {\n\tsize := r.Alloc()\n\tif size == 0 {\n\t\treturn\n\t}\n\ti := r.decUint8s[0]\n\tr.decUint8s = r.decUint8s[1:]\n\t*v = &i\n}",
"func (m *InBufferBase) ReadInt8() int8 {\n\tr := int8(m.b[m.i])\n\tm.i += 1\n\treturn r\n}",
"func NewInt8Value(x int8) Value {\n\treturn Value{\n\t\tType: Int8Value,\n\t\tV: x,\n\t}\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
RefInt16 returns a pointer to a newly created int16.
|
func RefInt16(value int16) *int16 {
return &value
}
|
[
"func RefUint16(value uint16) *uint16 {\n\treturn &value\n}",
"func (seg *Segment) Int16(offset int64) *int16 {\n\treturn (*int16)(unsafe.Pointer(seg.Pointer(offset, Int16Size)))\n}",
"func (r *Reader) Int16Ptr(v **int16) {\n\tsize := r.Alloc()\n\tif size == 0 {\n\t\treturn\n\t}\n\ti := r.decInt16s[0]\n\tr.decInt16s = r.decInt16s[1:]\n\t*v = &i\n}",
"func Uint16ToPtrInt16(uint16_ uint16) (ptr_int16_ *int16) {\n\tptr_int16_ = new(int16)\n\n\t*ptr_int16_ = int16(uint16_)\n\n\treturn\n}",
"func Int16(v int16) Value {\n\treturn Value{bits: bits(TypeInt16) | bitsConst, vInt: int64(v)}\n}",
"func NewInt16(v int16) Value {\n\treturn MakeTrusted(Int16, strconv.AppendInt(nil, int64(v), 10))\n}",
"func (r *Reader) Int16(v *int16) {\n\t*v = r.decInt16s[0]\n\tr.decInt16s = r.decInt16s[1:]\n}",
"func (put *PutBuffer) Int16(val int16) {\n\tput.vlsEncode(int64(val))\n}",
"func Int16(macro Token, i int16) Value {\n\treturn Value{macro, \"\", uint64(int64(i)), typeInt, nil}\n}",
"func (d *Decoder) Int16() (v int16, err error) {\n\tv, err = decodeInt16(d.r)\n\treturn\n}",
"func (c Context) Int16(key string, i int16) Context {\n\tc.l.context = enc.AppendInt16(enc.AppendKey(c.l.context, key), i)\n\treturn c\n}",
"func Int16Of(val int16) *Int16 {\n\treturn &Int16{Val: val, IsAssigned: true}\n}",
"func (get *GetBuffer) Int16(val *int16) {\n\tif get.err == nil {\n\t\tvar s int64\n\t\ts, get.err = vlsDecode(&get.buf)\n\t\tif get.err == nil {\n\t\t\t*val = int16(s)\n\t\t}\n\t}\n}",
"func UintInt16(from uint64, defaultValue ...int16) Int16Accessor {\n\tnv := &NullInt16{}\n\tif safe := isSafeUintToInt(from, 16); !safe {\n\t\tnv.Error = ErrConvert\n\t\tif defaultInt16(nv, defaultValue...) {\n\t\t\treturn nv\n\t\t}\n\t}\n\tv := int16(from)\n\tnv.P = &v\n\treturn nv\n}",
"func (b *Buffer) GetInt16(offset int) int16 {\n return int16(b.GetUint16(offset))\n}",
"func Int16() (int16, error) {\n\ti, err := Uint16()\n\n\tif err != nil {\n\t\treturn int16(0), err\n\t}\n\n\treturn int16(i), nil\n}",
"func (i *Inp) GetInt16(out *int16) {\n\ti.readUnsafe(out)\n}",
"func (kb *KeyBuffer) Int16(val int16) {\n\tkb.write(KeyInt16(val))\n}",
"func Uint16ToPtrInt(uint16_ uint16) (ptr_int_ *int) {\n\tptr_int_ = new(int)\n\n\t*ptr_int_ = int(uint16_)\n\n\treturn\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
RefInt32 returns a pointer to a newly created int32.
|
func RefInt32(value int32) *int32 {
return &value
}
|
[
"func RefFromInt32(i int32) *int32 {\n\treturn &i\n}",
"func RefFromInt(i int32) *int32 {\n\treturn &i\n}",
"func RefInt(value int) *int {\n\treturn &value\n}",
"func Int32AsPTR(value int32) *int32 {\n\treturn &value\n}",
"func (n Int32) Ptr() *int32 {\n\tif n.Valid {\n\t\tv := n.Int32\n\t\treturn &v\n\t}\n\treturn nil\n}",
"func TestInt32Ptr(i int32) *int32 {\n\treturn &i\n}",
"func Int32FromPtr(i *int32) Int32 {\n\tif i == nil {\n\t\treturn NewInt32(0, false)\n\t}\n\tn := NewInt32(*i, true)\n\treturn n\n}",
"func Int32FromPtr(ptr *int32) Int32 {\n\tvar v Int32\n\treturn v.Assign(ptr)\n}",
"func (seg *Segment) Int32(offset int64) *int32 {\n\treturn (*int32)(unsafe.Pointer(seg.Pointer(offset, Int32Size)))\n}",
"func NewInt32FromPtr(v *int32) Int32 {\n\tif v == nil {\n\t\treturn Int32{}\n\t}\n\treturn NewInt32(*v)\n}",
"func RefUint32(value uint32) *uint32 {\n\treturn &value\n}",
"func (i Int32) ToPtr() *int32 {\n\tif !i.Present() {\n\t\treturn nil\n\t}\n\tv := *i.value\n\treturn &v\n}",
"func AddInt32Release(addr *int32, value int32) int32",
"func DerefInt32(i *int32) int32 {\n\tif i != nil {\n\t\treturn *i\n\t}\n\treturn 0\n}",
"func AddrOfInt32(i int32) *int32 {\n\treturn &i\n}",
"func (i *Inp) GetInt32(out *int32) {\n\ti.readUnsafe(out)\n}",
"func Int32(v int32) Value {\n\treturn Value{bits: bits(TypeInt32) | bitsConst, vInt: int64(v)}\n}",
"func XorInt32Release(addr *int32, value int32) int32",
"func StoreInt32Release(addr *int32, val int32)"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
RefInt64 returns a pointer to a newly created int64.
|
func RefInt64(value int64) *int64 {
return &value
}
|
[
"func RefFromInt64(i int64) *int64 {\n\treturn &i\n}",
"func Int64Ptr(i64 int64) *int64 {\n\treturn &i64\n}",
"func makeInt64Ptr(i int64) *int64 {\n\treturn &i\n}",
"func TestInt64Ptr(i int64) *int64 {\n\treturn &i\n}",
"func (r *Reader) Int64Ptr(v **int64) {\n\tsize := r.Alloc()\n\tif size == 0 {\n\t\treturn\n\t}\n\ti := r.decInt64s[0]\n\tr.decInt64s = r.decInt64s[1:]\n\t*v = &i\n}",
"func Int64AsPTR(value int64) *int64 {\n\treturn &value\n}",
"func (seg *Segment) Int64(offset int64) *int64 {\n\treturn (*int64)(unsafe.Pointer(seg.Pointer(offset, Int64Size)))\n}",
"func AddInt64Release(addr *int64, value int64) int64",
"func XorInt64Release(addr *int64, value int64) int64",
"func StoreInt64Release(addr *int64, val int64)",
"func RefUint64(value uint64) *uint64 {\n\treturn &value\n}",
"func DerefInt64(i *int64) int64 {\n\tif i != nil {\n\t\treturn *i\n\t}\n\treturn 0\n}",
"func FromInt64(v int64) Int64 {\n\tvar i Int64\n\t*i.ptr() = v\n\treturn i\n}",
"func AnyIntToInt64Ptr(g GenericCLIResult) *int64 {\n\tif !g.IsSet() {\n\t\treturn nil\n\t}\n\tvar newT int64\n\tswitch g.Value().(type) {\n\tcase int:\n\t\tnewT = int64(g.Value().(int))\n\tcase int64:\n\t\tnewT = g.Value().(int64)\n\tcase uint64:\n\t\tnewT = int64(g.Value().(uint64))\n\tcase uint:\n\t\tnewT = int64(g.Value().(uint))\n\tdefault:\n\t\tpanic(errors.Errorf(\"invalid int type\"))\n\t}\n\treturn &newT\n}",
"func (n *Int64) Int64() int64 {\n\tif n != nil {\n\t\treturn int64(*n)\n\t}\n\treturn 0\n}",
"func RefInt(value int) *int {\n\treturn &value\n}",
"func DynInt64(flagSet *flag.FlagSet, name string, value int64, usage string) *DynInt64Value {\n\tdynValue := &DynInt64Value{ptr: &value}\n\tflagSet.Var(dynValue, name, usage)\n\treturn dynValue\n}",
"func NandInt64Release(addr *int64, value int64) int64",
"func Int64(name string, value int64, usage string) *int64 {\n\treturn Configuration.Int64(name, value, usage)\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
RefFloat32 returns a pointer to a newly created float32.
|
func RefFloat32(value float32) *float32 {
return &value
}
|
[
"func (f Number) Float32() float32 {\n\tu32 := expandF16ToF32(f)\n\tptr := unsafe.Pointer(&u32)\n\tf32 := *(*float32)(ptr)\n\treturn f32\n}",
"func (seg *Segment) Float32(offset int64) *float32 {\n\treturn (*float32)(unsafe.Pointer(seg.Pointer(offset, Float32Size)))\n}",
"func (f Float) ReadFloat32() (float32, error) { return float32(f), nil }",
"func NewFloat32(v float32) Value {\n\treturn MakeTrusted(Float32, strconv.AppendFloat(nil, float64(v), 'g', -1, 64))\n}",
"func Float32(i int) float32",
"func (i *Inp) GetFloat32(out *float32) {\n\ti.readUnsafe(out)\n}",
"func Float32(v float32) Value {\n\treturn Value{bits: bits(TypeFloat32) | bitsConst, vInt: int64(math.Float32bits(v))}\n}",
"func (self *tAttr) AsFloat32() tFloat32Attr {\n\tself.Type = Number\n\tself.updateAttrTypeInTable(Number)\n\treturn tFloat32Attr{self}\n}",
"func (r *Rand) Float32() float32 {}",
"func FloatPtr(f float64) *float64 {\n\treturn &f\n}",
"func Float32(key string, val float32) Field {\n\treturn Field{Key: key, Type: zapcore.Float32Type, Integer: int64(math.Float32bits(val))}\n}",
"func Float32(macro Token, f float32) Value {\n\treturn Value{macro, \"\", math.Float64bits(float64(f)), typeFloat, nil}\n}",
"func (v *Float32Value) Get() float32\t{ return *(*float32)(v.addr) }",
"func FP32ToFloat32(buf []byte) (v float32, e error) {\n\tif e = checkByteCount(buf, 4, \"FP32\"); e != nil {\n\t\treturn\n\t}\n\tvar i uint32\n\ti, e = UI32ToUint32(buf)\n\tv = math.Float32frombits(i)\n\treturn\n}",
"func (s Series) Float32(i int) float32 {\n\ts.Retain()\n\n\tvar v float32\n\tswitch s.field.Type {\n\tcase arrow.PrimitiveTypes.Int32:\n\t\tv = float32(s.Interface.(*array.Int32).Value(i))\n\tcase arrow.PrimitiveTypes.Int64:\n\t\tv = float32(s.Interface.(*array.Int64).Value(i))\n\tcase arrow.PrimitiveTypes.Float32:\n\t\tv = s.Interface.(*array.Float32).Value(i)\n\tcase arrow.PrimitiveTypes.Float64:\n\t\tv = float32(s.Interface.(*array.Float64).Value(i))\n\tdefault:\n\t\tpanic(\"series: unknown type\")\n\t}\n\n\ts.Release()\n\treturn v\n}",
"func FloatUint32(from float64, defaultValue ...uint32) Uint32Accessor {\n\tnv := &NullUint32{}\n\tif safe := isSafeFloatToUint(float64(from), 64, 32); !safe {\n\t\tnv.Error = ErrConvert\n\t\tif defaultUint32(nv, defaultValue...) {\n\t\t\treturn nv\n\t\t}\n\t}\n\tv := uint32(from)\n\tnv.P = &v\n\treturn nv\n}",
"func Float32From(f float32) Float32 {\n\treturn NewFloat32(f, f != 0)\n}",
"func (f Flags) GetFloat32(name string) (float32, error) {\n\treturn f.first(name).GetFloat32()\n}",
"func Float32(i1, i2 float32) float32 {\n\tif i1 == 0.0 {\n\t\treturn i2\n\t}\n\treturn i1\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
RefFloat64 returns a pointer to a newly created float64.
|
func RefFloat64(value float64) *float64 {
return &value
}
|
[
"func FloatPtr(f float64) *float64 {\n\treturn &f\n}",
"func TestFloat64Ptr(f float64) *float64 {\n\treturn &f\n}",
"func (seg *Segment) Float64(offset int64) *float64 {\n\treturn (*float64)(unsafe.Pointer(seg.Pointer(offset, Float64Size)))\n}",
"func RefFloat32(value float32) *float32 {\n\treturn &value\n}",
"func NewFloat64(v float64) Variant {\n\treturn Variant{\n\t\tptr: unsafe.Pointer(&floatTypeMarker),\n\t\tbits: *(*uint)(unsafe.Pointer(&v)),\n\t}\n}",
"func Float64ToPtr(g GenericCLIResult) *float64 {\n\tif !g.IsSet() {\n\t\treturn nil\n\t}\n\tnewT := g.Value().(float64)\n\treturn &newT\n}",
"func (f *Float) Float64() float64 {\n\treturn f.f\n}",
"func (f *Float64) Float64() float64 {\n\tif f != nil {\n\t\treturn float64(*f)\n\t}\n\treturn 0\n}",
"func (md *MockDocument) GetFloat64(_ string) (float64, error) {\n\treturn md.MockGetFloat64()\n}",
"func (r *Root) Float64(field string) *Float64 {\r\n\treturn (*Float64)(r.Field(strings.Split(field, \".\")...))\r\n}",
"func NewFloat(v float64) *Float {\n\treturn &Float{v: v}\n}",
"func (i *Inp) GetFloat64(out *float64) {\n\ti.readUnsafe(out)\n}",
"func (r *Rand) Float64() float64 {}",
"func (a gateioNumericalValue) Float64() float64 { return float64(a) }",
"func Float64(macro Token, f float64) Value {\n\treturn Value{macro, \"\", math.Float64bits(f), typeFloat, nil}\n}",
"func (m Meter) NewFloat64ValueRecorder(name string, opts ...InstrumentOption) (Float64ValueRecorder, error) {\n\treturn wrapFloat64ValueRecorderInstrument(\n\t\tm.newSync(name, ValueRecorderInstrumentKind, number.Float64Kind, opts))\n}",
"func MakeFloat64SlicePtr(values ...*float64) float64SlicePtr {\n\tnewSlice := float64SlicePtr(values)\n\treturn newSlice\n}",
"func (_e *GosoConf_Expecter) GetFloat64(key interface{}, optionalDefault ...interface{}) *GosoConf_GetFloat64_Call {\n\treturn &GosoConf_GetFloat64_Call{Call: _e.mock.On(\"GetFloat64\",\n\t\tappend([]interface{}{key}, optionalDefault...)...)}\n}",
"func FP64ToFloat64(buf []byte) (v float64, e error) {\n\tif e = checkByteCount(buf, 8, \"FP64\"); e != nil {\n\t\treturn\n\t}\n\tvar i uint64\n\ti, e = UI64ToUint64(buf)\n\tif e == nil {\n\t\tv = math.Float64frombits(i)\n\t}\n\treturn\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
RefComplex64 returns a pointer to a newly created complex64.
|
func RefComplex64(value complex64) *complex64 {
return &value
}
|
[
"func ToComplex64(c complex64) *complex64 { return &c }",
"func (seg *Segment) Complex64(offset int64) *complex64 {\n\treturn (*complex64)(unsafe.Pointer(seg.Pointer(offset, Complex64Size)))\n}",
"func NewComplex64() *complex64 {\n\tvar c = complex64(0)\n\treturn &c\n}",
"func RefComplex128(value complex128) *complex128 {\n\treturn &value\n}",
"func ComplexUint64(from complex128, defaultValue ...uint64) Uint64Accessor {\n\tnv := &NullUint64{}\n\tfr, vi := float64(real(from)), float64(imag(from))\n\tcv := FloatUint64(fr, defaultValue...)\n\tnv.Error = cv.Err()\n\tif vi != 0 {\n\t}\n\tif defaultUint64(nv, defaultValue...) {\n\t\treturn nv\n\t}\n\tv := cv.V()\n\tnv.P = &v\n\treturn nv\n}",
"func RefFloat64(value float64) *float64 {\n\treturn &value\n}",
"func Complex64(b []byte) complex64 {\n\tr := Float32(b)\n\ti := Float32(b[4:8])\n\treturn complex(r, i)\n}",
"func ToComplex128(c complex128) *complex128 { return &c }",
"func (s Slice) Complex64(i int) (complex64, error) {\n\t_v, err := s.Complex128(i)\n\treturn complex64(_v), err\n}",
"func (r *Decoder) ReadComplex64(order ByteOrder) complex64 {\n\trnum := r.ReadFloat32(order)\n\tinum := r.ReadFloat32(order)\n\n\treturn complex(rnum, inum)\n}",
"func (h *Hamba) GetAsComplex64(key string) (complex64, error) {\n\ti := find(h.key, key)\n\tif i == -1 {\n\t\treturn -1, errIsNotExistKey\n\t}\n\n\tvalue, err := strconv.ParseComplex(h.value[i], 64)\n\tcheckErr(err)\n\treturn complex64(value), nil\n}",
"func C(p Pointer) complex128 { return complex128(p.Pt()) }",
"func Complex64Uint(from complex64, defaultValue ...uint) UintAccessor {\n\tnv := &NullUint{}\n\tfr := float32(real(from))\n\tvi := float32(imag(from))\n\tcv := Float32Uint(fr, defaultValue...)\n\tnv.Error = cv.Err()\n\tif vi != 0 {\n\t}\n\tif defaultUint(nv, defaultValue...) {\n\t\treturn nv\n\t}\n\tv := cv.V()\n\tnv.P = &v\n\treturn nv\n}",
"func Complex64Uint8(from complex64, defaultValue ...uint8) Uint8Accessor {\n\tnv := &NullUint8{}\n\tfr := float32(real(from))\n\tvi := float32(imag(from))\n\tcv := Float32Uint8(fr, defaultValue...)\n\tnv.Error = cv.Err()\n\tif vi != 0 {\n\t}\n\tif defaultUint8(nv, defaultValue...) {\n\t\treturn nv\n\t}\n\tv := cv.V()\n\tnv.P = &v\n\treturn nv\n}",
"func PutComplex64(b []byte, v complex64) {\n\tr, i := real(v), imag(v)\n\tPutFloat32(b, r)\n\tPutFloat32(b[4:8], i)\n}",
"func newMatrix2x2Ref(ref unsafe.Pointer) *gMatrix2x2 {\n\tif ref == nil {\n\t\treturn nil\n\t}\n\tobj := new(gMatrix2x2)\n\tobj.refb92f06e6 = (*C.Matrix2x2)(unsafe.Pointer(ref))\n\treturn obj\n}",
"func RefUint64(value uint64) *uint64 {\n\treturn &value\n}",
"func GenerateComplex64s(ch <-chan complex64) []complex64 {\n\ts := make([]complex64, 0, 32)\n\tfor v := range ch {\n\t\ts = append(s, v)\n\t}\n\treturn s\n}",
"func MustComplex64(v interface{}) complex64 {\n\n\tx, err := Complex64(v)\n\tif nil != err {\n\t\tpanic(err)\n\t}\n\n\treturn x\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
RefComplex128 returns a pointer to a newly created complex128.
|
func RefComplex128(value complex128) *complex128 {
return &value
}
|
[
"func ToComplex128(c complex128) *complex128 { return &c }",
"func C(p Pointer) complex128 { return complex128(p.Pt()) }",
"func (seg *Segment) Complex128(offset int64) *complex128 {\n\treturn (*complex128)(unsafe.Pointer(seg.Pointer(offset, Complex128Size)))\n}",
"func RefComplex64(value complex64) *complex64 {\n\treturn &value\n}",
"func ToComplex64(c complex64) *complex64 { return &c }",
"func Complex128(b []byte) complex128 {\n\tr := Float64(b)\n\ti := Float64(b[8:16])\n\treturn complex(r, i)\n}",
"func Complex128(c1 *complex128, c2 *complex128) bool {\n\tif c1 == nil {\n\t\treturn c2 == nil\n\t}\n\treturn c2 != nil && *c1 == *c2\n}",
"func (s Slice) Complex128(i int) (v complex128, err error) {\n\tif len(s) <= i {\n\t\terr = ErrOutOfLen\n\t\treturn\n\t}\n\treturn ToComplex128(s[i])\n}",
"func (v Value) Complex() complex128 {\n\tpt := v.ptrto()\n\tswitch v.Kind() {\n\tcase Complex64:\n\t\treturn complex128(*(*complex64)(pt))\n\tcase Complex128:\n\t\treturn *(*complex128)(pt)\n\t}\n\tpanic(badKind)\n}",
"func (h *Hamba) GetAsComplex128(key string) (complex128, error) {\n\ti := find(h.key, key)\n\tif i == -1 {\n\t\treturn -1, errIsNotExistKey\n\t}\n\n\tvalue, err := strconv.ParseComplex(h.value[i], 128)\n\tcheckErr(err)\n\treturn value, nil\n}",
"func PutComplex128(b []byte, v complex128) {\n\tr, i := real(v), imag(v)\n\tPutFloat64(b, r)\n\tPutFloat64(b[8:16], i)\n}",
"func Complex128(i complex128) []byte {\n\tbuffer := new(bytes.Buffer)\n\tbinary.Write(buffer, binary.LittleEndian, i)\n\treturn buffer.Bytes()\n}",
"func (r *Decoder) ReadComplex128(order ByteOrder) complex128 {\n\trnum := r.ReadFloat64(order)\n\tinum := r.ReadFloat64(order)\n\n\treturn complex(rnum, inum)\n}",
"func NewComplexSummer128() *ComplexSummer128 {\n\treturn &ComplexSummer128{\n\t\trealSum: NewSummer64(),\n\t\timagSum: NewSummer64(),\n\t}\n}",
"func NewSliceComplex128(elems ...complex128) *SliceComplex128 {\n\ts := new(SliceComplex128)\n\ts.data = make([]complex128, len(elems))\n\tfor i := 0; i < len(elems); i++ {\n\t\ts.data[i] = elems[i]\n\t}\n\treturn s\n}",
"func GenerateComplex128s(ch <-chan complex128) []complex128 {\n\ts := make([]complex128, 0, 32)\n\tfor v := range ch {\n\t\ts = append(s, v)\n\t}\n\treturn s\n}",
"func ToComplex128(s string) (complex128, error) {\n\tval, err := eval(s)\n\tif err != nil {\n\t\treturn 0.0, err\n\t}\n\tswitch val.Kind() {\n\tcase constant.Float:\n\t\tr, _ := constant.Float64Val(val)\n\t\treturn complex128(complex(r, 0.0)), nil\n\tcase constant.Complex:\n\t\tr, _ := constant.Float64Val(constant.Real(val))\n\t\ti, _ := constant.Float64Val(constant.Imag(val))\n\t\treturn complex128(complex(r, i)), nil\n\tdefault:\n\t\treturn 0.0, ErrEvalNotComplex\n\t}\n}",
"func NewComplex64() *complex64 {\n\tvar c = complex64(0)\n\treturn &c\n}",
"func Complex128IsZero(n complex128, a complex128) complex128 {\n\tif n == _complex128 {\n\t\treturn a\n\t}\n\treturn n\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
RefByte returns a pointer to a newly created byte.
|
func RefByte(value byte) *byte {
return &value
}
|
[
"func Byte(v byte) *byte { return &v }",
"func (bytes Bytes) Ref() Bytes {\n\tret0 := C.g_bytes_ref(bytes.native())\n\treturn wrapBytes(ret0)\n}",
"func NewByte() *Byte {\n\treturn &Byte{}\n}",
"func RefUint8(value uint8) *uint8 {\n\treturn &value\n}",
"func bytePtr(addr uintptr) *byte {\n\treturn (*byte)(unsafe.Pointer(addr))\n}",
"func NewUnsafeByte(p *C.char, length int) UnsafeByte {\n\tvar b UnsafeByte\n\tb = UnsafeByte((*[1<<31 - 1]byte)(unsafe.Pointer(p))[:length:length])\n\treturn b\n}",
"func RefInt8(value int8) *int8 {\n\treturn &value\n}",
"func Byte(v *byte) byte {\n\tif v == nil {\n\t\treturn 0\n\t}\n\treturn *v\n}",
"func VariantNewByte(value byte) Variant {\n\tret0 := C.g_variant_new_byte(C.guchar(value))\n\treturn wrapVariant(ret0)\n}",
"func NewByte(values ...byte) *Byte {\n\ts := &Byte{}\n\ts.m = make(map[byte]struct{})\n\ts.Add(values...)\n\treturn s\n}",
"func (bd *Bytes) PeekByte(context.Context) (b byte, err error) {\n\tif bd.pos >= len(bd.buf) {\n\t\treturn 0, io.EOF\n\t}\n\n\treturn bd.buf[bd.pos], nil\n}",
"func (sh *StateHelper) GetByte(key string) byte {\n\treturn *sh.GetEx(key, new(byte)).(*byte)\n}",
"func (s *Byte) Get() byte {\n\ts.mutex.RLock()\n\tdefer s.mutex.RUnlock()\n\treturn s.byte\n}",
"func (bytes Bytes) Unref() {\n\tC.g_bytes_unref(bytes.native())\n}",
"func NewTagByte(key string, value byte) *TagByte {\n\tt := new(TagByte)\n\tt.SetKey(key)\n\tt.Value = value\n\treturn t\n}",
"func (value Variant) GetByte() byte {\n\tret0 := C.g_variant_get_byte(value.native())\n\treturn byte(ret0)\n}",
"func RefRune(value rune) *rune {\n\treturn &value\n}",
"func RefUint(value uint) *uint {\n\treturn &value\n}",
"func (t FrameType) Byte() byte {\n\treturn byte(t)\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
RefRune returns a pointer to a newly created rune.
|
func RefRune(value rune) *rune {
return &value
}
|
[
"func Rune(v rune) *rune { return &v }",
"func (s *selfState) NewRune(r rune) State {\n\treturn s.closure(s, r)\n}",
"func NewRune(image string, env []string, volumes []string) (Rune, error) {\n\tworkingDir, getWdErr := os.Getwd()\n\n\tif getWdErr != nil {\n\t\treturn Rune{}, fmt.Errorf(\n\t\t\t\"Could not determine current working directory\\n%v\",\n\t\t\tgetWdErr,\n\t\t)\n\t}\n\tvolumes = append(\n\t\tvolumes,\n\t\tfmt.Sprintf(\n\t\t\t\"%s:%s\",\n\t\t\tworkingDir,\n\t\t\t\"/home/sygaldry/project\",\n\t\t),\n\t)\n\n\treturn Rune{\n\t\tImage: image,\n\t\tEnv: env,\n\t\tTty: true,\n\t\tVolumes: volumes,\n\t}, nil\n}",
"func NewRuneNode(r rune, tok Token) *RuneNode {\n\treturn &RuneNode{\n\t\tterminalNode: tok.asTerminalNode(),\n\t\tRune: r,\n\t}\n}",
"func (i *Inp) GetRune(out *rune) {\n\tvar tmp int32\n\ti.readUnsafe(&i)\n\tif i.Error() == nil {\n\t\t*out = tmp\n\t}\n}",
"func renderRune(a game.Actor) rune {\n\tif a.IsDead {\n\t\treturn '✝'\n\t}\n\n\treturn a.Rune\n}",
"func NewChar(pos token.Pos, r rune) Char { return Char{pos: int32(pos), Rune: r} }",
"func NewRuneReader(reader io.RuneReader) *RuneReader {\n\treturn &RuneReader{\n\t\treader, nil,\n\t}\n}",
"func CharFromRune(val rune) driver.Valuer {\n\treturn charFromRune{val: val}\n}",
"func (t token) rune() rune {\n\treturn t.r\n}",
"func Rune(v *rune) rune {\n\tif v == nil {\n\t\treturn 0\n\t}\n\treturn *v\n}",
"func NewRuneTrie() *RuneTrie {\n\treturn &RuneTrie{\n\t\tinformation: nil,\n\t\tchildren: make(map[rune]*RuneTrie),\n\t}\n}",
"func (s *bufferedScanner) Rune() rune {\n\treturn s.last\n}",
"func (s *stringScanner) Rune() rune {\n\treturn s.last\n}",
"func (i Instruction) Rune() rune {\n\treturn rune(instructionRunes[i])\n}",
"func (a *Atlas) DrawRune(prevR, r rune, dot pixel.Vec) (rect, frame, bounds pixel.Rect, newDot pixel.Vec) {\n\tif !a.Contains(r) {\n\t\tr = unicode.ReplacementChar\n\t}\n\tif !a.Contains(unicode.ReplacementChar) {\n\t\treturn pixel.Rect{}, pixel.Rect{}, pixel.Rect{}, dot\n\t}\n\tif !a.Contains(prevR) {\n\t\tprevR = unicode.ReplacementChar\n\t}\n\n\tif prevR >= 0 {\n\t\tdot.X += a.Kern(prevR, r)\n\t}\n\n\tglyph := a.Glyph(r)\n\n\trect = glyph.Frame.Moved(dot.Sub(glyph.Dot))\n\tbounds = rect\n\n\tif bounds.W()*bounds.H() != 0 {\n\t\tbounds = pixel.R(\n\t\t\tbounds.Min.X,\n\t\t\tdot.Y-a.Descent(),\n\t\t\tbounds.Max.X,\n\t\t\tdot.Y+a.Ascent(),\n\t\t)\n\t}\n\n\tdot.X += glyph.Advance\n\n\treturn rect, glyph.Frame, bounds, dot\n}",
"func NewRuneCursor(in io.Reader, nn ...int) *RuneCursor {\n\tvar n int\n\tif len(nn) > 0 {\n\t\tn = nn[0]\n\t}\n\t// This buffer is used when reading from the underlying io.Reader.\n\t// It is necessary to read from the io.Reader because otherwise\n\t// we can't call utf8.DecodeRune on it\n\tif n <= 0 {\n\t\t// by default, read up to 40 bytes = maximum 10 runes worth of data\n\t\tn = 40\n\t}\n\n\tbuf := make([]byte, n)\n\treturn &RuneCursor{\n\t\tbuf: buf,\n\t\tbuflen: n,\n\t\tbufpos: n, // set to maximum to force filling up the bufer on first read\n\t\tcolumn: 1,\n\t\tin: in,\n\t\tline: bytes.Buffer{},\n\t\tlineno: 1,\n\t\tnread: 0,\n\t\trabuf: nil,\n\t}\n}",
"func CharToRune(val *rune) sql.Scanner {\n\treturn charToRune{val: val}\n}",
"func (k Key) Rune() rune {\n\tr := rune(k)\n\tif r < 0 {\n\t\treturn -1\n\t}\n\treturn rune(k)\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
RefString returns a pointer to a newly created string.
|
func RefString(value string) *string {
return &value
}
|
[
"func RefFromString(s string) *string {\n\treturn &s\n}",
"func makeStringPtr(s string) *string {\n\treturn &s\n}",
"func stringPointer(s string) *string {\n\treturn &s\n}",
"func TestStringPtr(s string) *string {\n\treturn &s\n}",
"func NewString() *String {\n\treturn &String{}\n}",
"func PointerToString(str *string) string {\n\tif str == nil {\n\t\treturn \"<nil>\"\n\t}\n\treturn *str\n}",
"func JSValueMakeString(ctx JSContextRef, string JSStringRef) JSValueRef {\n\tcctx, cctxAllocMap := *(*C.JSContextRef)(unsafe.Pointer(&ctx)), cgoAllocsUnknown\n\tcstring, cstringAllocMap := *(*C.JSStringRef)(unsafe.Pointer(&string)), cgoAllocsUnknown\n\t__ret := C.JSValueMakeString(cctx, cstring)\n\truntime.KeepAlive(cstringAllocMap)\n\truntime.KeepAlive(cctxAllocMap)\n\t__v := *(*JSValueRef)(unsafe.Pointer(&__ret))\n\treturn __v\n}",
"func StringAsPTR(value string) *string {\n\treturn &value\n}",
"func JSStringRetain(string JSStringRef) JSStringRef {\n\tcstring, cstringAllocMap := *(*C.JSStringRef)(unsafe.Pointer(&string)), cgoAllocsUnknown\n\t__ret := C.JSStringRetain(cstring)\n\truntime.KeepAlive(cstringAllocMap)\n\t__v := *(*JSStringRef)(unsafe.Pointer(&__ret))\n\treturn __v\n}",
"func JSStringCreateWithUTF8CString(string string) JSStringRef {\n\tstring = safeString(string)\n\tcstring, cstringAllocMap := unpackPCharString(string)\n\t__ret := C.JSStringCreateWithUTF8CString(cstring)\n\truntime.KeepAlive(string)\n\truntime.KeepAlive(cstringAllocMap)\n\t__v := *(*JSStringRef)(unsafe.Pointer(&__ret))\n\treturn __v\n}",
"func (s String) Ptr() *string {\n\tif !s.Valid {\n\t\treturn nil\n\t}\n\n\treturn &s.Data\n}",
"func derefStr(s *string) string {\n\tif s == nil {\n\t\treturn \"\"\n\t}\n\treturn *s\n}",
"func Ref(logicalName interface{}) string {\n\treturn encode(fmt.Sprintf(`{ \"Ref\": %q }`, logicalName))\n}",
"func Strp(s string) *string {\n\treturn &s\n}",
"func StringFromPtr(s *string) String {\n\tif s == nil {\n\t\treturn NewString(\"\", false)\n\t}\n\n\treturn NewString(*s, true)\n}",
"func (i *Reference) String() string {\n\tif i == nil {\n\t\treturn defaultStringValue\n\t}\n\treturn fmt.Sprintf(\"Registry: %s\\nRepository: %s\\nTag: %s\\nDigest: %s\\nReference: %s\\n\", i.Registry, i.Repository, i.Tag, i.Digest, i.Reference)\n}",
"func NewString(value string) (DataType, error) {\n\treturnValue := new(String)\n\treturnValue.value = value\n\treturn returnValue, nil\n}",
"func ToRef(i int, ref string) string {\n\tif i < 0 {\n\t\treturn \"\"\n\t}\n\treturn ref + \":\" + strconv.Itoa(i)\n}",
"func (r *Reader) StringPtr(v **string) {\n\tvar bs []byte\n\tr.Uint8s(&bs)\n\ts := unsafeGetString(bs)\n\t*v = &s\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
fetch fetches the IP addresses from the database.
|
func (t *IPsTable) fetch(c context.Context) error {
db := database.Get(c)
rows, err := db.QueryContext(c, `
SELECT id, ipv4, vlan_id
FROM ips
`)
if err != nil {
return errors.Annotate(err, "failed to select IP addresses").Err()
}
defer rows.Close()
for rows.Next() {
ip := &IP{}
if err := rows.Scan(&ip.Id, &ip.IPv4, &ip.VLANId); err != nil {
return errors.Annotate(err, "failed to scan IP address").Err()
}
t.current = append(t.current, ip)
}
return nil
}
|
[
"func (f *PostgresPhysicalAssetFetcher) FetchIPs(ctx context.Context, limit, offset int) ([]domain.AssetIP, error) {\n\trows, err := f.DB.Conn().QueryContext(ctx, fetchIPsQuery, limit, offset)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tips := make([]domain.AssetIP, 0, limit)\n\tfor rows.Next() {\n\t\tvar ipAddr string\n\t\tvar network string\n\t\tvar location sql.NullString\n\t\tvar resourceOwner sql.NullString\n\t\tvar businessUnit sql.NullString\n\t\tif err := rows.Scan(&ipAddr, &network, &location, &resourceOwner, &businessUnit); err != nil {\n\t\t\t// this would indicate an error in our schema or ordering of variables.\n\t\t\t// either case would be a terminal error, so we close the rows at best effort and return.\n\t\t\t_ = rows.Close()\n\t\t\treturn nil, err\n\t\t}\n\t\tip := domain.AssetIP{\n\t\t\tIP: ipAddr,\n\t\t\tNetwork: network,\n\t\t}\n\t\tif location.Valid {\n\t\t\tip.Location = location.String\n\t\t}\n\t\tif resourceOwner.Valid {\n\t\t\tip.ResourceOwner = resourceOwner.String\n\t\t}\n\t\tif businessUnit.Valid {\n\t\t\tip.BusinessUnit = businessUnit.String\n\t\t}\n\t\tips = append(ips, ip)\n\t}\n\tif err := rows.Close(); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn ips, nil\n}",
"func (tbl AddressTable) Fetch(req require.Requirement, query string, args ...interface{}) ([]*Address, error) {\n\treturn tbl.doQuery(req, false, query, args...)\n}",
"func Fetch(query string) (Ip, error) {\n\tvar response Ip\n\n\tresp, err := http.Get(\"http://freegeoip.net/json/\" + query)\n\tif err != nil {\n\t\treturn response, err\n\t}\n\tdefer resp.Body.Close()\n\n\tswitch resp.StatusCode {\n\tcase 403:\n\t\treturn response, errors.New(\"freegeoip hourly limit reached\")\n\tcase 404:\n\t\treturn response, errors.New(\"invalid ip Address, or not found\")\n\tdefault:\n\t}\n\n\tbody, err := ioutil.ReadAll(resp.Body)\n\tif err != nil {\n\t\treturn response, err\n\t}\n\terr = json.Unmarshal(body, &response)\n\treturn response, err\n}",
"func (q ipAddressQuery) All(ctx context.Context, exec boil.ContextExecutor) (IPAddressSlice, error) {\n\tvar o []*IPAddress\n\n\terr := q.Bind(ctx, exec, &o)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"models: failed to assign all query results to IPAddress slice\")\n\t}\n\n\tif len(ipAddressAfterSelectHooks) != 0 {\n\t\tfor _, obj := range o {\n\t\t\tif err := obj.doAfterSelectHooks(ctx, exec); err != nil {\n\t\t\t\treturn o, err\n\t\t\t}\n\t\t}\n\t}\n\n\treturn o, nil\n}",
"func (ds *DataStore) GetActiveIPs(ctx context.Context, date time.Time) (*model.ActiveIPs, error) {\n\tvar err error\n\tvar aip model.ActiveIPs\n\taip.Date = date\n\n\tquery := \"select distinct a.ip from a_nameservers, a where a_nameservers.a_id = a.id and first_seen <= $1 and (last_seen >= $1 or last_seen is NULL)\"\n\trows, err := ds.db.Query(ctx, query, date)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer rows.Close()\n\n\taip.IPv4IPs = make([]string, 0)\n\tfor rows.Next() {\n\t\tvar ipv4 string\n\t\terr = rows.Scan(&ipv4)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\taip.IPv4IPs = append(aip.IPv4IPs, ipv4)\n\t}\n\n\tquery = \"select distinct aaaa.ip from aaaa_nameservers, aaaa where aaaa_nameservers.aaaa_id = aaaa.id and first_seen <= $1 and (last_seen >= $1 or last_seen is NULL)\"\n\trows, err = ds.db.Query(ctx, query, date)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer rows.Close()\n\n\taip.IPv6IPs = make([]string, 0)\n\tfor rows.Next() {\n\t\tvar ipv6 string\n\t\terr = rows.Scan(&ipv6)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\taip.IPv6IPs = append(aip.IPv6IPs, ipv6)\n\t}\n\n\treturn &aip, nil\n}",
"func (s *serverData) ips() (ips []netip.Addr) {\n\tips = make([]netip.Addr, 0, len(s.IPs))\n\tfor _, ipObject := range s.IPs {\n\t\tif ipObject.Type != \"entry\" {\n\t\t\tcontinue\n\t\t}\n\t\tips = append(ips, ipObject.IP.IP)\n\t}\n\treturn ips\n}",
"func (m *eRepository) fetch(ctx context.Context, query string, args ...interface{}) ([]*model.Cart, error) {\n\n\trows, err := m.Conn.QueryContext(ctx, query, args...)\n\n\tif err != nil {\n\n\t\treturn nil, err\n\t}\n\tdefer rows.Close()\n\tresult := make([]*model.Cart, 0)\n\tfor rows.Next() {\n\t\tt := new(model.Cart)\n\n\t\terr = rows.Scan(\n\t\t\t&t.ID,\n\t\t\t&t.Code,\n\t\t\t&t.Prodid,\n\t\t\t&t.Name,\n\t\t\t&t.Price,\n\t\t\t&t.Items,\n\t\t\t&t.Dprice,\n\t\t)\n\n\t\tif err != nil {\n\n\t\t\treturn nil, err\n\t\t}\n\n\t\tresult = append(result, t)\n\t}\n\n\treturn result, nil\n}",
"func (cursor *Cursor) Fetch(ctx context.Context) (*CursorRows, error) {\n\treturn cursor.NewCursorRows()\n}",
"func (database *Database) Fetch(sql string, args ...interface{}) *sql.Row {\n\treturn database.db.QueryRow(sql, args)\n}",
"func FindIPAddress(ctx context.Context, exec boil.ContextExecutor, iD int, selectCols ...string) (*IPAddress, error) {\n\tipAddressObj := &IPAddress{}\n\n\tsel := \"*\"\n\tif len(selectCols) > 0 {\n\t\tsel = strings.Join(strmangle.IdentQuoteSlice(dialect.LQ, dialect.RQ, selectCols), \",\")\n\t}\n\tquery := fmt.Sprintf(\n\t\t\"select %s from \\\"ip_addresses\\\" where \\\"id\\\"=$1\", sel,\n\t)\n\n\tq := queries.Raw(query, iD)\n\n\terr := q.Bind(ctx, exec, ipAddressObj)\n\tif err != nil {\n\t\tif errors.Is(err, sql.ErrNoRows) {\n\t\t\treturn nil, sql.ErrNoRows\n\t\t}\n\t\treturn nil, errors.Wrap(err, \"models: unable to select from ip_addresses\")\n\t}\n\n\tif err = ipAddressObj.doAfterSelectHooks(ctx, exec); err != nil {\n\t\treturn ipAddressObj, err\n\t}\n\n\treturn ipAddressObj, nil\n}",
"func (h *DbHandle) FetchAll(sqlStr string, args ...interface{}) (*[]map[string]string, error) {\n\tdb := h.GetSlave()\n\tif db == nil {\n\t\treturn nil, errors.New(\"db: Slave DB is nil\")\n\t}\n\n\treturn h.queryAll(db, sqlStr, args...)\n}",
"func fetchGeoIP(v Visit) (Visit, error) {\n\t// http://api.ipstack.com/check\\?access_key\\=7eca814a6de384aab338e110c57fef37\n\tparams := url.Values{}\n\tparams.Add(\"access_key\", os.Getenv(\"IP_STACK_ACCESS_KEY\"))\n\turl := \"http://api.ipstack.com/\" + url.QueryEscape(v.Ip) + \"?\" + params.Encode()\n\tfmt.Println(\"fetching IP: %s\", url)\n\tr, err := http.Get(url)\n\tif err != nil {\n\t\treturn Visit{}, fmt.Errorf(\"could not fetch visit from %s: %v\", url, v)\n\t}\n\tif r.StatusCode != http.StatusOK {\n\t\treturn Visit{}, fmt.Errorf(\"bad response code: %d\\n\", r.StatusCode)\n\t}\n\tnewVisit := Visit{}\n\tdefer r.Body.Close()\n\tbodyBytes, _ := ioutil.ReadAll(r.Body)\n\tfmt.Println(string(bodyBytes))\n\terr = json.Unmarshal(bodyBytes, &newVisit)\n\tif err != nil {\n\t\treturn Visit{}, fmt.Errorf(\"could not decode json to visit: %v\", err)\n\t}\n\tif newVisit.Ip == \"\" {\n\t\treturn Visit{}, fmt.Errorf(\"could not convert bytes to Visit: %s\\n\", string(bodyBytes))\n\t}\n\tif newVisit.Latitude == 0 {\n\t\treturn Visit{}, fmt.Errorf(\"could not fetch new lat/lon: %s\\n\", string(bodyBytes))\n\t}\n\t// copy over non-ipstack properties\n\tnewVisit.Href = v.Href\n\tnewVisit.Visit_Date = v.Visit_Date\n\treturn newVisit, nil\n}",
"func LookupIP(host string) ([]IP, error) {}",
"func getIPs(startDate time.Time, endDate time.Time) (IPs int, userAgentIPs map[string]int, err error) {\n\t// This nested map approach (inside of a combined key) should allow for counting the # of unique IP's per user agent\n\tIPsPerUserAgent := make(map[string]map[[16]byte]int)\n\n\t// Retrieve entire result set of valid `/currentrelease` requests for the desired time range\n\tuniqueIPs := make(map[[16]byte]int)\n\tdbQuery := `\n\t\tSELECT http_user_agent, client_ipv4, client_ipv6, client_ip_strange\n\t\tFROM download_log\n\t\tWHERE request = '/currentrelease'\n\t\t\tAND http_user_agent LIKE 'sqlitebrowser %' AND http_user_agent NOT LIKE '%AppEngine%'\n\t\t\tAND request_time > $1\n\t\t\tAND request_time < $2\n\t\t\tAND status = 200`\n\trows, err := pg.Query(dbQuery, &startDate, &endDate)\n\tif err != nil {\n\t\tlog.Printf(\"Database query failed: %v\\n\", err)\n\t\treturn\n\t}\n\tdefer rows.Close()\n\trowCount := 0\n\tfor rows.Next() {\n\t\trowCount++\n\t\tvar userAgent pgtype.Text\n\t\tvar IPv4, IPv6, IPStrange pgtype.Text\n\t\terr = rows.Scan(&userAgent, &IPv4, &IPv6, &IPStrange)\n\t\tif err != nil {\n\t\t\tlog.Printf(\"Error retrieving rows: %v\\n\", err)\n\t\t\treturn\n\t\t}\n\n\t\t// Work out the key to use. We use a hash of the IP address, to stop weird characters in the IP Strange field\n\t\t// being a problem\n\t\tvar IPHash [16]byte\n\t\tif IPStrange.Status == pgtype.Present {\n\t\t\tIPHash = md5.Sum([]byte(IPStrange.String))\n\t\t} else if IPv6.Status == pgtype.Present {\n\t\t\tIPHash = md5.Sum([]byte(IPv6.String))\n\t\t} else if IPv4.Status == pgtype.Present {\n\t\t\tIPHash = md5.Sum([]byte(IPv4.String))\n\t\t} else {\n\t\t\t// This shouldn't happen, but check for it just in case\n\t\t\tlog.Fatalf(\"Doesn't seem to be any non-NULL client IP field for one of the rows\")\n\t\t}\n\n\t\t// Update the unique IP address counter as appropriate\n\t\tuniqueIPs[IPHash]++\n\n\t\t// Increment the counter for the user agent + IP address combination\n\t\tipMap, ok := IPsPerUserAgent[userAgent.String]\n\t\tif !ok {\n\t\t\tipMap = make(map[[16]byte]int)\n\t\t\tIPsPerUserAgent[userAgent.String] = ipMap\n\t\t}\n\t\tipMap[IPHash]++\n\t}\n\n\t// Unique IP addresses\n\tIPs = len(uniqueIPs)\n\n\t// Number of unique IP addresses per user agent\n\tuserAgentIPs = make(map[string]int)\n\tfor i, j := range IPsPerUserAgent {\n\t\tuserAgentIPs[i] = len(j)\n\t}\n\n\treturn\n}",
"func (r cRepository) Fetch() ([]*entity.Client, error) {\n\treturn nil, nil\n}",
"func fetchInstance(instanceKey *inst.InstanceKey, query string, onRow func(sqlutils.RowMap) error) error {\n\tif err := verifyInstance(instanceKey); err != nil {\n\t\treturn err\n\t}\n\tsqlDb, err := OpenDiscovery(instanceKey.Hostname, instanceKey.Port)\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn sqlutils.QueryRowsMap(sqlDb, query, onRow)\n}",
"func (hdb *HostDB) managedLookupIPNets(address modules.NetAddress) (ipNets []string, err error) {\n\t// Lookup the IP addresses of the host.\n\taddresses, err := hdb.deps.Resolver().LookupIP(address.Host())\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\t// Get the subnets of the addresses.\n\tfor _, ip := range addresses {\n\t\t// Set the filterRange according to the type of IP address.\n\t\tvar filterRange int\n\t\tif ip.To4() != nil {\n\t\t\tfilterRange = hosttree.IPv4FilterRange\n\t\t} else {\n\t\t\tfilterRange = hosttree.IPv6FilterRange\n\t\t}\n\n\t\t// Get the subnet.\n\t\t_, ipnet, err := net.ParseCIDR(fmt.Sprintf(\"%s/%d\", ip.String(), filterRange))\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\t// Add the subnet to the host.\n\t\tipNets = append(ipNets, ipnet.String())\n\t}\n\treturn\n}",
"func (tbl RecordTable) Fetch(req require.Requirement, query string, args ...interface{}) ([]*Record, error) {\n\treturn tbl.doQuery(req, false, query, args...)\n}",
"func (fc *Client) PoolFetch(ctx context.Context, objID string) (*models.Pool, error) {\n\tfc.InPoolFetchID = objID\n\treturn fc.RetPoolFetchObj, fc.RetPoolFetchErr\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
needsUpdate returns true if the given row needs to be updated to match the given config.
|
func (*IPsTable) needsUpdate(row, cfg *IP) bool {
return row.VLANId != cfg.VLANId
}
|
[
"func NeedsUpdate(c *Config) (bool, error) {\n\tif !util.FileExists(versionPath) {\n\t\treturn true, nil\n\t}\n\n\tdat, err := ioutil.ReadFile(versionPath)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\n\tfu, _ := strconv.ParseUint(string(dat), 10, 32)\n\n\tlog.Debugf(\"updated of %s is %d\", versionPath, fu)\n\tlog.Debugf(\"updated of serverconfig is %d\", c.Updated)\n\n\tif uint(fu) < c.Updated {\n\t\treturn true, nil\n\t}\n\n\tlog.Debug(\"No need to do task\")\n\treturn false, nil\n}",
"func (s *seqTest) NeedsUpdate(int64) bool {\n\treturn s.update\n}",
"func (b *Block) NeedsUpdate() bool {\n\treturn b.needsUpdate\n}",
"func updateValid(update interface{}) bool {\n\tfuncLog := blaze.NewFuncLog(\"updateValid\", log, zap.Any(\"Update\", update))\n\tfuncLog.Started()\n\n\tvalid, msg, _ := sentinal.ValidateFieldsWithYAML(\n\t\tupdate,\n\t\tschemaFile,\n\t\tschemaPaths,\n\t)\n\n\t// checking if the update data is not trying to update UserID\n\tif reflect.ValueOf(update).FieldByName(\"UserID\").String() != \"\" {\n\t\tvalid = false\n\t\tmsg = map[string][]string{\n\t\t\t\"UserID\": []string{\"Tring to update UserID\"},\n\t\t}\n\t}\n\n\tfuncLog.Completed(zap.Any(\"Message\", msg))\n\treturn valid\n}",
"func (r *rowState) dirty() bool {\n\treturn len(r.savedColVals) == 0 || len(r.dirtyColVals) > 0\n}",
"func (c CronImpl) NeedsUpdate(name string, pattern string) bool {\n\treturn c[name] != nil && c[name].Pattern != pattern\n}",
"func (c *CardHorn) AppliedOnRow() bool {\n\treturn true\n}",
"func (r *ResourceBase) IsUpdated() (updated bool, err error) {\n\treturn false, errors.Errorf(\"Not implemented\")\n}",
"func (db *Database) UpdateShouldRender(ctx context.Context, shopURL string, shouldRender bool) error {\n\tconn, err := db.Conn(ctx)\n\tif err != nil {\n\t\treturn err\n\t}\n\tvar merchantID int64\n\tdefer conn.Release()\n\trow := conn.QueryRow(ctx,\n\t\t`UPDATE merchants SET (updated_at, should_render) = (current_timestamp, $2)\n\t\t\tWHERE shop_url = $1\n\t\t\tRETURNING id`, shopURL, shouldRender)\n\n\terr = row.Scan(&merchantID)\n\treturn err\n}",
"func (c *ClusterProvider) CanUpdate(spec *api.ClusterConfig) (bool, error) {\n\terr := c.maybeRefreshClusterStatus(spec)\n\tif err != nil {\n\t\treturn false, errors.Wrapf(err, \"fetching cluster status to determine update status\")\n\t}\n\n\tswitch status := *c.Status.ClusterInfo.Cluster.Status; status {\n\tcase awseks.ClusterStatusActive:\n\t\t// only active cluster can be upgraded\n\t\treturn true, nil\n\tdefault:\n\t\treturn false, fmt.Errorf(\"cannot update cluster %q in %q region due to status %q\", spec.Metadata.Name, spec.Metadata.Region, status)\n\t}\n}",
"func (r *Reconciler) ensureStatusUpdateRecord(logger logr.Logger, tier *toolchainv1alpha1.NSTemplateTier) (bool, error) {\n\thash, err := hash.ComputeHashForNSTemplateTier(tier)\n\tif err != nil {\n\t\treturn false, errs.Wrapf(err, \"unable to append an entry in the `status.updates` for NSTemplateTier '%s'\", tier.Name)\n\t}\n\t// if there was no previous status:\n\tif len(tier.Status.Updates) == 0 {\n\t\treturn true, r.addNewTierUpdate(tier, hash)\n\t}\n\t// check whether the entry was already added\n\tif tier.Status.Updates[len(tier.Status.Updates)-1].Hash == hash {\n\t\tlogger.Info(\"current tier template already exists in tier.status.updates\")\n\t\treturn false, nil\n\t}\n\tlogger.Info(\"Adding a new entry in tier.status.updates\")\n\treturn true, r.addNewTierUpdate(tier, hash)\n}",
"func isReadyforUpdate(nodeConfig *osev1.Node) bool {\n\tvar conditionTypes = []string{\n\t\tosev1.KubeAPIServerProgressing,\n\t\tosev1.KubeControllerManagerProgressing,\n\t\tosev1.KubeletProgressing,\n\t\tosev1.KubeAPIServerDegraded,\n\t\tosev1.KubeControllerManagerDegraded,\n\t\tosev1.KubeletDegraded,\n\t}\n\t// if the node config resource is empty, it is ready for the update\n\t// to hold the new configuration update request.\n\tif nodeConfig == nil {\n\t\treturn true\n\t}\n\tif len(nodeConfig.Status.WorkerLatencyProfileStatus.Conditions) > 0 {\n\t\tfor _, condition := range nodeConfig.Status.WorkerLatencyProfileStatus.Conditions {\n\t\t\tfor _, conditionType := range conditionTypes {\n\t\t\t\tif conditionType == condition.Type {\n\t\t\t\t\treturn false\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn true\n}",
"func (e *Engine) updateConfigTable(database, tableName, longLivedName string) error {\n\t// If table is not configured for search just return\n\t// Nothing to update or check\n\tcurrentTableName, currentTable := e.getConfigTable(longLivedName)\n\tif currentTableName == \"\" && currentTable == nil {\n\t\treturn nil\n\t}\n\n\tcolumnNames, err := e.getSrcTableColumns(database, tableName)\n\tif err != nil {\n\t\te.ErrorLog.Errorf(\"updateConfigTable: unable to get source column names for table %v, %v\", tableName, err)\n\t\treturn err\n\t}\n\n\tsort.Strings(columnNames)\n\t// Build a new list of only fields contained in the new list of column names\n\tnewFields := make([]*ConfigField, 0)\n\tfor _, field := range currentTable.Fields {\n\t\tindex := sort.SearchStrings(columnNames, field.Field)\n\t\tif index < len(columnNames) && columnNames[index] == field.Field {\n\t\t\tnewFields = append(newFields, field)\n\t\t}\n\t}\n\n\tif len(newFields) > 0 {\n\t\tcurrentTable.Fields = newFields\n\t\tjsonConfig, err := json.Marshal(currentTable)\n\t\tif err != nil {\n\t\t\te.ErrorLog.Errorf(\"updateConfigTable: unable to marshal into json, table %v, %v\", tableName, err)\n\t\t\treturn err\n\t\t}\n\n\t\t_, err = e.IndexDB.Exec(`UPDATE search_config SET tablename = $1, config = $2 WHERE longlived_name = $3;`, tableName, jsonConfig, longLivedName)\n\t\tif err != nil {\n\t\t\te.ErrorLog.Errorf(\"updateConfigTable: unable to update search_config for table %v, %v\", tableName, err)\n\t\t\treturn err\n\t\t}\n\n\t\te.ErrorLog.Infof(\"Config updated for table %v\", longLivedName)\n\t} else {\n\t\t_, err := e.IndexDB.Exec(`DELETE FROM search_config WHERE longlived_name = $1`, longLivedName)\n\t\tif err != nil {\n\t\t\te.ErrorLog.Errorf(\"updateConfigTable: unable to delete for table %v: %v\", tableName, err)\n\t\t\treturn err\n\t\t}\n\n\t\te.ErrorLog.Infof(\"Config for table %v has been removed, since none of the originally indexed fields no longer exist\", tableName)\n\t}\n\n\treturn nil\n}",
"func (u *updateNode) BatchedNext(params runParams) (bool, error) {\n\tif u.run.done {\n\t\treturn false, nil\n\t}\n\n\t// Advance one batch. First, clear the last batch.\n\tu.run.tu.clearLastBatch(params.ctx)\n\n\t// Now consume/accumulate the rows for this batch.\n\tlastBatch := false\n\tfor {\n\t\tif err := params.p.cancelChecker.Check(); err != nil {\n\t\t\treturn false, err\n\t\t}\n\n\t\t// Advance one individual row.\n\t\tif next, err := u.source.Next(params); !next {\n\t\t\tlastBatch = true\n\t\t\tif err != nil {\n\t\t\t\treturn false, err\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\n\t\t// Process the update for the current source row, potentially\n\t\t// accumulating the result row for later.\n\t\tif err := u.processSourceRow(params, u.source.Values()); err != nil {\n\t\t\treturn false, err\n\t\t}\n\n\t\t// Are we done yet with the current batch?\n\t\tif u.run.tu.currentBatchSize >= u.run.tu.maxBatchSize {\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif u.run.tu.currentBatchSize > 0 {\n\t\tif !lastBatch {\n\t\t\t// We only run/commit the batch if there were some rows processed\n\t\t\t// in this batch.\n\t\t\tif err := u.run.tu.flushAndStartNewBatch(params.ctx); err != nil {\n\t\t\t\treturn false, err\n\t\t\t}\n\t\t}\n\t}\n\n\tif lastBatch {\n\t\tif err := u.run.tu.finalize(params.ctx); err != nil {\n\t\t\treturn false, err\n\t\t}\n\t\t// Remember we're done for the next call to BatchedNext().\n\t\tu.run.done = true\n\t}\n\n\t// Possibly initiate a run of CREATE STATISTICS.\n\tparams.ExecCfg().StatsRefresher.NotifyMutation(\n\t\tu.run.tu.tableDesc().GetID(),\n\t\tu.run.tu.lastBatchSize,\n\t)\n\n\treturn u.run.tu.lastBatchSize > 0, nil\n}",
"func (l *gcCPULimiterState) needUpdate(now int64) bool {\n\treturn now-l.lastUpdate.Load() > gcCPULimiterUpdatePeriod\n}",
"func needsUpdate(current, desired network.VirtualNetworkGatewayConnection) bool {\n\tif desired.Name == nil ||\n\t\tdesired.VirtualNetworkGatewayConnectionPropertiesFormat == nil ||\n\t\tdesired.VirtualNetworkGatewayConnectionPropertiesFormat.VirtualNetworkGateway1 == nil ||\n\t\tdesired.VirtualNetworkGatewayConnectionPropertiesFormat.VirtualNetworkGateway1.ID == nil ||\n\t\tdesired.VirtualNetworkGatewayConnectionPropertiesFormat.VirtualNetworkGateway2 == nil ||\n\t\tdesired.VirtualNetworkGatewayConnectionPropertiesFormat.VirtualNetworkGateway2.ID == nil {\n\t\treturn false\n\t}\n\n\tif current.Name == nil ||\n\t\t*current.Name != *desired.Name {\n\t\treturn true\n\t}\n\n\tif current.VirtualNetworkGatewayConnectionPropertiesFormat == nil {\n\t\treturn true\n\t}\n\n\tif current.VirtualNetworkGatewayConnectionPropertiesFormat.ConnectionType !=\n\t\tdesired.VirtualNetworkGatewayConnectionPropertiesFormat.ConnectionType {\n\t\treturn true\n\t}\n\n\tif current.VirtualNetworkGatewayConnectionPropertiesFormat.VirtualNetworkGateway1 == nil ||\n\t\tcurrent.VirtualNetworkGatewayConnectionPropertiesFormat.VirtualNetworkGateway1.ID == nil ||\n\t\t*current.VirtualNetworkGatewayConnectionPropertiesFormat.VirtualNetworkGateway1.ID !=\n\t\t\t*desired.VirtualNetworkGatewayConnectionPropertiesFormat.VirtualNetworkGateway1.ID {\n\t\treturn true\n\t}\n\n\tif current.VirtualNetworkGatewayConnectionPropertiesFormat.VirtualNetworkGateway2 == nil ||\n\t\tcurrent.VirtualNetworkGatewayConnectionPropertiesFormat.VirtualNetworkGateway2.ID == nil ||\n\t\t*current.VirtualNetworkGatewayConnectionPropertiesFormat.VirtualNetworkGateway2.ID !=\n\t\t\t*desired.VirtualNetworkGatewayConnectionPropertiesFormat.VirtualNetworkGateway2.ID {\n\t\treturn true\n\t}\n\n\tif current.VirtualNetworkGatewayConnectionPropertiesFormat.ConnectionStatus == network.VirtualNetworkGatewayConnectionStatusNotConnected {\n\t\treturn true\n\t}\n\n\treturn false\n}",
"func ShouldCheckForUpdates(upd *settings.UpdateCheck) bool {\n\tdiff := time.Since(upd.LastUpdateCheck)\n\treturn diff.Hours() >= float64(hoursBeforeCheck)\n}",
"func UpdateRecordRow(recordID int, newRecord string) (bool, error) {\n\n\t// mutex lock\n\tvar mutex = &sync.Mutex{}\n\n\tvar cwd, _ = os.Getwd()\n\n\t// init database driver\n\tdatabase, err := sql.Open(\"sqlite3\", cwd+\"/database/\"+DB_NAME)\n\tif err != nil {\n\t\tLOGS.ErrorLogger.Fatalln(err)\n\t}\n\tdefer database.Close()\n\n\tif err != nil {\n\t\tLOGS.ErrorLogger.Fatalln(err)\n\t\treturn false, err\n\t}\n\n\t// update record by ID\n\tcurrentTime := time.Now()\n\tcurrentTimestamp := currentTime.Format(\"2006-01-02 15:04:05\")\n\tstatementUpdateRecord, _ := database.Prepare(\"UPDATE records SET records_data=?, date_edited=? WHERE id=?\")\n\tmutex.Lock()\n\tstatementUpdateRecord.Exec(newRecord, currentTimestamp, recordID)\n\tmutex.Unlock()\n\n\tif err != nil {\n\t\treturn false, err\n\t} else {\n\t\treturn true, nil\n\t}\n}",
"func (s *status) update(err error) bool {\n\tif s.database == nil {\n\t\treturn false\n\t}\n\n\tvar errorMessage string\n\tvar phase postgresqlv1alpha1.PostgreSQLDatabasePhase\n\tswitch {\n\tcase err == nil:\n\t\tphase = postgresqlv1alpha1.PostgreSQLDatabasePhaseRunning\n\tcase err != nil:\n\t\terrorMessage = err.Error()\n\t\tif ctlerrors.IsInvalid(err) {\n\t\t\tphase = postgresqlv1alpha1.PostgreSQLDatabasePhaseInvalid\n\t\t} else {\n\t\t\tphase = postgresqlv1alpha1.PostgreSQLDatabasePhaseFailed\n\t\t}\n\t}\n\tphaseEqual := s.database.Status.Phase == phase\n\terrorEqual := s.database.Status.Error == errorMessage\n\thostEqual := s.database.Status.Host == s.host\n\tif phaseEqual && errorEqual && hostEqual {\n\t\treturn false\n\t}\n\ts.database.Status.PhaseUpdated = s.now()\n\ts.database.Status.Phase = phase\n\ts.database.Status.Host = s.host\n\ts.database.Status.User = s.user\n\ts.database.Status.Error = errorMessage\n\treturn true\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
computeChanges computes the changes that need to be made to the IP addresses in the database.
|
func (t *IPsTable) computeChanges(c context.Context, vlans []*config.VLAN) error {
cfgs := make(map[common.IPv4]*IP, len(vlans))
for _, vlan := range vlans {
ipv4, length, err := common.IPv4Range(vlan.CidrBlock)
if err != nil {
return errors.Annotate(err, "failed to determine start address and range for CIDR block %q", vlan.CidrBlock).Err()
}
// TODO(smut): Mark the first address as the network address and the last address as the broadcast address.
for i := int64(0); i < length; i++ {
cfgs[ipv4] = &IP{
IPv4: ipv4,
VLANId: vlan.Id,
}
ipv4++
}
}
for _, ip := range t.current {
if cfg, ok := cfgs[ip.IPv4]; ok {
// IP address found in the config.
if t.needsUpdate(ip, cfg) {
// IP address doesn't match the config.
cfg.Id = ip.Id
t.updates = append(t.updates, cfg)
}
// Record that the IP address config has been seen.
delete(cfgs, cfg.IPv4)
} else {
// IP address not found in the config.
t.removals = append(t.removals, ip)
}
}
// IP addresses remaining in the map are present in the config but not the database.
// Iterate deterministically over the slices to determine which IP addresses need to be added.
for _, vlan := range vlans {
ipv4, length, err := common.IPv4Range(vlan.CidrBlock)
if err != nil {
return errors.Annotate(err, "failed to determine start address and range for CIDR block %q", vlan.CidrBlock).Err()
}
for i := int64(0); i < length; i++ {
if ip, ok := cfgs[ipv4]; ok {
t.additions = append(t.additions, ip)
}
ipv4++
}
}
return nil
}
|
[
"func (o *IPAddress) Update(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error) {\n\tif !boil.TimestampsAreSkipped(ctx) {\n\t\tcurrTime := time.Now().In(boil.GetLocation())\n\n\t\to.UpdatedAt = currTime\n\t}\n\n\tvar err error\n\tif err = o.doBeforeUpdateHooks(ctx, exec); err != nil {\n\t\treturn 0, err\n\t}\n\tkey := makeCacheKey(columns, nil)\n\tipAddressUpdateCacheMut.RLock()\n\tcache, cached := ipAddressUpdateCache[key]\n\tipAddressUpdateCacheMut.RUnlock()\n\n\tif !cached {\n\t\twl := columns.UpdateColumnSet(\n\t\t\tipAddressAllColumns,\n\t\t\tipAddressPrimaryKeyColumns,\n\t\t)\n\t\twl = strmangle.SetComplement(wl, ipAddressGeneratedColumns)\n\n\t\tif !columns.IsWhitelist() {\n\t\t\twl = strmangle.SetComplement(wl, []string{\"created_at\"})\n\t\t}\n\t\tif len(wl) == 0 {\n\t\t\treturn 0, errors.New(\"models: unable to update ip_addresses, could not build whitelist\")\n\t\t}\n\n\t\tcache.query = fmt.Sprintf(\"UPDATE \\\"ip_addresses\\\" SET %s WHERE %s\",\n\t\t\tstrmangle.SetParamNames(\"\\\"\", \"\\\"\", 1, wl),\n\t\t\tstrmangle.WhereClause(\"\\\"\", \"\\\"\", len(wl)+1, ipAddressPrimaryKeyColumns),\n\t\t)\n\t\tcache.valueMapping, err = queries.BindMapping(ipAddressType, ipAddressMapping, append(wl, ipAddressPrimaryKeyColumns...))\n\t\tif err != nil {\n\t\t\treturn 0, err\n\t\t}\n\t}\n\n\tvalues := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(o)), cache.valueMapping)\n\n\tif boil.IsDebug(ctx) {\n\t\twriter := boil.DebugWriterFrom(ctx)\n\t\tfmt.Fprintln(writer, cache.query)\n\t\tfmt.Fprintln(writer, values)\n\t}\n\tvar result sql.Result\n\tresult, err = exec.ExecContext(ctx, cache.query, values...)\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"models: unable to update ip_addresses row\")\n\t}\n\n\trowsAff, err := result.RowsAffected()\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"models: failed to get rows affected by update for ip_addresses\")\n\t}\n\n\tif !cached {\n\t\tipAddressUpdateCacheMut.Lock()\n\t\tipAddressUpdateCache[key] = cache\n\t\tipAddressUpdateCacheMut.Unlock()\n\t}\n\n\treturn rowsAff, o.doAfterUpdateHooks(ctx, exec)\n}",
"func ComputeMigrationsToApply(ctx context.Context, diskMigrations []types.Migration, dbMigrations []types.MigrationDB) []types.Migration {\n\tflattenedMigrationDBs := flattenMigrationDBs(dbMigrations)\n\n\tlen := len(flattenedMigrationDBs)\n\tcommon.LogInfo(ctx, \"Number of flattened DB migrations: %d\", len)\n\n\tout := difference(diskMigrations, flattenedMigrationDBs)\n\n\treturn out\n}",
"func (c *IPAMContext) verifyAndAddIPsToDatastore(eni string, attachedENIIPs []*ec2.NetworkInterfacePrivateIpAddress, needEC2Reconcile bool) map[string]bool {\n\tvar ec2VerifiedAddresses []*ec2.NetworkInterfacePrivateIpAddress\n\tseenIPs := make(map[string]bool)\n\tfor _, privateIPv4 := range attachedENIIPs {\n\t\tstrPrivateIPv4 := aws.StringValue(privateIPv4.PrivateIpAddress)\n\t\tif strPrivateIPv4 == c.primaryIP[eni] {\n\t\t\tlog.Infof(\"Reconcile and skip primary IP %s on ENI %s\", strPrivateIPv4, eni)\n\t\t\tcontinue\n\t\t}\n\n\t\t// Check if this IP was recently freed\n\t\tipv4Addr := net.IPNet{IP: net.ParseIP(strPrivateIPv4), Mask: net.IPv4Mask(255, 255, 255, 255)}\n\t\tfound, recentlyFreed := c.reconcileCooldownCache.RecentlyFreed(strPrivateIPv4)\n\t\tif found {\n\t\t\tif recentlyFreed {\n\t\t\t\tlog.Debugf(\"Reconcile skipping IP %s on ENI %s because it was recently unassigned from the ENI.\", strPrivateIPv4, eni)\n\t\t\t\tcontinue\n\t\t\t} else {\n\t\t\t\tif needEC2Reconcile {\n\t\t\t\t\t// IMDS data might be stale\n\t\t\t\t\tlog.Debugf(\"This IP was recently freed, but is now out of cooldown. We need to verify with EC2 control plane.\")\n\t\t\t\t\t// Only call EC2 once for this ENI\n\t\t\t\t\tif ec2VerifiedAddresses == nil {\n\t\t\t\t\t\tvar err error\n\t\t\t\t\t\t// Call EC2 to verify IPs on this ENI\n\t\t\t\t\t\tec2VerifiedAddresses, err = c.awsClient.GetIPv4sFromEC2(eni)\n\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\tlog.Errorf(\"Failed to fetch ENI IP addresses from EC2! %v\", err)\n\t\t\t\t\t\t\t// Do not delete this IP from the datastore or cooldown until we have confirmed with EC2\n\t\t\t\t\t\t\tseenIPs[strPrivateIPv4] = true\n\t\t\t\t\t\t\tcontinue\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// Verify that the IP really belongs to this ENI\n\t\t\t\t\tisReallyAttachedToENI := false\n\t\t\t\t\tfor _, ec2Addr := range ec2VerifiedAddresses {\n\t\t\t\t\t\tif strPrivateIPv4 == aws.StringValue(ec2Addr.PrivateIpAddress) {\n\t\t\t\t\t\t\tisReallyAttachedToENI = true\n\t\t\t\t\t\t\tlog.Debugf(\"Verified that IP %s is attached to ENI %s\", strPrivateIPv4, eni)\n\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif !isReallyAttachedToENI {\n\t\t\t\t\t\tlog.Warnf(\"Skipping IP %s on ENI %s because it does not belong to this ENI!\", strPrivateIPv4, eni)\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// The IP can be removed from the cooldown cache\n\t\t\t\t// TODO: Here we could check if the IP is still used by a pod stuck in Terminating state. (Issue #1091)\n\t\t\t\tc.reconcileCooldownCache.Remove(strPrivateIPv4)\n\t\t\t}\n\t\t}\n\t\tlog.Infof(\"Trying to add %s\", strPrivateIPv4)\n\t\t// Try to add the IP\n\t\terr := c.dataStore.AddIPv4CidrToStore(eni, ipv4Addr, false)\n\t\tif err != nil && err.Error() != datastore.IPAlreadyInStoreError {\n\t\t\tlog.Errorf(\"Failed to reconcile IP %s on ENI %s\", strPrivateIPv4, eni)\n\t\t\tipamdErrInc(\"ipReconcileAdd\")\n\t\t\t// Continue to check the other IPs instead of bailout due to one wrong IP\n\t\t\tcontinue\n\n\t\t}\n\t\t// Mark action\n\t\tseenIPs[strPrivateIPv4] = true\n\t\treconcileCnt.With(prometheus.Labels{\"fn\": \"eniDataStorePoolReconcileAdd\"}).Inc()\n\t}\n\treturn seenIPs\n}",
"func updateAllEmptyEntries() error {\n\t// get all visits @0,0\n\tvisitFilters := Visit{\n\t\tHref: NO_INPUT,\n\t\tIp: NO_INPUT,\n\t\tCity: NO_INPUT,\n\t\tCountry_Code: NO_INPUT,\n\t\tCountry_Name: NO_INPUT,\n\t\tLatitude: 0,\n\t\tLongitude: 0,\n\t\tMetro_Code: NO_INPUT_INT,\n\t\tRegion_Code: NO_INPUT,\n\t\tTime_Zone: NO_INPUT,\n\t\tZip_Code: NO_INPUT,\n\t}\n\tquery, err := createQueryFromFilters(visitFilters, \"and\")\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Could not createQueryFromFilters: %v\", err)\n\t}\n\tctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)\n\tdefer cancel()\n\tcur, err := collection.Find(ctx, query, nil)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Collection.Find(): %v\\n\", err)\n\t}\n\tdefer cur.Close(context.Background())\n\t// go through each record and update\n\tfor cur.Next(context.Background()) {\n\t\tv := Visit{}\n\t\terr := cur.Decode(&v)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"could not decode visit: %v, %v\", v, err)\n\t\t}\n\t\tfmt.Printf(\"found visit to update: %v\\n\", spew.Sdump(v))\n\t\tnewVisit, err := fetchGeoIP(v)\n\t\tif err != nil {\n\t\t\tfmt.Printf(\"could not get info for new visit %v\", err)\n\t\t\tcontinue\n\t\t}\n\t\tfmt.Printf(\"found geoIP info for visit: %v\", newVisit)\n\t\t// success, merge and update in database\n\t\tif err = updateVisit(v.Ip, newVisit); err != nil {\n\t\t\tfmt.Printf(\"could not update visit: %v\", err)\n\t\t}\n\t}\n\treturn nil\n}",
"func (client CloudFlareClient) UpdateIPAddresses(ipv4, ipv6 net.IP) error {\n\tzonesResp, err := client.getZones()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tdnsRecordsUpdated := 0\n\tfor _, zone := range zonesResp.Zones {\n\t\tdnsRecordsResp, err := client.getDnsRecords(zone.ID)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tfor _, dnsRecord := range dnsRecordsResp.DnsRecords {\n\t\t\terr := client.applyIpAddressUpdate(&dnsRecord, ipv4, ipv6)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tdnsRecordsUpdated++\n\t\t}\n\t}\n\n\tClient(client).LogIPAddressUpdate(fmt.Sprintf(\"%d DNS records were updated\", dnsRecordsUpdated))\n\tlog.Printf(\"%d DNS records were updated at %s\", dnsRecordsUpdated, client.ServiceConfig.ServiceType)\n\n\treturn nil\n}",
"func (tsc *TestSubConn) UpdateAddresses([]resolver.Address) {}",
"func (store *memoryBlobStorage) applyChangesToShared() {\n\tfact := store.shared.table\n\tfor networkID, perNetworkChangeMap := range store.changes {\n\t\tfor id, change := range perNetworkChangeMap {\n\t\t\tswitch change.cType {\n\t\t\tcase Delete:\n\t\t\t\tdelete(fact[networkID], id)\n\t\t\tcase CreateOrUpdate:\n\t\t\t\tfact.initializeNetworkTable(networkID)\n\t\t\t\tfact[networkID][id] = change.blob\n\t\t\tdefault:\n\t\t\t\tpanic(fmt.Sprintf(\"unexpected change type %v\", change.cType))\n\t\t\t}\n\t\t}\n\t}\n}",
"func (p *CloudFlareProvider) submitChanges(ctx context.Context, changes []*cloudFlareChange) error {\n\t// return early if there is nothing to change\n\tif len(changes) == 0 {\n\t\tlog.Info(\"All records are already up to date\")\n\t\treturn nil\n\t}\n\n\tzones, err := p.Zones(ctx)\n\tif err != nil {\n\t\treturn err\n\t}\n\t// separate into per-zone change sets to be passed to the API.\n\tchangesByZone := p.changesByZone(zones, changes)\n\n\tfor zoneID, changes := range changesByZone {\n\t\trecords, err := p.listDNSRecordsWithAutoPagination(ctx, zoneID)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"could not fetch records from zone, %v\", err)\n\t\t}\n\t\tfor _, change := range changes {\n\t\t\tlogFields := log.Fields{\n\t\t\t\t\"record\": change.ResourceRecord.Name,\n\t\t\t\t\"type\": change.ResourceRecord.Type,\n\t\t\t\t\"ttl\": change.ResourceRecord.TTL,\n\t\t\t\t\"action\": change.Action,\n\t\t\t\t\"zone\": zoneID,\n\t\t\t}\n\n\t\t\tlog.WithFields(logFields).Info(\"Changing record.\")\n\n\t\t\tif p.DryRun {\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tresourceContainer := cloudflare.ZoneIdentifier(zoneID)\n\t\t\tif change.Action == cloudFlareUpdate {\n\t\t\t\trecordID := p.getRecordID(records, change.ResourceRecord)\n\t\t\t\tif recordID == \"\" {\n\t\t\t\t\tlog.WithFields(logFields).Errorf(\"failed to find previous record: %v\", change.ResourceRecord)\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\trecordParam := getUpdateDNSRecordParam(*change)\n\t\t\t\trecordParam.ID = recordID\n\t\t\t\terr := p.Client.UpdateDNSRecord(ctx, resourceContainer, recordParam)\n\t\t\t\tif err != nil {\n\t\t\t\t\tlog.WithFields(logFields).Errorf(\"failed to update record: %v\", err)\n\t\t\t\t}\n\t\t\t} else if change.Action == cloudFlareDelete {\n\t\t\t\trecordID := p.getRecordID(records, change.ResourceRecord)\n\t\t\t\tif recordID == \"\" {\n\t\t\t\t\tlog.WithFields(logFields).Errorf(\"failed to find previous record: %v\", change.ResourceRecord)\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\terr := p.Client.DeleteDNSRecord(ctx, resourceContainer, recordID)\n\t\t\t\tif err != nil {\n\t\t\t\t\tlog.WithFields(logFields).Errorf(\"failed to delete record: %v\", err)\n\t\t\t\t}\n\t\t\t} else if change.Action == cloudFlareCreate {\n\t\t\t\trecordParam := getCreateDNSRecordParam(*change)\n\t\t\t\t_, err := p.Client.CreateDNSRecord(ctx, resourceContainer, recordParam)\n\t\t\t\tif err != nil {\n\t\t\t\t\tlog.WithFields(logFields).Errorf(\"failed to create record: %v\", err)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn nil\n}",
"func ComputeRecipients(c context.Context, notifications []ToNotify, inputBlame []*gitpb.Commit, outputBlame Logs) []EmailNotify {\n\treturn computeRecipientsInternal(c, notifications, inputBlame, outputBlame,\n\t\tfunc(c context.Context, url string) ([]byte, error) {\n\t\t\ttransport, err := auth.GetRPCTransport(c, auth.AsSelf)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\n\t\t\treq, err := http.NewRequest(\"GET\", url, nil)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\treq = req.WithContext(c)\n\n\t\t\tresponse, err := (&http.Client{Transport: transport}).Do(req)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, errors.Annotate(err, \"failed to get data from %q\", url).Err()\n\t\t\t}\n\n\t\t\tdefer response.Body.Close()\n\t\t\tbytes, err := io.ReadAll(response.Body)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, errors.Annotate(err, \"failed to read response body from %q\", url).Err()\n\t\t\t}\n\n\t\t\treturn bytes, nil\n\t\t})\n}",
"func (lc *ListenerCache) recomputeListeners(ingresses map[metadata]*v1beta1.Ingress, secrets map[metadata]*v1.Secret) {\n\tadd, remove := lc.recomputeListener0(ingresses) // recompute ingress_http\n\tssladd, sslremove := lc.recomputeTLSListener0(ingresses, secrets) // recompute ingress_https\n\n\tadd = append(add, ssladd...)\n\tremove = append(remove, sslremove...)\n\tlc.Add(add...)\n\tlc.Remove(remove...)\n\n\tif len(add) > 0 || len(remove) > 0 {\n\t\tlc.Notify()\n\t}\n}",
"func (p *PiholeProvider) ApplyChanges(ctx context.Context, changes *plan.Changes) error {\n\t// Handle pure deletes first.\n\tfor _, ep := range changes.Delete {\n\t\tif err := p.api.deleteRecord(ctx, ep); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// Handle updated state - there are no endpoints for updating in place.\n\tupdateNew := make(map[piholeEntryKey]*endpoint.Endpoint)\n\tfor _, ep := range changes.UpdateNew {\n\t\tkey := piholeEntryKey{ep.DNSName, ep.RecordType}\n\t\tupdateNew[key] = ep\n\t}\n\n\tfor _, ep := range changes.UpdateOld {\n\t\t// Check if this existing entry has an exact match for an updated entry and skip it if so.\n\t\tkey := piholeEntryKey{ep.DNSName, ep.RecordType}\n\t\tif newRecord := updateNew[key]; newRecord != nil {\n\t\t\t// PiHole only has a single target; no need to compare other fields.\n\t\t\tif newRecord.Targets[0] == ep.Targets[0] {\n\t\t\t\tdelete(updateNew, key)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\t\tif err := p.api.deleteRecord(ctx, ep); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\t// Handle pure creates before applying new updated state.\n\tfor _, ep := range changes.Create {\n\t\tif err := p.api.createRecord(ctx, ep); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\tfor _, ep := range updateNew {\n\t\tif err := p.api.createRecord(ctx, ep); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\treturn nil\n}",
"func (t *IPsTable) update(c context.Context) error {\n\t// Avoid using the database connection to prepare unnecessary statements.\n\tif len(t.updates) == 0 {\n\t\treturn nil\n\t}\n\n\tdb := database.Get(c)\n\tstmt, err := db.PrepareContext(c, `\n\t\tUPDATE ips\n\t\tSET vlan_id = ?\n\t\tWHERE id = ?\n\t`)\n\tif err != nil {\n\t\treturn errors.Annotate(err, \"failed to prepare statement\").Err()\n\t}\n\tdefer stmt.Close()\n\n\t// Update each IP address in the table. It's more efficient to update the slice of\n\t// IP addresses once at the end rather than for each update, so use a defer.\n\tupdated := make(map[int64]*IP, len(t.updates))\n\tdefer func() {\n\t\tfor _, ip := range t.current {\n\t\t\tif u, ok := updated[ip.Id]; ok {\n\t\t\t\tip.VLANId = u.VLANId\n\t\t\t}\n\t\t}\n\t}()\n\tfor len(t.updates) > 0 {\n\t\tip := t.updates[0]\n\t\tif _, err := stmt.ExecContext(c, ip.VLANId, ip.Id); err != nil {\n\t\t\treturn errors.Annotate(err, \"failed to update IP address %q\", ip.IPv4).Err()\n\t\t}\n\t\tupdated[ip.Id] = ip\n\t\tt.updates = t.updates[1:]\n\t\tlogging.Infof(c, \"Updated IP address %q\", ip.IPv4)\n\t}\n\treturn nil\n}",
"func getChanges(db *sql.DB, tablename string, schema string, successful bool, configInfo ConfigInfo) error {\n\tvar changeid int\n\tif successful {\n\t\tchangeid = 0\n\t} else {\n\t\tchangeid = 1\n\t}\n\tupdateCount, err := getUpdateCount(db, tablename, schema)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif updateCount == 0 {\n\t\tif successful {\n\t\t\tconfigInfo.consumerWriter.noReplicationData()\n\t\t}\n\t\treturn nil\n\t}\n\n\tmaxChangeID, err := getLatestUpdate(db, tablename, schema)\n\tif err != nil {\n\t\treturn err\n\t}\n\tgetChangesForContext := []string{\n\t\t\"select\",\n\t\t\" dn_trunc, CONTROL_LONG, LASTCHANGEID\",\n\t\t\" from %s.LDAP_ENTRY, %s.REPLSTATUS, %s.%s\",\n\t\t\" where REPLSTATUS.LASTCHANGEID+%d=%s\",\n\t\t\".id and ldap_entry.eid=REPLSTATUS.eid\"}\n\tgetChangesForContextTemplate := strings.Join(getChangesForContext, \"\")\n\tgetChangesForContextSQL := fmt.Sprintf(getChangesForContextTemplate, schema, schema, schema, tablename, changeid, tablename)\n\tlog.Debug(fmt.Sprintf(\"Executing SQL: %s\", getChangesForContextSQL))\n\tst, err := db.Prepare(getChangesForContextSQL)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Error on Prepare: \", err)\n\t}\n\trows, err := st.Query()\n\tif err != nil {\n\t\tif strings.Contains(err.Error(), \"SQL0204N\") {\n\t\t\terr = fmt.Errorf(\" Table %s does not exist\\n\", tablename)\n\t\t} else {\n\t\t\terr = fmt.Errorf(\"Error on Query: \", err)\n\t\t}\n\t\treturn err\n\t}\n\tdefer rows.Close()\n\tfor rows.Next() {\n\t\tvar consumerDN, controls string\n\t\tvar lastChangeID int\n\t\terr = rows.Scan(&consumerDN, &controls, &lastChangeID)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"Error on Scan: \", err)\n\t\t}\n\t\tlog.Debug(fmt.Sprintf(\"consumerDN: %s controlString: %s lastChangeID: %s\",\n\t\t\tconsumerDN, controls, lastChangeID))\n\t\tconsumerComponents := strings.SplitN(consumerDN, \",\", 2)\n\t\trdnComponents := strings.SplitN(consumerComponents[0], \"=\", 2)\n\t\tconsumer := rdnComponents[1]\n\t\tif configInfo.replica != \"\" && consumer != configInfo.replica {\n log.Debug(\"Skipping replica %s\\n\", consumer)\n continue\n }\n\t\tcontrolComponents := strings.SplitN(controls, \"control: 1.3.18.0.2.10.19 false:: \", 2)\n\t\tif len(controlComponents) < 2 {\n\t\t\tlog.Info(\"No data found!\")\n\t\t\tcontinue\n\t\t}\n\t\tcontrol := strings.Join(strings.Split(controlComponents[1], \"\\n \"), \"\")\n\t\tdeltaChangeID := maxChangeID - lastChangeID\n timestamp, _ := decodeAndFindModifytimestamp(control)\n t, _ := time.Parse(\"20060102150405.000000Z\", timestamp)\n\t\tif successful {\n configInfo.consumerWriter.writeLastSuccessfulChange(consumer, t)\n configInfo.consumerWriter.writeQueueLength(consumer, lastChangeID, deltaChangeID)\n\t\t} else {\n configInfo.consumerWriter.writeFirstPendingChangeAge(consumer, t)\n }\n\t}\n\treturn nil\n}",
"func (p *OVHProvider) ApplyChanges(ctx context.Context, changes *plan.Changes) error {\n\tzones, records, err := p.zonesRecords(ctx)\n\tzonesChangeUniques := map[string]bool{}\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tallChanges := make([]ovhChange, 0, countTargets(changes.Create, changes.UpdateNew, changes.UpdateOld, changes.Delete))\n\n\tallChanges = append(allChanges, newOvhChange(ovhCreate, changes.Create, zones, records)...)\n\tallChanges = append(allChanges, newOvhChange(ovhCreate, changes.UpdateNew, zones, records)...)\n\n\tallChanges = append(allChanges, newOvhChange(ovhDelete, changes.UpdateOld, zones, records)...)\n\tallChanges = append(allChanges, newOvhChange(ovhDelete, changes.Delete, zones, records)...)\n\n\tlog.Infof(\"OVH: %d changes will be done\", len(allChanges))\n\n\teg, _ := errgroup.WithContext(ctx)\n\tfor _, change := range allChanges {\n\t\tchange := change\n\t\tzonesChangeUniques[change.Zone] = true\n\t\teg.Go(func() error { return p.change(change) })\n\t}\n\tif err := eg.Wait(); err != nil {\n\t\treturn err\n\t}\n\n\tlog.Infof(\"OVH: %d zones will be refreshed\", len(zonesChangeUniques))\n\n\teg, _ = errgroup.WithContext(ctx)\n\tfor zone := range zonesChangeUniques {\n\t\tzone := zone\n\t\teg.Go(func() error { return p.refresh(zone) })\n\t}\n\tif err := eg.Wait(); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}",
"func updateACLIPAddr(ctx *zedrouterContext, changedDepend []types.ACLDepend) {\n\tlog.Functionf(\"updateACLIPAddr changedDepend: %+v\", changedDepend)\n\tpub := ctx.pubAppNetworkStatus\n\titems := pub.GetAll()\n\tfor _, st := range items {\n\t\tstatus := st.(types.AppNetworkStatus)\n\t\tconfig := lookupAppNetworkConfig(ctx, status.Key())\n\t\tif config == nil || !config.Activate {\n\t\t\tlog.Tracef(\"updateACLIPAddr skipping %s: no config\",\n\t\t\t\tstatus.Key())\n\t\t\tcontinue\n\t\t}\n\t\tfor i := range config.UnderlayNetworkList {\n\t\t\tulConfig := &config.UnderlayNetworkList[i]\n\t\t\tulStatus := &status.UnderlayNetworkList[i]\n\t\t\tif ulStatus.ACLDependList == nil {\n\t\t\t\tlog.Tracef(\"updateACLIPAddr skipping ul %d %s: ACLDependList\",\n\t\t\t\t\ti, status.Key())\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tmatch := false\n\t\t\tfor _, d := range ulStatus.ACLDependList {\n\t\t\t\t// if d.Ifname in changedDepend\n\t\t\t\tfor _, c := range changedDepend {\n\t\t\t\t\tif d.Ifname != c.Ifname {\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t\tif len(d.IPAddr) == 0 || len(c.IPAddr) == 0 ||\n\t\t\t\t\t\td.IPAddr.Equal(c.IPAddr) {\n\t\t\t\t\t\tlog.Noticef(\"updateACLIPAddr match on %s == %s for %s\",\n\t\t\t\t\t\t\tc.IPAddr, d.IPAddr, status.Key())\n\t\t\t\t\t\tmatch = true\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif match {\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tif !match {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tipsets := compileAppInstanceIpsets(ctx,\n\t\t\t\tconfig.UnderlayNetworkList)\n\t\t\tdoAppNetworkModifyUnderlayNetwork(ctx, &status,\n\t\t\t\tulConfig, ulConfig, ulStatus, ipsets, true)\n\t\t\tpublishAppNetworkStatus(ctx, &status)\n\t\t}\n\t}\n}",
"func processChanges(origChanges []*Validator) (updates, removals []*Validator, err error) {\n\t// Make a deep copy of the changes and sort by proTxHash.\n\tchanges := validatorListCopy(origChanges)\n\tsort.Sort(ValidatorsByProTxHashes(changes))\n\n\tremovals = make([]*Validator, 0, len(changes))\n\tupdates = make([]*Validator, 0, len(changes))\n\tvar prevProTxHash []byte\n\n\t// Scan changes by proTxHash and append valid validators to updates or removals lists.\n\tfor _, valUpdate := range changes {\n\t\tif bytes.Equal(valUpdate.ProTxHash, prevProTxHash) {\n\t\t\terr = fmt.Errorf(\"duplicate entry %v in %v\", valUpdate, changes)\n\t\t\treturn nil, nil, err\n\t\t}\n\n\t\tswitch {\n\t\tcase valUpdate.VotingPower < 0:\n\t\t\terr = fmt.Errorf(\"voting power can't be negative: %d\", valUpdate.VotingPower)\n\t\t\treturn nil, nil, err\n\t\tcase valUpdate.VotingPower > MaxTotalVotingPower:\n\t\t\terr = fmt.Errorf(\"to prevent clipping/overflow, voting power can't be higher than %d, got %d\",\n\t\t\t\tMaxTotalVotingPower, valUpdate.VotingPower)\n\t\t\treturn nil, nil, err\n\t\tcase valUpdate.VotingPower == 0:\n\t\t\tremovals = append(removals, valUpdate)\n\t\tdefault:\n\t\t\tupdates = append(updates, valUpdate)\n\t\t}\n\n\t\tprevProTxHash = valUpdate.ProTxHash\n\t}\n\n\treturn updates, removals, err\n}",
"func ComputeEdits(before, after string) (edits []diff.Edit) {\n\t// The go-diff library has an unresolved panic (see golang/go#278774).\n\t// TODO(rstambler): Remove the recover once the issue has been fixed\n\t// upstream.\n\tdefer func() {\n\t\tif r := recover(); r != nil {\n\t\t\tbug.Reportf(\"unable to compute edits: %s\", r)\n\t\t\t// Report one big edit for the whole file.\n\t\t\tedits = []diff.Edit{{\n\t\t\t\tStart: 0,\n\t\t\t\tEnd: len(before),\n\t\t\t\tNew: after,\n\t\t\t}}\n\t\t}\n\t}()\n\tdiffs := diffmatchpatch.New().DiffMain(before, after, true)\n\tedits = make([]diff.Edit, 0, len(diffs))\n\toffset := 0\n\tfor _, d := range diffs {\n\t\tstart := offset\n\t\tswitch d.Type {\n\t\tcase diffmatchpatch.DiffDelete:\n\t\t\toffset += len(d.Text)\n\t\t\tedits = append(edits, diff.Edit{Start: start, End: offset})\n\t\tcase diffmatchpatch.DiffEqual:\n\t\t\toffset += len(d.Text)\n\t\tcase diffmatchpatch.DiffInsert:\n\t\t\tedits = append(edits, diff.Edit{Start: start, End: start, New: d.Text})\n\t\t}\n\t}\n\treturn edits\n}",
"func UpdateIPAddress() {\n\tfor {\n\t\tr := <-VMIPAddressUpdateChan\n\t\te, err := GetVMFromMac(r.MacAddress)\n\t\tif err != nil {\n\t\t\tlog.Println(\"Ignore GetVMFromMac error:\", err)\n\t\t\tcontinue\n\t\t}\n\n\t\te.IPAddress = r.IPAddress\n\t\terr = saveVMMetaData(e.Name, e)\n\t\tif err != nil {\n\t\t\tlog.Println(\"Ignore saveVMMetaData error:\", err)\n\t\t\tcontinue\n\t\t}\n\n\t\tUpdateIPAddressInForwarder(e.Name, r.IPAddress)\n\t}\n}",
"func (collector *dbCollector) CollectChangedAppts(lastRun time.Time) ([]*job.ApptChange, error) {\n\t// fetch all changed appointments since `lastRun`\n\trows, err := collector.db.Query(\"SELECT datlog, action, datum, zeit, pid, txt FROM pds6_kallog WHERE usc = 'eT' AND datlog > @p1 ORDER BY datlog ASC\", lastRun)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"could not query database\")\n\t}\n\tdefer rows.Close()\n\n\tvar changedAppts []*job.ApptChange\n\tfor rows.Next() {\n\t\tentry := &logEntry{}\n\t\terr := rows.Scan(&entry.logTime, &entry.action, &entry.date, &entry.time, &entry.pid, &entry.txt)\n\t\tif err != nil {\n\t\t\treturn nil, errors.Wrap(err, \"could not scan database row\")\n\t\t}\n\n\t\t// txt contains <name>, <anything>\n\t\tname := strings.SplitN(entry.txt, \",\", 2)[0]\n\n\t\t// string -> time.Time\n\t\tt, err := parseTime(entry.time)\n\t\tif err != nil {\n\t\t\treturn nil, errors.WithStack(err)\n\t\t}\n\n\t\tchangedAppts = append(changedAppts, &job.ApptChange{\n\t\t\tTime: entry.logTime,\n\t\t\tAppointment: entry.date.Add(timeDuration(t)),\n\t\t\tPatientID: entry.pid,\n\t\t\tPatientName: name,\n\t\t\tIsBooking: entry.action == \"eFill\",\n\t\t})\n\t}\n\terr = rows.Err()\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"row got an error\")\n\t}\n\n\treturn changedAppts, nil\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
add adds all IP addresses pending addition to the database, clearing pending additions. Noop unless computeChanges was called first. Idempotent until computeChanges is called again.
|
func (t *IPsTable) add(c context.Context) error {
// Avoid using the database connection to prepare unnecessary statements.
if len(t.additions) == 0 {
return nil
}
db := database.Get(c)
stmt, err := db.PrepareContext(c, `
INSERT INTO ips (ipv4, vlan_id)
VALUES (?, ?)
`)
if err != nil {
return errors.Annotate(err, "failed to prepare statement").Err()
}
defer stmt.Close()
// Add each IP address to the database, and update the slice of IP address with each addition.
// TODO(smut): Batch SQL operations if it becomes necessary.
logging.Infof(c, "Attempting to add %d IP addresses", len(t.additions))
for len(t.additions) > 0 {
ip := t.additions[0]
result, err := stmt.ExecContext(c, ip.IPv4, ip.VLANId)
if err != nil {
return errors.Annotate(err, "failed to add IP address %q", ip.IPv4).Err()
}
t.current = append(t.current, ip)
t.additions = t.additions[1:]
logging.Infof(c, "Added IP address %q", ip.IPv4)
ip.Id, err = result.LastInsertId()
if err != nil {
return errors.Annotate(err, "failed to get IP address ID %q", ip.IPv4).Err()
}
}
return nil
}
|
[
"func (b *batch) add(td pdata.Traces) {\n\tnewResourceSpansCount := td.ResourceSpans().Len()\n\tif newResourceSpansCount == 0 {\n\t\treturn\n\t}\n\n\tb.resourceSpansCount = b.resourceSpansCount + uint32(newResourceSpansCount)\n\tb.spanCount = b.spanCount + uint32(td.SpanCount())\n\ttd.ResourceSpans().MoveAndAppendTo(b.traceData.ResourceSpans())\n}",
"func (ref Ed25519FieldElement) add(g Ed25519FieldElement) Ed25519FieldElement {\n\th := make([]intRaw, 10)\n\tfor i := range h {\n\t\th[i] = ref.Raw[i] + g.Raw[i]\n\t}\n\treturn Ed25519FieldElement{h}\n}",
"func (m *WorkerManager) add(w *Worker) {\n\taddr := strings.Split(w.addr, \":\")[0] // remove port\n\tfor _, g := range m.workerGroups {\n\t\tif g.Match(addr) {\n\t\t\tw.group = g\n\t\t\tbreak\n\t\t}\n\t}\n\tw.update = m.WorkerService.UpdateWorker\n\tm.worker[w.addr] = w\n}",
"func (pdb *PoolDatabase) addService(ps *system.PoolService) {\n\tpdb.Uuids[ps.PoolUUID] = ps\n\tif ps.PoolLabel != \"\" {\n\t\tpdb.Labels[ps.PoolLabel] = ps\n\t}\n\tfor _, rank := range ps.Replicas {\n\t\tpdb.Ranks[rank] = append(pdb.Ranks[rank], ps)\n\t}\n}",
"func (p *peerStore) add(peer *Peer) {\n\tp.lock.Lock()\n\tdefer p.lock.Unlock()\n\n\tp.peers[peer.String()] = peer\n\n\tp.sortedIndexByTD = append(p.sortedIndexByTD, peer)\n\tsort.Sort(byTD(p.sortedIndexByTD))\n\n\tlog.Debugf(\"added peer to store %v %v %x\", peer.String(), peer.name, peer.currentBlock[:8])\n}",
"func (sp *serverPeer) addKnownAddresses(addresses []*wire.NetAddressV2) {\n\tsp.addressesMtx.Lock()\n\tfor _, na := range addresses {\n\t\tsp.knownAddresses.Add(addrmgr.NetAddressKey(na))\n\t}\n\tsp.addressesMtx.Unlock()\n}",
"func (self *q) add(b []byte) {\n\t*self = append(*self, BPNode{\n\t\twhen: time.Now(),\n\t\tdata: b,\n\t})\n}",
"func (ec *errorCollector) add(errs ...error) {\n\tfor _, e := range errs {\n\t\tif e != nil {\n\t\t\tec.errors = append(ec.errors, e)\n\t\t}\n\t}\n}",
"func (e *Concurrent) Add(errs ...error) {\r\n\te.mutex.Lock()\r\n\tdefer e.mutex.Unlock()\r\n\te.errors = append(e.errors, errs...)\r\n}",
"func (n *Node) add() {\n\tr := n.newState()\n\treq, err := http.NewRequest(\"POST\", \"http://129.242.22.74:7560/add\", r)\n\tif err != nil {\n\t\tn.logger.Error(err.Error())\n\t}\n\n\tclient := &http.Client{}\n\n\tresp, err := client.Do(req)\n\tif err != nil {\n\t\tn.logger.Error(err.Error())\n\t} else {\n\t\tresp.Body.Close()\n\t}\n}",
"func (s *memoryStore) add(model urlModel) {\n\ts.delay()\n\ts.models = append(s.models, model)\n}",
"func (m *mempool) add(tx *wire.MsgTx) {\n\thash := tx.TxHash()\n\n\t// Add the txid to the mempool map.\n\tm.txs[hash] = true\n\n\t// Update the inputs being spent.\n\tm.updateInputs(tx)\n}",
"func (n *defNetwork) add(s *Sandbox, hotplug bool) error {\n\tspan, _ := n.trace(s.ctx, \"add\")\n\tdefer span.Finish()\n\n\tendpoints, err := createEndpointsFromScan(s.config.NetworkConfig.NetNSPath, s.config.NetworkConfig)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\ts.networkNS.Endpoints = endpoints\n\n\terr = doNetNS(s.config.NetworkConfig.NetNSPath, func(_ ns.NetNS) error {\n\t\tfor _, endpoint := range s.networkNS.Endpoints {\n\t\t\tn.logger().WithField(\"endpoint-type\", endpoint.Type()).WithField(\"hotplug\", hotplug).Info(\"Attaching endpoint\")\n\t\t\tif hotplug {\n\t\t\t\tif err := endpoint.HotAttach(s.hypervisor); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif err := endpoint.Attach(s.hypervisor); err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn nil\n\t})\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tn.logger().Debug(\"Network added\")\n\n\treturn nil\n}",
"func ConnectionsAdd(address *string) ClientFunc {\n\treturn gen(\"connections/add\", Values{\n\t\t\"address\": address,\n\t})\n}",
"func (m *Master) addWorkers(services []*api.ServiceEntry) int {\n\tcounter := 0\n\t// add new services if any\n\tfor _, cService := range services {\n\t\tif _, ok := m.workers[cService.Service.ID]; ok {\n\t\t\tm.l.Debug(\"worker %s is already in workers pool\", cService.Service.ID)\n\t\t\tcontinue\n\t\t}\n\n\t\tif len(cService.Service.Tags) < 2 {\n\t\t\tm.l.Error(\"service (%s, %s) has no tags - should contain at least 2 tags with grpc and rpc address\", cService.Service.ID, cService.Service.Service)\n\t\t\tcontinue\n\t\t}\n\n\t\tif _, _, err := net.SplitHostPort(cService.Service.Tags[1]); err != nil {\n\t\t\tm.l.Error(\"second element in tags should contain valid rpc address\")\n\t\t\tcontinue\n\t\t}\n\n\t\t// Connect to the server.\n\t\tconn, err := grpc.Dial(cService.Service.Tags[1], grpc.WithInsecure())\n\t\tif err != nil {\n\t\t\tm.l.Error(\"fail to dial: %v\", err)\n\t\t\tcontinue\n\t\t}\n\n\t\twrk := &wrk{\n\t\t\tid: cService.Service.ID,\n\t\t\tgrpcConn: conn,\n\t\t\tgrpcClient: service.NewMapReduceClient(conn),\n\t\t}\n\n\t\tm.l.Info(\"worker (%s, %s) added to workers pool!\", cService.Service.Service, cService.Service.ID)\n\t\tm.workers[cService.Service.ID] = wrk\n\t\tcounter++\n\t}\n\n\treturn counter\n}",
"func (al *Allowlist) Add(ma multiaddr.Multiaddr) error {\n\tipnet, allowedPeer, err := toIPNet(ma)\n\tif err != nil {\n\t\treturn err\n\t}\n\tal.mu.Lock()\n\tdefer al.mu.Unlock()\n\n\tif allowedPeer != peer.ID(\"\") {\n\t\t// We have a peerID constraint\n\t\tif al.allowedPeerByNetwork == nil {\n\t\t\tal.allowedPeerByNetwork = make(map[peer.ID][]*net.IPNet)\n\t\t}\n\t\tal.allowedPeerByNetwork[allowedPeer] = append(al.allowedPeerByNetwork[allowedPeer], ipnet)\n\t} else {\n\t\tal.allowedNetworks = append(al.allowedNetworks, ipnet)\n\t}\n\treturn nil\n}",
"func (eic *EnvoyIngressController) addService(obj interface{}) {\n\tservice := obj.(*v1.Service)\n\n\tingresses := eic.getIngressesForService(service)\n\tif len(ingresses) == 0 {\n\t\treturn\n\t}\n\tfor _, ingress := range ingresses {\n\t\teic.enqueue(ingress)\n\t}\n}",
"func (m *indexMap) add(tableID descpb.ID, indexID descpb.IndexID, v *indexMapValue) {\n\tm.scratchKey.tableID = tableID\n\tm.scratchKey.indexID = indexID\n\tm.internalCache.Add(m.scratchKey, v)\n}",
"func (eq *evictedQueue) add(value interface{}) {\n\tif eq.capacity == 0 {\n\t\teq.droppedCount++\n\t\treturn\n\t}\n\n\tif eq.capacity > 0 && len(eq.queue) == eq.capacity {\n\t\t// Drop first-in while avoiding allocating more capacity to eq.queue.\n\t\tcopy(eq.queue[:eq.capacity-1], eq.queue[1:])\n\t\teq.queue = eq.queue[:eq.capacity-1]\n\t\teq.droppedCount++\n\t}\n\teq.queue = append(eq.queue, value)\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
remove removes all IP addresses pending removal from the database, clearing pending removals. Noop unless computeChanges was called first. Idempotent until computeChanges is called again.
|
func (t *IPsTable) remove(c context.Context) error {
// Avoid using the database connection to prepare unnecessary statements.
if len(t.removals) == 0 {
return nil
}
db := database.Get(c)
stmt, err := db.PrepareContext(c, `
DELETE FROM ips
WHERE id = ?
`)
if err != nil {
return errors.Annotate(err, "failed to prepare statement").Err()
}
defer stmt.Close()
// Remove each IP address from the table. It's more efficient to update the slice of
// IP addresses once at the end rather than for each removal, so use a defer.
removed := make(map[int64]struct{}, len(t.removals))
defer func() {
var ips []*IP
for _, ip := range t.current {
if _, ok := removed[ip.Id]; !ok {
ips = append(ips, ip)
}
}
t.current = ips
}()
for len(t.removals) > 0 {
ip := t.removals[0]
if _, err := stmt.ExecContext(c, ip.Id); err != nil {
// Defer ensures the slice of IP addresses is updated even if we exit early.
return errors.Annotate(err, "failed to remove IP address %q", ip.IPv4).Err()
}
removed[ip.Id] = struct{}{}
t.removals = t.removals[1:]
logging.Infof(c, "Removed IP address %q", ip.IPv4)
}
return nil
}
|
[
"func Remove(s []resolver.Address, addr string) ([]resolver.Address, bool) {\n\tfor i := range s {\n\t\tif s[i].Addr == addr {\n\t\t\ts[i] = s[len(s)-1]\n\t\t\treturn s[:len(s)-1], true\n\t\t}\n\t}\n\treturn nil, false\n}",
"func (p *peerStore) remove(id string) {\n\tp.lock.Lock()\n\tdefer p.lock.Unlock()\n\n\tdelete(p.peers, id)\n\n\tnewSortedIndexByTD := make([]*Peer, 0)\n\tfor _, sortedPeer := range p.sortedIndexByTD {\n\t\tif sortedPeer.String() != id {\n\t\t\tnewSortedIndexByTD = append(newSortedIndexByTD, sortedPeer)\n\t\t}\n\t}\n\tp.sortedIndexByTD = newSortedIndexByTD\n\n\tlog.Debug(\"removed peer from store\", id)\n}",
"func (pdb *PoolDatabase) removeService(ps *system.PoolService) {\n\tdelete(pdb.Uuids, ps.PoolUUID)\n\tif ps.PoolLabel != \"\" {\n\t\tdelete(pdb.Labels, ps.PoolLabel)\n\t}\n\tfor _, rank := range ps.Replicas {\n\t\trankServices := pdb.Ranks[rank]\n\t\tfor idx, rs := range rankServices {\n\t\t\tif rs.PoolUUID == ps.PoolUUID {\n\t\t\t\tpdb.Ranks[rank] = append(rankServices[:idx], rankServices[:idx]...)\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n}",
"func (pool *OrganizationPool) Remove(delConn *Connection) error {\n\tvar offset int\n\tfor i, conn := range *pool {\n\t\tif delConn.Uuid == conn.Uuid {\n\t\t\toffset = i\n\t\t\tbreak\n\t\t}\n\t}\n\t*pool = append((*pool)[:offset], (*pool)[offset+1:]...)\n\treturn nil\n}",
"func (p *StorageSetListPlanner) remove() {\n\tfor uid, isremove := range p.IsNodeRemove {\n\t\tif !isremove {\n\t\t\tcontinue\n\t\t}\n\t\t// log it for debuggability purposes\n\t\tglog.V(2).Infof(\n\t\t\t\"Will remove CStorClusterStorageSet %s %s having node uid %s\",\n\t\t\tp.ObservedStorageSetObjs[uid].GetNamespace(),\n\t\t\tp.ObservedStorageSetObjs[uid].GetName(),\n\t\t\tuid,\n\t\t)\n\t}\n}",
"func ConnectionsRemove(address *string) ClientFunc {\n\treturn gen(\"connections/remove\", Values{\n\t\t\"address\": address,\n\t})\n}",
"func (db *DB) setRemove(batch *leveldb.Batch, addr swarm.Address) (gcSizeChange int64, err error) {\n\titem := addressToItem(addr)\n\n\t// need to get access timestamp here as it is not\n\t// provided by the access function, and it is not\n\t// a property of a chunk provided to Accessor.Put.\n\ti, err := db.retrievalAccessIndex.Get(item)\n\tswitch {\n\tcase err == nil:\n\t\titem.AccessTimestamp = i.AccessTimestamp\n\tcase errors.Is(err, leveldb.ErrNotFound):\n\tdefault:\n\t\treturn 0, err\n\t}\n\ti, err = db.retrievalDataIndex.Get(item)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\titem.StoreTimestamp = i.StoreTimestamp\n\titem.BinID = i.BinID\n\n\terr = db.retrievalDataIndex.DeleteInBatch(batch, item)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\terr = db.retrievalAccessIndex.DeleteInBatch(batch, item)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\terr = db.pullIndex.DeleteInBatch(batch, item)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\terr = db.gcIndex.DeleteInBatch(batch, item)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\t// a check is needed for decrementing gcSize\n\t// as delete is not reporting if the key/value pair\n\t// is deleted or not\n\tif _, err := db.gcIndex.Get(item); err == nil {\n\t\tgcSizeChange = -1\n\t}\n\n\treturn gcSizeChange, nil\n}",
"func RemoveIPfromIPSet(ipSetLister IPSetLister, ipSetGetter IPSetGetter,\n\tipIPSetUpdater IPSetUpdater, envConfig *EnvConfig, ip *string) error {\n\t// ListIPSets\n\t// GetIPSet\n\t// UpdateIPSet\n\tif *ip == \"\" {\n\t\treturn errors.New(\"IP cannot be blank\")\n\t}\n\tparsedIP := net.ParseIP(*ip)\n\tif parsedIP == nil {\n\t\treturn errors.New(\"Failed to parse IP\")\n\t}\n\tipset, err := GetIPSet(ipSetLister, envConfig)\n\tif err != nil {\n\t\tlog.Error().Str(\"IP\", *ip).Str(\"Error\", err.Error()).\n\t\t\tMsg(\"Error getting IP set in RemoveIP\")\n\t\treturn err\n\t}\n\t// get the IP set\n\tscope := \"REGIONAL\"\n\tgipInput := wafv2.GetIPSetInput{\n\t\tId: ipset.Id,\n\t\tName: ipset.Name,\n\t\tScope: &scope,\n\t}\n\tipsetOutput, err := ipSetGetter(&gipInput)\n\tif err != nil {\n\t\tlog.Error().Str(\"IP\", *ip).Str(\"Error\", err.Error()).Msg(\"Error getting full IP set\")\n\t\treturn err\n\t}\n\tipIndex := -1\n\n\tfor idx, currentIP := range ipsetOutput.IPSet.Addresses {\n\t\tif *currentIP == fmt.Sprintf(\"%s/32\", *ip) {\n\t\t\tipIndex = idx\n\t\t\tbreak\n\t\t}\n\t}\n\tif ipIndex == -1 {\n\t\tlog.Info().Str(\"IP\", *ip).Msg(\"Tried to remove IP that wasn't in blocklist\")\n\t\treturn ErrIPNotFound\n\t}\n\t// remove element and truncate list\n\tipsetOutput.IPSet.Addresses[ipIndex] = ipsetOutput.IPSet.Addresses[len(ipsetOutput.IPSet.Addresses)-1]\n\tipsetOutput.IPSet.Addresses[len(ipsetOutput.IPSet.Addresses)-1] = nil\n\tipsetOutput.IPSet.Addresses = ipsetOutput.IPSet.Addresses[:len(ipsetOutput.IPSet.Addresses)-1]\n\t// update the IP set with the addresses removed\n\tupdateInput := wafv2.UpdateIPSetInput{\n\t\tAddresses: ipsetOutput.IPSet.Addresses,\n\t\tId: ipset.Id,\n\t\tLockToken: ipsetOutput.LockToken,\n\t\tName: ipset.Name,\n\t\tScope: &scope,\n\t}\n\t_, err = ipIPSetUpdater(&updateInput)\n\tif err != nil {\n\t\tlog.Error().Str(\"IP\", *ip).Str(\"Error\", err.Error()).Msg(\"Error updating ipset after removing IP\")\n\t\treturn err\n\t}\n\tlog.Info().Str(\"IP\", *ip).Msg(\"Removed IP from blocklist\")\n\treturn nil\n}",
"func (sqld *SQLDatabase) Remove(i interface{}, where string, params map[string]interface{}) (goedbres models.Result, err error) {\n\tmodel, err := sqld.Model(i)\n\tif err != nil {\n\t\treturn goedbres, err\n\t}\n\n\tsql, err := sqld.DBAccess.Delete(model, where, i)\n\tif err != nil {\n\t\treturn goedbres, err\n\t}\n\n\tresult, err := sqld.db.NamedExec(sql, params)\n\tgoedbres.NumRecordsAffected, _ = result.RowsAffected()\n\treturn goedbres, err\n}",
"func (n *defNetwork) remove(s *Sandbox, hotunplug bool) error {\n\tspan, _ := n.trace(s.ctx, \"remove\")\n\tdefer span.Finish()\n\n\tfor _, endpoint := range s.networkNS.Endpoints {\n\t\t// Detach for an endpoint should enter the network namespace\n\t\t// if required.\n\t\tn.logger().WithField(\"endpoint-type\", endpoint.Type()).WithField(\"hotunplug\", hotunplug).Info(\"Detaching endpoint\")\n\t\tif hotunplug {\n\t\t\tif err := endpoint.HotDetach(s.hypervisor, s.networkNS.NetNsCreated, s.networkNS.NetNsPath); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t} else {\n\t\t\tif err := endpoint.Detach(s.networkNS.NetNsCreated, s.networkNS.NetNsPath); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\n\tn.logger().Debug(\"Network removed\")\n\n\tif s.networkNS.NetNsCreated {\n\t\tn.logger().Infof(\"Network namespace %q deleted\", s.networkNS.NetNsPath)\n\t\treturn deleteNetNS(s.networkNS.NetNsPath)\n\t}\n\n\treturn nil\n}",
"func (e *EmptyNetworks) Remove(ctx context.Context) error {\n\treturn nil\n}",
"func (pc *peerContainer) removeAttempt(ip string) (events []*peerEvent) {\n\tif bundle, ok := pc.Bundles[ip]; ok {\n\t\tif len(bundle.Attempts) > 0 {\n\t\t\tevents = append(events, &peerEvent{\n\t\t\t\tRemove: RemoveAttempt,\n\t\t\t\tIP: ip,\n\t\t\t})\n\t\t\tbundle.Attempts = bundle.Attempts[1:]\n\t\t}\n\t\tif len(bundle.Attempts) < 1 && len(bundle.KnownPeers) < 1 {\n\t\t\tevents = append(events, &peerEvent{\n\t\t\t\tRemove: RemoveBundle,\n\t\t\t\tIP: ip,\n\t\t\t})\n\t\t\tdelete(pc.Bundles, ip)\n\t\t}\n\t}\n\treturn events\n}",
"func (s *ServerPool) Remove(hostUrl string) {\n\n\tfor k, v := range s.Servers {\n\t\tif v.Url == hostUrl {\n\t\t\ts.Servers = append(s.Servers[:k], s.Servers[k+1:]...)\n\t\t}\n\t}\n}",
"func (self *Ring) Remove(remote Remote) {\n\tself.lock.Lock()\n\tdefer self.lock.Unlock()\n\toldHash := self.hash()\n\tfor index, current := range self.nodes {\n\t\tif current.Addr == remote.Addr {\n\t\t\tif len(self.nodes) == 1 {\n\t\t\t\tpanic(\"Why would you want to remove the last Node in the Ring? Inconceivable!\")\n\t\t\t}\n\t\t\tself.nodes = append(self.nodes[:index], self.nodes[index+1:]...)\n\t\t}\n\t}\n\tself.sendChanges(oldHash)\n}",
"func (g *BoardsMetaSubmissionAddresses) Remove(w http.ResponseWriter, r *http.Request) {\n\tbpk, e := misc.GetPubKey(r.FormValue(\"board\"))\n\tif e != nil {\n\t\tsend(w, e.Error(), http.StatusBadRequest)\n\t\treturn\n\t}\n\taddress := r.FormValue(\"address\")\n\tif address == \"\" {\n\t\tsend(w, \"no submission address provided\", http.StatusBadRequest)\n\t\treturn\n\t}\n\tif e := g.remove(bpk, address); e != nil {\n\t\tsend(w, e.Error(), http.StatusBadRequest)\n\t\treturn\n\t}\n\tsend(w, true, http.StatusOK)\n}",
"func (bw *BlbWatcher) remove(blobs []client.BlobID) {\n\t// Remove them from the blb cluster.\n\tvar removed []client.BlobID\n\tfor _, blob := range blobs {\n\t\top := bw.opm.Start(\"clean\")\n\t\tif err := bw.cli.Delete(context.Background(), blob); err != nil && err.Error() != core.ErrNoSuchBlob.Error().Error() {\n\t\t\tlog.Errorf(\"failed to remove blob %s: %s\", blob, err)\n\t\t\top.Failed()\n\t\t} else {\n\t\t\tremoved = append(removed, blob)\n\t\t\tlog.Infof(\"successfully removed expired blob %s\", blob)\n\t\t}\n\t\top.End()\n\t}\n\n\t// Remove from the db.\n\tif err := bw.db.ConfirmDeletion(removed); err != nil {\n\t\tlog.Errorf(\"failed to remove blobs from the db: %s\", err)\n\t}\n}",
"func (pc *peerContainer) removeKnown(ip, id string) (events []*peerEvent) {\n\t// TODO (kurkomisi): Remove peers that don't have traffic samples anymore.\n\tif bundle, ok := pc.Bundles[ip]; ok {\n\t\tif _, ok := bundle.KnownPeers[id]; ok {\n\t\t\tevents = append(events, &peerEvent{\n\t\t\t\tRemove: RemoveKnown,\n\t\t\t\tIP: ip,\n\t\t\t\tID: id,\n\t\t\t})\n\t\t\tdelete(bundle.KnownPeers, id)\n\t\t} else {\n\t\t\tlog.Warn(\"No peer to remove\", \"ip\", ip, \"id\", id)\n\t\t}\n\t\tif len(bundle.KnownPeers) < 1 && len(bundle.Attempts) < 1 {\n\t\t\tevents = append(events, &peerEvent{\n\t\t\t\tRemove: RemoveBundle,\n\t\t\t\tIP: ip,\n\t\t\t})\n\t\t\tdelete(pc.Bundles, ip)\n\t\t}\n\t} else {\n\t\tlog.Warn(\"No bundle to remove\", \"ip\", ip)\n\t}\n\treturn events\n}",
"func TryRemove(set []net.IP, ip net.IP) []net.IP {\n\tresult := set\n\n\tfirstFoundIndex := -1\n\tfor i, a := range result {\n\t\tif a.Equal(ip) {\n\t\t\tfirstFoundIndex = i\n\t\t\tbreak\n\t\t}\n\t}\n\tif firstFoundIndex > -1 {\n\t\toldResult := result\n\t\tresult = make([]net.IP, 0, firstFoundIndex)\n\t\tif firstFoundIndex > 0 {\n\t\t\tresult = append(result, oldResult[0:firstFoundIndex]...)\n\t\t}\n\t\tfor i := firstFoundIndex + 1; i < len(oldResult); i++ {\n\t\t\tif !oldResult[i].Equal(ip) {\n\t\t\t\tresult = append(result, oldResult[i])\n\t\t\t}\n\t\t}\n\t}\n\treturn result\n}",
"func (svm *simVM) remove(ctx *Context) error {\n\tif svm == nil || svm.c == nil {\n\t\treturn nil\n\t}\n\n\terr := svm.c.remove(ctx)\n\tif err != nil {\n\t\tlog.Printf(\"%s %s: %s\", svm.vm.Name, \"remove\", err)\n\n\t\treturn err\n\t}\n\n\treturn nil\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
update updates all IP addresses pending update in the database, clearing pending updates. Noop unless computeChanges was called first. Idempotent until computeChanges is called again.
|
func (t *IPsTable) update(c context.Context) error {
// Avoid using the database connection to prepare unnecessary statements.
if len(t.updates) == 0 {
return nil
}
db := database.Get(c)
stmt, err := db.PrepareContext(c, `
UPDATE ips
SET vlan_id = ?
WHERE id = ?
`)
if err != nil {
return errors.Annotate(err, "failed to prepare statement").Err()
}
defer stmt.Close()
// Update each IP address in the table. It's more efficient to update the slice of
// IP addresses once at the end rather than for each update, so use a defer.
updated := make(map[int64]*IP, len(t.updates))
defer func() {
for _, ip := range t.current {
if u, ok := updated[ip.Id]; ok {
ip.VLANId = u.VLANId
}
}
}()
for len(t.updates) > 0 {
ip := t.updates[0]
if _, err := stmt.ExecContext(c, ip.VLANId, ip.Id); err != nil {
return errors.Annotate(err, "failed to update IP address %q", ip.IPv4).Err()
}
updated[ip.Id] = ip
t.updates = t.updates[1:]
logging.Infof(c, "Updated IP address %q", ip.IPv4)
}
return nil
}
|
[
"func (o *IPAddress) Update(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error) {\n\tif !boil.TimestampsAreSkipped(ctx) {\n\t\tcurrTime := time.Now().In(boil.GetLocation())\n\n\t\to.UpdatedAt = currTime\n\t}\n\n\tvar err error\n\tif err = o.doBeforeUpdateHooks(ctx, exec); err != nil {\n\t\treturn 0, err\n\t}\n\tkey := makeCacheKey(columns, nil)\n\tipAddressUpdateCacheMut.RLock()\n\tcache, cached := ipAddressUpdateCache[key]\n\tipAddressUpdateCacheMut.RUnlock()\n\n\tif !cached {\n\t\twl := columns.UpdateColumnSet(\n\t\t\tipAddressAllColumns,\n\t\t\tipAddressPrimaryKeyColumns,\n\t\t)\n\t\twl = strmangle.SetComplement(wl, ipAddressGeneratedColumns)\n\n\t\tif !columns.IsWhitelist() {\n\t\t\twl = strmangle.SetComplement(wl, []string{\"created_at\"})\n\t\t}\n\t\tif len(wl) == 0 {\n\t\t\treturn 0, errors.New(\"models: unable to update ip_addresses, could not build whitelist\")\n\t\t}\n\n\t\tcache.query = fmt.Sprintf(\"UPDATE \\\"ip_addresses\\\" SET %s WHERE %s\",\n\t\t\tstrmangle.SetParamNames(\"\\\"\", \"\\\"\", 1, wl),\n\t\t\tstrmangle.WhereClause(\"\\\"\", \"\\\"\", len(wl)+1, ipAddressPrimaryKeyColumns),\n\t\t)\n\t\tcache.valueMapping, err = queries.BindMapping(ipAddressType, ipAddressMapping, append(wl, ipAddressPrimaryKeyColumns...))\n\t\tif err != nil {\n\t\t\treturn 0, err\n\t\t}\n\t}\n\n\tvalues := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(o)), cache.valueMapping)\n\n\tif boil.IsDebug(ctx) {\n\t\twriter := boil.DebugWriterFrom(ctx)\n\t\tfmt.Fprintln(writer, cache.query)\n\t\tfmt.Fprintln(writer, values)\n\t}\n\tvar result sql.Result\n\tresult, err = exec.ExecContext(ctx, cache.query, values...)\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"models: unable to update ip_addresses row\")\n\t}\n\n\trowsAff, err := result.RowsAffected()\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"models: failed to get rows affected by update for ip_addresses\")\n\t}\n\n\tif !cached {\n\t\tipAddressUpdateCacheMut.Lock()\n\t\tipAddressUpdateCache[key] = cache\n\t\tipAddressUpdateCacheMut.Unlock()\n\t}\n\n\treturn rowsAff, o.doAfterUpdateHooks(ctx, exec)\n}",
"func updateAllEmptyEntries() error {\n\t// get all visits @0,0\n\tvisitFilters := Visit{\n\t\tHref: NO_INPUT,\n\t\tIp: NO_INPUT,\n\t\tCity: NO_INPUT,\n\t\tCountry_Code: NO_INPUT,\n\t\tCountry_Name: NO_INPUT,\n\t\tLatitude: 0,\n\t\tLongitude: 0,\n\t\tMetro_Code: NO_INPUT_INT,\n\t\tRegion_Code: NO_INPUT,\n\t\tTime_Zone: NO_INPUT,\n\t\tZip_Code: NO_INPUT,\n\t}\n\tquery, err := createQueryFromFilters(visitFilters, \"and\")\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Could not createQueryFromFilters: %v\", err)\n\t}\n\tctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)\n\tdefer cancel()\n\tcur, err := collection.Find(ctx, query, nil)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"Collection.Find(): %v\\n\", err)\n\t}\n\tdefer cur.Close(context.Background())\n\t// go through each record and update\n\tfor cur.Next(context.Background()) {\n\t\tv := Visit{}\n\t\terr := cur.Decode(&v)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"could not decode visit: %v, %v\", v, err)\n\t\t}\n\t\tfmt.Printf(\"found visit to update: %v\\n\", spew.Sdump(v))\n\t\tnewVisit, err := fetchGeoIP(v)\n\t\tif err != nil {\n\t\t\tfmt.Printf(\"could not get info for new visit %v\", err)\n\t\t\tcontinue\n\t\t}\n\t\tfmt.Printf(\"found geoIP info for visit: %v\", newVisit)\n\t\t// success, merge and update in database\n\t\tif err = updateVisit(v.Ip, newVisit); err != nil {\n\t\t\tfmt.Printf(\"could not update visit: %v\", err)\n\t\t}\n\t}\n\treturn nil\n}",
"func (o *Address) Update(exec boil.Executor, columns boil.Columns) error {\n\tvar err error\n\tkey := makeCacheKey(columns, nil)\n\taddressUpdateCacheMut.RLock()\n\tcache, cached := addressUpdateCache[key]\n\taddressUpdateCacheMut.RUnlock()\n\n\tif !cached {\n\t\twl := columns.UpdateColumnSet(\n\t\t\taddressAllColumns,\n\t\t\taddressPrimaryKeyColumns,\n\t\t)\n\n\t\tif len(wl) == 0 {\n\t\t\treturn errors.New(\"model: unable to update address, could not build whitelist\")\n\t\t}\n\n\t\tcache.query = fmt.Sprintf(\"UPDATE `address` SET %s WHERE %s\",\n\t\t\tstrmangle.SetParamNames(\"`\", \"`\", 0, wl),\n\t\t\tstrmangle.WhereClause(\"`\", \"`\", 0, addressPrimaryKeyColumns),\n\t\t)\n\t\tcache.valueMapping, err = queries.BindMapping(addressType, addressMapping, append(wl, addressPrimaryKeyColumns...))\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\n\tvalues := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(o)), cache.valueMapping)\n\n\tif boil.DebugMode {\n\t\tfmt.Fprintln(boil.DebugWriter, cache.query)\n\t\tfmt.Fprintln(boil.DebugWriter, values)\n\t}\n\n\t_, err = exec.Exec(cache.query, values...)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"model: unable to update address row\")\n\t}\n\n\tif !cached {\n\t\taddressUpdateCacheMut.Lock()\n\t\taddressUpdateCache[key] = cache\n\t\taddressUpdateCacheMut.Unlock()\n\t}\n\n\treturn nil\n}",
"func (tbl AddressTable) Update(req require.Requirement, vv ...*Address) (int64, error) {\n\tif req == require.All {\n\t\treq = require.Exactly(len(vv))\n\t}\n\n\tvar count int64\n\tdialect := tbl.Dialect()\n\t//columns := allAddressQuotedUpdates[dialect.Index()]\n\t//query := fmt.Sprintf(\"UPDATE %s SET %s\", tbl.name, columns)\n\n\tfor _, v := range vv {\n\t\tvar iv interface{} = v\n\t\tif hook, ok := iv.(sqlgen2.CanPreUpdate); ok {\n\t\t\terr := hook.PreUpdate()\n\t\t\tif err != nil {\n\t\t\t\treturn count, tbl.logError(err)\n\t\t\t}\n\t\t}\n\n\t\tb := &bytes.Buffer{}\n\t\tio.WriteString(b, \"UPDATE \")\n\t\tio.WriteString(b, tbl.name.String())\n\t\tio.WriteString(b, \" SET \")\n\n\t\targs, err := constructAddressUpdate(b, v, dialect)\n\t\tk := len(args) + 1\n\t\targs = append(args, v.Id)\n\t\tif err != nil {\n\t\t\treturn count, tbl.logError(err)\n\t\t}\n\n\t\tio.WriteString(b, \" WHERE \")\n\t\tdialect.QuoteWithPlaceholder(b, tbl.pk, k)\n\n\t\tquery := b.String()\n\t\tn, err := tbl.Exec(nil, query, args...)\n\t\tif err != nil {\n\t\t\treturn count, err\n\t\t}\n\t\tcount += n\n\t}\n\n\treturn count, tbl.logIfError(require.ErrorIfExecNotSatisfiedBy(req, count))\n}",
"func (client CloudFlareClient) UpdateIPAddresses(ipv4, ipv6 net.IP) error {\n\tzonesResp, err := client.getZones()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tdnsRecordsUpdated := 0\n\tfor _, zone := range zonesResp.Zones {\n\t\tdnsRecordsResp, err := client.getDnsRecords(zone.ID)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tfor _, dnsRecord := range dnsRecordsResp.DnsRecords {\n\t\t\terr := client.applyIpAddressUpdate(&dnsRecord, ipv4, ipv6)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tdnsRecordsUpdated++\n\t\t}\n\t}\n\n\tClient(client).LogIPAddressUpdate(fmt.Sprintf(\"%d DNS records were updated\", dnsRecordsUpdated))\n\tlog.Printf(\"%d DNS records were updated at %s\", dnsRecordsUpdated, client.ServiceConfig.ServiceType)\n\n\treturn nil\n}",
"func (tsc *TestSubConn) UpdateAddresses([]resolver.Address) {}",
"func UpdateIPAddress() {\n\tfor {\n\t\tr := <-VMIPAddressUpdateChan\n\t\te, err := GetVMFromMac(r.MacAddress)\n\t\tif err != nil {\n\t\t\tlog.Println(\"Ignore GetVMFromMac error:\", err)\n\t\t\tcontinue\n\t\t}\n\n\t\te.IPAddress = r.IPAddress\n\t\terr = saveVMMetaData(e.Name, e)\n\t\tif err != nil {\n\t\t\tlog.Println(\"Ignore saveVMMetaData error:\", err)\n\t\t\tcontinue\n\t\t}\n\n\t\tUpdateIPAddressInForwarder(e.Name, r.IPAddress)\n\t}\n}",
"func (o *ServiceEndpoint) Update(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error) {\n\tvar err error\n\tif err = o.doBeforeUpdateHooks(ctx, exec); err != nil {\n\t\treturn 0, err\n\t}\n\tkey := makeCacheKey(columns, nil)\n\tserviceEndpointUpdateCacheMut.RLock()\n\tcache, cached := serviceEndpointUpdateCache[key]\n\tserviceEndpointUpdateCacheMut.RUnlock()\n\n\tif !cached {\n\t\twl := columns.UpdateColumnSet(\n\t\t\tserviceEndpointAllColumns,\n\t\t\tserviceEndpointPrimaryKeyColumns,\n\t\t)\n\n\t\tif !columns.IsWhitelist() {\n\t\t\twl = strmangle.SetComplement(wl, []string{\"created_at\"})\n\t\t}\n\t\tif len(wl) == 0 {\n\t\t\treturn 0, errors.New(\"models: unable to update service_endpoint, could not build whitelist\")\n\t\t}\n\n\t\tcache.query = fmt.Sprintf(\"UPDATE \\\"service_endpoint\\\" SET %s WHERE %s\",\n\t\t\tstrmangle.SetParamNames(\"\\\"\", \"\\\"\", 1, wl),\n\t\t\tstrmangle.WhereClause(\"\\\"\", \"\\\"\", len(wl)+1, serviceEndpointPrimaryKeyColumns),\n\t\t)\n\t\tcache.valueMapping, err = queries.BindMapping(serviceEndpointType, serviceEndpointMapping, append(wl, serviceEndpointPrimaryKeyColumns...))\n\t\tif err != nil {\n\t\t\treturn 0, err\n\t\t}\n\t}\n\n\tvalues := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(o)), cache.valueMapping)\n\n\tif boil.IsDebug(ctx) {\n\t\twriter := boil.DebugWriterFrom(ctx)\n\t\tfmt.Fprintln(writer, cache.query)\n\t\tfmt.Fprintln(writer, values)\n\t}\n\tvar result sql.Result\n\tresult, err = exec.ExecContext(ctx, cache.query, values...)\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"models: unable to update service_endpoint row\")\n\t}\n\n\trowsAff, err := result.RowsAffected()\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"models: failed to get rows affected by update for service_endpoint\")\n\t}\n\n\tif !cached {\n\t\tserviceEndpointUpdateCacheMut.Lock()\n\t\tserviceEndpointUpdateCache[key] = cache\n\t\tserviceEndpointUpdateCacheMut.Unlock()\n\t}\n\n\treturn rowsAff, o.doAfterUpdateHooks(ctx, exec)\n}",
"func (t *IPsTable) computeChanges(c context.Context, vlans []*config.VLAN) error {\n\tcfgs := make(map[common.IPv4]*IP, len(vlans))\n\tfor _, vlan := range vlans {\n\t\tipv4, length, err := common.IPv4Range(vlan.CidrBlock)\n\t\tif err != nil {\n\t\t\treturn errors.Annotate(err, \"failed to determine start address and range for CIDR block %q\", vlan.CidrBlock).Err()\n\t\t}\n\t\t// TODO(smut): Mark the first address as the network address and the last address as the broadcast address.\n\t\tfor i := int64(0); i < length; i++ {\n\t\t\tcfgs[ipv4] = &IP{\n\t\t\t\tIPv4: ipv4,\n\t\t\t\tVLANId: vlan.Id,\n\t\t\t}\n\t\t\tipv4++\n\t\t}\n\t}\n\n\tfor _, ip := range t.current {\n\t\tif cfg, ok := cfgs[ip.IPv4]; ok {\n\t\t\t// IP address found in the config.\n\t\t\tif t.needsUpdate(ip, cfg) {\n\t\t\t\t// IP address doesn't match the config.\n\t\t\t\tcfg.Id = ip.Id\n\t\t\t\tt.updates = append(t.updates, cfg)\n\t\t\t}\n\t\t\t// Record that the IP address config has been seen.\n\t\t\tdelete(cfgs, cfg.IPv4)\n\t\t} else {\n\t\t\t// IP address not found in the config.\n\t\t\tt.removals = append(t.removals, ip)\n\t\t}\n\t}\n\n\t// IP addresses remaining in the map are present in the config but not the database.\n\t// Iterate deterministically over the slices to determine which IP addresses need to be added.\n\tfor _, vlan := range vlans {\n\t\tipv4, length, err := common.IPv4Range(vlan.CidrBlock)\n\t\tif err != nil {\n\t\t\treturn errors.Annotate(err, \"failed to determine start address and range for CIDR block %q\", vlan.CidrBlock).Err()\n\t\t}\n\t\tfor i := int64(0); i < length; i++ {\n\t\t\tif ip, ok := cfgs[ipv4]; ok {\n\t\t\t\tt.additions = append(t.additions, ip)\n\t\t\t}\n\t\t\tipv4++\n\t\t}\n\t}\n\treturn nil\n}",
"func (s *Service) Update(ctx context.Context, userContext am.UserContext, addresses map[string]*am.ScanGroupAddress) (oid int, count int, err error) {\n\tif !s.IsAuthorized(ctx, userContext, am.RNAddressAddresses, \"create\") {\n\t\treturn 0, 0, am.ErrUserNotAuthorized\n\t}\n\tserviceLog := log.With().\n\t\tInt(\"UserID\", userContext.GetUserID()).\n\t\tInt(\"OrgID\", userContext.GetOrgID()).\n\t\tStr(\"TraceID\", userContext.GetTraceID()).Logger()\n\n\tctx = serviceLog.WithContext(ctx)\n\n\tvar tx *pgx.Tx\n\n\tlog.Ctx(ctx).Info().Int(\"address_len\", len(addresses)).Msg(\"adding\")\n\n\ttx, err = s.pool.BeginEx(ctx, nil)\n\tif err != nil {\n\t\treturn 0, 0, err\n\t}\n\tdefer tx.Rollback() // safe to call as no-op on success\n\n\tif _, err := tx.Exec(AddAddressesTempTable); err != nil {\n\t\treturn 0, 0, err\n\t}\n\n\tnumAddresses := len(addresses)\n\n\taddressRows := make([][]interface{}, numAddresses)\n\torgID := userContext.GetOrgID()\n\ti := 0\n\n\tfor _, a := range addresses {\n\t\tif a == nil || (a.HostAddress == \"\" && a.IPAddress == \"\") {\n\t\t\treturn 0, 0, ErrAddressMissing\n\t\t}\n\n\t\taddressRows[i] = []interface{}{int32(orgID), int32(a.GroupID), a.HostAddress, a.IPAddress,\n\t\t\ttime.Unix(0, a.DiscoveryTime), a.DiscoveredBy, time.Unix(0, a.LastScannedTime), time.Unix(0, a.LastSeenTime), a.ConfidenceScore, a.UserConfidenceScore,\n\t\t\ta.IsSOA, a.IsWildcardZone, a.IsHostedService, a.Ignored, a.FoundFrom, a.NSRecord, a.AddressHash,\n\t\t}\n\n\t\ti++\n\t}\n\n\tcopyCount, err := tx.CopyFrom(pgx.Identifier{AddAddressesTempTableKey}, AddAddressesTempTableColumns, pgx.CopyFromRows(addressRows))\n\tif err != nil {\n\t\treturn 0, 0, err\n\t}\n\n\tif copyCount != numAddresses {\n\t\treturn 0, 0, am.ErrAddressCopyCount\n\t}\n\n\tif _, err := tx.Exec(AddAddressesTempToAddress); err != nil {\n\t\tif v, ok := err.(pgx.PgError); ok {\n\t\t\treturn 0, 0, errors.Wrap(v, \"failed to update addresses\")\n\t\t}\n\t\treturn 0, 0, err\n\t}\n\n\terr = tx.Commit()\n\n\treturn orgID, copyCount, err\n}",
"func (d *ServiceEntryStore) update() {\n\td.changeMutex.RLock()\n\tif !d.updateNeeded {\n\t\td.changeMutex.RUnlock()\n\t\treturn\n\t}\n\td.changeMutex.RUnlock()\n\n\tdi := map[string][]*model.ServiceInstance{}\n\tdip := map[string][]*model.ServiceInstance{}\n\n\tfor _, config := range d.store.ServiceEntries() {\n\t\tserviceEntry := config.Spec.(*networking.ServiceEntry)\n\t\tfor _, instance := range convertInstances(serviceEntry, config.CreationTimestamp) {\n\t\t\tkey := string(instance.Service.Hostname)\n\t\t\tout, found := di[key]\n\t\t\tif !found {\n\t\t\t\tout = []*model.ServiceInstance{}\n\t\t\t}\n\t\t\tout = append(out, instance)\n\t\t\tdi[key] = out\n\n\t\t\tbyip, found := dip[instance.Endpoint.Address]\n\t\t\tif !found {\n\t\t\t\tbyip = []*model.ServiceInstance{}\n\t\t\t}\n\t\t\tbyip = append(byip, instance)\n\t\t\tdip[instance.Endpoint.Address] = byip\n\t\t}\n\t}\n\n\td.storeMutex.Lock()\n\td.instances = di\n\td.ip2instance = dip\n\td.storeMutex.Unlock()\n\n\t// Without this pilot will become very unstable even with few 100 ServiceEntry\n\t// objects - the N_clusters * N_update generates too much garbage\n\t// ( yaml to proto)\n\t// This is reset on any change in ServiceEntries\n\td.changeMutex.Lock()\n\td.updateNeeded = false\n\td.changeMutex.Unlock()\n}",
"func (i *IPTables) Update() error {\n\tas, err := Arps()\n\tif err != nil {\n\t\treturn err\n\t}\n\tas = as.FilterDeviceName(i.netif)\n\n\tok, err := i.ipt.Exists(\"filter\", \"FORWARD\", \"-j\", i.chain)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif !ok {\n\t\terr = i.ipt.Insert(\"filter\", \"FORWARD\", 1, \"-j\", i.chain)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\naloop:\n\tfor _, a := range as {\n\t\tif err := i.ipt.AppendUnique(\"filter\", i.chain, \"-d\", a.IPAddress, \"-j\", \"RETURN\"); err != nil {\n\t\t\tlog.Error().Err(err).Msg(\"\")\n\t\t\tcontinue aloop\n\t\t}\n\t\tif err := i.ipt.AppendUnique(\"filter\", i.chain, \"-s\", a.IPAddress, \"-j\", \"RETURN\"); err != nil {\n\t\t\tlog.Error().Err(err).Msg(\"\")\n\t\t}\n\t}\n\treturn nil\n}",
"func (o *Gateway) Update(exec boil.Executor, columns boil.Columns) (int64, error) {\n\tvar err error\n\tkey := makeCacheKey(columns, nil)\n\tgatewayUpdateCacheMut.RLock()\n\tcache, cached := gatewayUpdateCache[key]\n\tgatewayUpdateCacheMut.RUnlock()\n\n\tif !cached {\n\t\twl := columns.UpdateColumnSet(\n\t\t\tgatewayAllColumns,\n\t\t\tgatewayPrimaryKeyColumns,\n\t\t)\n\n\t\tif len(wl) == 0 {\n\t\t\treturn 0, errors.New(\"models: unable to update gateways, could not build whitelist\")\n\t\t}\n\n\t\tcache.query = fmt.Sprintf(\"UPDATE \\\"gateways\\\" SET %s WHERE %s\",\n\t\t\tstrmangle.SetParamNames(\"\\\"\", \"\\\"\", 1, wl),\n\t\t\tstrmangle.WhereClause(\"\\\"\", \"\\\"\", len(wl)+1, gatewayPrimaryKeyColumns),\n\t\t)\n\t\tcache.valueMapping, err = queries.BindMapping(gatewayType, gatewayMapping, append(wl, gatewayPrimaryKeyColumns...))\n\t\tif err != nil {\n\t\t\treturn 0, err\n\t\t}\n\t}\n\n\tvalues := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(o)), cache.valueMapping)\n\n\tif boil.DebugMode {\n\t\tfmt.Fprintln(boil.DebugWriter, cache.query)\n\t\tfmt.Fprintln(boil.DebugWriter, values)\n\t}\n\tvar result sql.Result\n\tresult, err = exec.Exec(cache.query, values...)\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"models: unable to update gateways row\")\n\t}\n\n\trowsAff, err := result.RowsAffected()\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"models: failed to get rows affected by update for gateways\")\n\t}\n\n\tif !cached {\n\t\tgatewayUpdateCacheMut.Lock()\n\t\tgatewayUpdateCache[key] = cache\n\t\tgatewayUpdateCacheMut.Unlock()\n\t}\n\n\treturn rowsAff, nil\n}",
"func (im *InstanceManager) UpdateInstanceIP() {\n\tlogger.Infof(\"[cron] Update instance IP\")\n\n\tquery := datastore.NewQuery(im.Kind())\n\tresult := &[]*Instance{}\n\tim.Gds.GetAll(query, result)\n\n\tfor _, instance := range *result {\n\t\tvm, _ := im.GetVM(instance.Key.Name())\n\t\tif vm == nil {\n\t\t\tcontinue\n\t\t}\n\n\t\tip := im.Gce.GetNetworkIP(vm)\n\t\tif !formatutil.IsIP(ip) {\n\t\t\tcontinue\n\t\t}\n\n\t\tif instance.IP != ip {\n\t\t\t// The IP will change when stopped instance starts again\n\t\t\tlogger.Infof(\"Ephemeral IP changes: instance[%s], original[%s], new[%s]\", instance.Key.Name(), instance.IP, ip)\n\n\t\t\t// Update instance IP\n\t\t\tvar updateIP TxInstanceOperator = func(instance *Instance) {\n\t\t\t\tinstance.IP = ip\n\t\t\t}\n\t\t\tim.TxOperateInstance(instance.Key, updateIP)\n\t\t}\n\t}\n}",
"func (o CurrencySlice) UpdateAll(ctx context.Context, exec boil.ContextExecutor, cols M) (int64, error) {\n\tln := int64(len(o))\n\tif ln == 0 {\n\t\treturn 0, nil\n\t}\n\n\tif len(cols) == 0 {\n\t\treturn 0, errors.New(\"models: update all requires at least one column argument\")\n\t}\n\n\tcolNames := make([]string, len(cols))\n\targs := make([]interface{}, len(cols))\n\n\ti := 0\n\tfor name, value := range cols {\n\t\tcolNames[i] = name\n\t\targs[i] = value\n\t\ti++\n\t}\n\n\t// Append all of the primary key values for each column\n\tfor _, obj := range o {\n\t\tpkeyArgs := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(obj)), currencyPrimaryKeyMapping)\n\t\targs = append(args, pkeyArgs...)\n\t}\n\n\tsql := fmt.Sprintf(\"UPDATE `currencies` SET %s WHERE %s\",\n\t\tstrmangle.SetParamNames(\"`\", \"`\", 0, colNames),\n\t\tstrmangle.WhereClauseRepeated(string(dialect.LQ), string(dialect.RQ), 0, currencyPrimaryKeyColumns, len(o)))\n\n\tif boil.DebugMode {\n\t\tfmt.Fprintln(boil.DebugWriter, sql)\n\t\tfmt.Fprintln(boil.DebugWriter, args...)\n\t}\n\n\tresult, err := exec.ExecContext(ctx, sql, args...)\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"models: unable to update all in currency slice\")\n\t}\n\n\trowsAff, err := result.RowsAffected()\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"models: unable to retrieve rows affected all in update all currency\")\n\t}\n\treturn rowsAff, nil\n}",
"func updateIp() {\n\tsvc := s3.New(session.New(), &aws.Config{Region: aws.String(\"us-east-1\")})\n\n\tfirstRun := true\n\tfor {\n\t\tif !firstRun {\n\t\t\ttime.Sleep(time.Minute * 3)\n\t\t}\n\t\tfirstRun = false\n\n\t\t// Get the IP address\n\t\tlog.Println(\"Updating IP...\")\n\t\tresp, err := http.Get(\"http://ipv4bot.whatismyipaddress.com/\")\n\t\tif err != nil {\n\t\t\tlog.Println(\"Error fetching IP:\", err)\n\t\t\tcontinue\n\t\t}\n\t\tdefer resp.Body.Close()\n\n\t\tbody, err := ioutil.ReadAll(resp.Body)\n\t\tif err != nil {\n\t\t\tlog.Println(\"Error reading body:\", err)\n\t\t\tcontinue\n\t\t}\n\t\tlog.Println(\"Found IP:\", string(body))\n\n\t\t// Upload it as a file to S3\n\t\tlog.Println(\"Uploading...\")\n\t\ts3res, err := svc.PutObject(&s3.PutObjectInput{\n\t\t\tBucket: aws.String(\"banks-residence\"),\n\t\t\tKey: aws.String(\"ip.txt\"),\n\t\t\tBody: bytes.NewReader(body),\n\t\t\tContentType: aws.String(\"text/plain\"),\n\t\t})\n\t\tif err != nil {\n\t\t\tlog.Println(\"Error uploading IP:\", err)\n\t\t\tcontinue\n\t\t}\n\t\tlog.Println(\"Upload complete:\", s3res)\n\t}\n}",
"func (client CloudFlareClient) applyIpAddressUpdate(dnsRecord *DnsRecord, ipv4, ipv6 net.IP) error {\n\tvar err error\n\tif strings.EqualFold(client.ServiceConfig.TargetDomain, dnsRecord.Name) ||\n\t\tstrings.EqualFold(client.ServiceConfig.TargetDomain, dnsRecord.ZoneName) {\n\t\tvar ipToUse *net.IP\n\t\tswitch dnsRecord.Type {\n\t\tcase \"A\":\n\t\t\tipToUse = &ipv4\n\t\tcase \"AAAA\":\n\t\t\tipToUse = &ipv6\n\t\t}\n\t\tif ipToUse != nil {\n\t\t\theaders := client.getRequestHeaders()\n\n\t\t\tjsonBody := fmt.Sprintf(`{\n\t\t\t\t\"type\":\"%s\",\n\t\t\t\t\"name\":\"%s\",\n\t\t\t\t\"content\":\"%s\",\n\t\t\t\t\"ttl\":%d\n\t\t\t}`, dnsRecord.Type, client.ServiceConfig.TargetDomain, *ipToUse, client.ServiceConfig.TTL)\n\n\t\t\tstatusCode, responseBytes, err := PerformHttpRequest(\n\t\t\t\thttp.MethodPut,\n\t\t\t\tfmt.Sprintf(\"https://api.cloudflare.com/client/v4/zones/%s/dns_records/%s\", dnsRecord.ZoneID, dnsRecord.ID),\n\t\t\t\t\"\",\n\t\t\t\t\"\",\n\t\t\t\tbytes.NewBuffer([]byte(jsonBody)),\n\t\t\t\t*headers)\n\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tif statusCode != http.StatusOK {\n\t\t\t\treturn fmt.Errorf(\"%s dns_records PUT returned http status code %d and response \\n%s\",\n\t\t\t\t\tclient.ServiceConfig.ServiceType, statusCode, string(responseBytes))\n\t\t\t}\n\n\t\t\tvar dnsUpdateJson DnsRecordUpdateResponse\n\t\t\tif err = json.Unmarshal(responseBytes, &dnsUpdateJson); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tif !dnsUpdateJson.Success {\n\t\t\t\treturn fmt.Errorf(\"%s dns_records PUT returned an unsuccessful response \\n%s\",\n\t\t\t\t\tclient.ServiceConfig.ServiceType, string(responseBytes))\n\t\t\t}\n\t\t}\n\t}\n\treturn err\n}",
"func (e *RemoteEndpoint) Update(tx *apsql.Tx) error {\n\treturn e.update(tx, true)\n}",
"func (o *Useremail) Update(ctx context.Context, exec boil.ContextExecutor, columns boil.Columns) (int64, error) {\n\tvar err error\n\tif err = o.doBeforeUpdateHooks(ctx, exec); err != nil {\n\t\treturn 0, err\n\t}\n\tkey := makeCacheKey(columns, nil)\n\tuseremailUpdateCacheMut.RLock()\n\tcache, cached := useremailUpdateCache[key]\n\tuseremailUpdateCacheMut.RUnlock()\n\n\tif !cached {\n\t\twl := columns.UpdateColumnSet(\n\t\t\tuseremailAllColumns,\n\t\t\tuseremailPrimaryKeyColumns,\n\t\t)\n\n\t\tif !columns.IsWhitelist() {\n\t\t\twl = strmangle.SetComplement(wl, []string{\"created_at\"})\n\t\t}\n\t\tif len(wl) == 0 {\n\t\t\treturn 0, errors.New(\"orm: unable to update useremails, could not build whitelist\")\n\t\t}\n\n\t\tcache.query = fmt.Sprintf(\"UPDATE \\\"useremails\\\" SET %s WHERE %s\",\n\t\t\tstrmangle.SetParamNames(\"\\\"\", \"\\\"\", 1, wl),\n\t\t\tstrmangle.WhereClause(\"\\\"\", \"\\\"\", len(wl)+1, useremailPrimaryKeyColumns),\n\t\t)\n\t\tcache.valueMapping, err = queries.BindMapping(useremailType, useremailMapping, append(wl, useremailPrimaryKeyColumns...))\n\t\tif err != nil {\n\t\t\treturn 0, err\n\t\t}\n\t}\n\n\tvalues := queries.ValuesFromMapping(reflect.Indirect(reflect.ValueOf(o)), cache.valueMapping)\n\n\tif boil.IsDebug(ctx) {\n\t\twriter := boil.DebugWriterFrom(ctx)\n\t\tfmt.Fprintln(writer, cache.query)\n\t\tfmt.Fprintln(writer, values)\n\t}\n\tvar result sql.Result\n\tresult, err = exec.ExecContext(ctx, cache.query, values...)\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"orm: unable to update useremails row\")\n\t}\n\n\trowsAff, err := result.RowsAffected()\n\tif err != nil {\n\t\treturn 0, errors.Wrap(err, \"orm: failed to get rows affected by update for useremails\")\n\t}\n\n\tif !cached {\n\t\tuseremailUpdateCacheMut.Lock()\n\t\tuseremailUpdateCache[key] = cache\n\t\tuseremailUpdateCacheMut.Unlock()\n\t}\n\n\treturn rowsAff, o.doAfterUpdateHooks(ctx, exec)\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
ids returns a map of IP addresses to IDs.
|
func (t *IPsTable) ids(c context.Context) map[common.IPv4]int64 {
ips := make(map[common.IPv4]int64, len(t.current))
for _, ip := range t.current {
ips[ip.IPv4] = ip.Id
}
return ips
}
|
[
"func ids(inst []*ec2.Instance) []*string {\n\tids := make([]*string, len(inst))\n\tfor i, v := range inst {\n\t\t// Append instanceId to new slice\n\t\tids[i] = v.InstanceId\n\t}\n\treturn ids\n}",
"func (o GetNetworkInterfacesResultOutput) Ids() pulumi.StringArrayOutput {\n\treturn o.ApplyT(func(v GetNetworkInterfacesResult) []string { return v.Ids }).(pulumi.StringArrayOutput)\n}",
"func GetIds(alias string) (vids, ipids []int) {\n\tif pts, ok := Results[alias]; ok {\n\t\tfor _, p := range pts {\n\t\t\tif p.Vid >= 0 {\n\t\t\t\tvids = append(vids, p.Vid)\n\t\t\t}\n\t\t\tif p.IpId >= 0 {\n\t\t\t\tipids = append(ipids, p.IpId)\n\t\t\t}\n\t\t}\n\t}\n\treturn\n}",
"func (o GetEnterpriseProxyAccessesResultOutput) Ids() pulumi.StringArrayOutput {\n\treturn o.ApplyT(func(v GetEnterpriseProxyAccessesResult) []string { return v.Ids }).(pulumi.StringArrayOutput)\n}",
"func (o GetVpcsResultOutput) Ids() pulumi.StringArrayOutput {\n\treturn o.ApplyT(func(v GetVpcsResult) []string { return v.Ids }).(pulumi.StringArrayOutput)\n}",
"func (o GetLocalGatewayVirtualInterfaceGroupsResultOutput) Ids() pulumi.StringArrayOutput {\n\treturn o.ApplyT(func(v GetLocalGatewayVirtualInterfaceGroupsResult) []string { return v.Ids }).(pulumi.StringArrayOutput)\n}",
"func (o GetImageCachesResultOutput) Ids() pulumi.StringArrayOutput {\n\treturn o.ApplyT(func(v GetImageCachesResult) []string { return v.Ids }).(pulumi.StringArrayOutput)\n}",
"func (s *serverData) ips() (ips []netip.Addr) {\n\tips = make([]netip.Addr, 0, len(s.IPs))\n\tfor _, ipObject := range s.IPs {\n\t\tif ipObject.Type != \"entry\" {\n\t\t\tcontinue\n\t\t}\n\t\tips = append(ips, ipObject.IP.IP)\n\t}\n\treturn ips\n}",
"func IPinRanges(ctx context.Context, IPranges string) ([]string, error) {\n\tvar ips []string\n\tranges := strings.Split(IPranges, \",\")\n\tfor _, r := range ranges {\n\t\ti, err := IPinRange(ctx, r)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tips = append(ips, i...)\n\t}\n\treturn ips, nil\n}",
"func (d *dataset) IDs() []string {\n\treturn d.ids\n}",
"func (c *LRUCache) IDs() []uint64 {\n\ta := make([]uint64, 0, len(c.counts))\n\tfor id := range c.counts {\n\t\ta = append(a, id)\n\t}\n\tsort.Sort(uint64Slice(a))\n\treturn a\n}",
"func InterfaceAddrs() ([]Addr, error) {}",
"func (m *ServiceMutation) PortsIDs() (ids []int) {\n\tfor id := range m.ports {\n\t\tids = append(ids, id)\n\t}\n\treturn\n}",
"func (m *idenaStateManager) getIdsFromPool(n int) identities {\n\tif len(m.pool) < n {\n\t\tfor i := 0; i < n; i++ {\n\t\t\tseed := bytes.NewReader(crypto.Keccak512(nextPrivateKeySeed.Bytes()))\n\t\t\tecdPri, err := crypto.GenerateKeyFromSeed(seed)\n\t\t\tif err != nil {\n\t\t\t\tpanic(err)\n\t\t\t}\n\t\t\tm.pool = append(m.pool, NewIdentity(ecdPri))\n\t\t\tnextPrivateKeySeed.Add(nextPrivateKeySeed, big.NewInt(1))\n\t\t}\n\t}\n\t// randomly select ids from the pool\n\trand.Shuffle(len(m.pool), func(i, j int) {\n\t\tm.pool[i], m.pool[j] = m.pool[j], m.pool[i]\n\t})\n\tret := append(identities{}, m.pool[len(m.pool)-n:]...)\n\tm.pool = m.pool[:len(m.pool)-n]\n\t// sort by addresses (same as implement in idena-go)\n\tsort.Slice(ret, func(i, j int) bool {\n\t\treturn bytes.Compare(ret[i].addr[:], ret[j].addr[:]) == 1\n\t})\n\treturn ret\n}",
"func (ws WebsiteSlice) IDs() utils.Int64Slice {\n\tif len(ws) == 0 {\n\t\treturn nil\n\t}\n\tvar ids utils.Int64Slice\n\tfor _, w := range ws {\n\t\tif w != nil {\n\t\t\tids.Append(w.Data.WebsiteID)\n\t\t}\n\t}\n\treturn ids\n}",
"func (o GetEnterpriseInstancesResultOutput) Ids() pulumi.StringArrayOutput {\n\treturn o.ApplyT(func(v GetEnterpriseInstancesResult) []string { return v.Ids }).(pulumi.StringArrayOutput)\n}",
"func todoIds(todos map[int]Todo) []int {\n\tvar ids []int = make([]int, len(todos))\n\n\tvar k int\n\tfor i := range todos {\n\t\tids[k] = i\n\t\tk++\n\t}\n\n\tsort.Ints(ids)\n\treturn ids\n}",
"func (c *RankCache) IDs() []uint64 {\n\tc.mu.Lock()\n\tdefer c.mu.Unlock()\n\ta := make([]uint64, 0, len(c.entries))\n\tfor id := range c.entries {\n\t\ta = append(a, id)\n\t}\n\tsort.Sort(uint64Slice(a))\n\treturn a\n}",
"func GetAllIds() []int {\n\tch := make(chan []int, 1)\n\tsuccess := func(s []int) {\n\t\tch <- s\n\t}\n\tmo().Call(\"getAllIds\", success)\n\treturn <-ch\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
EnsureIPs ensures the database contains exactly the given IP addresses.
|
func EnsureIPs(c context.Context, cfgs []*config.VLAN) error {
t := &IPsTable{}
if err := t.fetch(c); err != nil {
return errors.Annotate(err, "failed to fetch IP addresses").Err()
}
if err := t.computeChanges(c, cfgs); err != nil {
return errors.Annotate(err, "failed to compute changes").Err()
}
if err := t.add(c); err != nil {
return errors.Annotate(err, "failed to add IP addresses").Err()
}
if err := t.remove(c); err != nil {
return errors.Annotate(err, "failed to remove IP addresses").Err()
}
if err := t.update(c); err != nil {
return errors.Annotate(err, "failed to update IP addresses").Err()
}
return nil
}
|
[
"func TestValidateIPs(t *testing.T) {\n\t// ipMap is a map of ips/should_pass pairs\n\tipMap := map[string]bool{\"127.0.0.1\": true, \"1.2.3.4.5\": false, \"::1\": true}\n\tfor k, v := range ipMap {\n\t\t_, err := ValidateIPs([]string{k}, true)\n\t\tif (err == nil && v == false) || (err != nil && v == true) {\n\t\t\tt.Errorf(\"IP %s was accepted!\", k)\n\t\t}\n\t}\n}",
"func (s *Sandbox) AddIPs(ips []string) {\n\ts.ips = ips\n}",
"func (c *IPAMContext) verifyAndAddIPsToDatastore(eni string, attachedENIIPs []*ec2.NetworkInterfacePrivateIpAddress, needEC2Reconcile bool) map[string]bool {\n\tvar ec2VerifiedAddresses []*ec2.NetworkInterfacePrivateIpAddress\n\tseenIPs := make(map[string]bool)\n\tfor _, privateIPv4 := range attachedENIIPs {\n\t\tstrPrivateIPv4 := aws.StringValue(privateIPv4.PrivateIpAddress)\n\t\tif strPrivateIPv4 == c.primaryIP[eni] {\n\t\t\tlog.Infof(\"Reconcile and skip primary IP %s on ENI %s\", strPrivateIPv4, eni)\n\t\t\tcontinue\n\t\t}\n\n\t\t// Check if this IP was recently freed\n\t\tipv4Addr := net.IPNet{IP: net.ParseIP(strPrivateIPv4), Mask: net.IPv4Mask(255, 255, 255, 255)}\n\t\tfound, recentlyFreed := c.reconcileCooldownCache.RecentlyFreed(strPrivateIPv4)\n\t\tif found {\n\t\t\tif recentlyFreed {\n\t\t\t\tlog.Debugf(\"Reconcile skipping IP %s on ENI %s because it was recently unassigned from the ENI.\", strPrivateIPv4, eni)\n\t\t\t\tcontinue\n\t\t\t} else {\n\t\t\t\tif needEC2Reconcile {\n\t\t\t\t\t// IMDS data might be stale\n\t\t\t\t\tlog.Debugf(\"This IP was recently freed, but is now out of cooldown. We need to verify with EC2 control plane.\")\n\t\t\t\t\t// Only call EC2 once for this ENI\n\t\t\t\t\tif ec2VerifiedAddresses == nil {\n\t\t\t\t\t\tvar err error\n\t\t\t\t\t\t// Call EC2 to verify IPs on this ENI\n\t\t\t\t\t\tec2VerifiedAddresses, err = c.awsClient.GetIPv4sFromEC2(eni)\n\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\tlog.Errorf(\"Failed to fetch ENI IP addresses from EC2! %v\", err)\n\t\t\t\t\t\t\t// Do not delete this IP from the datastore or cooldown until we have confirmed with EC2\n\t\t\t\t\t\t\tseenIPs[strPrivateIPv4] = true\n\t\t\t\t\t\t\tcontinue\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// Verify that the IP really belongs to this ENI\n\t\t\t\t\tisReallyAttachedToENI := false\n\t\t\t\t\tfor _, ec2Addr := range ec2VerifiedAddresses {\n\t\t\t\t\t\tif strPrivateIPv4 == aws.StringValue(ec2Addr.PrivateIpAddress) {\n\t\t\t\t\t\t\tisReallyAttachedToENI = true\n\t\t\t\t\t\t\tlog.Debugf(\"Verified that IP %s is attached to ENI %s\", strPrivateIPv4, eni)\n\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif !isReallyAttachedToENI {\n\t\t\t\t\t\tlog.Warnf(\"Skipping IP %s on ENI %s because it does not belong to this ENI!\", strPrivateIPv4, eni)\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// The IP can be removed from the cooldown cache\n\t\t\t\t// TODO: Here we could check if the IP is still used by a pod stuck in Terminating state. (Issue #1091)\n\t\t\t\tc.reconcileCooldownCache.Remove(strPrivateIPv4)\n\t\t\t}\n\t\t}\n\t\tlog.Infof(\"Trying to add %s\", strPrivateIPv4)\n\t\t// Try to add the IP\n\t\terr := c.dataStore.AddIPv4CidrToStore(eni, ipv4Addr, false)\n\t\tif err != nil && err.Error() != datastore.IPAlreadyInStoreError {\n\t\t\tlog.Errorf(\"Failed to reconcile IP %s on ENI %s\", strPrivateIPv4, eni)\n\t\t\tipamdErrInc(\"ipReconcileAdd\")\n\t\t\t// Continue to check the other IPs instead of bailout due to one wrong IP\n\t\t\tcontinue\n\n\t\t}\n\t\t// Mark action\n\t\tseenIPs[strPrivateIPv4] = true\n\t\treconcileCnt.With(prometheus.Labels{\"fn\": \"eniDataStorePoolReconcileAdd\"}).Inc()\n\t}\n\treturn seenIPs\n}",
"func (s *securityHooks) validateIPAddresses(addresses []string) (int, error) {\n\tvar ipAddresses []*net.IP\n\tfor _, a := range addresses {\n\t\t// special keyword to denote match all on ip addresses\n\t\tif strings.ToLower(a) == \"any\" {\n\t\t\tif len(addresses) > 1 {\n\t\t\t\treturn ipNone, fmt.Errorf(\"cannot specify more than one IP addresses if any is specified since this supersedes other IP addresses within a rule. Found %d proto-ports\", len(addresses))\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\t\tif strings.Contains(a, \"-\") {\n\t\t\t// Try Parsing as a range\n\t\t\tipRange := strings.Split(a, \"-\")\n\t\t\tif len(ipRange) != 2 {\n\t\t\t\treturn ipNone, fmt.Errorf(\"ip range doesn't doesn't contain begin and end ip addresses, specified %v\", a)\n\t\t\t}\n\n\t\t\tstartIP := net.ParseIP(strings.TrimSpace(ipRange[0]))\n\t\t\tendIP := net.ParseIP(strings.TrimSpace(ipRange[1]))\n\t\t\tif len(startIP) > 0 && len(endIP) > 0 {\n\t\t\t\tipAddresses = append(ipAddresses, &startIP, &endIP)\n\t\t\t\tcontinue\n\t\t\t} else {\n\t\t\t\treturn ipNone, fmt.Errorf(\"could not parse IP from %v\", a)\n\t\t\t}\n\t\t} else if strings.Contains(a, \"/\") {\n\t\t\t// try parsing as a CIDR block\n\t\t\tip, _, err := net.ParseCIDR(strings.TrimSpace(a))\n\t\t\tif err == nil {\n\t\t\t\t// found a valid cidr block\n\t\t\t\tipAddresses = append(ipAddresses, &ip)\n\t\t\t\tcontinue\n\t\t\t} else {\n\t\t\t\treturn ipNone, fmt.Errorf(\"could not parse IP CIDR block from %v\", a)\n\t\t\t}\n\t\t} else {\n\t\t\t// try parsing as an IP\n\t\t\tipAddress := net.ParseIP(strings.TrimSpace(a))\n\t\t\tif len(ipAddress) > 0 {\n\t\t\t\t// found valid ip address in octet form\n\t\t\t\tipAddresses = append(ipAddresses, &ipAddress)\n\t\t\t\tcontinue\n\t\t\t} else {\n\t\t\t\treturn ipNone, fmt.Errorf(\"could not parse IP Address from %v\", a)\n\t\t\t}\n\t\t}\n\t}\n\n\treturn s.validateIPAddressFamily(ipAddresses)\n}",
"func (c *configValidator) validateEIPS(ctx context.Context, awsClient awsclient.Interface, shootNamespace string, elasticIPAllocationIDs []string, elasticIPAllocationIDToZone map[string]string, fldPath *field.Path) field.ErrorList {\n\tallErrs := field.ErrorList{}\n\n\tmapping, err := awsClient.GetElasticIPsAssociationIDForAllocationIDs(ctx, elasticIPAllocationIDs)\n\tif err != nil {\n\t\tallErrs = append(allErrs, field.InternalError(fldPath, fmt.Errorf(\"failed to list Elastic IPs: %w\", err)))\n\t\treturn allErrs\n\t}\n\n\tvar associatedEips []string\n\tfor _, allocationID := range elasticIPAllocationIDs {\n\t\tassociationId, ok := mapping[allocationID]\n\t\tif !ok {\n\t\t\tallErrs = append(allErrs, field.Invalid(fldPath, allocationID, fmt.Sprintf(\"elastic IP in zone %q cannot be used as it does not exist. Please make sure the elastic IPs configured in the Infrastructure configuration (field: `elasticIPAllocationID`) exist.\", elasticIPAllocationIDToZone[allocationID])))\n\t\t\tcontinue\n\t\t}\n\n\t\t// EIP found, but not associated to any resource yet --> new.\n\t\t// no further checks needed as this Elastic IPs is freely available to be associated with the NAT Gateway of the Shoot\n\t\tif associationId == nil {\n\t\t\tcontinue\n\t\t}\n\n\t\tassociatedEips = append(associatedEips, allocationID)\n\t}\n\n\tif len(associatedEips) == 0 {\n\t\treturn allErrs\n\t}\n\n\t// check if the existing and already associated Elastic IPs are associated with NAT Gateways in the VPC of the Shoot\n\tallocationIDsNATGateway, err := awsClient.GetNATGatewayAddressAllocations(ctx, shootNamespace)\n\tif err != nil {\n\t\tallErrs = append(allErrs, field.InternalError(fldPath, fmt.Errorf(\"failed to list existing address allocations for NAT Gateways: %w\", err)))\n\t\treturn allErrs\n\t}\n\n\tdiff := sets.New[string](associatedEips...).Difference(allocationIDsNATGateway)\n\tif diff.Len() == 0 {\n\t\treturn allErrs\n\t}\n\n\tfor _, allocationID := range sets.List(diff) {\n\t\tallErrs = append(allErrs, field.Invalid(fldPath, allocationID, fmt.Sprintf(\"elastic IP in zone %q cannot be attached to the clusters NAT Gateway(s) as it is already associated. Please make sure the elastic IPs configured in the Infrastructure configuration (field: `elasticIPAllocationID`) are not already attached to another AWS resource.\", elasticIPAllocationIDToZone[allocationID])))\n\t}\n\n\treturn allErrs\n}",
"func validateIpAddress(i interface{}, val string) ([]string, []error) {\n\treturn verify.ValidateIpAddress(i, val)\n}",
"func (wgi *WireguardInterface) EnsureIPAddressIsAssigned() error {\n\n\tvar err error\n\n\ti, err := net.InterfaceByName(wgi.InterfaceName)\n\tif err != nil {\n\t\treturn err\n\t}\n\tlog.WithField(\"intfName\", i.Name).Tracef(\"found wg interface\")\n\n\t// Assign IP if not yet present\n\ta, err := i.Addrs()\n\tif err != nil {\n\t\treturn err\n\t}\n\tif len(a) == 0 {\n\t\tcmd := exec.Command(\"/sbin/ip\", \"address\", \"add\", \"dev\", wgi.InterfaceName, wgi.IP.String())\n\t\tvar stdout, stderr bytes.Buffer\n\t\tcmd.Stdout = &stdout\n\t\tcmd.Stderr = &stderr\n\t\terr := cmd.Run()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t_, errStr := string(stdout.Bytes()), string(stderr.Bytes())\n\t\tif len(errStr) > 0 {\n\t\t\te := fmt.Sprintf(\"/sbin/ip reported: %s\", errStr)\n\t\t\treturn errors.New(e)\n\t\t}\n\t}\n\n\ta, err = i.Addrs()\n\tif len(a) == 0 {\n\t\te := fmt.Sprintf(\"unable to add ip address %s to interface %s: %s\", wgi.IP.String(), wgi.InterfaceName, err)\n\t\treturn errors.New(e)\n\t}\n\tlog.WithFields(log.Fields{\n\t\t\"intfName\": i.Name,\n\t\t\"ip\": a[0],\n\t}).Tracef(\"added ip to interface\")\n\n\treturn nil\n}",
"func ParceIPs(ipsList string) ([]string, []string, []error) {\n\tvar errs []error\n\tvar ips []string\n\tvar warnings []string\n\tusedFunctions := map[string]func(string) ([]string, []string, error) {\n\t\t\"cidr\": expandCidrIntoIPs,\n\t\t\"range\": expandRangeIntoIPs,\n\t\t\"ip\": isUnicastIP,\n\t}\n\tsplitted := strings.Split(ipsList, \",\")\n\tfor _, element := range splitted {\n\t\tvar elementType string\n\t\telement = strings.TrimSpace(element)\n\t\tif strings.Contains(element, \"/\") {\n\t\t\telementType = \"cidr\"\n\t\t} else if strings.Contains(element, \"-\") {\n\t\t\telementType = \"range\"\n\t\t} else {\n\t\t\telementType = \"ip\"\n\t\t}\n\t\thosts, warning, err := usedFunctions[elementType](element)\n\t\tif err != nil {\n\t\t\terrs = append(errs, err)\n\t\t} else {\n\t\t\tif warning != nil {\n\t\t\t\tfor _, msg := range warning{\n\t\t\t\t\twarnings = append(warnings, msg)\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor _, host := range hosts {\n\t\t\t\tips = append(ips, host)\n\t\t\t}\n\t\t}\n\t}\n\tips = removeDuplicateValues(ips)\n\treturn ips, warnings, errs\n}",
"func ValidIPAddresses(digits string) []string {\n\treturn validIPAddresses(digits, 0)\n}",
"func (f *PostgresPhysicalAssetFetcher) FetchIPs(ctx context.Context, limit, offset int) ([]domain.AssetIP, error) {\n\trows, err := f.DB.Conn().QueryContext(ctx, fetchIPsQuery, limit, offset)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tips := make([]domain.AssetIP, 0, limit)\n\tfor rows.Next() {\n\t\tvar ipAddr string\n\t\tvar network string\n\t\tvar location sql.NullString\n\t\tvar resourceOwner sql.NullString\n\t\tvar businessUnit sql.NullString\n\t\tif err := rows.Scan(&ipAddr, &network, &location, &resourceOwner, &businessUnit); err != nil {\n\t\t\t// this would indicate an error in our schema or ordering of variables.\n\t\t\t// either case would be a terminal error, so we close the rows at best effort and return.\n\t\t\t_ = rows.Close()\n\t\t\treturn nil, err\n\t\t}\n\t\tip := domain.AssetIP{\n\t\t\tIP: ipAddr,\n\t\t\tNetwork: network,\n\t\t}\n\t\tif location.Valid {\n\t\t\tip.Location = location.String\n\t\t}\n\t\tif resourceOwner.Valid {\n\t\t\tip.ResourceOwner = resourceOwner.String\n\t\t}\n\t\tif businessUnit.Valid {\n\t\t\tip.BusinessUnit = businessUnit.String\n\t\t}\n\t\tips = append(ips, ip)\n\t}\n\tif err := rows.Close(); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn ips, nil\n}",
"func WithIPs(ips []string) OptionFunc {\n\treturn func(o *options) error {\n\t\to.ips = ips\n\t\treturn nil\n\t}\n}",
"func checkAddresses(confTimeout time.Duration, addresses []HostAddress, sslConfig *tls.Config, useHTTP2 bool) error {\n\tvar timeout = 3 * time.Second\n\tif confTimeout != 0 && confTimeout < timeout {\n\t\ttimeout = confTimeout\n\t}\n\tfor _, address := range addresses {\n\t\tif err := pingAddress(address, timeout, sslConfig, useHTTP2); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}",
"func GetIPs(logger *zap.Logger, dnsServer net.IP, domains []string) (ips []net.IP, changed bool, err error) {\n\tlogger.Debug(\"+ GetIPs\")\n\tdefer logger.Debug(\"- GetIPs\")\n\tfor _, domain := range domains {\n\t\tdomainIPs := theResolver.get(logger, dnsServer, domain)\n\t\tlogger.Sugar().Debugf(\"resolved IPs for %s: %s\", domain, domainIPs)\n\t\tips = append(ips, domainIPs...)\n\t}\n\tchanged = !sameIPs(lastIPs, ips)\n\tlastIPs = ips\n\treturn ips, changed, nil\n}",
"func (c *Client) InstancesAssignIPs(ctx context.Context, opts LinodesAssignIPsOptions) error {\n\tbody, err := json.Marshal(opts)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\te := \"networking/ips/assign\"\n\treq := c.R(ctx).SetBody(string(body))\n\t_, err = coupleAPIErrors(req.Post(e))\n\treturn err\n}",
"func (client CloudFlareClient) UpdateIPAddresses(ipv4, ipv6 net.IP) error {\n\tzonesResp, err := client.getZones()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tdnsRecordsUpdated := 0\n\tfor _, zone := range zonesResp.Zones {\n\t\tdnsRecordsResp, err := client.getDnsRecords(zone.ID)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tfor _, dnsRecord := range dnsRecordsResp.DnsRecords {\n\t\t\terr := client.applyIpAddressUpdate(&dnsRecord, ipv4, ipv6)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tdnsRecordsUpdated++\n\t\t}\n\t}\n\n\tClient(client).LogIPAddressUpdate(fmt.Sprintf(\"%d DNS records were updated\", dnsRecordsUpdated))\n\tlog.Printf(\"%d DNS records were updated at %s\", dnsRecordsUpdated, client.ServiceConfig.ServiceType)\n\n\treturn nil\n}",
"func (config *TCPConfig) SortIPs() {\n\tsort.Strings(config.IPs)\n}",
"func (s *RPC) BlockIPs(g iplist.Ranger) {\n\ts.ipBlockList = g\n}",
"func (iis *IpamInterfaceStub) ReleaseIPs(ctx context.Context, ips ...ipam.ReleaseOptions) ([]cnet.IP, error) {\n\tpanic(\"not implemented\")\n}",
"func CheckIP(ctx context.Context, IP string, apiKeys ...string) (banned bool, err error) {\n\tif len(IP) == 0 {\n\t\terr = errors.New(\"IP address is required\")\n\t\treturn\n\t}\n\tif len(apiKeys) == 0 {\n\t\terr = errors.New(\"API keys are required\")\n\t\treturn\n\t}\n\tfor _, apiKey := range apiKeys {\n\t\turl := RootURL + apiKey + check + IP\n\t\tvar resp *http.Response\n\t\tif resp, err = getHTTP(ctx, url); err != nil {\n\t\t\treturn\n\t\t}\n\n\t\tif resp.StatusCode < 200 || resp.StatusCode >= 500 ||\n\t\t\t(resp.StatusCode >= 300 && resp.StatusCode < 400) {\n\t\t\terr = fmt.Errorf(\"unexpected status code<%s>\", resp.Status)\n\t\t\tresp.Body.Close()\n\t\t\treturn\n\t\t}\n\t\tvar obj *apibanObj\n\t\tobj, err = decodeObj(resp.Body)\n\t\tresp.Body.Close()\n\t\tif err != nil {\n\t\t\tif err != ErrRateLimit {\n\t\t\t\treturn\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\t\tval := obj.Ipaddress.([]interface{})\n\n\t\tif resp.StatusCode >= 200 && resp.StatusCode < 300 {\n\t\t\tif banned = !(obj.ID == noneID ||\n\t\t\t\tlen(val) != 1 ||\n\t\t\t\tval[0] != IP); !banned {\n\t\t\t\terr = ErrBadRequest\n\t\t\t\treturn\n\t\t\t}\n\t\t} else if obj.ID != noneID ||\n\t\t\tlen(val) != 1 ||\n\t\t\tval[0] != \"not blocked\" {\n\t\t\terr = ErrBadRequest\n\t\t}\n\t\treturn\n\t}\n\treturn\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
NewFactory returns a new factory with a set of required configurations like writer and formatter.
|
func NewFactory(writer io.Writer, formatter formatters.Formatter, name ...string) *Factory {
return &Factory{
namePrefix: strings.Join(name, nameSeparator),
LoggerConfig: NewLoggerConfig(config.NewConfig().SetWriter(writer)).SetFormatter(formatter),
}
}
|
[
"func NewFactory(std *stdlog.Logger, min log.LoggerLevel, fmt FmtFun) log.Factory {\n\treturn &factory{std: std, min: min, fmt: fmt}\n}",
"func NewFactory() processor.Factory {\n\treturn processor.NewFactory(\n\t\tmetadata.Type,\n\t\tcreateDefaultConfig,\n\t\tprocessor.WithLogs(createLogsProcessor, metadata.LogsStability))\n}",
"func Factory(configFile string) func() (*Config, error) {\n\treturn func() (*Config, error) {\n\t\treturn New(configFile)\n\t}\n}",
"func NewFactory(stack Middleware, common ...Opt) *Factory {\n\treturn &Factory{stack: stack, common: common}\n}",
"func NewFactory() *factory {\n\treturn &factory{}\n}",
"func NewFactory(dir string) Factory {\n\treturn Factory{\n\t\tcounter: helpers.Counter{},\n\t\tdir: dir,\n\t\tmemoized: NewStandardFixture(filepath.Join(dir, \"memoized\")),\n\t}\n}",
"func NewFactory(prefix string, defaultTags map[string]string, serializer serializers.Serializer, shipper shippers.Shipper, onError func(error)) *MetricFactory {\n\treturn &MetricFactory{\n\t\tprefix: prefix,\n\t\tdefaultTags: defaultTags,\n\t\tserializer: serializer,\n\t\tshipper: shipper,\n\t\tonError: onError,\n\t}\n}",
"func NewFactory() component.ReceiverFactory {\n\treturn receiverhelper.NewFactory(\n\t\ttypeStr,\n\t\tcreateDefaultConfig,\n\t\treceiverhelper.WithMetrics(createMetricsReceiver),\n\t)\n}",
"func New(format Format, writers []io.Writer) Logger {\n\tswitch format {\n\tcase JSON:\n\t\treturn NewJSON(io.MultiWriter(writers...))\n\tcase TEXT:\n\t\treturn NewText(io.MultiWriter(writers...))\n\tdefault:\n\t\tpanic(\"Invalid logger format\")\n\t}\n}",
"func NewFactory() xgress.Factory {\n\treturn &factory{}\n}",
"func New(r, m, c, cl io.Reader) (*Factory, error) {\n\tvar err error\n\tf := &Factory{}\n\tf.recipeList, err = readRecipes(r)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tf.availableMaterials, err = readCategories(m)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tf.availableContents, err = readCategories(c)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tf.availableClasses, err = readClasses(cl)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn f, nil\n}",
"func NewFactory(buckets int) metrics.Factory {\n\treturn adapters.WrapFactoryWithoutTags(\n\t\t&factory{\n\t\t\tfactory: expvar.NewFactory(buckets),\n\t\t},\n\t\tadapters.Options{},\n\t)\n}",
"func NewFactory() *AdapterFactory { return &AdapterFactory{} }",
"func NewFactory(ctx context.Context, manifest string, opts ...FactoryOption) (*Factory, error) {\n\tvar err error\n\tf := Factory{\n\t\tclient: http.DefaultClient, // TODO(hank) Remove DefaultClient\n\t}\n\tf.url, err = url.Parse(manifest)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tfor _, o := range opts {\n\t\tif err := o(&f); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\treturn &f, nil\n}",
"func Factory(cfg Config) client.MiddlewareFactory {\n\treturn func(_ string) client.Middleware {\n\t\treturn newCiruitBreaker(cfg)\n\t}\n}",
"func (t *WriterType) New(w io.Writer, emptySets []signal.Set, extra ...string) Writer {\n\tswitch *t {\n\tcase WriterTypeCSV:\n\t\treturn CSVWriter(w, emptySets, extra...)\n\tcase WriterTypeJSON:\n\t\treturn JSONWriter(w)\n\tcase WriterTypeText:\n\t\treturn TextWriter(w, emptySets, extra...)\n\tdefault:\n\t\treturn nil\n\t}\n}",
"func New(config *Configuration) Logger {\n\tswitch config.Provider {\n\tcase ZAP:\n\t\treturn newZap(*config)\n\tcase LOGRUS:\n\t\treturn newLogrus(*config)\n\tdefault:\n\t\tpanic(ErrInvalidProvider)\n\t}\n}",
"func setupNewWriter(fs afero.Fs) *writer {\n\treturn New(Context{\n\t\tFs: fs,\n\t\tPath: testPath,\n\t\tOutputDir: testOutPath,\n\t\tTheme: theme.Default,\n\t\tRecompileTemplates: false,\n\t})\n}",
"func New(w *bufio.Writer, l []level, t bool, f Formatter) Logger {\n\treturn Logger{w, l, t, f}\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
register called by register function of each probe it will check for probe status if it is enabled then it will call Start() of that probe.
|
func (rp *registerProbe) register() {
newProbe := &controller.Probe{
Priority: rp.priority,
Name: rp.name,
State: rp.state,
Interface: rp.pi,
}
rp.controller.AddNewProbe(newProbe)
if rp.state {
rp.pi.Start()
}
}
|
[
"func Start(registeredProbes []func()) {\n\tklog.Info(\"registering probes\")\n\tfor _, probe := range registeredProbes {\n\t\tprobe()\n\t}\n}",
"func (up *udevProbe) Start() {\n\tgo up.listen()\n\tif features.FeatureGates.IsEnabled(features.ChangeDetection) {\n\t\tup.udeveventSubscription = udevevent.Subscribe(\n\t\t\tudevevent.EventTypeAdd,\n\t\t\tudevevent.EventTypeRemove,\n\t\t\tudevevent.EventTypeChange,\n\t\t)\n\t} else {\n\t\tup.udeveventSubscription = udevevent.Subscribe(\n\t\t\tudevevent.EventTypeAdd,\n\t\t\tudevevent.EventTypeRemove,\n\t\t)\n\t}\n\terrChan := udevevent.Monitor()\n\tgo up.listenUdevEventMonitor(errChan)\n\tprobeEvent := newUdevProbe(up.controller)\n\terr := probeEvent.scan()\n\tif err != nil {\n\t\tklog.Errorf(\"error while scanning system for block devices, Error: %v\", err)\n\t}\n}",
"func (m *ProbeManager) Start() {\n\tgo m.run()\n}",
"func (b *Backend) Probe() {\n\tlog.WithFields(log.Fields{\n\t\t\"backend\": b,\n\t}).Debug(\"Started a probe into a backend\")\n\n\tresp, err := b.Get(b.URL.String())\n\tif err != nil {\n\t\tlog.WithFields(log.Fields{\n\t\t\t\"backend\": b,\n\t\t\t\"error\": err,\n\t\t}).Debug(\"Couldn't get a response from a backend\")\n\n\t\tb.Sick = true\n\t\treturn\n\t}\n\n\tlog.WithFields(log.Fields{\n\t\t\"backend\": b,\n\t\t\"status\": resp.StatusCode,\n\t}).Debug(\"Got a response from a backend\")\n\n\tb.Sick = resp.StatusCode >= 400\n}",
"func (p *EBPFProbesHandler) RegisterProbe(n *graph.Node, capture *types.Capture, e FlowProbeEventHandler) error {\n\treturn nil\n}",
"func (p Func) Probe(ctx context.Context, addressable Addressable, expected Status) Status {\n\treturn p(ctx, addressable, expected)\n}",
"func (p *Prober) Run(name string, interval time.Duration, labels map[string]string, fun ProbeFunc) *Probe {\n\tp.mu.Lock()\n\tdefer p.mu.Unlock()\n\tif _, ok := p.probes[name]; ok {\n\t\tpanic(fmt.Sprintf(\"probe named %q already registered\", name))\n\t}\n\n\tl := prometheus.Labels{\"name\": name}\n\tfor k, v := range labels {\n\t\tl[k] = v\n\t}\n\n\tctx, cancel := context.WithCancel(context.Background())\n\tprobe := &Probe{\n\t\tprober: p,\n\t\tctx: ctx,\n\t\tcancel: cancel,\n\t\tstopped: make(chan struct{}),\n\n\t\tname: name,\n\t\tdoProbe: fun,\n\t\tinterval: interval,\n\t\tinitialDelay: initialDelay(name, interval),\n\t\tmetrics: prometheus.NewRegistry(),\n\t\tmInterval: prometheus.NewDesc(\"interval_secs\", \"Probe interval in seconds\", nil, l),\n\t\tmStartTime: prometheus.NewDesc(\"start_secs\", \"Latest probe start time (seconds since epoch)\", nil, l),\n\t\tmEndTime: prometheus.NewDesc(\"end_secs\", \"Latest probe end time (seconds since epoch)\", nil, l),\n\t\tmLatency: prometheus.NewDesc(\"latency_millis\", \"Latest probe latency (ms)\", nil, l),\n\t\tmResult: prometheus.NewDesc(\"result\", \"Latest probe result (1 = success, 0 = failure)\", nil, l),\n\t}\n\n\tprometheus.WrapRegistererWithPrefix(p.namespace+\"_\", p.metrics).MustRegister(probe.metrics)\n\tprobe.metrics.MustRegister(probe)\n\n\tp.probes[name] = probe\n\tgo probe.loop()\n\treturn probe\n}",
"func (ms *Microservice) RegisterLivenessProbeEndpoint(path string) {\n\tms.echo.GET(path, func(c echo.Context) error {\n\t\t// If Microservice isAlive return !ok, it is because some dependency is failed\n\t\tok, reason := ms.isAlive()\n\t\tif !ok {\n\t\t\t// If !ok we will response status 500 error\n\t\t\tms.responseProbeFailed(c.Response(), reason)\n\t\t\treturn nil\n\t\t}\n\t\t// If ok we will response 200 OK\n\t\tms.responseProbeOK(c.Response())\n\t\treturn nil\n\t})\n}",
"func Probe(g *gin.Context) {\n\tg.File(\"./probe_100k\")\n}",
"func (s *Service) RegisterProbe(name string, p Probe) {\n\ts.mu.Lock()\n\n\ts.probes[name] = p\n\n\ts.mu.Unlock()\n}",
"func StartProbeCheck(livenessProbeController, readinessProbeController probe.Controller, stop <-chan struct{}) {\n\tif livenessProbeController != nil {\n\t\tlivenessProbeController.Start()\n\t\tdefer livenessProbeController.Close()\n\t}\n\tif readinessProbeController != nil {\n\t\treadinessProbeController.Start()\n\t\tdefer readinessProbeController.Close()\n\t}\n\t<-stop\n}",
"func (ap *activePluginsHost) activate(reg *Registration) {\n\tpluginDiskName := diskName(reg)\n\n\tap.mu.Lock()\n\tdefer ap.mu.Unlock()\n\n\t// Check if the plugin is already running active.\n\tif _, ok := ap.active[pluginDiskName]; ok {\n\t\treturn\n\t}\n\n\t// TODO: Check if the plugin is on disk.\n\n\tcc := newClientConfig()\n\tcc.Plugins = hashiplug.PluginSet{\n\t\tpluginSetName: &pluginImplementation{\n\t\t\t// TODO\n\t\t},\n\t}\n\thc := hashiplug.NewClient(cc)\n\n\t_, err := hc.Start()\n\tif err != nil {\n\t\t// TODO\n\t}\n\n\tfor hookName, hh := range reg.Hooks {\n\t\t// Since we already checked that this plugin is not running active, there shouldn't be any\n\t\t// handlers for this plugin.\n\t\t// TODO: append to the slice\n\t\tHostSideHooks.Add(pluginDiskName, hooks.Hook(hookName), hh.Specs)\n\t}\n\n}",
"func (s *BaseagcListener) EnterRegister_(ctx *Register_Context) {}",
"func registerSampler(m map[string]setupFunc, app *kingpin.Application, name string, reloadCh chan struct{}, reloaders *configReloaders) {\n\tcmd := app.Command(name, \"Run a sampler, that appends profiles to a configured storage.\")\n\n\tconfigFile := cmd.Flag(\"config.file\", \"Config file to use.\").\n\t\tDefault(\"conprof.yaml\").String()\n\ttargets := cmd.Flag(\"target\", \"Targets to scrape.\").Strings()\n\tstoreAddress := cmd.Flag(\"store\", \"Address of statically configured store.\").\n\t\tDefault(\"127.0.0.1:10901\").String()\n\tbearerToken := cmd.Flag(\"bearer-token\", \"Bearer token to authenticate with store.\").String()\n\tbearerTokenFile := cmd.Flag(\"bearer-token-file\", \"File to read bearer token from to authenticate with store.\").String()\n\tinsecure := cmd.Flag(\"insecure\", \"Send gRPC requests via plaintext instead of TLS.\").Default(\"false\").Bool()\n\tinsecureSkipVerify := cmd.Flag(\"insecure-skip-verify\", \"Skip TLS certificate verification.\").Default(\"false\").Bool()\n\n\tm[name] = func(comp component.Component, g *run.Group, mux httpMux, probe prober.Probe, logger log.Logger, reg *prometheus.Registry, debugLogging bool) (prober.Probe, error) {\n\t\tmet := grpc_prometheus.NewClientMetrics()\n\t\tmet.EnableClientHandlingTimeHistogram()\n\t\treg.MustRegister(met)\n\n\t\topts := []grpc.DialOption{\n\t\t\tgrpc.WithUnaryInterceptor(\n\t\t\t\tmet.UnaryClientInterceptor(),\n\t\t\t),\n\t\t}\n\t\tif *insecure {\n\t\t\topts = append(opts, grpc.WithInsecure())\n\t\t} else {\n\t\t\tconfig := &tls.Config{\n\t\t\t\tInsecureSkipVerify: *insecureSkipVerify,\n\t\t\t}\n\t\t\topts = append(opts, grpc.WithTransportCredentials(credentials.NewTLS(config)))\n\t\t}\n\n\t\tif bearerToken != nil && *bearerToken != \"\" {\n\t\t\topts = append(opts, grpc.WithPerRPCCredentials(&perRequestBearerToken{\n\t\t\t\ttoken: *bearerToken,\n\t\t\t\tinsecure: *insecure,\n\t\t\t}))\n\t\t}\n\n\t\tif bearerTokenFile != nil && *bearerTokenFile != \"\" {\n\t\t\tb, err := ioutil.ReadFile(*bearerTokenFile)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"failed to read bearer token from file: %w\", err)\n\t\t\t}\n\t\t\topts = append(opts, grpc.WithPerRPCCredentials(&perRequestBearerToken{\n\t\t\t\ttoken: string(b),\n\t\t\t\tinsecure: *insecure,\n\t\t\t}))\n\t\t}\n\n\t\tconn, err := grpc.Dial(*storeAddress, opts...)\n\t\tif err != nil {\n\t\t\treturn probe, err\n\t\t}\n\t\tc := storepb.NewWritableProfileStoreClient(conn)\n\n\t\tdb := store.NewGRPCAppendable(logger, c)\n\t\tscrapeManager := scrape.NewManager(log.With(log.NewNopLogger(), \"component\", \"scrape-manager\"), db)\n\n\t\tsamplerOpts := []SamplerOption{\n\t\t\tSamplerScraper(scrapeManager),\n\t\t}\n\t\tif len(*targets) > 0 {\n\t\t\tsamplerOpts = append(samplerOpts, SamplerTargets(*targets))\n\t\t} else {\n\t\t\tsamplerOpts = append(samplerOpts, SamplerConfig(*configFile))\n\t\t}\n\n\t\ts, err := NewSampler(db, reloaders, samplerOpts...)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif err := s.Run(context.TODO(), g, reloadCh); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tconst apiPrefix = \"/api/v1/\"\n\t\tapi := conprofapi.New(logger, reg,\n\t\t\tconprofapi.WithPrefix(apiPrefix),\n\t\t\tconprofapi.WithReloadChannel(reloadCh),\n\t\t\tconprofapi.WithTargets(func(ctx context.Context) conprofapi.TargetRetriever {\n\t\t\t\treturn scrapeManager\n\t\t\t}),\n\t\t)\n\t\tmux.Handle(apiPrefix, api.Routes())\n\n\t\tprobe.Ready()\n\n\t\treturn probe, nil\n\t}\n}",
"func EnableTracker() {\n\tdevice.Register(\"bluetooth\", newBTTracker)\n}",
"func RegisterProbes(list ...string) {\n\tprobesLocker.Lock()\n\tprobes = list\n\tprobesLocker.Unlock()\n}",
"func initialiseRegister() {\n\tregister = master[:]\n}",
"func (s *Server) Start() (bool, error) {\n\tvar err error\n\tif s.logFH, err = s.opts.SetupLogging(); err != nil {\n\t\treturn false, err\n\t}\n\n\tregistry := plugin.NewRegistry()\n\n\tsuccessfullyLoadedPlugins := true\n\tif !s.forVerifyInstall {\n\t\tsuccessfullyLoadedPlugins = s.loadPlugins(registry)\n\t\tif len(registry.Plugins()) == 0 {\n\t\t\treturn successfullyLoadedPlugins, fmt.Errorf(\"no plugins loaded. If you're planning on using Wash just for its external plugins, then go to https://puppetlabs.github.io/wash/docs/external-plugins\")\n\t\t}\n\n\t\tplugin.InitCache()\n\n\t\tanalyticsConfig, err := analytics.GetConfig()\n\t\tif err != nil {\n\t\t\treturn successfullyLoadedPlugins, err\n\t\t}\n\t\ts.analyticsClient = analytics.NewClient(analyticsConfig)\n\t}\n\n\tapiServerStopCh, apiServerStoppedCh, err := api.StartAPI(\n\t\tregistry,\n\t\ts.mountpoint,\n\t\ts.socket,\n\t\ts.analyticsClient,\n\t)\n\tif err != nil {\n\t\treturn successfullyLoadedPlugins, err\n\t}\n\ts.api = controlChannels{stopCh: apiServerStopCh, stoppedCh: apiServerStoppedCh}\n\n\tfuseServerStopCh, fuseServerStoppedCh, err := fuse.ServeFuseFS(\n\t\tregistry,\n\t\ts.mountpoint,\n\t\ts.analyticsClient,\n\t)\n\tif err != nil {\n\t\ts.stopAPIServer()\n\t\treturn successfullyLoadedPlugins, err\n\t}\n\ts.fuse = controlChannels{stopCh: fuseServerStopCh, stoppedCh: fuseServerStoppedCh}\n\n\tif !s.forVerifyInstall {\n\t\tif s.opts.CPUProfilePath != \"\" {\n\t\t\tf, err := os.Create(s.opts.CPUProfilePath)\n\t\t\tif err != nil {\n\t\t\t\tlog.Fatal(err)\n\t\t\t}\n\t\t\terrz.Fatal(pprof.StartCPUProfile(f))\n\t\t}\n\n\t\t// Submit the initial start-up ping to GA. It's OK to do this synchronously\n\t\t// because this is the first hit so the analytics client will not send it\n\t\t// over the network.\n\t\tif err := s.analyticsClient.Screenview(\"wash\", analytics.Params{}); err != nil {\n\t\t\tlog.Infof(\"Failed to submit the initial start-up ping: %v\", err)\n\t\t}\n\t}\n\n\treturn successfullyLoadedPlugins, nil\n}",
"func (m *Monitor) Start() {\n m.Active = true\n util.LogInfo(\"main\", \"MON\", \"monitoring active\")\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
Start starts registration of probes present in RegisteredProbes
|
func Start(registeredProbes []func()) {
klog.Info("registering probes")
for _, probe := range registeredProbes {
probe()
}
}
|
[
"func RegisterProbes(list ...string) {\n\tprobesLocker.Lock()\n\tprobes = list\n\tprobesLocker.Unlock()\n}",
"func (m *ProbeManager) Start() {\n\tgo m.run()\n}",
"func (rp *registerProbe) register() {\n\tnewProbe := &controller.Probe{\n\t\tPriority: rp.priority,\n\t\tName: rp.name,\n\t\tState: rp.state,\n\t\tInterface: rp.pi,\n\t}\n\trp.controller.AddNewProbe(newProbe)\n\tif rp.state {\n\t\trp.pi.Start()\n\t}\n}",
"func StartProber() {\n\tfor _, value := range RoutingTable {\n\t\tgo CheckExpiration(conn, value)\n\t}\n}",
"func (p *EBPFProbesHandler) RegisterProbe(n *graph.Node, capture *types.Capture, e FlowProbeEventHandler) error {\n\treturn nil\n}",
"func (b *boot) startProc() {\n\tfor _, f := range b.procRegistered {\n\t\tgo func(f func()) {\n\t\t\tdefer b.wg.Done()\n\t\t\tf()\n\t\t}(f)\n\t}\n}",
"func (reg *Manager) Start(ctx context.Context, wg *sync.WaitGroup) error {\n\tdefer wg.Done()\n\n\tif reg.cfg.RegistrationCollective == \"\" {\n\t\treg.cfg.RegistrationCollective = reg.cfg.MainCollective\n\t}\n\n\tvar err error\n\tvar registrator Registrator\n\n\tfor _, rtype := range reg.cfg.Registration {\n\t\tswitch rtype {\n\t\tcase \"\":\n\t\t\treturn nil\n\t\tcase \"file_content\":\n\t\t\tregistrator, err = registration.NewFileContent(reg.cfg, reg.si, reg.log)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"cannot start File Content Registrator: %s\", err)\n\t\t\t}\n\n\t\tcase \"inventory_content\":\n\t\t\tregistrator, err = registration.NewInventoryContent(reg.cfg, reg.si, reg.log)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"cannot start File Content Registrator: %s\", err)\n\t\t\t}\n\n\t\tdefault:\n\t\t\treturn fmt.Errorf(\"unknown registration plugin: %s\", reg.cfg.Registration)\n\t\t}\n\n\t\treg.log.Infof(\"Starting registration worker for %s\", rtype)\n\t\terr = reg.RegisterProvider(ctx, wg, registrator)\n\t\tif err != nil {\n\t\t\treg.log.Errorf(\"Could not register registration worker for %s: %s\", rtype, err)\n\t\t}\n\t}\n\n\treturn nil\n}",
"func (up *udevProbe) Start() {\n\tgo up.listen()\n\tif features.FeatureGates.IsEnabled(features.ChangeDetection) {\n\t\tup.udeveventSubscription = udevevent.Subscribe(\n\t\t\tudevevent.EventTypeAdd,\n\t\t\tudevevent.EventTypeRemove,\n\t\t\tudevevent.EventTypeChange,\n\t\t)\n\t} else {\n\t\tup.udeveventSubscription = udevevent.Subscribe(\n\t\t\tudevevent.EventTypeAdd,\n\t\t\tudevevent.EventTypeRemove,\n\t\t)\n\t}\n\terrChan := udevevent.Monitor()\n\tgo up.listenUdevEventMonitor(errChan)\n\tprobeEvent := newUdevProbe(up.controller)\n\terr := probeEvent.scan()\n\tif err != nil {\n\t\tklog.Errorf(\"error while scanning system for block devices, Error: %v\", err)\n\t}\n}",
"func (p *Prober) Run(name string, interval time.Duration, labels map[string]string, fun ProbeFunc) *Probe {\n\tp.mu.Lock()\n\tdefer p.mu.Unlock()\n\tif _, ok := p.probes[name]; ok {\n\t\tpanic(fmt.Sprintf(\"probe named %q already registered\", name))\n\t}\n\n\tl := prometheus.Labels{\"name\": name}\n\tfor k, v := range labels {\n\t\tl[k] = v\n\t}\n\n\tctx, cancel := context.WithCancel(context.Background())\n\tprobe := &Probe{\n\t\tprober: p,\n\t\tctx: ctx,\n\t\tcancel: cancel,\n\t\tstopped: make(chan struct{}),\n\n\t\tname: name,\n\t\tdoProbe: fun,\n\t\tinterval: interval,\n\t\tinitialDelay: initialDelay(name, interval),\n\t\tmetrics: prometheus.NewRegistry(),\n\t\tmInterval: prometheus.NewDesc(\"interval_secs\", \"Probe interval in seconds\", nil, l),\n\t\tmStartTime: prometheus.NewDesc(\"start_secs\", \"Latest probe start time (seconds since epoch)\", nil, l),\n\t\tmEndTime: prometheus.NewDesc(\"end_secs\", \"Latest probe end time (seconds since epoch)\", nil, l),\n\t\tmLatency: prometheus.NewDesc(\"latency_millis\", \"Latest probe latency (ms)\", nil, l),\n\t\tmResult: prometheus.NewDesc(\"result\", \"Latest probe result (1 = success, 0 = failure)\", nil, l),\n\t}\n\n\tprometheus.WrapRegistererWithPrefix(p.namespace+\"_\", p.metrics).MustRegister(probe.metrics)\n\tprobe.metrics.MustRegister(probe)\n\n\tp.probes[name] = probe\n\tgo probe.loop()\n\treturn probe\n}",
"func (p *PVCWatcher) Start(mgr manager.Manager) error {\n\treturn controllers.RegisterTo(mgr, \"pvc-watcher\", p, &corev1.PersistentVolumeClaim{})\n}",
"func (p *Provisioner) Run(stopCh <-chan struct{}) (err error) {\n\tdefer klog.Flush()\n\tlog.Info(\"starting provisioner\", \"name\", p.Name)\n\n\tp.informerFactory.Start(stopCh)\n\n\tgo func() {\n\t\terr = p.claimController.Start(stopCh)\n\t}()\n\t<-stopCh\n\treturn\n}",
"func StartProbeCheck(livenessProbeController, readinessProbeController probe.Controller, stop <-chan struct{}) {\n\tif livenessProbeController != nil {\n\t\tlivenessProbeController.Start()\n\t\tdefer livenessProbeController.Close()\n\t}\n\tif readinessProbeController != nil {\n\t\treadinessProbeController.Start()\n\t\tdefer readinessProbeController.Close()\n\t}\n\t<-stop\n}",
"func Probe(g *gin.Context) {\n\tg.File(\"./probe_100k\")\n}",
"func (m *testPayloadSenderMonitor) Start() {\n\tgo m.Run()\n}",
"func (r *Reporter) Start(ctx context.Context) error {\n\tif r.runtimeRegistry != nil {\n\t\tr.t, _ = tomb.WithContext(ctx)\n\n\t\tr.t.Go(func() error {\n\t\t\tticker := time.NewTicker(time.Duration(r.config.FlushInterval) * time.Second)\n\n\t\t\tfor {\n\t\t\t\tselect {\n\t\t\t\tcase <-ticker.C:\n\t\t\t\t\tr.Debug(\"flushing runtime metrics to registry\")\n\t\t\t\t\tmetrics.CaptureRuntimeMemStatsOnce(r.runtimeRegistry)\n\n\t\t\t\tcase <-r.t.Dying():\n\t\t\t\t\tticker.Stop()\n\t\t\t\t\treturn nil\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t}\n\n\tif r.Prometheus != nil {\n\t\tr.Debug(\"starting Prometheus exporter\")\n\t\tif err := r.Prometheus.Start(ctx); err != nil {\n\t\t\treturn err\n\t\t}\n\t\tr.Debug(\"Prometheus exporter started\")\n\t}\n\n\treturn nil\n}",
"func (s *Registry) Start() {\n\ts.informerFactory.Start(s.stopCh)\n\tif !cache.WaitForCacheSync(s.stopCh, s.podInformer.HasSynced) {\n\t\treturn\n\t}\n}",
"func (d discovery) Start(ctx context.Context, wg *sync.WaitGroup, cfg config.Config, opts config.Options) {\n\tdefer wg.Done()\n\twg.Add(1)\n\tadapterList := make([]adapter.Adapter, 0)\n\tdiscoveryList := make([]Discovery, 0)\n\n\tfor name, discovery := range cfg.Discoveries {\n\t\tlevel.Info(log.With(d.log, \"component\", \"discovery\")).Log(\"info\", fmt.Sprintf(\"=============> Loading discovery: %s\", name))\n\t\tdisc, err := d.createDiscovery(name, discovery)\n\t\tif err != nil {\n\t\t\tlevel.Error(log.With(d.log, \"component\", \"discovery\")).Log(\"err\", err)\n\t\t\tcontinue\n\t\t}\n\n\t\tgo disc.GetManager().Run()\n\t\tdisc.GetManager().StartCustomProvider(ctx, name, disc)\n\t\tgo disc.StartAdapter()\n\n\t\tadapterList = append(adapterList, disc.GetAdapter())\n\t\tdiscoveryList = append(discoveryList, disc)\n\t\tprometheus.MustRegister(NewMetricsCollector(name+\"_sd_up\", \"Shows if discovery is running\", disc.GetAdapter(), disc, opts.Version))\n\n\t}\n\tgo NewServer(adapterList, discoveryList, d.log).Start()\n}",
"func (m *ManagerImpl) Start(activePods ActivePodsFunc, sourcesReady config.SourcesReady, initialContainers containermap.ContainerMap, initialContainerRunningSet sets.String) error {\n\tklog.V(2).InfoS(\"Starting Device Plugin manager\")\n\n\tm.activePods = activePods\n\tm.sourcesReady = sourcesReady\n\tm.containerMap = initialContainers\n\tm.containerRunningSet = initialContainerRunningSet\n\n\t// Loads in allocatedDevices information from disk.\n\terr := m.readCheckpoint()\n\tif err != nil {\n\t\tklog.InfoS(\"Continue after failing to read checkpoint file. Device allocation info may NOT be up-to-date\", \"err\", err)\n\t}\n\n\treturn m.server.Start()\n}",
"func (gm *GroupManager) Start(tp TestPlanGen, count, offset, SecRamp int) {\n\tif tp == nil {\n\t\tpanic(\"Failed to receive test plan generator\")\n\t}\n\tgm.Info.Println(\"Starting tests\")\n\n\tgm.panicWithoutDB()\n\tgm.Group = Group{}\n\tgo gm.startGroupCheck()\n\tgm.Group.Kickstart(tp, count, offset, SecRamp)\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
NewGuestListProjector creates a new GuestListProjector.
|
func NewGuestListProjector(repository eventhorizon.ReadRepository, eventID string) *GuestListProjector {
p := &GuestListProjector{
repository: repository,
eventID: eventID,
}
return p
}
|
[
"func NewProjectParticipation()(*ProjectParticipation) {\n m := &ProjectParticipation{\n ItemFacet: *NewItemFacet(),\n }\n odataTypeValue := \"#microsoft.graph.projectParticipation\"\n m.SetOdataType(&odataTypeValue)\n return m\n}",
"func (u *User) NewProject(name, slug string, dateStart, dateEnd time.Time, wordCountStart, wordCountGoal int) (*Project, error) {\n\tp := &Project{\n\t\tUserID: u.ID,\n\t\tName: name,\n\t\tSlug: slug,\n\t\tDateStart: dateStart,\n\t\tDateEnd: dateEnd,\n\t\tWordCountStart: wordCountStart,\n\t\tWordCountGoal: wordCountGoal,\n\t}\n\n\tlog.Print(p)\n\n\tif p.Name == \"\" || p.Slug == \"\" || p.DateStart.Before(time.Now().Truncate(time.Hour*time.Duration(24))) || p.DateEnd.Before(p.DateStart) || p.WordCountStart < 0 || p.WordCountGoal < p.WordCountStart {\n\t\treturn nil, errors.New(\"NewProject: invalid data\")\n\t}\n\n\tdb, err := sqlx.Open(\"postgres\", connStr)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer db.Close()\n\n\trow := db.QueryRowx(`\n\t\tinsert into autochrone.projects(\n\t\t\tuser_id, name, slug, date_start, date_end, word_count_start, word_count_goal\n\t\t) values ($1, $2, $3, $4, $5, $6, $7)\n\t\treturning id\n\t`, p.UserID, p.Name, p.Slug, p.DateStart, p.DateEnd, p.WordCountStart, p.WordCountGoal)\n\tif err := row.Scan(&(p.ID)); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn p, nil\n}",
"func NewListProjectResult(data []byte, commonResp *CommonResponseResult) (*ListProjectResult, error) {\n lpr := &ListProjectResult{\n CommonResponseResult: *commonResp,\n ProjectNames: make([]string, 0, 0),\n }\n if err := json.Unmarshal(data, lpr); err != nil {\n return nil, err\n }\n return lpr, nil\n}",
"func NewTodoTaskList()(*TodoTaskList) {\n m := &TodoTaskList{\n Entity: *NewEntity(),\n }\n return m\n}",
"func (blueprint *Blueprint) NewProject() (string, error) {\n\tignoreMap, err := blueprint.ignoreMap()\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\n\tvar exampleFiles []string\n\terr = blueprint.ignoreWalk(ignoreMap, func(srcPath string, typ os.FileMode) error {\n\t\tdestPath := blueprint.destPath(srcPath)\n\t\tif typ.IsDir() {\n\t\t\treturn utils.MkdirAll(destPath)\n\t\t}\n\t\tif path.Ext(srcPath) == lockFileExt {\n\t\t\treturn nil\n\t\t}\n\n\t\tdestPaths := []string{destPath}\n\n\t\texampleRealDestPath := exampleRealDestPath(destPath)\n\t\tif exampleRealDestPath != \"\" {\n\t\t\texampleFiles = append(exampleFiles, blueprint.destRelativePath(exampleRealDestPath))\n\t\t\tdestPaths = append(destPaths, exampleRealDestPath)\n\t\t}\n\n\t\tvar bytes []byte\n\t\tbytes, err = replaceFuncBytes(blueprint, srcPath)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\treturn forEachDestPath(destPaths, func(destPath string) error {\n\t\t\tif bytes != nil {\n\t\t\t\treturn utils.WriteFile(destPath, bytes)\n\t\t\t}\n\t\t\treturn utils.CopyFile(srcPath, destPath)\n\t\t})\n\t})\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\treturn newProjectMessage(exampleFiles), nil\n}",
"func NewProjectPOST(w http.ResponseWriter, r *http.Request) {\n\t// Get session\n\tsess := session.Instance(r)\n\n\t// Validate with required fields\n\tif validate, _ := view.Validate(r, []string{\"projectname\", \"short_description\", \"description\"}); !validate {\n\t\tsess.AddFlash(view.Flash{\"אנא מלא שדות חסרים\", view.FlashError})\n\t\tsess.Save(r, w)\n\t\tNewProjectGET(w, r)\n\t\treturn\n\t}\n\n\t// Get user ID form session\n\tprojectManagerId, err := strconv.ParseInt(sess.Values[\"id\"].(string), 10, 32)\n\t//Check if the number converted well\n\tif err != nil {\n\t\tlog.Println(err)\n\t\tsess.AddFlash(view.Flash{\"שגיאת שרת פנימית\", view.FlashError})\n\t\tsess.Save(r, w)\n\t\tNewProjectGET(w, r)\n\t\treturn\n\t}\n\n\tstudents := model.Students{\n\t\t0,\n\t\t0,\n\t}\n\n\tstudentJson, err := json.Marshal(students)\n\tif err != nil {\n\t\tlog.Println(err)\n\t\tsess.AddFlash(view.Flash{\"שגיאת שרת פנימית\", view.FlashError})\n\t\tsess.Save(r, w)\n\t\tNewProjectGET(w, r)\n\t\treturn\n\t}\n\n\terr = model.CreateProject(r.FormValue(\"projectname\"), r.FormValue(\"description\"), r.FormValue(\"short_description\"), uint32(projectManagerId), studentJson)\n\n\tif err != nil {\n\t\tlog.Println(err)\n\t\tsess.AddFlash(view.Flash{\"שגיאת שרת פנימית\", view.FlashError})\n\t\tsess.Save(r, w)\n\t\tNewProjectGET(w, r)\n\t\treturn\n\t}\n\n\tsess.AddFlash(view.Flash{\"הפרויקט עלה בהצלחה\", view.FlashSuccess})\n\tsess.Save(r, w)\n\thttp.Redirect(w, r, \"/project/projects\", http.StatusFound)\n}",
"func NewProject(name string, roster []*Student, optimalGroupSize int, preferSmallerGroups bool) *Project {\n\tproject := Project{Name: name}\n\n\tfor _, student := range roster {\n\t\tproject.UngroupedStudents = append(project.UngroupedStudents, student)\n\t}\n\n\tgroupSizes := determineGroupSizes(len(roster), optimalGroupSize, preferSmallerGroups)\n\tfor _, size := range groupSizes {\n\t\tproject.Groups = append(project.Groups, NewGroup(size))\n\t}\n\n\treturn &project\n}",
"func (ui *UI) CreateProject() {\n\tui.ProjectForm.Name.Focus()\n\tui.Modal = func(gtx C) D {\n\t\treturn ui.ProjectForm.Layout(gtx, ui.Th)\n\t}\n}",
"func NewProject(name, shorthand, description, status string, tm time.Time) Project {\n\treturn Project{\n\t\t0,\n\t\tname,\n\t\tshorthand,\n\t\tdescription,\n\t\tstatus,\n\t\ttm,\n\t}\n}",
"func NewTreeList(proj *Project) (newTree *DepTree) {\n\tcreated := make(map[string]*DepService)\n\tnewTree = &DepTree{CurrNode: nil}\n\tfor i := range proj.Services {\n\t\tlog.Println(\"Finding a spot in the tree for\", proj.Services[i].conf.Name)\n\t\tif _, ok := created[proj.Services[i].conf.Name]; ok {\n\t\t\tcontinue\n\t\t}\n\t\tdepSrv := &DepService{build: proj.Services[i], Children: make(map[string]*DepService)}\n\t\tif len(depSrv.build.conf.DependsOn) != 0 {\n\t\t\tgetDependencies(depSrv, newTree, created, proj)\n\t\t} else if newTree.CurrNode == nil {\n\t\t\tnewTree.CurrNode = depSrv\n\t\t} else {\n\t\t\tnewTree.CurrNode.Children[depSrv.build.conf.Name] = depSrv\n\t\t}\n\t}\n\treturn\n}",
"func (c *RESTClient) NewProject(ctx context.Context, name string, storageLimit *int64) (*modelv2.Project, error) {\n\tpReq := &modelv2.ProjectReq{\n\t\tProjectName: name,\n\t\tStorageLimit: storageLimit,\n\t}\n\n\t_, err := c.V2Client.Project.CreateProject(\n\t\t&projectapi.CreateProjectParams{\n\t\t\tProject: pReq,\n\t\t\tContext: ctx,\n\t\t}, c.AuthInfo)\n\tif err != nil {\n\t\treturn nil, handleSwaggerProjectErrors(err)\n\t}\n\n\tproject, err := c.GetProject(ctx, name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn project, nil\n}",
"func (st *Postgres) CreateProject(p *Project) error {\n\tlogger := logger.WithField(\"project\", p.Name)\n\tlogger.Debug(\"saving project to postgres\")\n\n\tsqlinsert := `\n\tINSERT INTO projects (name, description, permissions, user_email, group_name)\n\tSELECT $1, $2, $3, $4, u.group_name\n\tFROM users AS u\n\tWHERE u.email = $5\n\tRETURNING id;\n\t`\n\n\t// Using QueryRow because the insert is returning the ID.\n\terr := st.db.QueryRow(sqlinsert, p.Name, p.Description, p.Permissions,\n\t\t// Duplication is necessary here because the driver will get confused\n\t\t// and infer two different types for the same parameter.\n\t\tp.User.Email, p.User.Email).\n\t\tScan(&p.ID)\n\n\tif err != nil {\n\t\tlogger.WithField(\"error\", err).\n\t\t\tDebug(\"unable to create project\")\n\t}\n\treturn err\n}",
"func NewListProjectEndpoint(s Service, authJWTFn security.AuthJWTFunc) goa.Endpoint {\n\treturn func(ctx context.Context, req interface{}) (interface{}, error) {\n\t\tp := req.(*ListProjectPayload)\n\t\tvar err error\n\t\tsc := security.JWTScheme{\n\t\t\tName: \"jwt\",\n\t\t\tScopes: []string{\"api:access\", \"api:admin\", \"api:ingestion\"},\n\t\t\tRequiredScopes: []string{},\n\t\t}\n\t\tvar token string\n\t\tif p.Auth != nil {\n\t\t\ttoken = *p.Auth\n\t\t}\n\t\tctx, err = authJWTFn(ctx, token, &sc)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tres, err := s.ListProject(ctx, p)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tvres := NewViewedStationsFull(res, \"default\")\n\t\treturn vres, nil\n\t}\n}",
"func CreateProject(userID int64, title string, description string, repositoryID int64, oauthToken sql.NullString) (*domain.Project, error) {\n\tvar repoID sql.NullInt64\n\tif repositoryID != 0 && oauthToken.Valid {\n\t\tinfra := InjectRepoRepository()\n\t\tr, err := infra.FindByGithubRepoID(repositoryID)\n\t\tif err != nil {\n\t\t\tr, err = services.CreateRepo(repositoryID, oauthToken.String, InjectRepoRepository())\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t}\n\t\trepoID = sql.NullInt64{Int64: r.ID, Valid: true}\n\t}\n\n\ttx, err := InjectDB().Begin()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tproject := domain.New(0, userID, title, description, repoID, true, true)\n\tinfra := InjectProjectRepository()\n\tid, err := infra.Create(project.UserID, project.Title, project.Description, project.RepositoryID, project.ShowIssues, project.ShowPullRequests, tx)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tproject.ID = id\n\terr = services.CreateInitialLists(project, InjectListRepository(), tx)\n\tif err != nil {\n\t\ttx.Rollback()\n\t\treturn nil, err\n\t}\n\terr = tx.Commit()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tgo services.AfterCreateProject(project, InjectProjectRepository(), InjectListRepository(), InjectTaskRepository(), InjectRepoRepository())\n\n\treturn project, nil\n}",
"func CreateListDevopsProjectsRequest() (request *ListDevopsProjectsRequest) {\n\trequest = &ListDevopsProjectsRequest{\n\t\tRpcRequest: &requests.RpcRequest{},\n\t}\n\trequest.InitWithApiInfo(\"devops-rdc\", \"2020-03-03\", \"ListDevopsProjects\", \"\", \"\")\n\trequest.Method = requests.POST\n\treturn\n}",
"func CreateEndpoint(projectProvider provider.ProjectProvider) endpoint.Endpoint {\n\treturn func(ctx context.Context, request interface{}) (interface{}, error) {\n\t\tprojectRq, ok := request.(projectReq)\n\t\tif !ok {\n\t\t\treturn nil, errors.NewBadRequest(\"invalid request\")\n\t\t}\n\n\t\tif len(projectRq.Body.Name) == 0 {\n\t\t\treturn nil, errors.NewBadRequest(\"the name of the project cannot be empty\")\n\t\t}\n\n\t\tuser := ctx.Value(middleware.UserCRContextKey).(*kubermaticapiv1.User)\n\t\tkubermaticProject, err := projectProvider.New(user, projectRq.Body.Name, projectRq.Body.Labels)\n\t\tif err != nil {\n\t\t\treturn nil, common.KubernetesErrorToHTTPError(err)\n\t\t}\n\t\treturn apiv1.Project{\n\t\t\tObjectMeta: apiv1.ObjectMeta{\n\t\t\t\tID: kubermaticProject.Name,\n\t\t\t\tName: kubermaticProject.Spec.Name,\n\t\t\t\tCreationTimestamp: apiv1.NewTime(kubermaticProject.CreationTimestamp.Time),\n\t\t\t},\n\t\t\tStatus: kubermaticProject.Status.Phase,\n\t\t\tLabels: kubermaticProject.Labels,\n\t\t\tOwners: []apiv1.User{\n\t\t\t\t{\n\t\t\t\t\tObjectMeta: apiv1.ObjectMeta{\n\t\t\t\t\t\tName: user.Spec.Name,\n\t\t\t\t\t},\n\t\t\t\t\tEmail: user.Spec.Email,\n\t\t\t\t},\n\t\t\t},\n\t\t}, nil\n\t}\n}",
"func (client *AzureDevOpsProjectClient) NewListPager(resourceGroupName string, azureDevOpsConnectorName string, azureDevOpsOrgName string, options *AzureDevOpsProjectClientListOptions) *runtime.Pager[AzureDevOpsProjectClientListResponse] {\n\treturn runtime.NewPager(runtime.PagingHandler[AzureDevOpsProjectClientListResponse]{\n\t\tMore: func(page AzureDevOpsProjectClientListResponse) bool {\n\t\t\treturn page.NextLink != nil && len(*page.NextLink) > 0\n\t\t},\n\t\tFetcher: func(ctx context.Context, page *AzureDevOpsProjectClientListResponse) (AzureDevOpsProjectClientListResponse, error) {\n\t\t\tvar req *policy.Request\n\t\t\tvar err error\n\t\t\tif page == nil {\n\t\t\t\treq, err = client.listCreateRequest(ctx, resourceGroupName, azureDevOpsConnectorName, azureDevOpsOrgName, options)\n\t\t\t} else {\n\t\t\t\treq, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink)\n\t\t\t}\n\t\t\tif err != nil {\n\t\t\t\treturn AzureDevOpsProjectClientListResponse{}, err\n\t\t\t}\n\t\t\tresp, err := client.internal.Pipeline().Do(req)\n\t\t\tif err != nil {\n\t\t\t\treturn AzureDevOpsProjectClientListResponse{}, err\n\t\t\t}\n\t\t\tif !runtime.HasStatusCode(resp, http.StatusOK) {\n\t\t\t\treturn AzureDevOpsProjectClientListResponse{}, runtime.NewResponseError(resp)\n\t\t\t}\n\t\t\treturn client.listHandleResponse(resp)\n\t\t},\n\t})\n}",
"func NewProject(model store.ProjectModel) *ProjectHandler {\n\treturn &ProjectHandler{\n\t\tmodel: model,\n\t}\n}",
"func (p *ProjectDBService) AddNewProject(projectName string, tests []string, researchers []string, participants []string) error {\n\tprojectID := uuid.New()\n\n\tprojects = append(projects, ProjectDAO{\n\t\tprojectID.String(), projectName, researchers, participants, tests,\n\t})\n\n\treturn nil\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
HandleEvent handles events that GuestListProjector is concerned about. HandleEvent builds guest lists.
|
func (p *GuestListProjector) HandleEvent(event eventhorizon.Event) {
switch event.(type) {
case *InviteCreated:
m, err := p.repository.Find(p.eventID)
if err != nil && err != eventhorizon.ErrModelNotFound {
log.Fatalf("guest list: unable to find model for invite created: %s", err)
}
if m == nil {
m = &GuestList{
ID: p.eventID,
}
}
g := m.(*GuestList)
if err := p.repository.Save(p.eventID, g); err != nil {
log.Fatalf("guest list: unable to save event: %s", err)
}
case *InviteAccepted:
m, err := p.repository.Find(p.eventID)
if err != nil {
log.Fatalf("guest list: unable to find model for invite accepted: %s", err)
}
g := m.(*GuestList)
g.NumAccepted++
if err := p.repository.Save(p.eventID, g); err != nil {
log.Fatalf("guest list: unable to save event: %s", err)
}
case *InviteDeclined:
m, err := p.repository.Find(p.eventID)
if err != nil {
log.Fatalf("guest list: unable to find model for invite declined: %s", err)
}
g := m.(*GuestList)
g.NumDeclined++
if err := p.repository.Save(p.eventID, g); err != nil {
log.Fatalf("guest list: unable to save event: %s", err)
}
}
}
|
[
"func NewGuestListProjector(repository eventhorizon.ReadRepository, eventID string) *GuestListProjector {\n\tp := &GuestListProjector{\n\t\trepository: repository,\n\t\teventID: eventID,\n\t}\n\treturn p\n}",
"func HandleListGuests(w http.ResponseWriter, r *http.Request) {\n\tdb := database.Get()\n\n\tvar reservations []model.Reservation\n\tif err := db.Preload(\"Table\").Where(\"arrival_time IS NOT NULL\").Find(&reservations).Error; err != nil {\n\t\tErrorResponse(w, http.StatusInternalServerError, fmt.Sprintf(\"failed to load reservations: %v\", err))\n\t\treturn\n\t}\n\n\tformattedReservations := []model.FormattedGuestArrival{}\n\tfor _, res := range reservations {\n\t\tformattedReservations = append(formattedReservations, res.FormatAsGuestArrival())\n\t}\n\n\tout, err := json.Marshal(map[string][]model.FormattedGuestArrival{\n\t\t\"guests\": formattedReservations,\n\t})\n\tif err != nil {\n\t\tErrorResponse(w, http.StatusInternalServerError, fmt.Sprintf(\"failed to marshal reservations: %v\", err))\n\t\treturn\n\t}\n\n\thttp.StatusText(http.StatusOK)\n\t_, _ = w.Write(out)\n}",
"func NewGithubEvent_List(s *capnp.Segment, sz int32) (GithubEvent_List, error) {\n\tl, err := capnp.NewCompositeList(s, capnp.ObjectSize{DataSize: 16, PointerCount: 4}, sz)\n\treturn GithubEvent_List{l}, err\n}",
"func (app *App) HandleListProjectInfra(w http.ResponseWriter, r *http.Request) {\n\tprojID, err := strconv.ParseUint(chi.URLParam(r, \"project_id\"), 0, 64)\n\n\tif err != nil || projID == 0 {\n\t\tapp.handleErrorFormDecoding(err, ErrProjectDecode, w)\n\t\treturn\n\t}\n\n\tinfras, err := app.Repo.Infra.ListInfrasByProjectID(uint(projID))\n\n\tif err != nil {\n\t\tapp.handleErrorRead(err, ErrProjectDataRead, w)\n\t\treturn\n\t}\n\n\textInfras := make([]*models.InfraExternal, 0)\n\n\tfor _, infra := range infras {\n\t\textInfras = append(extInfras, infra.Externalize())\n\t}\n\n\tw.WriteHeader(http.StatusOK)\n\n\tif err := json.NewEncoder(w).Encode(extInfras); err != nil {\n\t\tapp.handleErrorFormDecoding(err, ErrProjectDecode, w)\n\t\treturn\n\t}\n}",
"func ListEvents(w http.ResponseWriter, r *http.Request) {\n\t// Get Environment and convert the EventLog to JSON\n\tenv := envFromRequest(r)\n\teventList, err := json.Marshal(env.EventLog.Events)\n\tif err != nil {\n\t\tenv.Logger.Error(\"component\", \"handler\", \"err\", err)\n\t\tos.Exit(1)\n\t}\n\n\t//Write the EventLog and send the HTTP response\n\tw.Header().Set(\"Content-Type\", \"application/json\")\n\tw.Write(eventList)\n}",
"func (s *EventsService) ListProjectVisibleEvents(pid interface{}, opt *ListProjectVisibleEventsOptions, options ...RequestOptionFunc) ([]*ProjectEvent, *Response, error) {\n\tproject, err := parseID(pid)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\tu := fmt.Sprintf(\"projects/%s/events\", PathEscape(project))\n\n\treq, err := s.client.NewRequest(http.MethodGet, u, opt, options)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\tvar p []*ProjectEvent\n\tresp, err := s.client.Do(req, &p)\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn p, resp, nil\n}",
"func (s *BaseFoxySheepListener) EnterList(ctx *ListContext) {}",
"func (p *PipelineManager) handleAddEvent(event *pipelineEvent) error {\n\n\t_, exist := p.getPipelines(event.name)\n\tif exist {\n\t\treturn errors.Errorf(\"get moudle %s pipleines is exist\", event.name)\n\t}\n\n\terr := initPipelinesFunc(event.pipelines)\n\tif err != nil {\n\t\treturn errors.Wrapf(err, \"create moudle %s pipelines\", event.name)\n\t}\n\n\tstartPipelinesFunc(event.pipelines)\n\n\tp.setPipelines(event.name, event.pipelines)\n\n\treturn nil\n}",
"func (s *BasetinyListener) EnterExpr_list(ctx *Expr_listContext) {}",
"func CreateGuest(e Event, c chan error, mutex *sync.Mutex) {\n\tif e.GuestDetails.Email == \"\" {\n\t\tc <- nil\n\t\treturn\n\t}\n\tmutex.Lock()\n\tresult, err := Session.Run(`MATCH(a:EVENT) WHERE a.name=$EventName\n\tCREATE (n:GUEST {name:$name, stake:$stake,\n\temail:$email, phoneNumber:$phoneNumber, gender: $gender, locationOfStay:$locationOfStay\n\t})<-[:GUEST]-(a) `, map[string]interface{}{\n\t\t\"EventName\": e.Name,\n\t\t\"name\": e.GetField(\"GuestDetails\", \"Name\"),\n\t\t\"stake\": e.GetField(\"GuestDetails\", \"Stake\"),\n\t\t\"email\": e.GetField(\"GuestDetails\", \"Email\"),\n\t\t\"phoneNumber\": e.GetField(\"GuestDetails\", \"PhoneNumber\"),\n\t\t\"gender\": e.GetField(\"GuestDetails\", \"Gender\"),\n\t\t\"locationOfStay\": e.GetField(\"GuestDetails\", \"LocationOfStay\"),\n\t})\n\tif err != nil {\n\t\tc <- err\n\t\treturn\n\t}\n\tmutex.Unlock()\n\n\tif err = result.Err(); err != nil {\n\t\tc <- err\n\t\treturn\n\t}\n\tlog.Println(\"Created GUEST node\")\n\tc <- nil\n\treturn\n}",
"func HandleConfigEvent(op protos.SdkMgrOperation, key *protos.ConfigKey, data *string, a *Agent) {\n\tlog.Infof(\"\\nkey %v\", *key)\n\n\tif key.GetJsPath() != \".commit.end\" {\n\t\ta.CfgTranxMap[key.GetJsPath()] = append(a.CfgTranxMap[key.GetJsPath()], CfgTranxEntry{Op: op, Key: key, Data: data})\n\t\treturn\n\t}\n\n\t// for _, item := range FibMgr.CfgTranxMap[\".gofib.ipv4_routes\"] {\n\t// \tHandleIpv4ConfigEvent(item.Op, item.Key, item.Data)\n\t// }\n\n\tfor _, item := range a.CfgTranxMap[\".kubernetes\"] {\n\t\tHandleKubeConfigEvent(item.Op, item.Key, item.Data, a)\n\t}\n\n\t// Delete all current candidate list.\n\ta.CfgTranxMap = make(map[string][]CfgTranxEntry)\n}",
"func BuildListFunc(grpccli organizationpb.OrganizationClient, cliopts ...grpc.CallOption) goagrpc.RemoteFunc {\n\treturn func(ctx context.Context, reqpb interface{}, opts ...grpc.CallOption) (interface{}, error) {\n\t\tfor _, opt := range cliopts {\n\t\t\topts = append(opts, opt)\n\t\t}\n\t\tif reqpb != nil {\n\t\t\treturn grpccli.List(ctx, reqpb.(*organizationpb.ListRequest), opts...)\n\t\t}\n\t\treturn grpccli.List(ctx, &organizationpb.ListRequest{}, opts...)\n\t}\n}",
"func (a *Api) HandleGetHostGroups(w http.ResponseWriter, r *http.Request) {\n\tvar hg []hostGroup\n\tfor _, item := range a.staticData.hostgroupList {\n\t\tgroup := hostGroup{HostGroupName: item[\"hostgroup_name\"], Alias: item[\"alias\"], Members: strings.Split(item[\"members\"], \",\")}\n\t\thg = append(hg, group)\n\t}\n\tw.Header().Set(\"Content-Type\", \"application/json\")\n\tjson.NewEncoder(w).Encode(hg)\n}",
"func (i *Integration) HandleJoinEvent(ctx context.Context, vars map[string]string, payload pb.JoinEvent) error {\n\ti.SendJoinNotificationChan <- payload\n\treturn nil\n}",
"func JoinedHostsFromEvents(ctx context.Context, evs []gomatrixserverlib.PDU, rsAPI api.FederationRoomserverAPI) ([]types.JoinedHost, error) {\n\tvar joinedHosts []types.JoinedHost\n\tfor _, ev := range evs {\n\t\tif ev.Type() != \"m.room.member\" || ev.StateKey() == nil {\n\t\t\tcontinue\n\t\t}\n\t\tmembership, err := ev.Membership()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif membership != spec.Join {\n\t\t\tcontinue\n\t\t}\n\t\tvalidRoomID, err := spec.NewRoomID(ev.RoomID())\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tvar domain spec.ServerName\n\t\tuserID, err := rsAPI.QueryUserIDForSender(ctx, *validRoomID, spec.SenderID(*ev.StateKey()))\n\t\tif err != nil {\n\t\t\tif errors.As(err, new(base64.CorruptInputError)) {\n\t\t\t\t// Fallback to using the \"old\" way of getting the user domain, avoids\n\t\t\t\t// \"illegal base64 data at input byte 0\" errors\n\t\t\t\t// FIXME: we should do this in QueryUserIDForSender instead\n\t\t\t\t_, domain, err = gomatrixserverlib.SplitID('@', *ev.StateKey())\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn nil, err\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t} else {\n\t\t\tdomain = userID.Domain()\n\t\t}\n\n\t\tjoinedHosts = append(joinedHosts, types.JoinedHost{\n\t\t\tMemberEventID: ev.EventID(), ServerName: domain,\n\t\t})\n\t}\n\treturn joinedHosts, nil\n}",
"func (s *BaseSV2017ParserListener) EnterLet_port_list(ctx *Let_port_listContext) {}",
"func HandleEventNames(w http.ResponseWriter, r *http.Request) {\n\n\tr.ParseForm()\n\tw.Header().Set(\"Content-Type\", \"application/json\")\n\n\tdb, err := sql.Open(\"sqlite3\", \"./data/database.sqlite3\")\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tdefer db.Close()\n\n\tstmt, err := db.Prepare(\"SELECT UUID, title, content FROM Event ORDER BY id DESC;\")\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\trows, err := stmt.Query()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tdefer rows.Close()\n\n\tvar e event\n\tvar events []event\n\n\tfor rows.Next() {\n\t\terr = rows.Scan(&e.eventUUID, &e.title, &e.content)\n\t\tevents = append(events, e)\n\t}\n\n\tvar json = jsoniter.ConfigCompatibleWithStandardLibrary\n\tresponse, err := json.Marshal(events)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\tfmt.Fprintln(w, string(response))\n}",
"func (s *OutputRoomEventConsumer) joinedHostsAtEvent(\n\tore api.OutputNewRoomEvent, oldJoinedHosts []types.JoinedHost,\n) ([]spec.ServerName, error) {\n\t// Combine the delta into a single delta so that the adds and removes can\n\t// cancel each other out. This should reduce the number of times we need\n\t// to fetch a state event from the room server.\n\tcombinedAdds, combinedRemoves := combineDeltas(\n\t\tore.AddsStateEventIDs, ore.RemovesStateEventIDs,\n\t\tore.StateBeforeAddsEventIDs, ore.StateBeforeRemovesEventIDs,\n\t)\n\tcombinedAddsEvents, err := s.lookupStateEvents(combinedAdds, ore.Event.PDU)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tcombinedAddsJoinedHosts, err := JoinedHostsFromEvents(s.ctx, combinedAddsEvents, s.rsAPI)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tremoved := map[string]bool{}\n\tfor _, eventID := range combinedRemoves {\n\t\tremoved[eventID] = true\n\t}\n\n\tjoined := map[spec.ServerName]bool{}\n\tfor _, joinedHost := range oldJoinedHosts {\n\t\tif removed[joinedHost.MemberEventID] {\n\t\t\t// This m.room.member event is part of the current state of the\n\t\t\t// room, but not part of the state at the event we are processing\n\t\t\t// Therefore we can't use it to tell whether the server was in\n\t\t\t// the room at the event.\n\t\t\tcontinue\n\t\t}\n\t\tjoined[joinedHost.ServerName] = true\n\t}\n\n\tfor _, joinedHost := range combinedAddsJoinedHosts {\n\t\t// This m.room.member event was part of the state of the room at the\n\t\t// event, but isn't part of the current state of the room now.\n\t\tjoined[joinedHost.ServerName] = true\n\t}\n\n\t// handle peeking hosts\n\tinboundPeeks, err := s.db.GetInboundPeeks(s.ctx, ore.Event.PDU.RoomID())\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tfor _, inboundPeek := range inboundPeeks {\n\t\tjoined[inboundPeek.ServerName] = true\n\t}\n\n\tvar result []spec.ServerName\n\tfor serverName, include := range joined {\n\t\tif include {\n\t\t\tresult = append(result, serverName)\n\t\t}\n\t}\n\treturn result, nil\n}",
"func (a *NetworkingProjectNetadpApiService) NetworkingProjectNetadpEventList(ctx context.Context, projectId string, locationId string, netadpId string) ApiNetworkingProjectNetadpEventListRequest {\n\treturn ApiNetworkingProjectNetadpEventListRequest{\n\t\tApiService: a,\n\t\tctx: ctx,\n\t\tprojectId: projectId,\n\t\tlocationId: locationId,\n\t\tnetadpId: netadpId,\n\t}\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
ParseFromContent will read the character from a byte slice.
|
func ParseFromContent(data []byte) (*Character, error) {
// Create a reader from the byte slice.
r := bytes.NewReader(data)
// Implements buffered reading, wraps io.Reader.
bfr := bufio.NewReader(r)
return parse(bfr)
}
|
[
"func ReadFromContent(r io.ReadCloser) []byte {\n\t//fixme 2000 seems is enough\n\tp := make([]byte, 2000)\n\tn, err := r.Read(p)\n\tif err != nil {\n\t\tlog.Printf(\"Error while reading content : %s\", err)\n\t\treturn p[:1]\n\t}\n\treturn p[:n]\n}",
"func (p *parser) parseContent() (*chunk, error) {\n\tvar chunks []*chunk\n\nloop:\n\tfor {\n\t\ttk, e := p.scanner.scanToken()\n\t\tif e != nil {\n\t\t\treturn nil, e\n\t\t}\n\n\t\tswitch {\n\t\tcase tk.kind == TOKEN_LITERAL:\n\t\t\tchunks = append(chunks, newChunkLiteral(tk.value, p.scanner))\n\t\tcase tk.isSym(\"<%\"):\n\t\t\t// look at the next token\n\t\t\ttk2, e := p.scanner.peek()\n\t\t\tif e != nil {\n\t\t\t\treturn nil, e\n\t\t\t}\n\n\t\t\tif tk2.isIdent(\"end_if\") || tk2.isIdent(\"end_loop\") || tk2.isIdent(\"end_with\") || tk2.isIdent(\"end_cached\") || tk2.isIdent(\"else\") {\n\t\t\t\t// we've hit a token that we can't process. Put back the start of, and exit.\n\t\t\t\tp.scanner.putBack(tk)\n\t\t\t\tbreak loop\n\t\t\t}\n\n\t\t\t// parse the content of the tag\n\t\t\tch, e := p.parseTag()\n\t\t\tif e != nil {\n\t\t\t\treturn nil, e\n\t\t\t}\n\n\t\t\tchunks = append(chunks, ch)\n\t\tcase tk.kind == TOKEN_END_SOURCE:\n\t\t\tp.scanner.putBack(tk)\n\t\t\tbreak loop\n\t\tcase tk.isSym(\"{\"):\n\t\t\t// the scanner only emits this when it sees \"{$\", and the next token will be \"$\".\n\t\t\ttk2, e := p.scanner.scanToken()\n\t\t\tif e != nil {\n\t\t\t\treturn nil, e\n\t\t\t}\n\t\t\tif !tk2.isSym(\"$\") {\n\t\t\t\treturn nil, newTemplateError(\"Expected '$' after '{'\", p.scanner)\n\t\t\t}\n\n\t\t\t// now parse the variable or function\n\t\t\tch, e := p.parseVariableOrFn()\n\t\t\tif e != nil {\n\t\t\t\treturn nil, e\n\t\t\t}\n\n\t\t\t// finally we expect \"}\"\n\t\t\te = p.expectSym(\"}\")\n\t\t\tif e != nil {\n\t\t\t\treturn nil, e\n\t\t\t}\n\n\t\t\t// here we have to tell the scanner that it is now scanning literals again\n\t\t\tp.scanner.inTemplateTag = false\n\n\t\t\t// all is ok, add the variable or function to the list.\n\t\t\tchunks = append(chunks, ch)\n\t\tcase tk.isSym(\"$\"):\n\t\t\t// variable/function injection\n\t\t\tch, e := p.parseVariableOrFn()\n\t\t\tif e != nil {\n\t\t\t\treturn nil, e\n\t\t\t}\n\t\t\tchunks = append(chunks, ch)\n\n\t\t\tp.scanner.inTemplateTag = false\n\n\t\tdefault:\n\t\t\t// if we don't know what to do with something, we're out of here\n\t\t\tp.scanner.putBack(tk)\n\t\t\tbreak loop\n\t\t}\n\t}\n\n\treturn newChunkBlock(chunks, p.scanner), nil\n}",
"func Parse(content string, spec *vpython.Spec) error {\n\tif err := cproto.UnmarshalTextML(content, spec); err != nil {\n\t\treturn errors.Annotate(err, \"failed to unmarshal vpython.Spec\").Err()\n\t}\n\treturn nil\n}",
"func (p *Parser) ParseContent(content string, filename ...string) (*Api, error) {\n\tvar f string\n\tif len(filename) > 0 {\n\t\tf = filename[0]\n\t\tabs, err := filepath.Abs(f)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tp.src = abs\n\t}\n\n\treturn p.parse(f, content)\n}",
"func (p *Parser) ParseContent(content string, filename ...string) (*Api, error) {\n\tvar f, abs string\n\tif len(filename) > 0 {\n\t\tf = filename[0]\n\t\ta, err := filepath.Abs(f)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tabs = a\n\t}\n\n\tp.importStatck.push(abs)\n\treturn p.parse(f, content)\n}",
"func ParseContent(header string) (*Content, error) {\n\tcontent := &Content{\n\t\tType: ContentTypeUnknown,\n\t\tParams: make(map[string]string),\n\t}\n\n\tif header == \"\" {\n\t\treturn content, nil\n\t}\n\n\tmedia, params, err := mime.ParseMediaType(header)\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tcontent.Params = params\n\n\tswitch media {\n\tcase \"text/plain\":\n\t\tcontent.Type = ContentTypePlainText\n\tcase \"text/html\", \"application/xhtml+xml\":\n\t\tcontent.Type = ContentTypeHTML\n\tcase \"application/json\", \"text/javascript\":\n\t\tcontent.Type = ContentTypeJSON\n\tcase \"text/xml\", \"application/xml\":\n\t\tcontent.Type = ContentTypeXML\n\tcase \"application/x-www-form-urlencoded\":\n\t\tcontent.Type = ContentTypeForm\n\tcase \"text/event-stream\":\n\t\tcontent.Type = ContentTypeEventStream\n\t}\n\n\treturn content, nil\n}",
"func parseContentRange(r string) (parsed contentRange, err error) {\n\tinvalidErr := fmt.Errorf(\"invalid Content-Range: %v\", r)\n\n\t// Require that units == \"bytes\"\n\tconst bytesPrefix = \"bytes \"\n\tif !strings.HasPrefix(r, bytesPrefix) {\n\t\treturn parsed, invalidErr\n\t}\n\n\t// Split range from total length\n\tparts := strings.SplitN(r[len(bytesPrefix):], \"/\", 2)\n\tif len(parts) != 2 {\n\t\treturn parsed, invalidErr\n\t}\n\n\t// Process range\n\tif parts[0] == \"*\" {\n\t\tparsed.Start = -1\n\t\tparsed.End = -1\n\t} else {\n\t\trangeParts := strings.SplitN(parts[0], \"-\", 2)\n\t\tif len(rangeParts) != 2 {\n\t\t\treturn parsed, invalidErr\n\t\t}\n\n\t\tparsed.Start, err = strconv.Atoi(rangeParts[0])\n\t\tif err != nil {\n\t\t\treturn parsed, invalidErr\n\t\t}\n\n\t\tif rangeParts[1] == \"*\" {\n\t\t\tparsed.End = -1\n\t\t} else {\n\t\t\tparsed.KnownRange = true\n\t\t\tparsed.End, err = strconv.Atoi(rangeParts[1])\n\t\t\tif err != nil {\n\t\t\t\treturn parsed, invalidErr\n\t\t\t}\n\t\t}\n\t}\n\n\t// Process total length\n\tif parts[1] == \"*\" {\n\t\tparsed.Total = -1\n\t} else {\n\t\tparsed.KnownTotal = true\n\t\tparsed.Total, err = strconv.Atoi(parts[1])\n\t\tif err != nil {\n\t\t\treturn parsed, invalidErr\n\t\t}\n\t}\n\n\treturn parsed, nil\n}",
"func (c *Client) Parse(ctx context.Context, input io.Reader) (string, error) {\n\treturn c.ParseWithHeader(ctx, input, nil)\n}",
"func parseBinaryContent(v string, msg proto.Message) error {\n\tr := strings.NewReader(v)\n\tencName, _, err := cmpbin.ReadString(r)\n\tif err != nil {\n\t\treturn errors.Annotate(err, \"failed to read message name\").Err()\n\t}\n\n\t// Construct a message for this.\n\tif name := proto.MessageName(msg); name != encName {\n\t\treturn errors.Reason(\"message name %q doesn't match encoded name %q\", name, encName).Err()\n\t}\n\n\t// We have the right message, unmarshal.\n\td, _, err := cmpbin.ReadBytes(r)\n\tif err != nil {\n\t\treturn errors.Annotate(err, \"failed to read binary message content\").Err()\n\t}\n\tif err := proto.Unmarshal(d, msg); err != nil {\n\t\treturn errors.Annotate(err, \"failed to unmarshal message\").Err()\n\t}\n\treturn nil\n}",
"func Parse(b []byte) (PrefMap, error) {\n\treturn parse(b)\n}",
"func ParseFile(charname string, data []byte) CharData {\n\t// start_index := 0\n\t// size := len(data)\n\t// fmt.Println(\"data size: \", size)\n\t// if size > 8000000 {\n\t// \tstart_index = 8389395\n\t// } else if size > 4000000 {\n\t// \tstart_index = 4194408\n\t// }\n\n\t// this could be removed if there is a way to always know where the character data starts\n\t// instead of parsing the file looking for the name\n\t// like the commented code above\n\tcharname = utils.MakeTitle(charname)\n\n\t// look for where character region starts by searching for the character name and some flags\n\tstartIndex := 0\n\tfor {\n\t\ttmpIndex := strings.Index(string(data[startIndex:]), charname)\n\n\t\tstartIndex += tmpIndex\n\t\t// log.Println(\"start_index:\", start_index)\n\n\t\t// log.Printf(\"name: %s | % 20x\", charname, charname)\n\t\t// log.Println(\"len:\", data[start_index-1])\n\t\t// log.Printf(\"% 20x\", data[start_index:start_index+40])\n\t\t// log.Printf(\"% 20x\", data[start_index-9:start_index-1])\n\t\t// fmt.Println(\"nbr: \", (int(data[start_index-1]) + 16))\n\t\t// log.Printf(\"% 20x \\n\", data[start_index+int(data[start_index-1])+14])\n\n\t\t// it seems that all characters have this byte with the value of 0x18, so I'm using it to make sure i'm in the character data region\n\t\tbyte0x18 := data[startIndex+int(data[startIndex-1])+14]\n\n\t\tif startIndex <= 0 {\n\t\t\treturn CharData{}\n\t\t}\n\n\t\t// if byte_0x18 doesn't work, try to use the previous 4 bytes before the name\n\t\t// && string(data[start_index-5:start_index-1]) == string([]byte{0, 0, 0, 0})\n\t\t// checks if the leading byte of the name is the name size and if 15th byte has the value of 0x18\n\t\tif int(data[startIndex-1]) == len(charname) && byte0x18 == 0x18 {\n\t\t\tstartIndex--\n\t\t\tbreak\n\t\t}\n\t\tstartIndex++\n\n\t\ttime.Sleep(time.Second * 5)\n\t}\n\n\tcharSectionRegion := data[startIndex:]\n\n\tcharnameLen := charSectionRegion[0]\n\tcharnameFromFile := string(charSectionRegion[1 : charnameLen+1])\n\tunknown1 := charSectionRegion[charnameLen+1 : charnameLen+1+35]\n\tequipedPowerLen := charSectionRegion[charnameLen+1+35]\n\tequipedPower := string(charSectionRegion[charnameLen+1+35+1 : charnameLen+1+35+1+equipedPowerLen])\n\n\tnextIndex := charnameLen + 1 + 35 + 1 + equipedPowerLen\n\ti := nextIndex\n\tpowerCooldownIndex := uint32(startIndex) + uint32(i)\n\tnextIndex = i + 4\n\tpowerCooldown := binary.LittleEndian.Uint32(charSectionRegion[i:nextIndex])\n\n\tunknown2 := charSectionRegion[nextIndex : nextIndex+4]\n\tnumberOfItemsInInventory := binary.LittleEndian.Uint32(charSectionRegion[nextIndex+4 : nextIndex+4+4])\n\n\t// for debugging\n\t// fmt.Printf(\"charname_len: %d, % 20x\\n\", charname_len, char_section_region[0])\n\t// fmt.Printf(\"charname: %s, % 20x\\n\", charname_from_file, char_section_region[1:charname_len+1])\n\t// fmt.Printf(\"unknown1: % 20x\\n\", unknown1)\n\t// fmt.Printf(\"equiped_power_len: %d\\n\", char_section_region[charname_len+1+35])\n\t// fmt.Printf(\"equiped_power: %s, % 20x\\n\", equiped_power, char_section_region[charname_len+1+35+1:charname_len+1+35+1+equiped_power_len])\n\t// power_cooldown_bytes := char_section_region[i:next_i]\n\t// fmt.Printf(\"power_cooldown: %d, % 20x\\n\", power_cooldown, power_cooldown_bytes)\n\t// // Max cooldown 1200s\n\t// fmt.Println(\"power_cooldown: microseconds\", power_cooldown/1000000)\n\t// fmt.Printf(\"unknown2: %d, % 20x\\n\", unknown2, char_section_region[next_i:next_i+4])\n\t// fmt.Printf(\"number_of_items_in_inventory: %d, % 20x\\n\", number_of_items_in_inventory, char_section_region[next_i+4:next_i+4+4])\n\n\tcharData := &CharData{\n\t\tCharnameLen: uint8(charnameLen),\n\t\tCharname: string(charnameFromFile),\n\t\tUnknown1: unknown1,\n\t\tEquipedPowerLenIndex: uint32(startIndex) + uint32(charnameLen+1+35),\n\t\tEquipedPowerLen: uint8(equipedPowerLen),\n\t\tEquipedPower: equipedPower,\n\t\tPowerCooldownIndex: powerCooldownIndex,\n\t\tPowerCooldown: powerCooldown,\n\t\tUnknown2: binary.LittleEndian.Uint32(unknown2),\n\t\tNumberOfItemsInInventory: numberOfItemsInInventory,\n\t\tNewPowerToEquip: \"\",\n\t\tModifyPowerEquiped: false,\n\t\t// ItemSection:,\n\t}\n\n\tstartOfItemsSection := startIndex + int(nextIndex+4+4)\n\titems, _ := GetItems(int(numberOfItemsInInventory), startOfItemsSection, data)\n\tcharData.ItemSection = items\n\n\treturn *charData\n}",
"func ParseByte(txt []byte) (*Session, error) {\n\ts, err := parse(\"\", txt)\n\n\tif err != nil {\n\t\treturn &Session{}, err\n\t}\n\n\treturn s, nil\n}",
"func (d *Decoder) Parse(schema cue.Value, filename string, b []byte) (ast.Expr, error) {\n\tdec := decoder{Decoder: d}\n\n\t// dec.errs = nil\n\n\tf := token.NewFile(filename, 0, len(b))\n\tf.SetLinesForContent(b)\n\tdec.file = f\n\n\tcfg := parser.Config{}\n\tnodes, err := parser.ParseWithConfig(b, cfg)\n\tif err != nil {\n\t\treturn nil, errors.Newf(token.NoPos, \"textproto: %v\", err)\n\t}\n\n\tm := dec.parseSchema(schema)\n\tif dec.errs != nil {\n\t\treturn nil, dec.errs\n\t}\n\n\tn := dec.decodeMsg(m, nodes)\n\tif dec.errs != nil {\n\t\treturn nil, dec.errs\n\t}\n\n\treturn n, nil\n}",
"func (n *RegistryNotification) ParseFrom(b []byte) error {\n if len(b) < MinRegistryNotificationSize {\n return ErrParsingFailed\n }\n n.NotificationHeader.ParseFrom(b)\n n.RegistryAction = binary.LittleEndian.Uint16(b[24:26])\n n.Truncated = binary.LittleEndian.Uint16(b[26:28])\n n.ValueName = decodeUnicodeByteBuffer(b[28:156])\n n.KeyPath = decodeUnicodeByteBuffer(b[156:])\n return nil\n}",
"func (p *Parser) ParseBytes(b []byte) (*Value, error) {\n\treturn p.Parse(hack.String(b))\n}",
"func (t *textStructure) Read(content string, paragraphNumber int) {\n\tline := t.rgp.ReplaceAllString(content, \"\")\n\n\tif line = strings.TrimSpace(line); line != \"\" {\n\t\tvar resultWords []string\n\n\t\tfor _, line := range strings.Split(line, \".\") {\n\t\t\tt.parseLine(strings.ToLower(strings.TrimSpace(line)), &resultWords)\n\t\t}\n\t\tt.mapper.Insert(resultWords, paragraphNumber)\n\t}\n\n}",
"func ParseFrom(name string, src io.Reader, mode ParseMode) (f *ast.Module, err error) {\n\tloader := source.NewMemLoader()\n\tvar content []byte\n\tcontent, err = ioutil.ReadAll(src)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tloader.Add(name, string(content))\n\tcm := source.NewCodeMap(loader)\n\tdefer cm.Close()\n\n\tsess := NewSession(\n\t\treport.NewReporter(cm, report.Errors(!mode.Is(SkipWarnings))),\n\t\tcm,\n\t\tbuiltinOpTable(),\n\t)\n\n\tp := newParser(sess)\n\ts := scanner.New(name, bytes.NewBuffer(content))\n\ts.Run()\n\tp.init(name, s, mode)\n\tdefer catchBailout()\n\tdefer func() {\n\t\terr = sess.Emit()\n\t}()\n\tf = parseFile(p)\n\treturn\n\n}",
"func (m *Manager) Parse(ctx context.Context, src Source, command string) *ParseResults {\n\treturn m.ParseReader(ctx, src, &brigodier.StringReader{String: command})\n}",
"func parse(r io.Reader, pf *ProtoFile) error {\n\tbr := bufio.NewReader(r)\n\n\t// initialize parser...\n\tloc := location{line: 1, column: 0}\n\tparser := parser{br: br, loc: &loc}\n\n\t// parse the file contents...\n\treturn parser.parse(pf)\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
Parses the 767 byte static header, all characters have this data.
|
func parseHeader(bfr io.Reader, char *Character) error {
// Make a buffer that can hold 767 bytes, which can hold the entire header.
// The header is 765 bytes, but the first 2 bytes of the attributes section
// is included here, because it's a 2 bytes header that we're not really
// interested in.
buf := make([]byte, 767)
_, err := io.ReadFull(bfr, buf)
if err != nil {
return err
}
err = binary.Read(bytes.NewBuffer(buf), binary.LittleEndian, &char.Header)
if err != nil {
return err
}
return nil
}
|
[
"func parseHeader(b []byte) (ovsh.Header, error) {\n\t// Verify that the byte slice is long enough before doing unsafe casts.\n\tif l := len(b); l < sizeofHeader {\n\t\treturn ovsh.Header{}, fmt.Errorf(\"not enough data for OVS message header: %d bytes\", l)\n\t}\n\n\th := *(*ovsh.Header)(unsafe.Pointer(&b[:sizeofHeader][0]))\n\treturn h, nil\n}",
"func (clh *CashLetterHeader) Parse(record string) {\n\tif utf8.RuneCountInString(record) != 80 {\n\t\treturn\n\t}\n\n\t// Character position 1-2, Always \"10\"\n\tclh.setRecordType()\n\t// 03-04\n\tclh.CollectionTypeIndicator = clh.parseStringField(record[2:4])\n\t// 05-13\n\tclh.DestinationRoutingNumber = clh.parseStringField(record[4:13])\n\t// 14-22\n\tclh.ECEInstitutionRoutingNumber = clh.parseStringField(record[13:22])\n\t// 23-30\n\tclh.CashLetterBusinessDate = clh.parseYYYYMMDDDate(record[22:30])\n\t// 31-38\n\tclh.CashLetterCreationDate = clh.parseYYYYMMDDDate(record[30:38])\n\t// 39-42\n\tclh.CashLetterCreationTime = clh.parseSimpleTime(record[38:42])\n\t// 43-43\n\tclh.RecordTypeIndicator = clh.parseStringField(record[42:43])\n\t// 44-44\n\tclh.DocumentationTypeIndicator = clh.parseStringField(record[43:44])\n\t// 45-52\n\tclh.CashLetterID = clh.parseStringField(record[44:52])\n\t// 53-66\n\tclh.OriginatorContactName = clh.parseStringField(record[52:66])\n\t// 67-76\n\tclh.OriginatorContactPhoneNumber = clh.parseStringField(record[66:76])\n\t// 77-77\n\tclh.FedWorkType = clh.parseStringField(record[76:77])\n\t// 78-78\n\tclh.ReturnsIndicator = clh.parseStringField(record[77:78])\n\t// 79-79\n\tclh.UserField = clh.parseStringField(record[78:79])\n\t// 80-80\n\tclh.reserved = \" \"\n}",
"func (header *FixedHeader) decodeHeader(buf []byte) (int, error) {\n\n\tif len(buf) < 1 {\n\t\treturn 0, errors.New(\"wrong message format\")\n\t}\n\theader.ControlFlag = buf[0]\n\t// messageType := header.ControlFlag >> 4\n\tremainLen, l, err := readVint(buf[1:])\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\n\theader.remainLen = uint32(remainLen)\n\treturn l + 1, nil\n}",
"func readMobiHeader(b []byte) (*MOBIHeader, error) {\n\theader := &MOBIHeader{}\n\n\tvar err error\n\theader.Identifier = string(b[0:4])\n\theader.Length, err = getUint(b, 4, 4)\n\theader.MobiType, err = getUint(b, 8, 4)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\theader.Encoding, err = getUint(b, 12, 4)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\theader.UniqueID, err = getUint(b, 16, 4)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\theader.FileVersion, err = getUint(b, 20, 4)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\theader.OrthographicIndex, err = getUint(b, 24, 4)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\theader.InflectionIndex, err = getUint(b, 28, 4)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\theader.IndexNames = string(b[32:36])\n\theader.IndexKeys = string(b[36:40])\n\theader.ExtraIndex0 = string(b[40:44])\n\theader.ExtraIndex1 = string(b[44:48])\n\theader.ExtraIndex2 = string(b[48:52])\n\theader.ExtraIndex3 = string(b[52:56])\n\theader.ExtraIndex4 = string(b[56:60])\n\theader.ExtraIndex5 = string(b[60:64])\n\theader.FirstNonBookIndex, err = getUint(b, 64, 4)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\theader.FullNameOffset, err = getUint(b, 68, 4)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\theader.FullNameLength, err = getUint(b, 72, 4)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\theader.Locale, err = getUint(b, 76, 4)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\theader.InputLanguage = string(b[80:84])\n\theader.OutputLangugage = string(b[84:88])\n\theader.MinVersion, err = getUint(b, 88, 4)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\theader.FirstImageIndex, err = getUint(b, 92, 4)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\theader.HuffmanRecordOffset, err = getUint(b, 96, 4)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\theader.HuffmanRecordCount, err = getUint(b, 100, 4)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\theader.HuffmanTableOffset, err = getUint(b, 104, 4)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\theader.HuffmanTableLength, err = getUint(b, 108, 4)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\theader.EXTHFlags, err = getUint(b, 112, 4)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\theader.Unknown1 = b[112:144]\n\theader.Unknown2 = b[144:148]\n\theader.DRMOffset, err = getUint(b, 152, 4)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\theader.DRMCount, err = getUint(b, 156, 4)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\theader.DRMSize, err = getUint(b, 160, 4)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\theader.DRMFlags, err = getUint(b, 164, 4)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\theader.Unknown3 = b[168:176]\n\theader.FirstContentRecordNumber, err = getUint(b, 176, 2)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\theader.LastContentRecordNumber, err = getUint(b, 178, 2)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\theader.Unknown4 = b[180:184]\n\theader.FCISRecordNumber, err = getUint(b, 184, 4)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\theader.Unknown5 = b[188:192]\n\theader.FLISRecordNumber, err = getUint(b, 192, 4)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\theader.Unknown6 = b[196:200]\n\theader.Unknown7 = b[200:208]\n\theader.FirstCompDataSecCount, err = getUint(b, 212, 4)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\theader.NumCompDataSections, err = getUint(b, 216, 4)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\theader.Unknown8 = b[220:224]\n\theader.ExtraRecordDataFlag, err = getUint(b, 224, 4)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif header.Length > 228 {\n\t\theader.INDXRecordOffset, err = getUint(b, 228, 4)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\tif header.Length > 232 {\n\t\theader.Unknown9 = b[232:236]\n\t\theader.Unknown10 = b[236:240]\n\t\theader.Unknown11 = b[240:244]\n\t\theader.Unknown12 = b[244:248]\n\t\theader.Unknown13 = b[248:252]\n\t\theader.Unknown14 = b[252:256]\n\t}\n\n\treturn header, nil\n}",
"func (h *Header) Decode(in []byte) error {\n\tif len(in) < 4 {\n\t\treturn io.ErrUnexpectedEOF\n\t}\n\tb, in := in[:4], in[4:]\n\tif !bytes.Equal(b, frameMagic) {\n\t\tif !bytes.Equal(b[1:4], skippableFrameMagic) || b[0]&0xf0 != 0x50 {\n\t\t\treturn ErrMagicMismatch\n\t\t}\n\t\t*h = Header{Skippable: true}\n\t\treturn nil\n\t}\n\tif len(in) < 1 {\n\t\treturn io.ErrUnexpectedEOF\n\t}\n\n\t// Clear output\n\t*h = Header{}\n\tfhd, in := in[0], in[1:]\n\th.SingleSegment = fhd&(1<<5) != 0\n\th.HasCheckSum = fhd&(1<<2) != 0\n\n\tif fhd&(1<<3) != 0 {\n\t\treturn errors.New(\"reserved bit set on frame header\")\n\t}\n\n\t// Read Window_Descriptor\n\t// https://github.com/facebook/zstd/blob/dev/doc/zstd_compression_format.md#window_descriptor\n\tif !h.SingleSegment {\n\t\tif len(in) < 1 {\n\t\t\treturn io.ErrUnexpectedEOF\n\t\t}\n\t\tvar wd byte\n\t\twd, in = in[0], in[1:]\n\t\twindowLog := 10 + (wd >> 3)\n\t\twindowBase := uint64(1) << windowLog\n\t\twindowAdd := (windowBase / 8) * uint64(wd&0x7)\n\t\th.WindowSize = windowBase + windowAdd\n\t}\n\n\t// Read Dictionary_ID\n\t// https://github.com/facebook/zstd/blob/dev/doc/zstd_compression_format.md#dictionary_id\n\tif size := fhd & 3; size != 0 {\n\t\tif size == 3 {\n\t\t\tsize = 4\n\t\t}\n\t\tif len(in) < int(size) {\n\t\t\treturn io.ErrUnexpectedEOF\n\t\t}\n\t\tb, in = in[:size], in[size:]\n\t\tif b == nil {\n\t\t\treturn io.ErrUnexpectedEOF\n\t\t}\n\t\tswitch size {\n\t\tcase 1:\n\t\t\th.DictionaryID = uint32(b[0])\n\t\tcase 2:\n\t\t\th.DictionaryID = uint32(b[0]) | (uint32(b[1]) << 8)\n\t\tcase 4:\n\t\t\th.DictionaryID = uint32(b[0]) | (uint32(b[1]) << 8) | (uint32(b[2]) << 16) | (uint32(b[3]) << 24)\n\t\t}\n\t}\n\n\t// Read Frame_Content_Size\n\t// https://github.com/facebook/zstd/blob/dev/doc/zstd_compression_format.md#frame_content_size\n\tvar fcsSize int\n\tv := fhd >> 6\n\tswitch v {\n\tcase 0:\n\t\tif h.SingleSegment {\n\t\t\tfcsSize = 1\n\t\t}\n\tdefault:\n\t\tfcsSize = 1 << v\n\t}\n\n\tif fcsSize > 0 {\n\t\th.HasFCS = true\n\t\tif len(in) < fcsSize {\n\t\t\treturn io.ErrUnexpectedEOF\n\t\t}\n\t\tb, in = in[:fcsSize], in[fcsSize:]\n\t\tif b == nil {\n\t\t\treturn io.ErrUnexpectedEOF\n\t\t}\n\t\tswitch fcsSize {\n\t\tcase 1:\n\t\t\th.FrameContentSize = uint64(b[0])\n\t\tcase 2:\n\t\t\t// When FCS_Field_Size is 2, the offset of 256 is added.\n\t\t\th.FrameContentSize = uint64(b[0]) | (uint64(b[1]) << 8) + 256\n\t\tcase 4:\n\t\t\th.FrameContentSize = uint64(b[0]) | (uint64(b[1]) << 8) | (uint64(b[2]) << 16) | (uint64(b[3]) << 24)\n\t\tcase 8:\n\t\t\td1 := uint32(b[0]) | (uint32(b[1]) << 8) | (uint32(b[2]) << 16) | (uint32(b[3]) << 24)\n\t\t\td2 := uint32(b[4]) | (uint32(b[5]) << 8) | (uint32(b[6]) << 16) | (uint32(b[7]) << 24)\n\t\t\th.FrameContentSize = uint64(d1) | (uint64(d2) << 32)\n\t\t}\n\t}\n\n\t// Frame Header done, we will not fail from now on.\n\tif len(in) < 3 {\n\t\treturn nil\n\t}\n\ttmp := in[:3]\n\tbh := uint32(tmp[0]) | (uint32(tmp[1]) << 8) | (uint32(tmp[2]) << 16)\n\th.FirstBlock.Last = bh&1 != 0\n\tblockType := blockType((bh >> 1) & 3)\n\t// find size.\n\tcSize := int(bh >> 3)\n\tswitch blockType {\n\tcase blockTypeReserved:\n\t\treturn nil\n\tcase blockTypeRLE:\n\t\th.FirstBlock.Compressed = true\n\t\th.FirstBlock.DecompressedSize = cSize\n\t\th.FirstBlock.CompressedSize = 1\n\tcase blockTypeCompressed:\n\t\th.FirstBlock.Compressed = true\n\t\th.FirstBlock.CompressedSize = cSize\n\tcase blockTypeRaw:\n\t\th.FirstBlock.DecompressedSize = cSize\n\t\th.FirstBlock.CompressedSize = cSize\n\tdefault:\n\t\tpanic(\"Invalid block type\")\n\t}\n\n\th.FirstBlock.OK = true\n\treturn nil\n}",
"func ParseHeader(flzss io.Reader) (header *Header, err error) {\n\tvar magic uint32\n\tif err = binary.Read(flzss, binary.LittleEndian, &magic); err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar orgSize uint32\n\tif err = binary.Read(flzss, binary.LittleEndian, &orgSize); err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar crc16 uint32\n\tif err = binary.Read(flzss, binary.LittleEndian, &crc16); err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar name [4 * 9]byte\n\tif _, err = io.ReadFull(flzss, name[:]); err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar flags uint32\n\tif err = binary.Read(flzss, binary.LittleEndian, &flags); err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar payloadSize uint32\n\tif err = binary.Read(flzss, binary.LittleEndian, &payloadSize); err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar w uint16\n\tif err = binary.Read(flzss, binary.LittleEndian, &w); err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar h uint16\n\tif err = binary.Read(flzss, binary.LittleEndian, &h); err != nil {\n\t\treturn nil, err\n\t}\n\n\theader = &Header{\n\t\tmagic,\n\t\torgSize,\n\t\tcrc16,\n\t\tname,\n\t\tflags,\n\t\tpayloadSize,\n\t\tw, h,\n\t}\n\treturn header, err\n}",
"func parseHeader(rd io.Reader) (tagHeader, error) {\n\tvar header tagHeader\n\n\tdata := make([]byte, tagHeaderSize)\n\tn, err := rd.Read(data)\n\tif err != nil {\n\t\treturn header, err\n\t}\n\tif n < tagHeaderSize {\n\t\treturn header, ErrSmallHeaderSize\n\t}\n\n\tif !isID3Tag(data[0:3]) {\n\t\treturn header, errNoTag\n\t}\n\n\theader.Version = data[3]\n\n\t// Tag header size is always synchsafe.\n\tsize, err := parseSize(data[6:], true)\n\tif err != nil {\n\t\treturn header, err\n\t}\n\n\theader.FramesSize = size\n\treturn header, nil\n}",
"func UA_RequestHeader_init(p []UA_RequestHeader) {\n\tnoarch.Memset(p, byte(0), 776)\n}",
"func (rr Int8) ReadHeader(header http.Header) error {\n\tfor k, v := range rr {\n\t\ti64, _ := strconv.ParseInt(header.Get(k), 10, 8)\n\t\t*v = int8(i64)\n\t}\n\treturn nil\n}",
"func (subframe *Subframe) parseHeader(br *bits.Reader) error {\n\t// 1 bit: zero-padding.\n\tx, err := br.Read(1)\n\tif err != nil {\n\t\treturn unexpected(err)\n\t}\n\tif x != 0 {\n\t\treturn errors.New(\"frame.Subframe.parseHeader: non-zero padding\")\n\t}\n\n\t// 6 bits: Pred.\n\tx, err = br.Read(6)\n\tif err != nil {\n\t\treturn unexpected(err)\n\t}\n\t// The 6 bits are used to specify the prediction method and order as follows:\n\t// 000000: Constant prediction method.\n\t// 000001: Verbatim prediction method.\n\t// 00001x: reserved.\n\t// 0001xx: reserved.\n\t// 001xxx:\n\t// if (xxx <= 4)\n\t// Fixed prediction method; xxx=order\n\t// else\n\t// reserved.\n\t// 01xxxx: reserved.\n\t// 1xxxxx: FIR prediction method; xxxxx=order-1\n\tswitch {\n\tcase x < 1:\n\t\t// 000000: Constant prediction method.\n\t\tsubframe.Pred = PredConstant\n\tcase x < 2:\n\t\t// 000001: Verbatim prediction method.\n\t\tsubframe.Pred = PredVerbatim\n\tcase x < 8:\n\t\t// 00001x: reserved.\n\t\t// 0001xx: reserved.\n\t\treturn fmt.Errorf(\"frame.Subframe.parseHeader: reserved prediction method bit pattern (%06b)\", x)\n\tcase x < 16:\n\t\t// 001xxx:\n\t\t// if (xxx <= 4)\n\t\t// Fixed prediction method; xxx=order\n\t\t// else\n\t\t// reserved.\n\t\torder := int(x & 0x07)\n\t\tif order > 4 {\n\t\t\treturn fmt.Errorf(\"frame.Subframe.parseHeader: reserved prediction method bit pattern (%06b)\", x)\n\t\t}\n\t\tsubframe.Pred = PredFixed\n\t\tsubframe.Order = order\n\tcase x < 32:\n\t\t// 01xxxx: reserved.\n\t\treturn fmt.Errorf(\"frame.Subframe.parseHeader: reserved prediction method bit pattern (%06b)\", x)\n\tdefault:\n\t\t// 1xxxxx: FIR prediction method; xxxxx=order-1\n\t\tsubframe.Pred = PredFIR\n\t\tsubframe.Order = int(x&0x1F) + 1\n\t}\n\n\t// 1 bit: hasWastedBits.\n\tx, err = br.Read(1)\n\tif err != nil {\n\t\treturn unexpected(err)\n\t}\n\tif x != 0 {\n\t\t// k wasted bits-per-sample in source subblock, k-1 follows, unary coded;\n\t\t// e.g. k=3 => 001 follows, k=7 => 0000001 follows.\n\t\tx, err = br.ReadUnary()\n\t\tif err != nil {\n\t\t\treturn unexpected(err)\n\t\t}\n\t\tsubframe.Wasted = uint(x) + 1\n\t}\n\n\treturn nil\n}",
"func TestHeaderHasdataButNullEnc(t *testing.T) {\n\tbuf, err := EncodeHeader(ItemHeader{0, nil, true, 5})\n\tassert.Nil(t, err)\n\tassert.Equal(t, SBytes(\"80\"), buf)\t\t\t\t\t// test that isNull supercedes dataLen\n}",
"func (fh *FileHeader) Parse(record string) {\n\tif utf8.RuneCountInString(record) != 80 {\n\t\treturn\n\t}\n\t// Character position 1-2, Always \"01\"\n\tfh.setRecordType()\n\t// 03-04\n\tfh.StandardLevel = fh.parseStringField(record[2:4])\n\t// 05-05\n\tfh.TestFileIndicator = fh.parseStringField(record[4:5])\n\t// 06-14\n\tfh.ImmediateDestination = fh.parseStringField(record[5:14])\n\t// 15-23\n\tfh.ImmediateOrigin = fh.parseStringField(record[14:23])\n\t// 24-31\n\tfh.FileCreationDate = fh.parseYYYYMMDDDate(record[23:31])\n\t// 32-35\n\tfh.FileCreationTime = fh.parseSimpleTime(record[31:35])\n\t// 36-36\n\tfh.ResendIndicator = fh.parseStringField(record[35:36])\n\t// 37-54\n\tfh.ImmediateDestinationName = fh.parseStringField(record[36:54])\n\t// 55-72\n\tfh.ImmediateOriginName = fh.parseStringField(record[54:72])\n\t// 73-73\n\tfh.FileIDModifier = fh.parseStringField(record[72:73])\n\t// 74-75\n\tfh.CountryCode = fh.parseStringField(record[73:75])\n\t// 76-79\n\tfh.UserField = fh.parseStringField(record[75:79])\n\t// 80-80\n\tfh.CompanionDocumentIndicator = fh.parseStringField(record[79:80])\n}",
"func header(buf []byte) (header http.Header, bytes int, err error) {\n\theader = make(http.Header)\n\n\tvar name string\n\tvar value string\n\tvar b int\n\n\tfor {\n\t\tname, b, err = str(buf)\n\t\tbuf = buf[b:]\n\t\tbytes += b\n\n\t\tif err != nil {\n\t\t\treturn nil, bytes, err\n\t\t}\n\n\t\tvalue, b, err = str(buf)\n\t\tbuf = buf[b:]\n\t\tbytes += b\n\n\t\tif err != nil {\n\t\t\treturn nil, bytes, err\n\t\t}\n\n\t\tif len(name) == 0 && len(value) == 0 {\n\t\t\t// Or return once len(buf) == 0?\n\t\t\treturn\n\t\t}\n\n\t\theader.Add(name, value)\n\t}\n}",
"func (rr Uint) ReadHeader(header http.Header) error {\n\tfor k, v := range rr {\n\t\tu64, _ := strconv.ParseUint(header.Get(k), 10, 64)\n\t\t*v = uint(u64)\n\t}\n\treturn nil\n}",
"func parseHandshakeResponseHeader(packet *handshakeResponse41, data []byte) (parsedBytes int, err error) {\n\t// Ensure there are enough data to read:\n\t// http://dev.mysql.com/doc/internals/en/connection-phase-packets.html#packet-Protocol::SSLRequest\n\tif len(data) < 4+4+1+23 {\n\t\treturn 0, ErrMalformPacket\n\t}\n\n\toffset := 0\n\t// capability\n\tcapability := binary.LittleEndian.Uint32(data[:4])\n\tpacket.Capability = capability\n\toffset += 4\n\t// skip max packet size\n\toffset += 4\n\t// charset, skip, if you want to use another charset, use set names\n\tpacket.Collation = data[offset]\n\toffset++\n\t// skip reserved 23[00]\n\toffset += 23\n\n\treturn offset, nil\n}",
"func (r *decoder) Header() (err error, from string, date time.Time) {\n\tif r.header.Len() > 0 {\n\t\ts := r.header.String()\n\t\tif i := strings.Index(s, \" \"); i != -1 {\n\t\t\tfrom = s[:i]\n\t\t\tif len(s)-1 > i+1 {\n\t\t\t\tdate, err = time.Parse(time.ANSIC, s[i+1:])\n\t\t\t}\n\t\t\tif err == nil {\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t}\n\terr = InvalidHeader\n\treturn\n}",
"func ParseHTTPHeader(buf string) string {\n\tfor _, l := range strings.Split(buf, \"\\r\\n\") {\n\t\tif strings.HasPrefix(l, \"Host:\") {\n\t\t\treturn strings.TrimSpace(l[5:])\n\t\t}\n\t}\n\n\treturn \"\"\n}",
"func (a *API) ReadRequestHeader(httpHeader http.Header) error {\n\tb := bytes.NewBuffer([]byte(\"\"))\n\tif err := httpHeader.WriteSubset(b, a.RequestSuppressedHeaders); err != nil {\n\t\treturn err\n\t}\n\tfor _, header := range strings.Split(b.String(), \"\\n\") {\n\t\tvalues := strings.Split(header, \":\")\n\t\tif len(values) < 2 {\n\t\t\tcontinue\n\t\t}\n\t\tkey := values[0]\n\t\tif key == \"\" {\n\t\t\tcontinue\n\t\t}\n\t\ta.RequestHeaders[key] = values[1]\n\t}\n\treturn nil\n}",
"func (c *Composite) parseHeader(reader *bufio.Reader) error {\n\theader, err := reader.ReadString('\\x03')\n\tif err != nil || len(header) < 22 { // smaller length makes no sense\n\t\treturn newError(\"parseHeader\", \"header corrupted: too short\")\n\t}\n\n\t// Split header segments\n\tsection := splitHeader(header[:len(header)-1]) // without delimiter\n\n\t// Parse Product - Example: \"PG\" or \"FZ\"\n\tc.Product = header[:2]\n\n\t// Lookup Unit\n\tc.DataUnit = Unit_unknown\n\tif unit, ok := unitCatalog[c.Product]; ok {\n\t\tc.DataUnit = unit\n\t}\n\n\t// Parse DataLength - Example: \"BY 405160\"\n\tif _, err := fmt.Sscanf(section[\"BY\"], \"%d\", &c.dataLength); err != nil {\n\t\treturn newError(\"parseHeader\", \"could not parse data length: \"+err.Error())\n\t}\n\tc.dataLength -= len(header) // remove header length including delimiter\n\n\t// Parse CaptureTime - Example: \"PG262115100000616\" or \"FZ211615100000716\"\n\tdate := header[2:8] + header[13:17] // cut WMO number\n\tc.CaptureTime, err = time.Parse(\"0215040106\", date)\n\tif err != nil {\n\t\treturn newError(\"parseHeader\", \"could not parse capture time: \"+err.Error())\n\t}\n\n\t// Parse ForecastTime - Example: \"VV 005\"\n\tc.ForecastTime = c.CaptureTime\n\tif vv, ok := section[\"VV\"]; ok {\n\t\tmin := 0\n\t\tif _, err := fmt.Sscanf(vv, \"%d\", &min); err != nil {\n\t\t\treturn newError(\"parseHeader\", \"could not parse forecast time: \"+err.Error())\n\t\t}\n\t\tc.ForecastTime = c.CaptureTime.Add(time.Duration(min) * time.Minute)\n\t}\n\n\t// Parse Interval - Example \"INT 5\" or \"INT1008\"\n\tif intr, ok := section[\"INT\"]; ok {\n\t\tmin := 0\n\t\tif _, err := fmt.Sscanf(intr, \"%d\", &min); err != nil {\n\t\t\treturn newError(\"parseHeader\", \"could not parse interval: \"+err.Error())\n\t\t}\n\n\t\tc.Interval = time.Duration(min) * time.Minute\n\t\tswitch c.Product {\n\t\tcase \"W1\", \"W2\", \"W3\", \"W4\":\n\t\t\tc.Interval *= 10\n\t\t}\n\t}\n\n\t// Parse Dimensions - Example: \"GP 450x 450\" or \"BG460460\" or \"GP 1500x1400\" (if defined)\n\tif dim, ok := section[\"GP\"]; ok {\n\t\tif _, err := fmt.Sscanf(dim, \"%dx%d\", &c.Dy, &c.Dx); err != nil {\n\t\t\treturn newError(\"parseHeader\", \"could not parse dimensions (GP): \"+err.Error())\n\t\t}\n\t\tc.Px, c.Py = c.Dx, c.Dy // composite formats do not show elevation\n\n\t} else if dim, ok := section[\"BG\"]; ok {\n\t\tif _, err := fmt.Sscanf(dim, \"%3d%3d\", &c.Dy, &c.Dx); err != nil {\n\t\t\treturn newError(\"parseHeader\", \"could not parse dimensions (BG): \"+err.Error())\n\t\t}\n\t\tc.Px, c.Py = c.Dx, c.Dy // composite formats do not show elevation\n\n\t} else { // dimensions of local picture products not defined in header\n\t\tv, ok := dimensionCatalog[c.Product] // lookup in catalog\n\t\tif !ok {\n\t\t\treturn newError(\"parseHeader\", \"no dimension information available\")\n\t\t}\n\n\t\tc.Px, c.Py = v.px, v.py // plain data dimensions\n\t\tc.Dx, c.Dy = v.dx, v.dy // data layer dimensions\n\t\tc.Rx, c.Ry = v.rx, v.ry // data resolution\n\t}\n\n\t// Parse Precision - Example: \"PR E-01\" or \"PR E+00\"\n\tif prec, ok := section[\"E\"]; ok { // not that nice\n\t\tif _, err := fmt.Sscanf(prec, \"%d\", &c.precision); err != nil {\n\t\t\treturn newError(\"parseHeader\", \"could not parse precision: \"+err.Error())\n\t\t}\n\t}\n\n\t// Parse Level - Example \"LV 6 1.0 19.0 28.0 37.0 46.0 55.0\"\n\t// or \"LV12-31.5-24.5-17.5-10.5 -5.5 -1.0 1.0 5.5 10.5 17.5 24.5 31.5\"\n\tif lv, ok := section[\"LV\"]; ok {\n\t\tif len(lv) < 2 {\n\t\t\treturn newError(\"parseHeader\", \"level field too short\")\n\t\t}\n\n\t\tvar cnt int\n\t\tif _, err = fmt.Sscanf(lv[:2], \"%d\", &cnt); err != nil {\n\t\t\treturn newError(\"parseHeader\", \"could not parse level count: \"+err.Error())\n\t\t}\n\n\t\tif len(lv) != cnt*5+2 { // fortran format I2 + F5.1\n\t\t\treturn newError(\"parseHeader\", \"invalid level format: \"+lv)\n\t\t}\n\n\t\tc.level = make([]float32, cnt)\n\t\tfor i := range c.level {\n\t\t\tn := i * 5\n\t\t\tif _, err = fmt.Sscanf(lv[n+2:n+7], \"%f\", &c.level[i]); err != nil {\n\t\t\t\treturn newError(\"parseHeader\", \"invalid level value: \"+err.Error())\n\t\t\t}\n\t\t}\n\t}\n\n\t// Parse Format Version - Example \"VS 5\"\n\tif vs, ok := section[\"VS\"]; ok {\n\t\tif _, err = fmt.Sscanf(vs, \"%d\", &c.Format); err != nil {\n\t\t\treturn newError(\"parseHeader\", \"invalid format value: \"+err.Error())\n\t\t}\n\t}\n\n\treturn nil\n}",
"func (h *Header) FromBytes(data []byte) (int, error) {\n\t// Make sure we have enough data\n\tif len(data) < HeaderSize {\n\t\treturn 0, ErrShortInput\n\t}\n\n\t// Check the version\n\tvers := (data[0] & MajorMask) >> MajorShift\n\tif vers > MaxMajor {\n\t\treturn 0, fmt.Errorf(\"%d: %w\", vers, ErrMaxVersion)\n\t}\n\n\t// Fill in the header\n\th.Major = vers\n\th.Reply = (data[0] & ReplyBit) != 0\n\th.Error = (data[0] & ErrorBit) != 0\n\th.Protocol = data[1]\n\th.Length = (uint16(data[2]) << 8) | uint16(data[3])\n\n\treturn HeaderSize, nil\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
Parses the total attributes the character has, before items are calculated.
|
func parseAttributes(bfr io.ByteReader, char *Character) error {
// Create a bit reader from the buffered reader to read the stats.
br := bitReader{r: bfr}
for {
id, err := br.ReadBits(9)
if err != nil {
return err
}
// If all 9 bits are set, we've hit the end of the attributes section
// at 0x1ff and exit the loop.
if id == 0x1ff {
break
}
// The attribute value bit length, so we'll know how many bits to read next.
length, ok := attributeBitMap[id]
if !ok {
return fmt.Errorf("unknown attribute id: %d", id)
}
// The attribute value.
attr, err := br.ReadBits(length)
if err != nil {
return err
}
switch id {
case strength:
char.Attributes.Strength = attr
case energy:
char.Attributes.Energy = attr
case dexterity:
char.Attributes.Dexterity = attr
case vitality:
char.Attributes.Vitality = attr
case unusedStats:
char.Attributes.UnusedStats = attr
case unusedSkills:
char.Attributes.UnusedSkillPoints = attr
case currentHP:
char.Attributes.CurrentHP = attr / 256
case maxHP:
char.Attributes.MaxHP = attr / 256
case currentMana:
char.Attributes.CurrentMana = attr / 256
case maxMana:
char.Attributes.MaxMana = attr / 256
case currentStamina:
char.Attributes.CurrentStamina = attr / 256
case maxStamina:
char.Attributes.MaxStamina = attr / 256
case level:
char.Attributes.Level = attr
case experience:
char.Attributes.Experience = attr
case gold:
char.Attributes.Gold = attr
case stashedGold:
char.Attributes.StashedGold = attr
}
}
return nil
}
|
[
"func (m *NfNlMessage) parseAttributes(r *bytes.Reader) error {\n\tfor r.Len() >= syscall.NLA_HDRLEN {\n\t\tattr, err := ParseAttr(r)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tm.AddAttribute(attr)\n\t}\n\treturn nil\n}",
"func (a *NLAttr) parse(r *bytes.Reader) error {\n\tif r.Len() < syscall.NLA_HDRLEN {\n\t\treturn errors.New(\"Truncated attribute\")\n\t}\n\tvar alen uint16\n\tbinary.Read(r, native, &alen)\n\tbinary.Read(r, native, &a.Type)\n\n\tif alen < syscall.NLA_HDRLEN || int(alen-syscall.NLA_HDRLEN) > r.Len() {\n\t\treturn errors.New(\"Truncated attribute\")\n\t}\n\talen -= syscall.NLA_HDRLEN\n\tif alen == 0 {\n\t\ta.Data = nil\n\t\treturn nil\n\t}\n\n\ta.Data = make([]byte, alen)\n\tr.Read(a.Data)\n\tpadlen := nlaAlignOf(int(alen)) - int(alen)\n\tfor i := 0; i < padlen; i++ {\n\t\tr.ReadByte()\n\t}\n\treturn nil\n}",
"func AttributeInfoRead(buf []byte, v *AttributeInfo) int {\n\tb := 0\n\n\tv.Flags = xgb.Get32(buf[b:])\n\tb += 4\n\n\tv.Min = int32(xgb.Get32(buf[b:]))\n\tb += 4\n\n\tv.Max = int32(xgb.Get32(buf[b:]))\n\tb += 4\n\n\tv.Size = xgb.Get32(buf[b:])\n\tb += 4\n\n\t{\n\t\tbyteString := make([]byte, v.Size)\n\t\tcopy(byteString[:v.Size], buf[b:])\n\t\tv.Name = string(byteString)\n\t\tb += int(v.Size)\n\t}\n\n\treturn b\n}",
"func (m *Mob) normalizeAttr() {\n\tif m.CurrentAttr.Vitals.Hp > m.Attributes.Vitals.Hp {\n\t\tm.CurrentAttr.Vitals.Hp = m.Attributes.Vitals.Hp\n\t}\n\tif m.CurrentAttr.Vitals.Mana > m.Attributes.Vitals.Mana {\n\t\tm.CurrentAttr.Vitals.Mana = m.Attributes.Vitals.Mana\n\t}\n\tif m.CurrentAttr.Vitals.Mv > m.Attributes.Vitals.Mv {\n\t\tm.CurrentAttr.Vitals.Mv = m.Attributes.Vitals.Mv\n\t}\n}",
"func (p *XDiff) parseAttributes(element *xtree.Node) error {\n\tfor lookupAttributeName[p.currentByte()] == 1 {\n\t\tstart := p.position\n\t\tp.position++\n\t\tp.skip(lookupAttributeName)\n\t\tattrNode := xtree.NewNode(xtree.Attribute)\n\t\tattrNode.Name = p.sliceFrom(start)\n\n\t\t// skip whitespace\n\t\tp.skip(lookupWhitespace)\n\t\t// skip \"=\"\n\t\tif p.currentByte() != '=' {\n\t\t\treturn fmt.Errorf(\"expected '=' but found %q at position %v\", p.data[p.position], p.position)\n\t\t}\n\t\tp.position++\n\n\t\t// skip whitespace after =\n\t\tp.skip(lookupWhitespace)\n\t\tq := p.currentByte()\n\t\tif q != '\\'' && q != '\"' {\n\t\t\treturn fmt.Errorf(\"expected ' or \\\" but found %q at position %v\", q, p.position)\n\t\t}\n\t\tp.position++ // Skip quote\n\t\t// Extract attribute value, and expand char refs in it\n\t\tstart = p.position\n\t\tvar value []byte\n\t\tif q == '\\'' {\n\t\t\tvalue = p.skipAndExpandCharacterRefs(lookupAttributeValueSingle, lookupAttributeValueSingleNoProc)\n\t\t} else if q == '\"' {\n\t\t\tvalue = p.skipAndExpandCharacterRefs(lookupAttributeValueDouble, lookupAttributeValueDoubleNoProc)\n\t\t} else {\n\t\t\tpanic(\"should never happen\")\n\t\t}\n\t\tif value == nil {\n\t\t\treturn fmt.Errorf(\"error parsing attribute value\")\n\t\t}\n\t\t// Set attribute value.\n\t\tattrNode.Value = value\n\t\t// Make sure end quote is present.\n\t\tif p.currentByte() != q {\n\t\t\treturn fmt.Errorf(\"expected %v as end quote\", q)\n\t\t}\n\t\telement.AppendChild(attrNode)\n\t\tp.position++ // Skip quote.\n\t\tp.skip(lookupWhitespace) // Skip whitespace after attribute value.\n\t}\n\treturn nil\n}",
"func parseRawAttributes(rawAttributes []asn1.RawValue) []pkix.AttributeTypeAndValueSET {\r\n\tvar attributes []pkix.AttributeTypeAndValueSET\r\n\tfor _, rawAttr := range rawAttributes {\r\n\t\tvar attr pkix.AttributeTypeAndValueSET\r\n\t\trest, err := asn1.Unmarshal(rawAttr.FullBytes, &attr)\r\n\t\t// Ignore attributes that don't parse into pkix.AttributeTypeAndValueSET\r\n\t\t// (i.e.: challengePassword or unstructuredName).\r\n\t\tif err == nil && len(rest) == 0 {\r\n\t\t\tattributes = append(attributes, attr)\r\n\t\t}\r\n\t}\r\n\treturn attributes\r\n}",
"func (du *DataUnit) LengthCal() uint16 {\n\tif du == nil {\n\t\tlog.Fatal(\"DataUnit is nil?\")\n\t}\n\t// DataUnit have 8 bytes header\n\tl := uint16(8)\n\tfor _, body := range du.Body {\n\t\tswitch by := body.(type) {\n\t\tcase *OBDBody:\n\t\t\tl = l + uint16(by.DTCCount)*4 + 103\n\t\tcase *RTBody:\n\t\t\tl += 44\n\t\t}\n\t}\n\treturn l\n}",
"func StatParse(line string) (plugin.EntryAttributes, string, error) {\n\tvar attr plugin.EntryAttributes\n\tsegments := strings.SplitN(line, \" \", 6)\n\tif len(segments) != 6 {\n\t\treturn attr, \"\", fmt.Errorf(\"Stat did not return 6 components: %v\", line)\n\t}\n\n\tsize, err := strconv.ParseUint(segments[0], 10, 64)\n\tif err != nil {\n\t\treturn attr, \"\", err\n\t}\n\tattr.SetSize(size)\n\n\tatime, err := parseTime(segments[1])\n\tif err != nil {\n\t\treturn attr, \"\", err\n\t}\n\tattr.SetAtime(atime)\n\n\tmtime, err := parseTime(segments[2])\n\tif err != nil {\n\t\treturn attr, \"\", err\n\t}\n\tattr.SetMtime(mtime)\n\n\tctime, err := parseTime(segments[3])\n\tif err != nil {\n\t\treturn attr, \"\", err\n\t}\n\tattr.SetCtime(ctime)\n\n\tmode, err := plugin.ToFileMode(\"0x\" + segments[4])\n\tif err != nil {\n\t\treturn attr, \"\", err\n\t}\n\tattr.SetMode(mode)\n\n\treturn attr, segments[5], nil\n}",
"func ParseCSVSniffAttributeTypes(filepath string, hasHeaders bool, n_samples int) []base.Attribute {\n\tvar attrs []base.Attribute\n\t// Open file\n\tfile, err := os.Open(filepath)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tdefer file.Close()\n\t// Create the CSV reader\n\treader := csv.NewReader(file)\n\tif hasHeaders {\n\t\t// Skip the headers\n\t\t_, err := reader.Read()\n\t\tif err != nil {\n\t\t\tpanic(err)\n\t\t}\n\t}\n\t// Read the first line of the file\n\tcolumns, err := reader.Read()\n\n\t// instantiate our 2d sample array\n\tcolumns_list := make([][]string, len(columns))\n\tfor i := range columns_list {\n\t\tcolumns_list[i] = make([]string, n_samples)\n\t}\n\n\tfor i := 0; i < n_samples; i++ {\n\t\tfor idx, entry := range columns {\n\t\t\tcolumns_list[idx][i] = entry\n\t\t}\n\t\tcolumns, err = reader.Read()\n\t}\n\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfor _, entries := range columns_list {\n\t\t// Match the Attribute type with regular expressions\n\t\tmatched := 0\n\t\tdidnt_match := 0\n\t\tfor _, entry := range entries {\n\t\t\tentry = strings.Trim(entry, \" \")\n\t\t\tm, err := regexp.MatchString(\"^[-+]?[0-9]*\\\\.?[0-9]+([eE][-+]?[0-9]+)?$\", entry)\n\t\t\tif err != nil {\n\t\t\t\tpanic(err)\n\t\t\t} else {\n\t\t\t\tif m {\n\t\t\t\t\tmatched++\n\t\t\t\t} else {\n\t\t\t\t\tdidnt_match++\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif matched > didnt_match {\n\t\t\tattrs = append(attrs, base.NewFloatAttribute(\"\"))\n\t\t} else {\n\t\t\tattrs = append(attrs, new(base.CategoricalAttribute))\n\t\t}\n\t}\n\n\t// Estimate file precision\n\tmaxP, err := base.ParseCSVEstimateFilePrecision(filepath)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tfor _, a := range attrs {\n\t\tif f, ok := a.(*base.FloatAttribute); ok {\n\t\t\tf.Precision = maxP\n\t\t}\n\t}\n\n\treturn attrs\n}",
"func CalculateTotalStats(o Options, e Equipment) Stats {\n\tgearStats := e.Stats()\n\tstats := BaseStats(o.Buffs.Race)\n\tfor i := range stats {\n\t\tstats[i] += gearStats[i]\n\t}\n\n\tstats = o.Talents.AddStats(o.Buffs.AddStats(o.Consumes.AddStats(o.Totems.AddStats(stats))))\n\n\tif o.Buffs.BlessingOfKings {\n\t\tstats[StatInt] *= 1.1 // blessing of kings\n\t}\n\tif o.Buffs.ImprovedDivineSpirit {\n\t\tstats[StatSpellDmg] += stats[StatSpirit] * 0.1\n\t}\n\n\tstats = stats.CalculatedTotal()\n\n\t// Add stat increases from talents\n\tstats[StatMP5] += stats[StatInt] * (0.02 * float64(o.Talents.UnrelentingStorm))\n\n\treturn stats\n}",
"func getLinesFromAttr(atr *hcl.Attribute) (lines []int) {\n\tlines = make([]int, 0)\n\tif atr == nil {\n\t\treturn\n\t}\n\n\tlines = append(lines, model.Range(atr.Range.Start.Line, atr.Range.End.Line)...)\n\treturn\n}",
"func (p *IntegrationProcessor) addAttributes(\n\tmetric *protocol.Metric, attributes map[string]interface{}) {\n\tif metric.Attributes == nil {\n\t\tmetric.Attributes = make(map[string]interface{})\n\t}\n\tfor k, v := range attributes {\n\t\tif _, ok := metric.Attributes[k]; !ok {\n\t\t\tmetric.Attributes[k] = v\n\t\t}\n\t}\n}",
"func AttributeInfoReadList(buf []byte, dest []AttributeInfo) int {\n\tb := 0\n\tfor i := 0; i < len(dest); i++ {\n\t\tdest[i] = AttributeInfo{}\n\t\tb += AttributeInfoRead(buf[b:], &dest[i])\n\t}\n\treturn xgb.Pad(b)\n}",
"func parseMagicalList(br *bitReader) ([]MagicAttribute, error) {\n\tvar magicAttributes []MagicAttribute\n\tfor {\n\t\tid, err := br.ReadBits(9)\n\t\tif err != nil {\n\t\t\treturn magicAttributes, err\n\t\t}\n\n\t\t// If all 9 bits are set, we've hit the end of the stats section\n\t\t// at 0x1ff and exit the loop.\n\t\tif id == 0x1ff {\n\t\t\tbreak\n\t\t}\n\n\t\tprop, ok := magicalProperties[id]\n\t\tif !ok {\n\t\t\treturn magicAttributes, fmt.Errorf(\"unknown magical property: %d\", id)\n\t\t}\n\n\t\tvar values []int64\n\t\tfor _, bitLength := range prop.Bits {\n\t\t\tval, err := br.ReadBits(bitLength)\n\t\t\tif err != nil {\n\t\t\t\treturn magicAttributes, err\n\t\t\t}\n\n\t\t\tif prop.Bias != 0 {\n\t\t\t\tval -= prop.Bias\n\t\t\t}\n\n\t\t\tvalues = append(values, int64(val))\n\t\t}\n\n\t\tattr := MagicAttribute{\n\t\t\tID: id,\n\t\t\tName: prop.Name,\n\t\t\tValues: values,\n\t\t}\n\n\t\tmagicAttributes = append(magicAttributes, attr)\n\t}\n\n\treturn magicAttributes, nil\n}",
"func ReadAttributes(r io.Reader, f *File) error {\n\tif f.AttrOffset == 0 {\n\t\treturn nil\n\t}\n\n\tb := make([]byte, f.SubHeaderOffset-f.AttrOffset)\n\tn, err := r.Read(b)\n\tif err != nil {\n\t\tDebug(\"ReadAttributes failed:%v\", err)\n\t\treturn err\n\t}\n\tDebug(\"ReadAttributes gets %#02x\", b)\n\tif n != len(b) {\n\t\terr = fmt.Errorf(\"ReadAttributes: got %d, want %d for name\", n, len(b))\n\t\tDebug(\"ReadAttributes short: %v\", err)\n\t\treturn err\n\t}\n\tf.Attr = b\n\treturn nil\n}",
"func StatParse(line string) (plugin.EntryAttributes, string, error) {\n\tvar attr plugin.EntryAttributes\n\tsegments := strings.SplitN(line, \" \", 6)\n\tif len(segments) != 6 {\n\t\treturn attr, \"\", fmt.Errorf(\"Stat did not return 6 components: %v\", line)\n\t}\n\n\tsize, err := strconv.ParseUint(segments[0], 10, 64)\n\tif err != nil {\n\t\treturn attr, \"\", err\n\t}\n\tattr.SetSize(size)\n\n\tatime, err := parseTime(segments[1])\n\tif err != nil {\n\t\treturn attr, \"\", err\n\t}\n\tattr.SetAtime(atime)\n\n\tmtime, err := parseTime(segments[2])\n\tif err != nil {\n\t\treturn attr, \"\", err\n\t}\n\tattr.SetMtime(mtime)\n\n\tctime, err := parseTime(segments[3])\n\tif err != nil {\n\t\treturn attr, \"\", err\n\t}\n\tattr.SetCtime(ctime)\n\n\tmode, err := munge.ToFileMode(\"0x\" + segments[4])\n\tif err != nil {\n\t\treturn attr, \"\", err\n\t}\n\tattr.SetMode(mode)\n\n\treturn attr, segments[5], nil\n}",
"func (p Poem) Stats() (numVowels, numConsonants, NumPuncts int) {\n\tfor _, stanza := range p {\n\t\tfor _, line := range stanza {\n\t\t\tfor _, r := range line {\n\t\t\t\tswitch r {\n\t\t\t\tcase 'a', 'e', 'i', 'o', 'u':\n\t\t\t\t\tnumVowels++ // named return values already initialized\n\t\t\t\tcase '.', ',', '?', '/', ':', ';', ' ':\n\t\t\t\t\tNumPuncts++\n\t\t\t\tdefault:\n\t\t\t\t\tnumConsonants++ // named return values already initialized\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn\n}",
"func readAttribute(reader *ClassReader,cp ConstantPool) AttributeInfo{\n\tattrNameIndex := reader.readUint16()\n\tattrName := cp.getUtf8(attrNameIndex)\n\tattrLen := reader.readUint32()\n\tattrInfo := newAttributeInfo(attrName,attrLen,cp)\n\tattrInfo.readInfo(reader)\n\treturn attrInfo\n}",
"func CalculateAggression(lines []string) map[string]float64 {\n\tusernames := GetUsernames(lines)\n\n\taggression := make(map[string]float64)\n\n\tfor _, username := range usernames {\n\t\taggression[username] = AggressionCount(GetUserLines(lines, username))\n\t}\n\n\ttotal := 0.0\n\tfor _, val := range aggression {\n\t\ttotal += val\n\t}\n\taggression[\"total\"] = total\n\treturn aggression\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
Parses the skill set, this contains of a 2 byte header and a 30 byte list of 30 indexes with the allocated points for that skill. The class determines what offset we start reading from in the skill list.
|
func parseSkills(bfr io.Reader, char *Character) error {
// Make a buffer that can hold 32 bytes, which can hold the entire skillset.
buf := make([]byte, 32)
_, err := io.ReadFull(bfr, buf)
if err != nil {
return err
}
skillHeaderData := skillData{}
if err := binary.Read(bytes.NewBuffer(buf), binary.LittleEndian, &skillHeaderData); err != nil {
return err
}
if string(skillHeaderData.Header[:]) != "if" {
return fmt.Errorf("failed to find skill header")
}
skillOffset, ok := skillOffsetMap[uint(char.Header.Class)]
if !ok {
return fmt.Errorf("unknown skill offset for class %d", char.Header.Class)
}
for i, allocatedPoints := range skillHeaderData.List {
id := (i + skillOffset)
skillName, ok := skillMap[id]
if !ok {
return fmt.Errorf("unknown skill id %d", id)
}
s := Skill{
ID: id,
Points: int(allocatedPoints),
Name: skillName,
}
char.Skills = append(char.Skills, s)
}
return nil
}
|
[
"func (pyhsmm *PYHSMM) InitializeFromAnnotatedData(dataContainer *DataContainer) {\n\tsents := dataContainer.Sents\n\tsamplingWordSeqs := dataContainer.SamplingWordSeqs\n\tsamplingPosSeqs := dataContainer.SamplingPosSeqs\n\tfor i := 0; i < len(samplingWordSeqs); i++ {\n\t\tadjustedSamplingWordSeq := make(context, 0, len(sents[i]))\n\t\tadjustedSamplingPosSeq := make([]int, 0, len(sents[i]))\n\t\tfor j := 0; j < len(samplingWordSeqs[i]); j++ {\n\t\t\tword := samplingWordSeqs[i][j]\n\t\t\tsliceWord := strings.Split(word, pyhsmm.npylms[0].splitter)\n\t\t\twordLen := len(sliceWord)\n\t\t\tif wordLen < pyhsmm.maxWordLength {\n\t\t\t\tadjustedSamplingWordSeq = append(adjustedSamplingWordSeq, word)\n\t\t\t\tadjustedSamplingPosSeq = append(adjustedSamplingPosSeq, samplingPosSeqs[i][j])\n\t\t\t} else {\n\t\t\t\tstart := 0\n\t\t\t\tfor {\n\t\t\t\t\tend := start + pyhsmm.maxWordLength\n\t\t\t\t\tif end > wordLen {\n\t\t\t\t\t\tend = wordLen\n\t\t\t\t\t}\n\t\t\t\t\tadjustedSamplingWordSeq = append(adjustedSamplingWordSeq, strings.Join(sliceWord[start:end], pyhsmm.npylms[0].splitter))\n\t\t\t\t\tadjustedSamplingPosSeq = append(adjustedSamplingPosSeq, samplingPosSeqs[i][j])\n\t\t\t\t\tstart = end\n\t\t\t\t\tif start == wordLen {\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tsamplingWordSeqs[i] = adjustedSamplingWordSeq\n\t\tsamplingPosSeqs[i] = adjustedSamplingPosSeq\n\t\tpyhsmm.addWordSeqAsCustomer(samplingWordSeqs[i], samplingPosSeqs[i])\n\t}\n\treturn\n}",
"func DecodeCharSkill(b []byte) (*CharSkill, error) {\n\tif len(b) < CharSkillSize {\n\t\treturn nil, wlerr.Errorf(\n\t\t\t\"failed to parse skill: data too short: have=%d want>=%d\",\n\t\t\tlen(b), CharSkillSize)\n\t}\n\n\treturn &CharSkill{\n\t\tID: int(b[0]),\n\t\tLevel: int(b[1]),\n\t}, nil\n}",
"func (b *BasePiece) GetPosition() [2]int {\n\treturn b.Position\n}",
"func (self *Decoder) Pos() int {\n return self.i\n}",
"func parseHandshakeResponseHeader(packet *handshakeResponse41, data []byte) (parsedBytes int, err error) {\n\t// Ensure there are enough data to read:\n\t// http://dev.mysql.com/doc/internals/en/connection-phase-packets.html#packet-Protocol::SSLRequest\n\tif len(data) < 4+4+1+23 {\n\t\treturn 0, ErrMalformPacket\n\t}\n\n\toffset := 0\n\t// capability\n\tcapability := binary.LittleEndian.Uint32(data[:4])\n\tpacket.Capability = capability\n\toffset += 4\n\t// skip max packet size\n\toffset += 4\n\t// charset, skip, if you want to use another charset, use set names\n\tpacket.Collation = data[offset]\n\toffset++\n\t// skip reserved 23[00]\n\toffset += 23\n\n\treturn offset, nil\n}",
"func parseAttributes(bfr io.ByteReader, char *Character) error {\n\t// Create a bit reader from the buffered reader to read the stats.\n\tbr := bitReader{r: bfr}\n\n\tfor {\n\t\tid, err := br.ReadBits(9)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\t// If all 9 bits are set, we've hit the end of the attributes section\n\t\t// at 0x1ff and exit the loop.\n\t\tif id == 0x1ff {\n\t\t\tbreak\n\t\t}\n\n\t\t// The attribute value bit length, so we'll know how many bits to read next.\n\t\tlength, ok := attributeBitMap[id]\n\t\tif !ok {\n\t\t\treturn fmt.Errorf(\"unknown attribute id: %d\", id)\n\t\t}\n\n\t\t// The attribute value.\n\t\tattr, err := br.ReadBits(length)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tswitch id {\n\t\tcase strength:\n\t\t\tchar.Attributes.Strength = attr\n\t\tcase energy:\n\t\t\tchar.Attributes.Energy = attr\n\t\tcase dexterity:\n\t\t\tchar.Attributes.Dexterity = attr\n\t\tcase vitality:\n\t\t\tchar.Attributes.Vitality = attr\n\t\tcase unusedStats:\n\t\t\tchar.Attributes.UnusedStats = attr\n\t\tcase unusedSkills:\n\t\t\tchar.Attributes.UnusedSkillPoints = attr\n\t\tcase currentHP:\n\t\t\tchar.Attributes.CurrentHP = attr / 256\n\t\tcase maxHP:\n\t\t\tchar.Attributes.MaxHP = attr / 256\n\t\tcase currentMana:\n\t\t\tchar.Attributes.CurrentMana = attr / 256\n\t\tcase maxMana:\n\t\t\tchar.Attributes.MaxMana = attr / 256\n\t\tcase currentStamina:\n\t\t\tchar.Attributes.CurrentStamina = attr / 256\n\t\tcase maxStamina:\n\t\t\tchar.Attributes.MaxStamina = attr / 256\n\t\tcase level:\n\t\t\tchar.Attributes.Level = attr\n\t\tcase experience:\n\t\t\tchar.Attributes.Experience = attr\n\t\tcase gold:\n\t\t\tchar.Attributes.Gold = attr\n\t\tcase stashedGold:\n\t\t\tchar.Attributes.StashedGold = attr\n\t\t}\n\t}\n\n\treturn nil\n}",
"func parseLigatureSet(data []byte) ([]LigatureGlyph, error) {\n\tif len(data) < 2 {\n\t\treturn nil, errors.New(\"invalid ligature set table\")\n\t}\n\tcount := binary.BigEndian.Uint16(data)\n\tout := make([]LigatureGlyph, count)\n\tvar err error\n\tfor i := range out {\n\t\tligOffset := binary.BigEndian.Uint16(data[2+2*i:])\n\t\tif int(ligOffset)+4 > len(data) {\n\t\t\treturn nil, errors.New(\"invalid ligature set table\")\n\t\t}\n\t\tout[i].Glyph = GID(binary.BigEndian.Uint16(data[ligOffset:]))\n\t\tligCount := binary.BigEndian.Uint16(data[ligOffset+2:])\n\t\tif ligCount == 0 {\n\t\t\treturn nil, errors.New(\"invalid ligature set table\")\n\t\t}\n\t\tout[i].Components, err = parseUint16s(data[ligOffset+4:], int(ligCount)-1)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"invalid ligature set table: %s\", err)\n\t\t}\n\t}\n\treturn out, nil\n}",
"func (h *Header) setOffsets(start int64) (first, last int64) {\n\toffs := h.size()\n\tif offs < start {\n\t\toffs = start\n\t}\n\n\toffs = pad4(offs)\n\tfirst = offs\n\n\tfor i := range h.vars {\n\t\tif !h.vars[i].isRecordVariable() {\n\t\t\th.vars[i].begin = offs\n\t\t\tlast = offs\n\t\t\toffs += pad4(h.vars[i].vSize())\n\t\t}\n\t}\n\n\tfor i := range h.vars {\n\t\tif h.vars[i].isRecordVariable() {\n\t\t\th.vars[i].begin = offs\n\t\t\tlast = offs\n\t\t\toffs += pad4(h.vars[i].vSize())\n\t\t}\n\t}\n\n\treturn\n}",
"func (api *API) GetPosition(instrument string) (*models.AccountPosition, error) {\n\tclient := &http.Client{}\n\taccount := api.context.Account\n\tapiURL := api.context.ApiURL\n\ttoken := api.context.Token\n\treq, errr := http.NewRequest(\"GET\", apiURL+\"/v3/accounts/\"+account+\"/positions/\"+instrument, nil)\n\tif errr != nil {\n\t\treturn nil, errr\n\t}\n\treq.Header.Add(\"Content-Type\", \"application/json\")\n\treq.Header.Add(\"Authorization\", \"Bearer \"+token)\n\tresponse, err := client.Do(req)\n\tif err != nil {\n\t\tfmt.Printf(\"The HTTP request failed with error %s\\n\", err)\n\t\treturn nil, err\n\t}\n\tdata, errb := ioutil.ReadAll(response.Body)\n\tif errb != nil {\n\t\treturn nil, errb\n\t}\n\t//fmt.Println(string(data))\n\tpositions, errp := parseAccountPosition(&data)\n\t//fmt.Println(positions)\n\n\treturn &positions, errp\n}",
"func (api *API) GetPositionBook(instrument string) (*models.PositionBook, error) {\n\n\t// TODO DEDUPLICATE THIS\n\tclient := &http.Client{}\n\tapiURL := api.context.ApiURL\n\ttoken := api.context.Token\n\treq, errr := http.NewRequest(\"GET\", apiURL+\"/v3/instruments/\"+instrument+\"/positionBook\", nil)\n\tif errr != nil {\n\t\treturn nil, errr\n\t}\n\treq.Header.Add(\"Content-Type\", \"application/json\")\n\treq.Header.Add(\"Authorization\", \"Bearer \"+token)\n\tresponse, err := client.Do(req)\n\tif err != nil {\n\t\tfmt.Printf(\"The HTTP request failed with error %s\\n\", err)\n\t\treturn nil, err\n\t}\n\tdata, errb := ioutil.ReadAll(response.Body)\n\tif errb != nil {\n\t\treturn nil, errb\n\t}\n\t//fmt.Println(string(data))\n\tpositionBook, errp := parsePositionBook(&data)\n\t//fmt.Println(positions)\n\n\treturn &positionBook, errp\n}",
"func parseLoca(tag Tag, b fontBinSegm, offset, size uint32) (Table, error) {\n\treturn newLocaTable(tag, b, offset, size), nil\n}",
"func (t *BaseToken) GetPosition() int {\n\treturn t.position\n}",
"func ParsePoints(buf []byte) ([]Point, error) {\n\treturn ParsePointsWithPrecision(buf, time.Now().UTC(), \"n\")\n}",
"func (raw rawAllocations) parseL3() (l3Schema, error) {\n\trawValues, err := raw.rawParse(\"100%\", false)\n\tif err != nil || rawValues == nil {\n\t\treturn nil, err\n\t}\n\n\tallocations := make(l3Schema, len(rawValues))\n\tfor id, rawVal := range rawValues {\n\t\tallocations[id], err = parseL3Allocation(rawVal)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\treturn allocations, nil\n}",
"func UA_ReadResponse_new() []UA_ReadResponse {\n\treturn UA_new((*[100000000]UA_DataType)(unsafe.Pointer(&UA_TYPES[161]))[:]).([]UA_ReadResponse)\n}",
"func (l *Lexer) Offset() int { return l.off }",
"func PointfixReadList(buf []byte, dest []Pointfix) int {\n\tb := 0\n\tfor i := 0; i < len(dest); i++ {\n\t\tdest[i] = Pointfix{}\n\t\tb += PointfixRead(buf[b:], &dest[i])\n\t}\n\treturn xgb.Pad(b)\n}",
"func ReadLine(filename string) (Game, int) {\n\tstart := time.Now()\n\tlog.Println(\"loading from \", filename)\n\tinFile, err := os.Open(filename)\n\tdefer inFile.Close()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t\t//TODO:return nil\n\t}\n\tscanner := bufio.NewScanner(inFile)\n\tscanner.Split(bufio.ScanLines)\n\n\tlinecounter := 0\n\tbatBowlCount := 0\n\tidx := 0\n\tvar inn1 Innings\n\tvar inn2 Innings\n\tinn1.Bat = make(map[int]Batting)\n\tinn2.Bat = make(map[int]Batting)\n\tinn1.Bowl = make(map[int]Bowling)\n\tinn2.Bowl = make(map[int]Bowling)\n\tgame := Game{}\n\n\tversion := \"0\"\n\tec := 0\n\tfor scanner.Scan() {\n\t\tline := scanner.Text()\n\n\t\tlinecounter++\n\t\t/*\n\t\t\tif linecounter == 1 {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t*/\n\n\t\tline = strings.TrimSpace(line)\n\t\tif strings.HasPrefix(line, \"#inn\") == true {\n\t\t\tbatBowlCount++\n\t\t\tidx = 0\n\t\t\tif batBowlCount == 1 {\n\t\t\t\tinn1.TeamName = getTeamName(line)\n\t\t\t}\n\t\t\tif batBowlCount == 3 {\n\t\t\t\tinn2.TeamName = getTeamName(line)\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\t\tif len(line) == 0 {\n\t\t\tcontinue\n\t\t}\n\t\tif strings.HasPrefix(line, \"#blg\") == true {\n\t\t\tidx = 0\n\t\t\tbatBowlCount++\n\t\t\tcontinue\n\t\t}\n\t\tif strings.HasPrefix(line, \"#version\") == true {\n\t\t\ttokens := strings.Split(line, \",\")\n\t\t\tversion = tokens[1]\n\t\t}\n\t\tif strings.HasPrefix(line, \"#wonby\") == true {\n\t\t\ttokens := strings.Split(line, \",\")\n\t\t\tgame.WonBy = tokens[1]\n\t\t\tif len(tokens) == 4 {\n\t\t\t\tgame.Team1Name = tokens[2]\n\t\t\t\tgame.Team2Name = tokens[3]\n\t\t\t} else {\n\t\t\t\tgame.Team1Name = \"team1\"\n\t\t\t\tgame.Team2Name = \"team2\"\n\t\t\t}\n\t\t\tfmt.Printf(\"%s Vs %s wonby %s\\n\", game.Team1Name, game.Team2Name, game.WonBy)\n\t\t\tcontinue\n\t\t}\n\n\t\tif strings.HasPrefix(line, \"#score\") == true {\n\t\t\tscore, overs := getScore(line)\n\t\t\tif batBowlCount > 2 {\n\t\t\t\tinn2.Total = score\n\t\t\t\tinn2.OversPlayed = overs\n\t\t\t} else {\n\t\t\t\tinn1.Total = score\n\t\t\t\tinn1.OversPlayed = overs\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\t\tif strings.HasPrefix(line, \"#catchdropped\") == true {\n\t\t\tplname := getDroppedPlayerName(line)\n\t\t\tif len(plname) == 0 {\n\t\t\t\tfmt.Printf(\" *** ignoring dropped line # %d [%s]\\n\", linecounter, line)\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tif batBowlCount > 2 {\n\t\t\t\tinn2.DroppedCatches = append(inn2.DroppedCatches, plname)\n\t\t\t} else {\n\t\t\t\tinn1.DroppedCatches = append(inn1.DroppedCatches, plname)\n\t\t\t}\n\t\t\tcontinue\n\t\t}\n\n\t\tif batBowlCount == 1 || batBowlCount == 3 {\n\t\t\tbat, e := procBatting(line, version, linecounter)\n\t\t\tec += e\n\t\t\tif e > 0 {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\t// if len(bat.Name) == 0 {\n\t\t\t// \tfmt.Printf(\" *** ignoring batting line # %d [%s]\\n\", linecounter, line)\n\t\t\t// \tcontinue\n\t\t\t// }\n\t\t\tidx++\n\t\t\tif batBowlCount == 1 {\n\t\t\t\tinn1.Bat[idx] = bat\n\t\t\t}\n\t\t\tif batBowlCount == 3 {\n\t\t\t\tinn2.Bat[idx] = bat\n\t\t\t}\n\t\t}\n\t\tif batBowlCount == 2 || batBowlCount == 4 {\n\t\t\tball := procBowling(line)\n\t\t\tif len(ball.Name) == 0 {\n\t\t\t\tfmt.Printf(\" *** ignoring bowling line # %d [%s]\\n\", linecounter, line)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tidx++\n\t\t\tif batBowlCount == 2 {\n\t\t\t\tinn1.Bowl[idx] = ball\n\t\t\t}\n\t\t\tif batBowlCount == 4 {\n\t\t\t\tinn2.Bowl[idx] = ball\n\t\t\t}\n\t\t}\n\t}\n\tgame.Team1 = inn1\n\tgame.Team2 = inn2\n\ttokens := strings.Split(filename, \".\")\n\tgame.GameDate = tokens[0]\n\tlog.Printf(\"readline %s \", time.Since(start))\n\treturn game, ec\n}",
"func (s *RestServer) getSgempu3intinfoMetricsPoints() ([]*tsdb.Point, error) {\n\n\treturn nil, nil\n\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
Parses all items on the character, this includes items in stash, cube, inventory and equipped items.
|
func parseItems(bfr io.ByteReader, char *Character) error {
// Make a buffer that can hold 4 bytes, which can hold the items header.
buf := make([]byte, 4)
_, err := io.ReadFull(bfr.(io.Reader), buf)
if err != nil {
return err
}
itemHeaderData := itemData{}
if err := binary.Read(bytes.NewBuffer(buf), binary.LittleEndian, &itemHeaderData); err != nil {
return err
}
if string(itemHeaderData.Header[:]) != "JM" {
return errors.New("failed to find the items header")
}
char.Items, err = ParseItemList(bfr, int(itemHeaderData.Count))
if err != nil {
return err
}
return nil
}
|
[
"func ParseItems(s string) ([]*Item, error) {\n\tlines, err := parseTSV(s, 3)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tvar items []*Item\n\tfor _, parts := range lines {\n\t\titems = append(items, &Item{\n\t\t\tEnglish: parts[0],\n\t\t\tPinyin: parts[1],\n\t\t\tCharacters: parts[2],\n\t\t})\n\t}\n\treturn items, nil\n}",
"func Item(src *bytes.Buffer, x *ItemStack) error {\n\tx.NBTData = make(map[string]interface{})\n\tif err := Varint32(src, &x.NetworkID); err != nil {\n\t\treturn wrap(err)\n\t}\n\tif x.NetworkID == 0 {\n\t\t// The item was air, so there is no more data we should read for the item instance. After all, air\n\t\t// items aren't really anything.\n\t\tx.MetadataValue = 0\n\t\tx.Count = 0\n\t\tx.CanBePlacedOn, x.CanBreak = nil, nil\n\t\treturn nil\n\t}\n\tvar auxValue int32\n\tif err := Varint32(src, &auxValue); err != nil {\n\t\treturn wrap(err)\n\t}\n\tx.MetadataValue = int16(auxValue >> 8)\n\tx.Count = int16(auxValue & 0xff)\n\n\tvar userDataMarker int16\n\tif err := binary.Read(src, binary.LittleEndian, &userDataMarker); err != nil {\n\t\treturn wrap(err)\n\t}\n\tif userDataMarker == -1 {\n\t\tvar userDataVersion uint8\n\t\tif err := binary.Read(src, binary.LittleEndian, &userDataVersion); err != nil {\n\t\t\treturn wrap(err)\n\t\t}\n\t\tswitch userDataVersion {\n\t\tcase 1:\n\t\t\tif err := nbt.NewDecoder(src).Decode(&x.NBTData); err != nil {\n\t\t\t\treturn fmt.Errorf(\"%v: error decoding user data NBT: %v\", callFrame(), err)\n\t\t\t}\n\t\tdefault:\n\t\t\treturn fmt.Errorf(\"%v: unexpected item user data version %v\", callFrame(), userDataVersion)\n\t\t}\n\t} else if userDataMarker != 0 {\n\t\tif userDataMarker < 0 {\n\t\t\treturn fmt.Errorf(\"%v: invalid NBT length %v\", callFrame(), userDataMarker)\n\t\t}\n\t\tnbtData := src.Next(int(userDataMarker))\n\t\tif err := nbt.UnmarshalEncoding(nbtData, &x.NBTData, nbt.LittleEndian); err != nil {\n\t\t\treturn fmt.Errorf(\"%v: error decoding item NBT: %v\", callFrame(), err)\n\t\t}\n\t}\n\tvar count int32\n\tif err := Varint32(src, &count); err != nil {\n\t\treturn wrap(err)\n\t}\n\tif count < 0 {\n\t\treturn NegativeCountError{Type: \"item can be placed on\"}\n\t}\n\tif count > higherLimit {\n\t\treturn LimitHitError{Limit: higherLimit, Type: \"item can be placed on\"}\n\t}\n\tx.CanBePlacedOn = make([]string, count)\n\tfor i := int32(0); i < count; i++ {\n\t\tif err := String(src, &x.CanBePlacedOn[i]); err != nil {\n\t\t\treturn wrap(err)\n\t\t}\n\t}\n\tif err := Varint32(src, &count); err != nil {\n\t\treturn wrap(err)\n\t}\n\tif count < 0 {\n\t\treturn NegativeCountError{Type: \"item can break\"}\n\t}\n\tif count > higherLimit {\n\t\treturn LimitHitError{Limit: higherLimit, Type: \"item can break\"}\n\t}\n\tx.CanBreak = make([]string, count)\n\tfor i := int32(0); i < count; i++ {\n\t\tif err := String(src, &x.CanBreak[i]); err != nil {\n\t\t\treturn wrap(err)\n\t\t}\n\t}\n\tconst shieldID = 513\n\tif x.NetworkID == shieldID {\n\t\tvar blockingTick int64\n\t\tif err := Varint64(src, &blockingTick); err != nil {\n\t\t\treturn wrap(err)\n\t\t}\n\t}\n\treturn nil\n}",
"func Parse(s string) (*Item, error) {\n\tm := matchMap(itemRe, itemRe.FindStringSubmatch(s))\n\tif m == nil {\n\t\treturn nil, fmt.Errorf(\"mismatch vs item regexp: %s\", s)\n\t}\n\n\ti := &Item{Class: &Class{}}\n\tif t, ok := m[\"type\"]; ok {\n\t\ti.Class.Name = t\n\t}\n\n\tif c, ok := m[\"called\"]; ok {\n\t\ti.Class.Called = c\n\t}\n\n\tif n, ok := m[\"named\"]; ok {\n\t\ti.Named = n\n\t}\n\n\tif bucStr, ok := m[\"buc\"]; ok {\n\t\ti.BUC = parseBUC(bucStr)\n\t}\n\n\tif enhStr, ok := m[\"enh\"]; ok {\n\t\ti.Enhancement.Known = true\n\t\tif _, err := fmt.Sscanf(enhStr, \"%d\", &i.Enhancement.Value); err != nil {\n\t\t\treturn nil, fmt.Errorf(\"error parsing enhancement \\\"%s\\\": %v\", enhStr, err)\n\t\t}\n\t}\n\n\tif charge, ok := m[\"charge\"]; ok {\n\t\tmaxCharge, ok := m[\"maxcharge\"]\n\t\tif !ok {\n\t\t\treturn nil, fmt.Errorf(\"maxcharge not set but charge is: %s\", s)\n\t\t}\n\t\tvar err error\n\t\ti.Charge.Cur, err = strconv.Atoi(charge)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\ti.Charge.Max, err = strconv.Atoi(maxCharge)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\tif _, ok := m[\"fixedness\"]; ok {\n\t\t// The only way this turns up is if the item is indeed fixed.\n\t\ti.Fixed = true\n\t}\n\n\tif erosion, ok := m[\"erosions\"]; ok {\n\t\ti.Erosion = parseErosion(erosion)\n\t}\n\n\tif invLetter, ok := m[\"slot\"]; ok {\n\t\ti.InventoryLetter = []rune(invLetter)[0]\n\t}\n\n\treturn i, nil\n}",
"func LoadItems(character string, path string, filename string) (charData CharData, FileData []byte) {\n\t// selected character\n\tcharacterPath := path + filename\n\t// log.Println(\"characterPath:\", characterPath)\n\n\t// read all data from selected character\n\tfullData := utils.ReadFileFromPath(characterPath)\n\n\t// log.Println(\"filesize:\", len(fullData))\n\n\t// parse file\n\tcharData = ParseFile(character, fullData)\n\n\treturn charData, fullData\n}",
"func parseMercItems(bfr io.ByteReader, char *Character) error {\n\tbr := bitReader{r: bfr}\n\n\t// offset: 0 \"j\"\n\tj, err := br.ReadByte()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// offset: 8, \"f\"\n\tf, err := br.ReadByte()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif string(j) != \"j\" || string(f) != \"f\" {\n\t\treturn errors.New(\"failed to find merc header jf\")\n\t}\n\n\t// If you have a merc, we'll read the item list of the merc here.\n\tif char.Header.MercID != 0 {\n\t\t// Make a buffer that can hold 4 bytes, which can hold the items header.\n\t\tbuf := make([]byte, 4)\n\n\t\t_, err := io.ReadFull(bfr.(io.Reader), buf[:4])\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\titemHeaderData := itemData{}\n\t\terr = binary.Read(bytes.NewBuffer(buf), binary.LittleEndian, &itemHeaderData)\n\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tif string(itemHeaderData.Header[:]) != \"JM\" {\n\t\t\treturn errors.New(\"failed to find the merc items header\")\n\t\t}\n\n\t\titems, err := ParseItemList(bfr, int(itemHeaderData.Count))\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tchar.MercItems = items\n\t}\n\n\treturn nil\n}",
"func (c *AuctionController) parse(rawAuctions *RawAuctions, characterName, serverType string) {\n\tvar auctions []Auction\n\tvar outerWait sync.WaitGroup\n\n\tc.ItemTrie = trie.NewTrie()\n\tc.ItemTrie.Add(\"selling\")\n\tc.ItemTrie.Add(\"buying\")\n\tc.ItemTrie.Add(\"wtb\")\n\tc.ItemTrie.Add(\"wts\")\n\tc.ItemTrie.Add(\"ea\")\n\tc.ItemTrie.Add(\"each\")\n\tc.ItemTrie.Add(\"per\")\n\n\t// Load all items into Trie structure\n\titemQuery := \"SELECT displayName, id FROM items ORDER BY displayName ASC\"\n\trows := DB.Query(itemQuery)\n\tif rows != nil {\n\t\tfor rows.Next() {\n\t\t\tvar itemName string\n\t\t\tvar itemId int64\n\n\t\t\trows.Scan(&itemName, &itemId)\n\t\t\tif itemId > 0 && itemName != \"\" {\n\t\t\t\tc.ItemTrie.Add(strings.ToLower(itemName))\n\t\t\t}\n\t\t}\n\t}\n\n\tfor _, line := range rawAuctions.Lines {\n\t\touterWait.Add(1)\n\t\tgo c.parseLine(line, characterName, serverType, &outerWait, &auctions)\n\t}\n\n\touterWait.Wait()\n\tfmt.Println(\"Processed all lines\")\n\n\tif len(auctions) > 0 {\n\t\tc.saveAuctionData(auctions)\n\t}\n}",
"func (e *Equipment) Unequip(alias string) (ok bool, item *Item) {\n\tok = false\n\n\tif e.Head != (*Item)(nil) {\n\t\tif strings.Contains(strings.ToLower(e.Head.Name), strings.ToLower(alias)) {\n\t\t\titem = e.Head\n\t\t\te.Head = (*Item)(nil)\n\t\t\tok = true\n\t\t}\n\t}\n\tif e.Chest != (*Item)(nil) {\n\t\tif strings.Contains(strings.ToLower(e.Chest.Name), strings.ToLower(alias)) {\n\t\t\titem = e.Chest\n\t\t\te.Chest = (*Item)(nil)\n\t\t\tok = true\n\t\t}\n\t}\n\tif e.Neck != (*Item)(nil) {\n\t\tif strings.Contains(strings.ToLower(e.Neck.Name), strings.ToLower(alias)) {\n\t\t\titem = e.Neck\n\t\t\te.Neck = (*Item)(nil)\n\t\t\tok = true\n\t\t}\n\t}\n\tif e.Legs != (*Item)(nil) {\n\t\tif strings.Contains(strings.ToLower(e.Legs.Name), strings.ToLower(alias)) {\n\t\t\titem = e.Legs\n\t\t\te.Legs = (*Item)(nil)\n\t\t\tok = true\n\t\t}\n\t}\n\tif e.Feet != (*Item)(nil) {\n\t\tif strings.Contains(strings.ToLower(e.Feet.Name), strings.ToLower(alias)) {\n\t\t\titem = e.Feet\n\t\t\te.Feet = (*Item)(nil)\n\t\t\tok = true\n\t\t}\n\t}\n\tif e.Arms != (*Item)(nil) {\n\t\tif strings.Contains(strings.ToLower(e.Arms.Name), strings.ToLower(alias)) {\n\t\t\titem = e.Arms\n\t\t\te.Arms = (*Item)(nil)\n\t\t\tok = true\n\t\t}\n\t}\n\tif e.Hands != (*Item)(nil) {\n\t\tif strings.Contains(strings.ToLower(e.Hands.Name), strings.ToLower(alias)) {\n\t\t\titem = e.Hands\n\t\t\te.Hands = (*Item)(nil)\n\t\t\tok = true\n\t\t}\n\t}\n\tif e.Ring1 != (*Item)(nil) {\n\t\tif strings.Contains(strings.ToLower(e.Ring1.Name), strings.ToLower(alias)) {\n\t\t\titem = e.Ring1\n\t\t\te.Ring1 = (*Item)(nil)\n\t\t\tok = true\n\t\t}\n\t}\n\tif e.Ring2 != (*Item)(nil) {\n\t\tif strings.Contains(strings.ToLower(e.Ring2.Name), strings.ToLower(alias)) {\n\t\t\titem = e.Ring2\n\t\t\te.Ring2 = (*Item)(nil)\n\t\t\tok = true\n\t\t}\n\t}\n\tif e.Main != (*Item)(nil) {\n\t\tif strings.Contains(strings.ToLower(e.Main.Name), strings.ToLower(alias)) {\n\t\t\titem = e.Main\n\t\t\te.Main = (*Item)(nil)\n\t\t\tok = true\n\t\t}\n\t}\n\tif e.Off != (*Item)(nil) {\n\t\tif strings.Contains(strings.ToLower(e.Off.Name), strings.ToLower(alias)) {\n\t\t\titem = e.Off\n\t\t\te.Off = (*Item)(nil)\n\t\t\tok = true\n\t\t}\n\t}\n\n\t// Update armor values\n\tif ok && item != (*Item)(nil) {\n\t\te.Armor -= item.Armor\n\t\te.Weight -= item.Weight\n\t}\n\treturn ok, item\n}",
"func (self *ItemsElem) processItems() {\n\tself.Items = make([]*item, 0)\n\n\t// elemValue must be a map\n\telemValueMap, ok := self.ElemValue.(map[interface{}]interface{})\n\tif !ok {\n\t\t//in case, no items nor attribute defines for radio element, ElemValue is a string\n //this is a rare case but still valid, check it here\n //e,g: - form:\n // - radio\n\t\treturn\n\t}\n\n\titems, ok := elemValueMap[\"items\"]\n\t// if no \"items\" defined\n\tif !ok {\n\t\treturn\n\t}\n\n\t// items must be a slice\n\titemSlice, ok := items.([]interface{})\n\tif !ok {\n\t\treturn\n\t}\n\n\t// create child item instance\n\tfor _, item := range itemSlice {\n\t\tnewItem := NewItem(self, item)\n\n\t\t// ignore those failed to initialize\n\t\tif newItem == nil {\n\t\t\tcontinue\n\t\t}\n\n\t\tself.Items = append(self.Items, newItem)\n\t}\n}",
"func (c *Character) item(e rune, a action) (items.Item, error) {\n\tswitch a {\n\tcase ReadAction:\n\t\treturn c.inv.Read(e, c.Stats)\n\tcase DropAction:\n\t\treturn c.inv.Drop(e, c.Stats)\n\tcase WearAction:\n\t\treturn c.inv.Wear(e, c.Stats)\n\tcase WieldAction:\n\t\treturn c.inv.Wield(e, c.Stats)\n\tcase TakeOffAction:\n\t\treturn c.inv.TakeOff(e, c.Stats)\n\tcase QuaffAction:\n\t\treturn c.inv.Quaff(e, c.Stats)\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"Invalid action %v\", a)\n\t}\n}",
"func (c *Client) CharacterItems(character, account string) ([]*Item, error) {\n\tresp, err := c.HTTP.PostForm(profileCharacterItems, url.Values{\n\t\t\"accountName\": {\n\t\t\taccount,\n\t\t},\n\t\t\"character\": {\n\t\t\tcharacter,\n\t\t},\n\t})\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tdefer resp.Body.Close()\n\n\tresponseBody, err := ioutil.ReadAll(resp.Body)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\titemList := &CharacterItems{}\n\tif err := json.Unmarshal(responseBody, &itemList); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn itemList.Items, nil\n}",
"func getItems() []Item {\n raw, err := ioutil.ReadFile(\"./movie_data_2.json\")\n\n if err != nil {\n fmt.Println(err.Error())\n os.Exit(1)\n }\n\n var items []Item\t\t\t\t\t\t// decode destination. Slice of struct maps to an array of json objects.\n json.Unmarshal(raw, &items)\n return items\n}",
"func parseCorpse(bfr io.ByteReader, char *Character) error {\n\t// Make a buffer that can hold 16 bytes, which can hold the corpse data.\n\tbuf := make([]byte, 16)\n\n\t// Read the first 4 bytes that contain the header string and if the char\n\t// is dead or not.\n\t_, err := io.ReadFull(bfr.(io.Reader), buf[:4])\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tcorpseHeaderData := corpseData{}\n\terr = binary.Read(bytes.NewBuffer(buf), binary.LittleEndian, &corpseHeaderData)\n\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif string(corpseHeaderData.Header[:]) != \"JM\" {\n\t\treturn errors.New(\"failed to find the corpse items header\")\n\t}\n\n\t// The character is currently dead and will have the corpse item list here.\n\tif corpseHeaderData.Count == 1 {\n\t\t// Character is dead, so we'll save the state.\n\t\tchar.IsDead = 1\n\n\t\t// 12 Unknown bytes.\n\t\t_, err := io.ReadFull(bfr.(io.Reader), buf[:12])\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\t_, err = io.ReadFull(bfr.(io.Reader), buf[:4])\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\titemHeaderData := itemData{}\n\t\terr = binary.Read(bytes.NewBuffer(buf), binary.LittleEndian, &itemHeaderData)\n\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tif string(itemHeaderData.Header[:]) != \"JM\" {\n\t\t\treturn errors.New(\"failed to find the merc items header\")\n\t\t}\n\n\t\tcorpseItems, err := ParseItemList(bfr, int(itemHeaderData.Count))\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tchar.CorpseItems = corpseItems\n\t}\n\n\treturn nil\n}",
"func (m *ReadModel) GetInventoryItems() []*InventoryItemListDto {\n\treturn bullShitDatabase.List\n}",
"func (c *Character) Inventory() []string {\n\treturn c.inv.List()\n}",
"func makeEquipment() {\n\tallArmor = []armor{\n\t\tarmor{name: \"clothe gloves\", stat: 10},\n\t\tarmor{name: \"cloth helm\", stat: 10},\n\t\tarmor{name: \"cloth curais\", stat: 10},\n\t\tarmor{name: \"boots\", stat: 10},\n\t\tarmor{name: \"shield\", stat: 10},\n\t}\n\tallWeapons = []weaps{\n\t\tweaps{name: \"sword\", stat: 10},\n\t\tweaps{name: \"axe\", stat: 10},\n\t\tweaps{name: \"mace\", stat: 10},\n\t}\n\tbaseStats = []base{\n\t\tbase{name: \"health\", stat: 10},\n\t\tbase{name: \"attack\", stat: 10},\n\t\tbase{name: \"defense\", stat: 10},\n\t}\n}",
"func NewItems(items *low.Items) *Items {\n\ti := new(Items)\n\ti.low = items\n\tif !items.Type.IsEmpty() {\n\t\ti.Type = items.Type.Value\n\t}\n\tif !items.Format.IsEmpty() {\n\t\ti.Format = items.Format.Value\n\t}\n\tif !items.Items.IsEmpty() {\n\t\ti.Items = NewItems(items.Items.Value)\n\t}\n\tif !items.CollectionFormat.IsEmpty() {\n\t\ti.CollectionFormat = items.CollectionFormat.Value\n\t}\n\tif !items.Default.IsEmpty() {\n\t\ti.Default = items.Default.Value\n\t}\n\tif !items.Maximum.IsEmpty() {\n\t\ti.Maximum = items.Maximum.Value\n\t}\n\tif !items.ExclusiveMaximum.IsEmpty() {\n\t\ti.ExclusiveMaximum = items.ExclusiveMaximum.Value\n\t}\n\tif !items.Minimum.IsEmpty() {\n\t\ti.Minimum = items.Minimum.Value\n\t}\n\tif !items.ExclusiveMinimum.IsEmpty() {\n\t\ti.ExclusiveMinimum = items.ExclusiveMinimum.Value\n\t}\n\tif !items.MaxLength.IsEmpty() {\n\t\ti.MaxLength = items.MaxLength.Value\n\t}\n\tif !items.MinLength.IsEmpty() {\n\t\ti.MinLength = items.MinLength.Value\n\t}\n\tif !items.Pattern.IsEmpty() {\n\t\ti.Pattern = items.Pattern.Value\n\t}\n\tif !items.MinItems.IsEmpty() {\n\t\ti.MinItems = items.MinItems.Value\n\t}\n\tif !items.MaxItems.IsEmpty() {\n\t\ti.MaxItems = items.MaxItems.Value\n\t}\n\tif !items.UniqueItems.IsEmpty() {\n\t\ti.UniqueItems = items.UniqueItems.Value\n\t}\n\tif !items.Enum.IsEmpty() {\n\t\tvar enums []any\n\t\tfor e := range items.Enum.Value {\n\t\t\tenums = append(enums, items.Enum.Value[e].Value)\n\t\t}\n\t\ti.Enum = enums\n\t}\n\tif !items.MultipleOf.IsEmpty() {\n\t\ti.MultipleOf = items.MultipleOf.Value\n\t}\n\treturn i\n}",
"func (env Env) GetAllItems(w http.ResponseWriter, r *http.Request) {\n\tJSONResponse(\"SUCCESS\", \"Implement to return food item list\", w)\n}",
"func (svc *ItemService) ReadItems(w http.ResponseWriter, r *http.Request) {\n\tfilter := r.FormValue(\"filter\")\n\titems, err := svc.Repository.ReadItems(filter)\n\tif err != nil {\n\t\tlog.Println(err)\n\t\tw.WriteHeader(http.StatusInternalServerError)\n\t\treturn\n\t}\n\tw.Header().Set(\"content-type\", \"application/json\")\n\tjson.NewEncoder(w).Encode(items)\n}",
"func (u InventoryUploader) GetDirtyOOSInventoryItems(items []model.Item) (dirtyInventoryItems []*model.InventoryItem, err error) {\n\n\t//NOTE: There can be multiple inventory type data.\n\t//Each inventory type data => 1 inventory Item. Each inventory type, can contain multiple items\n\n\t//iterating over multiple inventory data types.\n\tfor _, item := range items {\n\t\tvar data string\n\t\tvar rawItem *model.InventoryItem\n\n\t\tnewHash := \"\"\n\t\toldHash := \"\"\n\t\titemName := item.Name\n\n\t\t//we should only calculate checksum using content & not include capture time - because that field will always change causing\n\t\t//the checksum to change again & again even if content remains same.\n\n\t\tif item.Content == nil || reflect.ValueOf(item.Content).IsNil() {\n\t\t\tdata = \"[]\"\n\t\t} else {\n\t\t\tif data, err = jsonutil.Marshal(item.Content); err != nil {\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\n\t\tif data[len(data)-1] == '\\n' {\n\t\t\tdata = data[0 : len(data)-1]\n\t\t}\n\n\t\tnewHash = calculateCheckSum([]byte(data))\n\t\tlog.GetLogger().Debugf(\"Item being converted - %v with data - %v with checksum - %v\", itemName, string(data), newHash)\n\n\t\t//construct non-optimized inventory item\n\t\tif rawItem, err = convertToOOSInventoryItem(item); err != nil {\n\t\t\terr = fmt.Errorf(\"Formatting inventory data of %v failed due to %v, rawItem : %#v\", itemName, err.Error(), rawItem)\n\t\t\treturn\n\t\t}\n\n\t\t//add contentHash too\n\t\trawItem.ContentHash = &newHash\n\n\t\t//populate optimized item - if content hash matches with earlier collected data.\n\t\toldHash = u.optimizer.GetContentHash(itemName)\n\n\t\tlog.GetLogger().Debugf(\"Get Dirty inventory items, old hash - %v, new hash - %v for the inventory type - %v\", oldHash, newHash, itemName)\n\n\t\tif strings.Compare(newHash, oldHash) != 0 {\n\t\t\tlog.GetLogger().Debugf(\"Dirty inventory type found. Change has been detected for inventory type: %v\", itemName)\n\t\t\tdirtyInventoryItems = append(dirtyInventoryItems, rawItem)\n\t\t} else {\n\t\t\tlog.GetLogger().Debugf(\"Content hash is the same with the old for %v\", itemName)\n\t\t}\n\t}\n\n\treturn\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
Parses corpse data, if it exists, otherwise just reads the item header. If the item count of the header is 1, this means the character is dead and will have a corpse at its feet when loading into the game. The 12 bytes following is the corpse data, which we don't really care about.
|
func parseCorpse(bfr io.ByteReader, char *Character) error {
// Make a buffer that can hold 16 bytes, which can hold the corpse data.
buf := make([]byte, 16)
// Read the first 4 bytes that contain the header string and if the char
// is dead or not.
_, err := io.ReadFull(bfr.(io.Reader), buf[:4])
if err != nil {
return err
}
corpseHeaderData := corpseData{}
err = binary.Read(bytes.NewBuffer(buf), binary.LittleEndian, &corpseHeaderData)
if err != nil {
return err
}
if string(corpseHeaderData.Header[:]) != "JM" {
return errors.New("failed to find the corpse items header")
}
// The character is currently dead and will have the corpse item list here.
if corpseHeaderData.Count == 1 {
// Character is dead, so we'll save the state.
char.IsDead = 1
// 12 Unknown bytes.
_, err := io.ReadFull(bfr.(io.Reader), buf[:12])
if err != nil {
return err
}
_, err = io.ReadFull(bfr.(io.Reader), buf[:4])
if err != nil {
return err
}
itemHeaderData := itemData{}
err = binary.Read(bytes.NewBuffer(buf), binary.LittleEndian, &itemHeaderData)
if err != nil {
return err
}
if string(itemHeaderData.Header[:]) != "JM" {
return errors.New("failed to find the merc items header")
}
corpseItems, err := ParseItemList(bfr, int(itemHeaderData.Count))
if err != nil {
return err
}
char.CorpseItems = corpseItems
}
return nil
}
|
[
"func parseItems(bfr io.ByteReader, char *Character) error {\n\t// Make a buffer that can hold 4 bytes, which can hold the items header.\n\tbuf := make([]byte, 4)\n\n\t_, err := io.ReadFull(bfr.(io.Reader), buf)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\titemHeaderData := itemData{}\n\tif err := binary.Read(bytes.NewBuffer(buf), binary.LittleEndian, &itemHeaderData); err != nil {\n\t\treturn err\n\t}\n\n\tif string(itemHeaderData.Header[:]) != \"JM\" {\n\t\treturn errors.New(\"failed to find the items header\")\n\t}\n\n\tchar.Items, err = ParseItemList(bfr, int(itemHeaderData.Count))\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}",
"func parseMercItems(bfr io.ByteReader, char *Character) error {\n\tbr := bitReader{r: bfr}\n\n\t// offset: 0 \"j\"\n\tj, err := br.ReadByte()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// offset: 8, \"f\"\n\tf, err := br.ReadByte()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif string(j) != \"j\" || string(f) != \"f\" {\n\t\treturn errors.New(\"failed to find merc header jf\")\n\t}\n\n\t// If you have a merc, we'll read the item list of the merc here.\n\tif char.Header.MercID != 0 {\n\t\t// Make a buffer that can hold 4 bytes, which can hold the items header.\n\t\tbuf := make([]byte, 4)\n\n\t\t_, err := io.ReadFull(bfr.(io.Reader), buf[:4])\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\titemHeaderData := itemData{}\n\t\terr = binary.Read(bytes.NewBuffer(buf), binary.LittleEndian, &itemHeaderData)\n\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tif string(itemHeaderData.Header[:]) != \"JM\" {\n\t\t\treturn errors.New(\"failed to find the merc items header\")\n\t\t}\n\n\t\titems, err := ParseItemList(bfr, int(itemHeaderData.Count))\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tchar.MercItems = items\n\t}\n\n\treturn nil\n}",
"func readMobiHeader(b []byte) (*MOBIHeader, error) {\n\theader := &MOBIHeader{}\n\n\tvar err error\n\theader.Identifier = string(b[0:4])\n\theader.Length, err = getUint(b, 4, 4)\n\theader.MobiType, err = getUint(b, 8, 4)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\theader.Encoding, err = getUint(b, 12, 4)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\theader.UniqueID, err = getUint(b, 16, 4)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\theader.FileVersion, err = getUint(b, 20, 4)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\theader.OrthographicIndex, err = getUint(b, 24, 4)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\theader.InflectionIndex, err = getUint(b, 28, 4)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\theader.IndexNames = string(b[32:36])\n\theader.IndexKeys = string(b[36:40])\n\theader.ExtraIndex0 = string(b[40:44])\n\theader.ExtraIndex1 = string(b[44:48])\n\theader.ExtraIndex2 = string(b[48:52])\n\theader.ExtraIndex3 = string(b[52:56])\n\theader.ExtraIndex4 = string(b[56:60])\n\theader.ExtraIndex5 = string(b[60:64])\n\theader.FirstNonBookIndex, err = getUint(b, 64, 4)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\theader.FullNameOffset, err = getUint(b, 68, 4)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\theader.FullNameLength, err = getUint(b, 72, 4)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\theader.Locale, err = getUint(b, 76, 4)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\theader.InputLanguage = string(b[80:84])\n\theader.OutputLangugage = string(b[84:88])\n\theader.MinVersion, err = getUint(b, 88, 4)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\theader.FirstImageIndex, err = getUint(b, 92, 4)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\theader.HuffmanRecordOffset, err = getUint(b, 96, 4)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\theader.HuffmanRecordCount, err = getUint(b, 100, 4)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\theader.HuffmanTableOffset, err = getUint(b, 104, 4)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\theader.HuffmanTableLength, err = getUint(b, 108, 4)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\theader.EXTHFlags, err = getUint(b, 112, 4)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\theader.Unknown1 = b[112:144]\n\theader.Unknown2 = b[144:148]\n\theader.DRMOffset, err = getUint(b, 152, 4)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\theader.DRMCount, err = getUint(b, 156, 4)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\theader.DRMSize, err = getUint(b, 160, 4)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\theader.DRMFlags, err = getUint(b, 164, 4)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\theader.Unknown3 = b[168:176]\n\theader.FirstContentRecordNumber, err = getUint(b, 176, 2)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\theader.LastContentRecordNumber, err = getUint(b, 178, 2)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\theader.Unknown4 = b[180:184]\n\theader.FCISRecordNumber, err = getUint(b, 184, 4)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\theader.Unknown5 = b[188:192]\n\theader.FLISRecordNumber, err = getUint(b, 192, 4)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\theader.Unknown6 = b[196:200]\n\theader.Unknown7 = b[200:208]\n\theader.FirstCompDataSecCount, err = getUint(b, 212, 4)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\theader.NumCompDataSections, err = getUint(b, 216, 4)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\theader.Unknown8 = b[220:224]\n\theader.ExtraRecordDataFlag, err = getUint(b, 224, 4)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif header.Length > 228 {\n\t\theader.INDXRecordOffset, err = getUint(b, 228, 4)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\tif header.Length > 232 {\n\t\theader.Unknown9 = b[232:236]\n\t\theader.Unknown10 = b[236:240]\n\t\theader.Unknown11 = b[240:244]\n\t\theader.Unknown12 = b[244:248]\n\t\theader.Unknown13 = b[248:252]\n\t\theader.Unknown14 = b[252:256]\n\t}\n\n\treturn header, nil\n}",
"func (c *Composite) parseHeader(reader *bufio.Reader) error {\n\theader, err := reader.ReadString('\\x03')\n\tif err != nil || len(header) < 22 { // smaller length makes no sense\n\t\treturn newError(\"parseHeader\", \"header corrupted: too short\")\n\t}\n\n\t// Split header segments\n\tsection := splitHeader(header[:len(header)-1]) // without delimiter\n\n\t// Parse Product - Example: \"PG\" or \"FZ\"\n\tc.Product = header[:2]\n\n\t// Lookup Unit\n\tc.DataUnit = Unit_unknown\n\tif unit, ok := unitCatalog[c.Product]; ok {\n\t\tc.DataUnit = unit\n\t}\n\n\t// Parse DataLength - Example: \"BY 405160\"\n\tif _, err := fmt.Sscanf(section[\"BY\"], \"%d\", &c.dataLength); err != nil {\n\t\treturn newError(\"parseHeader\", \"could not parse data length: \"+err.Error())\n\t}\n\tc.dataLength -= len(header) // remove header length including delimiter\n\n\t// Parse CaptureTime - Example: \"PG262115100000616\" or \"FZ211615100000716\"\n\tdate := header[2:8] + header[13:17] // cut WMO number\n\tc.CaptureTime, err = time.Parse(\"0215040106\", date)\n\tif err != nil {\n\t\treturn newError(\"parseHeader\", \"could not parse capture time: \"+err.Error())\n\t}\n\n\t// Parse ForecastTime - Example: \"VV 005\"\n\tc.ForecastTime = c.CaptureTime\n\tif vv, ok := section[\"VV\"]; ok {\n\t\tmin := 0\n\t\tif _, err := fmt.Sscanf(vv, \"%d\", &min); err != nil {\n\t\t\treturn newError(\"parseHeader\", \"could not parse forecast time: \"+err.Error())\n\t\t}\n\t\tc.ForecastTime = c.CaptureTime.Add(time.Duration(min) * time.Minute)\n\t}\n\n\t// Parse Interval - Example \"INT 5\" or \"INT1008\"\n\tif intr, ok := section[\"INT\"]; ok {\n\t\tmin := 0\n\t\tif _, err := fmt.Sscanf(intr, \"%d\", &min); err != nil {\n\t\t\treturn newError(\"parseHeader\", \"could not parse interval: \"+err.Error())\n\t\t}\n\n\t\tc.Interval = time.Duration(min) * time.Minute\n\t\tswitch c.Product {\n\t\tcase \"W1\", \"W2\", \"W3\", \"W4\":\n\t\t\tc.Interval *= 10\n\t\t}\n\t}\n\n\t// Parse Dimensions - Example: \"GP 450x 450\" or \"BG460460\" or \"GP 1500x1400\" (if defined)\n\tif dim, ok := section[\"GP\"]; ok {\n\t\tif _, err := fmt.Sscanf(dim, \"%dx%d\", &c.Dy, &c.Dx); err != nil {\n\t\t\treturn newError(\"parseHeader\", \"could not parse dimensions (GP): \"+err.Error())\n\t\t}\n\t\tc.Px, c.Py = c.Dx, c.Dy // composite formats do not show elevation\n\n\t} else if dim, ok := section[\"BG\"]; ok {\n\t\tif _, err := fmt.Sscanf(dim, \"%3d%3d\", &c.Dy, &c.Dx); err != nil {\n\t\t\treturn newError(\"parseHeader\", \"could not parse dimensions (BG): \"+err.Error())\n\t\t}\n\t\tc.Px, c.Py = c.Dx, c.Dy // composite formats do not show elevation\n\n\t} else { // dimensions of local picture products not defined in header\n\t\tv, ok := dimensionCatalog[c.Product] // lookup in catalog\n\t\tif !ok {\n\t\t\treturn newError(\"parseHeader\", \"no dimension information available\")\n\t\t}\n\n\t\tc.Px, c.Py = v.px, v.py // plain data dimensions\n\t\tc.Dx, c.Dy = v.dx, v.dy // data layer dimensions\n\t\tc.Rx, c.Ry = v.rx, v.ry // data resolution\n\t}\n\n\t// Parse Precision - Example: \"PR E-01\" or \"PR E+00\"\n\tif prec, ok := section[\"E\"]; ok { // not that nice\n\t\tif _, err := fmt.Sscanf(prec, \"%d\", &c.precision); err != nil {\n\t\t\treturn newError(\"parseHeader\", \"could not parse precision: \"+err.Error())\n\t\t}\n\t}\n\n\t// Parse Level - Example \"LV 6 1.0 19.0 28.0 37.0 46.0 55.0\"\n\t// or \"LV12-31.5-24.5-17.5-10.5 -5.5 -1.0 1.0 5.5 10.5 17.5 24.5 31.5\"\n\tif lv, ok := section[\"LV\"]; ok {\n\t\tif len(lv) < 2 {\n\t\t\treturn newError(\"parseHeader\", \"level field too short\")\n\t\t}\n\n\t\tvar cnt int\n\t\tif _, err = fmt.Sscanf(lv[:2], \"%d\", &cnt); err != nil {\n\t\t\treturn newError(\"parseHeader\", \"could not parse level count: \"+err.Error())\n\t\t}\n\n\t\tif len(lv) != cnt*5+2 { // fortran format I2 + F5.1\n\t\t\treturn newError(\"parseHeader\", \"invalid level format: \"+lv)\n\t\t}\n\n\t\tc.level = make([]float32, cnt)\n\t\tfor i := range c.level {\n\t\t\tn := i * 5\n\t\t\tif _, err = fmt.Sscanf(lv[n+2:n+7], \"%f\", &c.level[i]); err != nil {\n\t\t\t\treturn newError(\"parseHeader\", \"invalid level value: \"+err.Error())\n\t\t\t}\n\t\t}\n\t}\n\n\t// Parse Format Version - Example \"VS 5\"\n\tif vs, ok := section[\"VS\"]; ok {\n\t\tif _, err = fmt.Sscanf(vs, \"%d\", &c.Format); err != nil {\n\t\t\treturn newError(\"parseHeader\", \"invalid format value: \"+err.Error())\n\t\t}\n\t}\n\n\treturn nil\n}",
"func readPalmDocHeader(b []byte) (*PalmDOCHeader, error) {\n\theader := &PalmDOCHeader{}\n\n\tvar err error\n\n\t// creates header from the 16 byte slice\n\theader.Compression, err = getUint(b, 0, 2)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\theader.Length, err = getUint(b, 4, 4)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\theader.RecordCount, err = getUint(b, 8, 2)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\theader.RecordSize, err = getUint(b, 10, 2)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\theader.EncryptionType, err = getUint(b, 12, 2)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\theader.Unknown1 = b[14:16]\n\n\treturn header, nil\n}",
"func ReadHeader(reader *bufio.Reader) (*Header, error) {\n\t// Read magic marker\n\tbuf := make([]byte, 4)\n\tif _, err := reader.Read(buf); err != nil {\n\t\treturn nil, err\n\t}\n\n\tversion := ymMarkerRegExp.FindString(string(buf))\n\tif version == \"\" {\n\t\treturn nil, fmt.Errorf(\"Unable to extract YM marker or YM version. Marker string: '%v'\", string(buf))\n\t}\n\n\tif _, ok := SupportedYmVersions[version]; !ok {\n\t\treturn nil, UnsupportedVersionError{UnsupportedVersion: version}\n\t}\n\n\tymHeader := Header{\n\t\tVersion: version,\n\t}\n\n\t// Read check string\n\tbuf = make([]byte, 8)\n\tif _, err := io.ReadFull(reader, buf); err != nil {\n\t\treturn nil, err\n\t}\n\tif checkString != string(buf) {\n\t\treturn nil, fmt.Errorf(\"Invalid check string: '%v'\", string(buf))\n\t}\n\n\tbinary.Read(reader, binary.BigEndian, &ymHeader.FrameCount)\n\tbinary.Read(reader, binary.BigEndian, &ymHeader.Attributes)\n\tbinary.Read(reader, binary.BigEndian, &ymHeader.DigiDrumSamplesNumber)\n\tbinary.Read(reader, binary.BigEndian, &ymHeader.MasterClock)\n\tbinary.Read(reader, binary.BigEndian, &ymHeader.PlayerFrame)\n\tbinary.Read(reader, binary.BigEndian, &ymHeader.LoopFrame)\n\n\tbufferedReader := bufio.NewReader(reader)\n\tbinary.Read(reader, binary.BigEndian, &ymHeader.skipBytes)\n\tymHeader.skippedData = make([]byte, ymHeader.skipBytes)\n\tio.ReadFull(reader, ymHeader.skippedData)\n\n\tfor i := 0; i < int(ymHeader.DigiDrumSamplesNumber); i++ {\n\t\tdd := DigiDrumSample{}\n\t\tbinary.Read(bufferedReader, binary.BigEndian, &dd.Size)\n\t\tdd.Data = make([]byte, dd.Size)\n\t\tio.ReadFull(bufferedReader, dd.Data)\n\t}\n\n\t// Read string information, stripping the trailing \\0\n\tstr, _ := bufferedReader.ReadString(0)\n\tymHeader.SongName = str[:len(str)-1]\n\tstr, _ = bufferedReader.ReadString(0)\n\tymHeader.Author = str[:len(str)-1]\n\tstr, _ = bufferedReader.ReadString(0)\n\tymHeader.Comment = str[:len(str)-1]\n\n\treturn &ymHeader, nil\n}",
"func Item(src *bytes.Buffer, x *ItemStack) error {\n\tx.NBTData = make(map[string]interface{})\n\tif err := Varint32(src, &x.NetworkID); err != nil {\n\t\treturn wrap(err)\n\t}\n\tif x.NetworkID == 0 {\n\t\t// The item was air, so there is no more data we should read for the item instance. After all, air\n\t\t// items aren't really anything.\n\t\tx.MetadataValue = 0\n\t\tx.Count = 0\n\t\tx.CanBePlacedOn, x.CanBreak = nil, nil\n\t\treturn nil\n\t}\n\tvar auxValue int32\n\tif err := Varint32(src, &auxValue); err != nil {\n\t\treturn wrap(err)\n\t}\n\tx.MetadataValue = int16(auxValue >> 8)\n\tx.Count = int16(auxValue & 0xff)\n\n\tvar userDataMarker int16\n\tif err := binary.Read(src, binary.LittleEndian, &userDataMarker); err != nil {\n\t\treturn wrap(err)\n\t}\n\tif userDataMarker == -1 {\n\t\tvar userDataVersion uint8\n\t\tif err := binary.Read(src, binary.LittleEndian, &userDataVersion); err != nil {\n\t\t\treturn wrap(err)\n\t\t}\n\t\tswitch userDataVersion {\n\t\tcase 1:\n\t\t\tif err := nbt.NewDecoder(src).Decode(&x.NBTData); err != nil {\n\t\t\t\treturn fmt.Errorf(\"%v: error decoding user data NBT: %v\", callFrame(), err)\n\t\t\t}\n\t\tdefault:\n\t\t\treturn fmt.Errorf(\"%v: unexpected item user data version %v\", callFrame(), userDataVersion)\n\t\t}\n\t} else if userDataMarker != 0 {\n\t\tif userDataMarker < 0 {\n\t\t\treturn fmt.Errorf(\"%v: invalid NBT length %v\", callFrame(), userDataMarker)\n\t\t}\n\t\tnbtData := src.Next(int(userDataMarker))\n\t\tif err := nbt.UnmarshalEncoding(nbtData, &x.NBTData, nbt.LittleEndian); err != nil {\n\t\t\treturn fmt.Errorf(\"%v: error decoding item NBT: %v\", callFrame(), err)\n\t\t}\n\t}\n\tvar count int32\n\tif err := Varint32(src, &count); err != nil {\n\t\treturn wrap(err)\n\t}\n\tif count < 0 {\n\t\treturn NegativeCountError{Type: \"item can be placed on\"}\n\t}\n\tif count > higherLimit {\n\t\treturn LimitHitError{Limit: higherLimit, Type: \"item can be placed on\"}\n\t}\n\tx.CanBePlacedOn = make([]string, count)\n\tfor i := int32(0); i < count; i++ {\n\t\tif err := String(src, &x.CanBePlacedOn[i]); err != nil {\n\t\t\treturn wrap(err)\n\t\t}\n\t}\n\tif err := Varint32(src, &count); err != nil {\n\t\treturn wrap(err)\n\t}\n\tif count < 0 {\n\t\treturn NegativeCountError{Type: \"item can break\"}\n\t}\n\tif count > higherLimit {\n\t\treturn LimitHitError{Limit: higherLimit, Type: \"item can break\"}\n\t}\n\tx.CanBreak = make([]string, count)\n\tfor i := int32(0); i < count; i++ {\n\t\tif err := String(src, &x.CanBreak[i]); err != nil {\n\t\t\treturn wrap(err)\n\t\t}\n\t}\n\tconst shieldID = 513\n\tif x.NetworkID == shieldID {\n\t\tvar blockingTick int64\n\t\tif err := Varint64(src, &blockingTick); err != nil {\n\t\t\treturn wrap(err)\n\t\t}\n\t}\n\treturn nil\n}",
"func decodeHeader(r io.Reader) (*boxHeader, error) {\n\tbuf := make([]byte, boxHeaderSize)\n\tn, err := r.Read(buf)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif n != boxHeaderSize {\n\t\treturn nil, ErrTruncatedHeader\n\t}\n\tsize := uint64(binary.BigEndian.Uint32(buf[0:4]))\n\theaderLen := boxHeaderSize\n\tif size == 1 {\n\t\tbuf := make([]byte, largeSizeLen)\n\t\tn, err := r.Read(buf)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif n != largeSizeLen {\n\t\t\treturn nil, errors.New(\"Could not read largeSize\")\n\t\t}\n\t\tsize = binary.BigEndian.Uint64(buf)\n\t\theaderLen += largeSizeLen\n\t} else if size == 0 {\n\t\treturn nil, errors.New(\"Size to end of file not supported\")\n\t}\n\treturn &boxHeader{string(buf[4:8]), size, headerLen}, nil\n}",
"func parseHeader(rd io.Reader) (tagHeader, error) {\n\tvar header tagHeader\n\n\tdata := make([]byte, tagHeaderSize)\n\tn, err := rd.Read(data)\n\tif err != nil {\n\t\treturn header, err\n\t}\n\tif n < tagHeaderSize {\n\t\treturn header, ErrSmallHeaderSize\n\t}\n\n\tif !isID3Tag(data[0:3]) {\n\t\treturn header, errNoTag\n\t}\n\n\theader.Version = data[3]\n\n\t// Tag header size is always synchsafe.\n\tsize, err := parseSize(data[6:], true)\n\tif err != nil {\n\t\treturn header, err\n\t}\n\n\theader.FramesSize = size\n\treturn header, nil\n}",
"func parseHeader(data []byte, r *rep.Replay) error {\n\tbo := binary.LittleEndian // ByteOrder reader: little-endian\n\n\th := new(rep.Header)\n\tr.Header = h\n\n\th.Engine = repcore.EngineByID(data[0x00])\n\th.Frames = repcore.Frame(bo.Uint32(data[0x01:]))\n\th.StartTime = time.Unix(int64(bo.Uint32(data[0x08:])), 0) // replay stores seconds since EPOCH\n\th.Title = cString(data[0x18 : 0x18+28])\n\th.MapWidth = bo.Uint16(data[0x34:])\n\th.MapHeight = bo.Uint16(data[0x36:])\n\th.AvailSlotsCount = data[0x39]\n\th.Speed = repcore.SpeedByID(data[0x3a])\n\th.Type = repcore.GameTypeByID(bo.Uint16(data[0x3c:]))\n\th.SubType = bo.Uint16(data[0x3e:])\n\th.Host = cString(data[0x48 : 0x48+24])\n\th.Map = cString(data[0x61 : 0x61+26])\n\n\t// Parse players\n\tconst (\n\t\tslotsCount = 12\n\t\tmaxPlayers = 8\n\t)\n\th.PIDPlayers = make(map[byte]*rep.Player, slotsCount)\n\th.Slots = make([]*rep.Player, slotsCount)\n\tplayerStructs := data[0xa1 : 0xa1+432]\n\tfor i := range h.Slots {\n\t\tp := new(rep.Player)\n\t\th.Slots[i] = p\n\t\tps := playerStructs[i*36 : i*36+432/slotsCount]\n\t\tp.SlotID = bo.Uint16(ps)\n\t\tp.ID = ps[4]\n\t\tp.Type = repcore.PlayerTypeByID(ps[8])\n\t\tp.Race = repcore.RaceByID(ps[9])\n\t\tp.Team = ps[10]\n\t\tp.Name = cString(ps[11 : 11+25])\n\n\t\tif i < maxPlayers {\n\t\t\tp.Color = repcore.ColorByID(bo.Uint32(data[0x251+i*4:]))\n\t\t}\n\n\t\th.PIDPlayers[p.ID] = p\n\n\t\t// Filter real players:\n\t\tif p.Name != \"\" {\n\t\t\th.OrigPlayers = append(h.OrigPlayers, p)\n\t\t}\n\t}\n\n\t// Fill Players in team order:\n\th.Players = make([]*rep.Player, len(h.OrigPlayers))\n\tcopy(h.Players, h.OrigPlayers)\n\tsort.SliceStable(h.Players, func(i int, j int) bool {\n\t\treturn h.Players[i].Team < h.Players[j].Team\n\t})\n\n\treturn nil\n}",
"func parseSimpleBits(br *bitReader, item *Item) error {\n\t// offset: 0 \"J\"\n\tj, err := br.ReadByte()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// offset: 8, \"M\"\n\tm, err := br.ReadByte()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif string(j) != \"J\" || string(m) != \"M\" {\n\t\treturn errors.New(\"failed to find item header JM\")\n\t}\n\n\t// offset: 16, unknown\n\tbr.ReadBits(4)\n\n\t// offset: 20\n\tif item.Identified, err = br.ReadBits(1); err != nil {\n\t\treturn err\n\t}\n\n\t// offset: 21, unknown\n\tbr.ReadBits(6)\n\n\t// offset: 27\n\tif item.Socketed, err = br.ReadBits(1); err != nil {\n\t\treturn err\n\t}\n\n\t// offset 28, unknown\n\tbr.ReadBits(1)\n\n\t// offset 29\n\tif item.New, err = br.ReadBits(1); err != nil {\n\t\treturn err\n\t}\n\n\t// offset 30, unknown\n\tbr.ReadBits(2)\n\n\t// offset 32\n\tif item.IsEar, err = br.ReadBits(1); err != nil {\n\t\treturn err\n\t}\n\n\t// offset 33\n\tif item.StarterItem, err = br.ReadBits(1); err != nil {\n\t\treturn err\n\t}\n\n\t// offset 34, unknown\n\tbr.ReadBits(3)\n\n\t// offset 37, if it's a simple item, it only contains 111 bits data\n\tif item.SimpleItem, err = br.ReadBits(1); err != nil {\n\t\treturn err\n\t}\n\n\t// offset 38\n\tif item.Ethereal, err = br.ReadBits(1); err != nil {\n\t\treturn err\n\t}\n\n\t// offset 39, unknown\n\tbr.ReadBits(1)\n\n\t// offset 40\n\tif item.Personalized, err = br.ReadBits(1); err != nil {\n\t\treturn err\n\t}\n\n\t// offset 41, unknown\n\tbr.ReadBits(1)\n\n\t// offset 42\n\tif item.GivenRuneword, err = br.ReadBits(1); err != nil {\n\t\treturn err\n\t}\n\n\t// offset 43, unknown\n\tbr.ReadBits(5)\n\n\t// offset 48\n\tif item.Version, err = br.ReadBits(8); err != nil {\n\t\treturn err\n\t}\n\n\t// offset 56, unknown\n\tbr.ReadBits(2)\n\n\t// offset 58\n\tif item.LocationID, err = br.ReadBits(3); err != nil {\n\t\treturn err\n\t}\n\n\t// offset 61\n\tif item.EquippedID, err = br.ReadBits(4); err != nil {\n\t\treturn err\n\t}\n\n\t// offset 65\n\tif item.PositionX, err = br.ReadBits(4); err != nil {\n\t\treturn err\n\t}\n\n\t// offset 69\n\tif item.PositionY, err = br.ReadBits(3); err != nil {\n\t\treturn err\n\t}\n\n\t// offset 72\n\tbr.ReadBits(1)\n\n\t// offset 73, if item is neither equipped or in the belt, this tells us where it is.\n\tif item.AltPositionID, err = br.ReadBits(3); err != nil {\n\t\treturn err\n\t}\n\n\tif item.IsEar == 0 {\n\t\t// offset 76, item type, 4 chars, each 8 bit (not byte aligned)\n\t\tvar itemType string\n\t\tfor j := 0; j < 4; j++ {\n\t\t\tt, err := br.ReadBits(8)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\titemType += fmt.Sprintf(\"%c\", t)\n\t\t}\n\n\t\titem.Type = strings.Trim(itemType, \" \")\n\t\titem.TypeID = item.getTypeID()\n\n\t\tswitch item.TypeID {\n\t\tcase armor:\n\t\t\ttypeName, ok := armorCodes[item.Type]\n\t\t\tif ok {\n\t\t\t\titem.TypeName = typeName\n\t\t\t}\n\t\tcase shield:\n\t\t\ttypeName, ok := shieldCodes[item.Type]\n\t\t\tif ok {\n\t\t\t\titem.TypeName = typeName\n\t\t\t}\n\t\tcase weapon:\n\t\t\ttypeName, ok := weaponCodes[item.Type]\n\t\t\tif ok {\n\t\t\t\titem.TypeName = typeName\n\t\t\t}\n\n\t\t\t// Weapons have base damage, so we'll check our\n\t\t\t// map for the base damage of this weapon type.\n\t\t\tbaseDamage, ok := weaponDamageMap[item.Type]\n\t\t\tif ok {\n\n\t\t\t\t// If the item is ethereal we need to add 50% enhanced\n\t\t\t\t// damage to the base damage.\n\t\t\t\tif item.Ethereal == 1 {\n\t\t\t\t\tbaseDamage.Min = int((float64(baseDamage.Min) * 1.5))\n\t\t\t\t\tbaseDamage.Max = int((float64(baseDamage.Max) * 1.5))\n\t\t\t\t\tbaseDamage.TwoMin = int((float64(baseDamage.TwoMin) * 1.5))\n\t\t\t\t\tbaseDamage.TwoMax = int((float64(baseDamage.TwoMax) * 1.5))\n\t\t\t\t}\n\n\t\t\t\titem.BaseDamage = &baseDamage\n\t\t\t}\n\t\tcase other:\n\t\t\ttypeName, ok := miscCodes[item.Type]\n\t\t\tif ok {\n\t\t\t\titem.TypeName = typeName\n\t\t\t}\n\t\t}\n\n\t\t// offset 108\n\t\t// If sockets exist, read the items, they'll be 108 bit basic items * nrOfSockets\n\t\tif item.NrOfItemsInSockets, err = br.ReadBits(3); err != nil {\n\t\t\treturn err\n\t\t}\n\t} else {\n\t\t// offset 76, the item is an ear, we need to read the ear data.\n\t\tearClass, err := br.ReadBits(3)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tearLevel, err := br.ReadBits(7)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tvar name string\n\t\tfor {\n\t\t\tc, err := br.ReadBits(7)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tif c == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\tname += fmt.Sprintf(\"%c\", c)\n\t\t}\n\n\t\titem.EarAttributes = earAttributes{\n\t\t\tClass: earClass,\n\t\t\tLevel: earLevel,\n\t\t\tName: name,\n\t\t}\n\n\t\t// If the ear is not byte aligned, we'll have to byte align it before\n\t\t// reading the next property.\n\t\tbr.Align()\n\t}\n\n\treturn nil\n}",
"func (d *decoder) parseChunk() error {\n\t_, err := io.ReadFull(d.r, d.tmp[:cacheSize])\n\tif err != nil {\n\t\treturn err\n\t}\n\td.dataLength = binary.BigEndian.Uint32(d.tmp[4:8])\n\treturn d.parseDrum()\n}",
"func (d *WordDecoder) DecodeHeader(header string) (string, error)",
"func GetHeader(reader *bufio.Reader) (HeaderT, error) {\n\tvar header HeaderT\n\tvar err error\n\n\theader.CallIDsStr = \"\"\n\theader.TotalNumCalls = 0\n\theader.NumRanks = 0\n\theader.DatatypeSize = 0\n\n\talltoallvCallStart := -1\n\talltoallvCallEnd := -1\n\tline := \"\"\n\n\t// Get the first line of the header skipping potential empty lines that\n\t// can be in front of header\n\tvar readerErr error\n\tfor line == \"\" || line == \"\\n\" {\n\t\tline, readerErr = reader.ReadString('\\n')\n\t\tif readerErr == io.EOF {\n\t\t\treturn header, readerErr\n\t\t}\n\t\tif readerErr != nil {\n\t\t\treturn header, readerErr\n\t\t}\n\t}\n\n\t// Are we at the beginning of a metadata block?\n\tif !strings.HasPrefix(line, \"# Raw\") {\n\t\treturn header, fmt.Errorf(\"[ERROR] not a header\")\n\t}\n\n\tfor {\n\t\tline, readerErr = reader.ReadString('\\n')\n\t\tif readerErr != nil && readerErr != io.EOF {\n\t\t\treturn header, readerErr\n\t\t}\n\n\t\tif strings.HasPrefix(line, numberOfRanksMarker) {\n\t\t\tline = strings.ReplaceAll(line, numberOfRanksMarker, \"\")\n\t\t\tline = strings.ReplaceAll(line, \"\\n\", \"\")\n\t\t\theader.NumRanks, err = strconv.Atoi(line)\n\t\t\tif err != nil {\n\t\t\t\tlog.Println(\"[ERROR] unable to parse number of ranks\")\n\t\t\t\treturn header, readerErr\n\t\t\t}\n\t\t}\n\n\t\tif strings.HasPrefix(line, datatypeSizeMarker) {\n\t\t\tline = strings.ReplaceAll(line, \"\\n\", \"\")\n\t\t\tline = strings.ReplaceAll(line, datatypeSizeMarker, \"\")\n\t\t\theader.DatatypeSize, err = strconv.Atoi(line)\n\t\t\tif err != nil {\n\t\t\t\tlog.Println(\"[ERROR] unable to parse the datatype size\")\n\t\t\t\treturn header, readerErr\n\t\t\t}\n\t\t}\n\n\t\tif strings.HasPrefix(line, alltoallvCallNumbersMarker) {\n\t\t\tline = strings.ReplaceAll(line, \"\\n\", \"\")\n\t\t\tcallRange := strings.ReplaceAll(line, alltoallvCallNumbersMarker, \"\")\n\t\t\ttokens := strings.Split(callRange, \"-\")\n\t\t\tif len(tokens) == 2 {\n\t\t\t\talltoallvCallStart, err = strconv.Atoi(strings.TrimLeft(tokens[0], \" \"))\n\t\t\t\tif err != nil {\n\t\t\t\t\tlog.Printf(\"[ERROR] unable to parse line to get first alltoallv call number: %s\", line)\n\t\t\t\t\treturn header, err\n\t\t\t\t}\n\t\t\t\talltoallvCallEnd, err = strconv.Atoi(tokens[1])\n\t\t\t\tif err != nil {\n\t\t\t\t\tlog.Printf(\"[ERROR] unable to convert %s to interger: %s\", tokens[1], err)\n\t\t\t\t\treturn header, err\n\t\t\t\t}\n\t\t\t\theader.TotalNumCalls = alltoallvCallEnd - alltoallvCallStart + 1 // Add 1 because we are 0-indexed\n\t\t\t}\n\t\t}\n\n\t\tif strings.HasPrefix(line, marker) {\n\t\t\tline = strings.ReplaceAll(line, \"\\n\", \"\")\n\t\t\tstrParsing := line\n\t\t\ttokens := strings.Split(line, \" - \")\n\t\t\tif len(tokens) > 1 {\n\t\t\t\tstrParsing = tokens[0]\n\t\t\t\theader.CallIDsStr = tokens[1]\n\t\t\t\ttokens2 := strings.Split(header.CallIDsStr, \" (\")\n\t\t\t\tif len(tokens2) > 1 {\n\t\t\t\t\theader.CallIDsStr = tokens2[0]\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tstrParsing = strings.ReplaceAll(strParsing, marker, \"\")\n\t\t\tstrParsing = strings.ReplaceAll(strParsing, \" calls\", \"\")\n\n\t\t\tif header.CallIDsStr != \"\" {\n\t\t\t\theader.CallIDs, err = notation.ConvertCompressedCallListToIntSlice(header.CallIDsStr)\n\t\t\t\tif err != nil {\n\t\t\t\t\tlog.Printf(\"[ERROR] unable to parse calls IDs: %s\", err)\n\t\t\t\t\treturn header, err\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// We check for the beginning of the actual data\n\t\tif strings.HasPrefix(line, beginningDataMarker) {\n\t\t\tbreak\n\t\t}\n\n\t\tif readerErr == io.EOF {\n\t\t\treturn header, readerErr\n\t\t}\n\t}\n\n\treturn header, nil\n}",
"func DecodeHeader(bts []byte) (ExifHeader, error) {\n\theader := ExifHeader{}\n\tif len(bts) != 16 {\n\t\treturn header, fmt.Errorf(\"expecting header length of 18 but got %d\", len(bts))\n\t}\n\tsizeBts := bts[:2]\n\texifStrBts := bts[2:6]\n\ttwoZeros := bts[6:8]\n\tcompanyIDBts := bts[8:10]\n\tbomBts := bts[10:12]\n\toffsetBts := bts[12:16]\n\t\n\tvar decodesResults []error\n\n\t// Start with validations\n\terr := validateExifString(exifStrBts); if err != nil { goto onError }\n\terr = validateTwoZeros(twoZeros); if err != nil { goto onError }\n\t// Continue on to determine byte order\n\theader.CompanyID = CompanyID(forceASCII(companyIDBts))\n\theader.ByteOrder, err = determineByteOrder(header.CompanyID, bomBts); if err != nil { goto onError }\n\n\t// Now we can decode all those numbers\n\tdecodesResults = []error{\n\t\tdecode(header.ByteOrder, sizeBts, &header.Size), \n\t\tdecode(header.ByteOrder, offsetBts, &header.Offset), \n\t}\n\tfor _, r := range decodesResults {\n\t\tif r != nil { \n\t\t\terr = r\n\t\t\tgoto onError \n\t\t}\n\t}\n\tonError:\n\t\tif err != nil{\n\t\t\treturn header, err\n\t\t}\n\n\treturn header, nil\n\n}",
"func WordDecoderDecodeHeader(d *mime.WordDecoder, header string) (string, error)",
"func Decode(r io.Reader) (sound.Tags, error) {\n\t// log.Print(\"decode id3 header\")\n\t//r := &countReader{r: rr}\n\th, padding, err := readHeader(r)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// log.Printf(\"%d bytes of padding\", padding)\n\n\t// calls from mp3 package should always be bufio.Reader\n\tvar br *bufio.Reader\n\n\tif _br, ok := r.(*bufio.Reader); ok {\n\t\t// log.Print(\"reader is *bufio.Reader\")\n\t\tbr = _br\n\t} else {\n\t\tbr = bufio.NewReader(r)\n\t}\n\n\t// Make sure we don't read more than we need to, so that subsequent readers\n\t// can get the audio data from the file\n\t// totalSize := int64(h.Size)\n\tif h.Flags&flagFooterPresent != 0 {\n\t\t// we're not using the footer (which is used only to aid in searching\n\t\t// for the ID3 tags backwards from EOF), so discard it\n\t\th.Size -= footerSize\n\t\tpadding += footerSize\n\t}\n\n\t// Operate on entire tag in memory. Simplest way we can reliably limit\n\t// bytes read from *bufio.Reader (wrapping with limited reader will take\n\t// chunks at a time and not be accurate).\n\ttag := make([]byte, h.Size)\n\tio.ReadFull(br, tag)\n\tlr := bytes.NewReader(tag)\n\t// lr := &limitedBufioReader{br, int64(h.Size)}\n\n\t//log.Print(\"data left: \", lr.N)\n\n\t// log.Print(\"reading frames\")\n\tframes, err := readFrames(lr, h)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"read frames\")\n\t}\n\n\tif padding > 0 {\n\t\t_, err = io.CopyN(ioutil.Discard, br, int64(padding))\n\t\tif err != nil {\n\t\t\treturn nil, errors.Wrap(err, \"discard padding\")\n\t\t}\n\t}\n\n\treturn makeTags(h, frames)\n}",
"func Parse2MG(data []uint8) (Header2MG, error) {\n\tvar result Header2MG\n\tif len(data) < HeaderSize {\n\t\treturn result, fmt.Errorf(\"2mg header too short: expected %d bytes, got %d\", HeaderSize, len(data))\n\t}\n\tresult.Magic = string(data[0x00 : 0x03+1]) // Magic Text\n\tresult.HeaderSize = binary.LittleEndian.Uint16(data[0x08 : 0x09+1])\n\tresult.Version = binary.LittleEndian.Uint16(data[0x0a : 0x0b+1])\n\tresult.ImageFormat = binary.LittleEndian.Uint32(data[0x0c : 0x0f+1])\n\tresult.BlockCount = binary.LittleEndian.Uint32(data[0x14 : 0x17+1])\n\tresult.Offset = binary.LittleEndian.Uint32(data[0x18 : 0x1b+1])\n\tresult.Length = binary.LittleEndian.Uint32(data[0x1c : 0x1f+1])\n\n\treturn result, nil\n}",
"func (d *decoder) checkHeader() error {\n\t_, err := io.ReadFull(d.r, d.tmp[:len(header)])\n\tif err != nil {\n\t\treturn err\n\t}\n\tif !bytes.Equal(d.tmp[:len(header)], header) {\n\t\treturn FormatError(\"not a SPLICE file\")\n\t}\n\treturn nil\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
Parses all items on the merc, if it exists, otherwise just reads the header.
|
func parseMercItems(bfr io.ByteReader, char *Character) error {
br := bitReader{r: bfr}
// offset: 0 "j"
j, err := br.ReadByte()
if err != nil {
return err
}
// offset: 8, "f"
f, err := br.ReadByte()
if err != nil {
return err
}
if string(j) != "j" || string(f) != "f" {
return errors.New("failed to find merc header jf")
}
// If you have a merc, we'll read the item list of the merc here.
if char.Header.MercID != 0 {
// Make a buffer that can hold 4 bytes, which can hold the items header.
buf := make([]byte, 4)
_, err := io.ReadFull(bfr.(io.Reader), buf[:4])
if err != nil {
return err
}
itemHeaderData := itemData{}
err = binary.Read(bytes.NewBuffer(buf), binary.LittleEndian, &itemHeaderData)
if err != nil {
return err
}
if string(itemHeaderData.Header[:]) != "JM" {
return errors.New("failed to find the merc items header")
}
items, err := ParseItemList(bfr, int(itemHeaderData.Count))
if err != nil {
return err
}
char.MercItems = items
}
return nil
}
|
[
"func parseItems(bfr io.ByteReader, char *Character) error {\n\t// Make a buffer that can hold 4 bytes, which can hold the items header.\n\tbuf := make([]byte, 4)\n\n\t_, err := io.ReadFull(bfr.(io.Reader), buf)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\titemHeaderData := itemData{}\n\tif err := binary.Read(bytes.NewBuffer(buf), binary.LittleEndian, &itemHeaderData); err != nil {\n\t\treturn err\n\t}\n\n\tif string(itemHeaderData.Header[:]) != \"JM\" {\n\t\treturn errors.New(\"failed to find the items header\")\n\t}\n\n\tchar.Items, err = ParseItemList(bfr, int(itemHeaderData.Count))\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}",
"func (c *Composite) parseHeader(reader *bufio.Reader) error {\n\theader, err := reader.ReadString('\\x03')\n\tif err != nil || len(header) < 22 { // smaller length makes no sense\n\t\treturn newError(\"parseHeader\", \"header corrupted: too short\")\n\t}\n\n\t// Split header segments\n\tsection := splitHeader(header[:len(header)-1]) // without delimiter\n\n\t// Parse Product - Example: \"PG\" or \"FZ\"\n\tc.Product = header[:2]\n\n\t// Lookup Unit\n\tc.DataUnit = Unit_unknown\n\tif unit, ok := unitCatalog[c.Product]; ok {\n\t\tc.DataUnit = unit\n\t}\n\n\t// Parse DataLength - Example: \"BY 405160\"\n\tif _, err := fmt.Sscanf(section[\"BY\"], \"%d\", &c.dataLength); err != nil {\n\t\treturn newError(\"parseHeader\", \"could not parse data length: \"+err.Error())\n\t}\n\tc.dataLength -= len(header) // remove header length including delimiter\n\n\t// Parse CaptureTime - Example: \"PG262115100000616\" or \"FZ211615100000716\"\n\tdate := header[2:8] + header[13:17] // cut WMO number\n\tc.CaptureTime, err = time.Parse(\"0215040106\", date)\n\tif err != nil {\n\t\treturn newError(\"parseHeader\", \"could not parse capture time: \"+err.Error())\n\t}\n\n\t// Parse ForecastTime - Example: \"VV 005\"\n\tc.ForecastTime = c.CaptureTime\n\tif vv, ok := section[\"VV\"]; ok {\n\t\tmin := 0\n\t\tif _, err := fmt.Sscanf(vv, \"%d\", &min); err != nil {\n\t\t\treturn newError(\"parseHeader\", \"could not parse forecast time: \"+err.Error())\n\t\t}\n\t\tc.ForecastTime = c.CaptureTime.Add(time.Duration(min) * time.Minute)\n\t}\n\n\t// Parse Interval - Example \"INT 5\" or \"INT1008\"\n\tif intr, ok := section[\"INT\"]; ok {\n\t\tmin := 0\n\t\tif _, err := fmt.Sscanf(intr, \"%d\", &min); err != nil {\n\t\t\treturn newError(\"parseHeader\", \"could not parse interval: \"+err.Error())\n\t\t}\n\n\t\tc.Interval = time.Duration(min) * time.Minute\n\t\tswitch c.Product {\n\t\tcase \"W1\", \"W2\", \"W3\", \"W4\":\n\t\t\tc.Interval *= 10\n\t\t}\n\t}\n\n\t// Parse Dimensions - Example: \"GP 450x 450\" or \"BG460460\" or \"GP 1500x1400\" (if defined)\n\tif dim, ok := section[\"GP\"]; ok {\n\t\tif _, err := fmt.Sscanf(dim, \"%dx%d\", &c.Dy, &c.Dx); err != nil {\n\t\t\treturn newError(\"parseHeader\", \"could not parse dimensions (GP): \"+err.Error())\n\t\t}\n\t\tc.Px, c.Py = c.Dx, c.Dy // composite formats do not show elevation\n\n\t} else if dim, ok := section[\"BG\"]; ok {\n\t\tif _, err := fmt.Sscanf(dim, \"%3d%3d\", &c.Dy, &c.Dx); err != nil {\n\t\t\treturn newError(\"parseHeader\", \"could not parse dimensions (BG): \"+err.Error())\n\t\t}\n\t\tc.Px, c.Py = c.Dx, c.Dy // composite formats do not show elevation\n\n\t} else { // dimensions of local picture products not defined in header\n\t\tv, ok := dimensionCatalog[c.Product] // lookup in catalog\n\t\tif !ok {\n\t\t\treturn newError(\"parseHeader\", \"no dimension information available\")\n\t\t}\n\n\t\tc.Px, c.Py = v.px, v.py // plain data dimensions\n\t\tc.Dx, c.Dy = v.dx, v.dy // data layer dimensions\n\t\tc.Rx, c.Ry = v.rx, v.ry // data resolution\n\t}\n\n\t// Parse Precision - Example: \"PR E-01\" or \"PR E+00\"\n\tif prec, ok := section[\"E\"]; ok { // not that nice\n\t\tif _, err := fmt.Sscanf(prec, \"%d\", &c.precision); err != nil {\n\t\t\treturn newError(\"parseHeader\", \"could not parse precision: \"+err.Error())\n\t\t}\n\t}\n\n\t// Parse Level - Example \"LV 6 1.0 19.0 28.0 37.0 46.0 55.0\"\n\t// or \"LV12-31.5-24.5-17.5-10.5 -5.5 -1.0 1.0 5.5 10.5 17.5 24.5 31.5\"\n\tif lv, ok := section[\"LV\"]; ok {\n\t\tif len(lv) < 2 {\n\t\t\treturn newError(\"parseHeader\", \"level field too short\")\n\t\t}\n\n\t\tvar cnt int\n\t\tif _, err = fmt.Sscanf(lv[:2], \"%d\", &cnt); err != nil {\n\t\t\treturn newError(\"parseHeader\", \"could not parse level count: \"+err.Error())\n\t\t}\n\n\t\tif len(lv) != cnt*5+2 { // fortran format I2 + F5.1\n\t\t\treturn newError(\"parseHeader\", \"invalid level format: \"+lv)\n\t\t}\n\n\t\tc.level = make([]float32, cnt)\n\t\tfor i := range c.level {\n\t\t\tn := i * 5\n\t\t\tif _, err = fmt.Sscanf(lv[n+2:n+7], \"%f\", &c.level[i]); err != nil {\n\t\t\t\treturn newError(\"parseHeader\", \"invalid level value: \"+err.Error())\n\t\t\t}\n\t\t}\n\t}\n\n\t// Parse Format Version - Example \"VS 5\"\n\tif vs, ok := section[\"VS\"]; ok {\n\t\tif _, err = fmt.Sscanf(vs, \"%d\", &c.Format); err != nil {\n\t\t\treturn newError(\"parseHeader\", \"invalid format value: \"+err.Error())\n\t\t}\n\t}\n\n\treturn nil\n}",
"func (d *Decoder) Parse(o OSMReader, skipHeaderCheck bool) error {\n\n\tif FeatureEnabled(\"INDEXING\") || nil == d.Index {\n\t\td.Index = &BlobIndex{}\n\t}\n\td.Mutex = &sync.Mutex{}\n\n\td.o = o\n\n\tif !skipHeaderCheck {\n\t\theader, _, err := d.block()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t// TODO: parser checks\n\t\tif header.GetType() != \"OSMHeader\" {\n\t\t\treturn fmt.Errorf(\"Invalid header of first data block. Wanted: OSMHeader, have: %s\", header.GetType())\n\t\t}\n\t}\n\n\t// a waitgroup to keep track of which blobs have been processed\n\tvar wgBlobs sync.WaitGroup\n\n\terrChan := make(chan error)\n\t// feeder\n\tblobs := make(chan *OSMPBF.Blob, d.QueueSize)\n\tgo func() {\n\t\tdefer close(blobs)\n\t\tfor {\n\t\t\t_, blob, err := d.block()\n\t\t\tif err != nil {\n\t\t\t\tif err == io.EOF {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\terrChan <- err\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\twgBlobs.Add(1)\n\t\t\tblobs <- blob\n\n\t\t\t// wait at a breakpoint offset\n\t\t\tfor i, offset := range d.Index.Breakpoints {\n\t\t\t\tif d.BytesRead == offset {\n\t\t\t\t\tlog.Println(\"Wait at offset\", offset)\n\t\t\t\t\twgBlobs.Wait()\n\n\t\t\t\t\t// if groups are provided in order to sync breakpoints, trigger them\n\t\t\t\t\tfor _, trigger := range d.Triggers {\n\t\t\t\t\t\tlog.Println(\"Trigger\", i, offset)\n\t\t\t\t\t\ttrigger(i, offset)\n\t\t\t\t\t}\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}()\n\n\tconsumerCount := runtime.GOMAXPROCS(0)\n\n\t// a waitgroup to keep track of which goroutines are still live\n\tvar wg sync.WaitGroup\n\n\tfor i := 0; i < consumerCount; i++ {\n\t\twg.Add(1)\n\t\tgo func() {\n\t\t\tdefer wg.Done()\n\t\t\tfor blob := range blobs {\n\t\t\t\terr := d.readElements(blob)\n\t\t\t\twgBlobs.Done()\n\t\t\t\tif err != nil {\n\t\t\t\t\terrChan <- err\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t}\n\t\t}()\n\t}\n\n\tfinished := make(chan bool)\n\tgo func() {\n\t\twg.Wait()\n\t\tfinished <- true\n\t}()\n\tselect {\n\tcase err := <-errChan:\n\t\treturn err\n\tcase <-finished:\n\n\t\t// save .idx file if applicable\n\t\tif FeatureEnabled(\"INDEXING\") {\n\t\t\td.AutoSaveIndex()\n\t\t}\n\n\t\treturn nil\n\t}\n}",
"func readMobiHeader(b []byte) (*MOBIHeader, error) {\n\theader := &MOBIHeader{}\n\n\tvar err error\n\theader.Identifier = string(b[0:4])\n\theader.Length, err = getUint(b, 4, 4)\n\theader.MobiType, err = getUint(b, 8, 4)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\theader.Encoding, err = getUint(b, 12, 4)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\theader.UniqueID, err = getUint(b, 16, 4)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\theader.FileVersion, err = getUint(b, 20, 4)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\theader.OrthographicIndex, err = getUint(b, 24, 4)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\theader.InflectionIndex, err = getUint(b, 28, 4)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\theader.IndexNames = string(b[32:36])\n\theader.IndexKeys = string(b[36:40])\n\theader.ExtraIndex0 = string(b[40:44])\n\theader.ExtraIndex1 = string(b[44:48])\n\theader.ExtraIndex2 = string(b[48:52])\n\theader.ExtraIndex3 = string(b[52:56])\n\theader.ExtraIndex4 = string(b[56:60])\n\theader.ExtraIndex5 = string(b[60:64])\n\theader.FirstNonBookIndex, err = getUint(b, 64, 4)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\theader.FullNameOffset, err = getUint(b, 68, 4)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\theader.FullNameLength, err = getUint(b, 72, 4)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\theader.Locale, err = getUint(b, 76, 4)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\theader.InputLanguage = string(b[80:84])\n\theader.OutputLangugage = string(b[84:88])\n\theader.MinVersion, err = getUint(b, 88, 4)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\theader.FirstImageIndex, err = getUint(b, 92, 4)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\theader.HuffmanRecordOffset, err = getUint(b, 96, 4)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\theader.HuffmanRecordCount, err = getUint(b, 100, 4)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\theader.HuffmanTableOffset, err = getUint(b, 104, 4)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\theader.HuffmanTableLength, err = getUint(b, 108, 4)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\theader.EXTHFlags, err = getUint(b, 112, 4)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\theader.Unknown1 = b[112:144]\n\theader.Unknown2 = b[144:148]\n\theader.DRMOffset, err = getUint(b, 152, 4)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\theader.DRMCount, err = getUint(b, 156, 4)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\theader.DRMSize, err = getUint(b, 160, 4)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\theader.DRMFlags, err = getUint(b, 164, 4)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\theader.Unknown3 = b[168:176]\n\theader.FirstContentRecordNumber, err = getUint(b, 176, 2)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\theader.LastContentRecordNumber, err = getUint(b, 178, 2)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\theader.Unknown4 = b[180:184]\n\theader.FCISRecordNumber, err = getUint(b, 184, 4)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\theader.Unknown5 = b[188:192]\n\theader.FLISRecordNumber, err = getUint(b, 192, 4)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\theader.Unknown6 = b[196:200]\n\theader.Unknown7 = b[200:208]\n\theader.FirstCompDataSecCount, err = getUint(b, 212, 4)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\theader.NumCompDataSections, err = getUint(b, 216, 4)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\theader.Unknown8 = b[220:224]\n\theader.ExtraRecordDataFlag, err = getUint(b, 224, 4)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif header.Length > 228 {\n\t\theader.INDXRecordOffset, err = getUint(b, 228, 4)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t}\n\tif header.Length > 232 {\n\t\theader.Unknown9 = b[232:236]\n\t\theader.Unknown10 = b[236:240]\n\t\theader.Unknown11 = b[240:244]\n\t\theader.Unknown12 = b[244:248]\n\t\theader.Unknown13 = b[248:252]\n\t\theader.Unknown14 = b[252:256]\n\t}\n\n\treturn header, nil\n}",
"func parseGetResponse(r *bufio.Reader, cb func(*Item)) error {\n\tfor {\n\t\tline, err := r.ReadSlice('\\n')\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tif bytes.Equal(line, resultEnd) {\n\t\t\treturn nil\n\t\t}\n\t\tit := new(Item)\n\t\tsize, err := scanGetResponseLine(line, it)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tit.Value = make([]byte, size+2)\n\t\t_, err = io.ReadFull(r, it.Value)\n\t\tif err != nil {\n\t\t\tit.Value = nil\n\t\t\treturn err\n\t\t}\n\t\tif !bytes.HasSuffix(it.Value, crlf) {\n\t\t\tit.Value = nil\n\t\t\treturn fmt.Errorf(\" corrupt get result read\")\n\t\t}\n\t\tit.Value = it.Value[:size]\n\t\tcb(it)\n\t}\n}",
"func readHeader(l *ledger) stateFn {\n\tbuf := make([]byte, 9)\n\t_, err := l.rd.Read(buf)\n\tif err != nil {\n\t\tlog.Fatal(\"Error parsing Header: \", err)\n\t}\n\tl.emit(item{Head, buf})\n\n\treturn readRecord\n}",
"func parseCorpse(bfr io.ByteReader, char *Character) error {\n\t// Make a buffer that can hold 16 bytes, which can hold the corpse data.\n\tbuf := make([]byte, 16)\n\n\t// Read the first 4 bytes that contain the header string and if the char\n\t// is dead or not.\n\t_, err := io.ReadFull(bfr.(io.Reader), buf[:4])\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tcorpseHeaderData := corpseData{}\n\terr = binary.Read(bytes.NewBuffer(buf), binary.LittleEndian, &corpseHeaderData)\n\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif string(corpseHeaderData.Header[:]) != \"JM\" {\n\t\treturn errors.New(\"failed to find the corpse items header\")\n\t}\n\n\t// The character is currently dead and will have the corpse item list here.\n\tif corpseHeaderData.Count == 1 {\n\t\t// Character is dead, so we'll save the state.\n\t\tchar.IsDead = 1\n\n\t\t// 12 Unknown bytes.\n\t\t_, err := io.ReadFull(bfr.(io.Reader), buf[:12])\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\t_, err = io.ReadFull(bfr.(io.Reader), buf[:4])\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\titemHeaderData := itemData{}\n\t\terr = binary.Read(bytes.NewBuffer(buf), binary.LittleEndian, &itemHeaderData)\n\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tif string(itemHeaderData.Header[:]) != \"JM\" {\n\t\t\treturn errors.New(\"failed to find the merc items header\")\n\t\t}\n\n\t\tcorpseItems, err := ParseItemList(bfr, int(itemHeaderData.Count))\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tchar.CorpseItems = corpseItems\n\t}\n\n\treturn nil\n}",
"func GetHeader(reader *bufio.Reader) (HeaderT, error) {\n\tvar header HeaderT\n\tvar err error\n\n\theader.CallIDsStr = \"\"\n\theader.TotalNumCalls = 0\n\theader.NumRanks = 0\n\theader.DatatypeSize = 0\n\n\talltoallvCallStart := -1\n\talltoallvCallEnd := -1\n\tline := \"\"\n\n\t// Get the first line of the header skipping potential empty lines that\n\t// can be in front of header\n\tvar readerErr error\n\tfor line == \"\" || line == \"\\n\" {\n\t\tline, readerErr = reader.ReadString('\\n')\n\t\tif readerErr == io.EOF {\n\t\t\treturn header, readerErr\n\t\t}\n\t\tif readerErr != nil {\n\t\t\treturn header, readerErr\n\t\t}\n\t}\n\n\t// Are we at the beginning of a metadata block?\n\tif !strings.HasPrefix(line, \"# Raw\") {\n\t\treturn header, fmt.Errorf(\"[ERROR] not a header\")\n\t}\n\n\tfor {\n\t\tline, readerErr = reader.ReadString('\\n')\n\t\tif readerErr != nil && readerErr != io.EOF {\n\t\t\treturn header, readerErr\n\t\t}\n\n\t\tif strings.HasPrefix(line, numberOfRanksMarker) {\n\t\t\tline = strings.ReplaceAll(line, numberOfRanksMarker, \"\")\n\t\t\tline = strings.ReplaceAll(line, \"\\n\", \"\")\n\t\t\theader.NumRanks, err = strconv.Atoi(line)\n\t\t\tif err != nil {\n\t\t\t\tlog.Println(\"[ERROR] unable to parse number of ranks\")\n\t\t\t\treturn header, readerErr\n\t\t\t}\n\t\t}\n\n\t\tif strings.HasPrefix(line, datatypeSizeMarker) {\n\t\t\tline = strings.ReplaceAll(line, \"\\n\", \"\")\n\t\t\tline = strings.ReplaceAll(line, datatypeSizeMarker, \"\")\n\t\t\theader.DatatypeSize, err = strconv.Atoi(line)\n\t\t\tif err != nil {\n\t\t\t\tlog.Println(\"[ERROR] unable to parse the datatype size\")\n\t\t\t\treturn header, readerErr\n\t\t\t}\n\t\t}\n\n\t\tif strings.HasPrefix(line, alltoallvCallNumbersMarker) {\n\t\t\tline = strings.ReplaceAll(line, \"\\n\", \"\")\n\t\t\tcallRange := strings.ReplaceAll(line, alltoallvCallNumbersMarker, \"\")\n\t\t\ttokens := strings.Split(callRange, \"-\")\n\t\t\tif len(tokens) == 2 {\n\t\t\t\talltoallvCallStart, err = strconv.Atoi(strings.TrimLeft(tokens[0], \" \"))\n\t\t\t\tif err != nil {\n\t\t\t\t\tlog.Printf(\"[ERROR] unable to parse line to get first alltoallv call number: %s\", line)\n\t\t\t\t\treturn header, err\n\t\t\t\t}\n\t\t\t\talltoallvCallEnd, err = strconv.Atoi(tokens[1])\n\t\t\t\tif err != nil {\n\t\t\t\t\tlog.Printf(\"[ERROR] unable to convert %s to interger: %s\", tokens[1], err)\n\t\t\t\t\treturn header, err\n\t\t\t\t}\n\t\t\t\theader.TotalNumCalls = alltoallvCallEnd - alltoallvCallStart + 1 // Add 1 because we are 0-indexed\n\t\t\t}\n\t\t}\n\n\t\tif strings.HasPrefix(line, marker) {\n\t\t\tline = strings.ReplaceAll(line, \"\\n\", \"\")\n\t\t\tstrParsing := line\n\t\t\ttokens := strings.Split(line, \" - \")\n\t\t\tif len(tokens) > 1 {\n\t\t\t\tstrParsing = tokens[0]\n\t\t\t\theader.CallIDsStr = tokens[1]\n\t\t\t\ttokens2 := strings.Split(header.CallIDsStr, \" (\")\n\t\t\t\tif len(tokens2) > 1 {\n\t\t\t\t\theader.CallIDsStr = tokens2[0]\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tstrParsing = strings.ReplaceAll(strParsing, marker, \"\")\n\t\t\tstrParsing = strings.ReplaceAll(strParsing, \" calls\", \"\")\n\n\t\t\tif header.CallIDsStr != \"\" {\n\t\t\t\theader.CallIDs, err = notation.ConvertCompressedCallListToIntSlice(header.CallIDsStr)\n\t\t\t\tif err != nil {\n\t\t\t\t\tlog.Printf(\"[ERROR] unable to parse calls IDs: %s\", err)\n\t\t\t\t\treturn header, err\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// We check for the beginning of the actual data\n\t\tif strings.HasPrefix(line, beginningDataMarker) {\n\t\t\tbreak\n\t\t}\n\n\t\tif readerErr == io.EOF {\n\t\t\treturn header, readerErr\n\t\t}\n\t}\n\n\treturn header, nil\n}",
"func loaditems() ([]item, error) {\r\n f, err := os.Open(pricefilepath)\r\n if err != nil {\r\n return nil, err\r\n }\r\n\r\n tsv := csv.NewReader(f)\r\n tsv.Comma = '\\t'\r\n tsv.ReuseRecord = true\r\n\r\n items := make([]item, 0, 32)\r\n\r\n for {\r\n vals, err := tsv.Read()\r\n if err != nil && err != io.EOF {\r\n f.Close()\r\n return nil, err\r\n }\r\n\r\n if len(vals) == 0 && err == io.EOF {\r\n break\r\n }\r\n\r\n var t time.Time\r\n if err := t.UnmarshalText([]byte(vals[0])); err != nil {\r\n log.Println(vals[0], err)\r\n continue\r\n }\r\n items = append(items, item{\r\n Seen: t,\r\n Label: vals[1],\r\n Offer: vals[2],\r\n })\r\n }\r\n\r\n if err := f.Close(); err != nil {\r\n return nil, err\r\n }\r\n\r\n return items, nil\r\n}",
"func (c *AuctionController) parse(rawAuctions *RawAuctions, characterName, serverType string) {\n\tvar auctions []Auction\n\tvar outerWait sync.WaitGroup\n\n\tc.ItemTrie = trie.NewTrie()\n\tc.ItemTrie.Add(\"selling\")\n\tc.ItemTrie.Add(\"buying\")\n\tc.ItemTrie.Add(\"wtb\")\n\tc.ItemTrie.Add(\"wts\")\n\tc.ItemTrie.Add(\"ea\")\n\tc.ItemTrie.Add(\"each\")\n\tc.ItemTrie.Add(\"per\")\n\n\t// Load all items into Trie structure\n\titemQuery := \"SELECT displayName, id FROM items ORDER BY displayName ASC\"\n\trows := DB.Query(itemQuery)\n\tif rows != nil {\n\t\tfor rows.Next() {\n\t\t\tvar itemName string\n\t\t\tvar itemId int64\n\n\t\t\trows.Scan(&itemName, &itemId)\n\t\t\tif itemId > 0 && itemName != \"\" {\n\t\t\t\tc.ItemTrie.Add(strings.ToLower(itemName))\n\t\t\t}\n\t\t}\n\t}\n\n\tfor _, line := range rawAuctions.Lines {\n\t\touterWait.Add(1)\n\t\tgo c.parseLine(line, characterName, serverType, &outerWait, &auctions)\n\t}\n\n\touterWait.Wait()\n\tfmt.Println(\"Processed all lines\")\n\n\tif len(auctions) > 0 {\n\t\tc.saveAuctionData(auctions)\n\t}\n}",
"func (m *IniMapper) Read() ([]*Item, error) {\n\tr, err := m.reader()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tcfg, err := ini.Load(r)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\titems := make([]*Item, 0)\n\n\tfor _, section := range cfg.Sections() {\n\t\tif section.Name() == ini.DefaultSection {\n\t\t\tcontinue\n\t\t}\n\n\t\titem := &Item{Name: section.Name()}\n\t\tif err := section.MapTo(&item); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\td, err := m.parseAlgorithmFn(item.Algorithm)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\titem.digest = d\n\n\t\tif item.Key == \"\" {\n\t\t\tcontinue\n\t\t}\n\n\t\titems = append(items, item)\n\t}\n\n\treturn items, nil\n}",
"func (c *Client) Parse(ctx context.Context, input io.Reader) (string, error) {\n\treturn c.ParseWithHeader(ctx, input, nil)\n}",
"func FetchBodyStructure(header textproto.Header, body io.Reader, extended bool) (*imap.BodyStructure, error) {\n\tbs := new(imap.BodyStructure)\n\n\tmediaType, mediaParams, err := mime.ParseMediaType(header.Get(\"Content-Type\"))\n\tif err == nil {\n\t\ttypeParts := strings.SplitN(mediaType, \"/\", 2)\n\t\tbs.MIMEType = typeParts[0]\n\t\tif len(typeParts) == 2 {\n\t\t\tbs.MIMESubType = typeParts[1]\n\t\t}\n\t\tbs.Params = mediaParams\n\t} else {\n\t\tbs.MIMEType = \"text\"\n\t\tbs.MIMESubType = \"plain\"\n\t}\n\n\tbs.Id = header.Get(\"Content-Id\")\n\tbs.Description = header.Get(\"Content-Description\")\n\tbs.Encoding = header.Get(\"Content-Transfer-Encoding\")\n\n\tif mr := multipartReader(header, body); mr != nil {\n\t\tvar parts []*imap.BodyStructure\n\t\tfor {\n\t\t\tp, err := mr.NextPart()\n\t\t\tif err == io.EOF {\n\t\t\t\tbreak\n\t\t\t} else if err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\n\t\t\tpbs, err := FetchBodyStructure(p.Header, p, extended)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tparts = append(parts, pbs)\n\t\t}\n\t\tbs.Parts = parts\n\t} else {\n\t\tcountedBody := countReader{r: body}\n\t\tneedLines := false\n\t\tif bs.MIMEType == \"message\" && bs.MIMESubType == \"rfc822\" {\n\t\t\t// This will result in double-buffering if body is already a\n\t\t\t// bufio.Reader (most likely it is). :\\\n\t\t\tbufBody := bufio.NewReader(&countedBody)\n\t\t\tsubMsgHdr, err := textproto.ReadHeader(bufBody)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tbs.Envelope, err = FetchEnvelope(subMsgHdr)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tbs.BodyStructure, err = FetchBodyStructure(subMsgHdr, bufBody, extended)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, err\n\t\t\t}\n\t\t\tneedLines = true\n\t\t} else if bs.MIMEType == \"text\" {\n\t\t\tneedLines = true\n\t\t}\n\t\tif _, err := io.Copy(ioutil.Discard, &countedBody); err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tbs.Size = countedBody.bytes\n\t\tif needLines {\n\t\t\tbs.Lines = countedBody.newlines\n\t\t}\n\t}\n\n\tif extended {\n\t\tbs.Extended = true\n\t\tbs.Disposition, bs.DispositionParams, _ = mime.ParseMediaType(header.Get(\"Content-Disposition\"))\n\n\t\t// TODO: bs.Language, bs.Location\n\t\t// TODO: bs.MD5\n\t}\n\n\treturn bs, nil\n}",
"func getItems() []Item {\n raw, err := ioutil.ReadFile(\"./movie_data_2.json\")\n\n if err != nil {\n fmt.Println(err.Error())\n os.Exit(1)\n }\n\n var items []Item\t\t\t\t\t\t// decode destination. Slice of struct maps to an array of json objects.\n json.Unmarshal(raw, &items)\n return items\n}",
"func (p *Parser) Parse(ctx context.Context) (err error) {\n\tif p.err != nil {\n\t\treturn err\n\t}\n\n\tdefer func() {\n\t\tif err != nil {\n\t\t\tp.err = err\n\t\t}\n\t}()\n\tif p.header == nil {\n\t\tif err := p.parseHeader(); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\twg := sync.WaitGroup{}\n\tblocks := make(chan []byte)\n\n\tfor i := 0; i < p.conf.Concurrency; i++ {\n\t\twg.Add(1)\n\t\tgo func() {\n\t\t\tfor block := range blocks {\n\t\t\t\tp.parseBlock(block)\n\t\t\t}\n\t\t\tif p.waySync != nil {\n\t\t\t\tp.waySync.doneWait()\n\t\t\t}\n\t\t\tif p.relSync != nil {\n\t\t\t\tp.relSync.doneWait()\n\t\t\t}\n\t\t\twg.Done()\n\t\t}()\n\t}\n\nread:\n\tfor {\n\t\theader, data, err := nextBlock(p.r)\n\t\tif err == io.EOF {\n\t\t\tbreak read\n\t\t}\n\t\tif err != nil {\n\t\t\tclose(blocks)\n\t\t\treturn errors.Wrap(err, \"parsing next block\")\n\t\t}\n\t\tif header.GetType() != \"OSMData\" {\n\t\t\tclose(blocks)\n\t\t\treturn errors.New(\"next block not of type OSMData but \" + header.GetType())\n\t\t}\n\t\tselect {\n\t\tcase <-ctx.Done():\n\t\t\tfmt.Println(\"done\")\n\t\t\tbreak read\n\t\tcase blocks <- data:\n\t\t}\n\t}\n\n\tclose(blocks)\n\twg.Wait()\n\n\tif !p.conf.KeepOpen {\n\t\tif p.conf.Coords != nil {\n\t\t\tclose(p.conf.Coords)\n\t\t}\n\t\tif p.conf.Nodes != nil {\n\t\t\tclose(p.conf.Nodes)\n\t\t}\n\t\tif p.conf.Ways != nil {\n\t\t\tclose(p.conf.Ways)\n\t\t}\n\t\tif p.conf.Relations != nil {\n\t\t\tclose(p.conf.Relations)\n\t\t}\n\t}\n\n\treturn ctx.Err()\n}",
"func parseBundleHeader(t testing.TB) {\n\tvar line = \"200123138010412104288220180905201809059999 1 01 \"\n\tr := NewReader(strings.NewReader(line))\n\tr.line = line\n\tclh := mockCashLetterHeader()\n\tr.addCurrentCashLetter(NewCashLetter(clh))\n\tbh := mockBundleHeader()\n\tr.currentCashLetter.AddBundle(NewBundle(bh))\n\n\trequire.NoError(t, r.parseBundleHeader())\n\n\trecord := r.currentCashLetter.currentBundle.BundleHeader\n\trequire.Equal(t, \"20\", record.recordType)\n\trequire.Equal(t, \"01\", record.CollectionTypeIndicatorField())\n\trequire.Equal(t, \"231380104\", record.DestinationRoutingNumberField())\n\trequire.Equal(t, \"121042882\", record.ECEInstitutionRoutingNumberField())\n\trequire.Equal(t, \"20180905\", record.BundleBusinessDateField())\n\trequire.Equal(t, \"20180905\", record.BundleCreationDateField())\n\trequire.Equal(t, \"9999 \", record.BundleIDField())\n\trequire.Equal(t, \"1 \", record.BundleSequenceNumberField())\n\trequire.Equal(t, \"01\", record.CycleNumberField())\n\trequire.Equal(t, \" \", record.ReturnLocationRoutingNumberField())\n\trequire.Equal(t, \" \", record.UserFieldField())\n\trequire.Equal(t, \" \", record.reservedField())\n}",
"func Parse(item *model.Item, lastModifiedDate time.Time, lines []string) (parseError error) {\n\n\t// find the meta data section\n\tmetaDataLines := GetMetaDataLines(lines)\n\n\t// create a new meta data object\n\tmetaData := model.NewMetaData()\n\n\t// parse the different attributes\n\tremainingLines := parseLanguage(metaData, metaDataLines)\n\tremainingLines = parseAuthor(metaData, remainingLines)\n\tremainingLines = parseAlias(metaData, remainingLines)\n\tremainingLines = parseCreationDate(metaData, lastModifiedDate, remainingLines)\n\tremainingLines = parseLastModifiedDate(metaData, lastModifiedDate, remainingLines)\n\tremainingLines = parseTags(metaData, remainingLines)\n\tremainingLines = parseGeoInformation(metaData, remainingLines)\n\n\t// assign the meta data to the item\n\titem.MetaData = *metaData\n\treturn\n}",
"func (m *Mp4Reader) Parse() error {\n\tif m.Size == 0 {\n\t\tif ofile, ok := m.Reader.(*os.File); ok {\n\t\t\tinfo, err := ofile.Stat()\n\t\t\tif err != nil {\n\t\t\t\tfmt.Fprintln(os.Stderr, err)\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tm.Size = info.Size()\n\t\t}\n\t}\n\n\tboxes := readBoxes(m, int64(0), m.Size)\n\tfor _, box := range boxes {\n\t\tswitch box.Name {\n\t\tcase \"ftyp\":\n\t\t\tm.Ftyp = &FtypBox{Box: box}\n\t\t\tm.Ftyp.parse()\n\t\tcase \"mdat\":\n\t\t\tm.Mdat = &MdatBox{Box: box}\n\t\tcase \"moov\":\n\t\t\tm.Moov = &MoovBox{Box: box}\n\t\t\tm.Moov.parse()\n\n\t\t\tm.IsFragmented = m.Moov.IsFragmented\n\t\t}\n\t}\n\treturn nil\n}",
"func (m *Mail) reader(mailReader *mail.Reader) {\n\theader := mailReader.Header\n\tfrom, err := header.AddressList(\"From\")\n\tif err != nil {\n\t\tlogger.ErrorJ(m.lc, fmt.Sprint(\"Error parsing the email header: \", err.Error()))\n\t\treturn\n\t}\n\n\tif len(from) == 0 {\n\t\tlogger.ErrorJ(m.lc, \"Error, message header does not contain addresses\")\n\t\treturn\n\t}\n\n\tfirstAddress := from[0].Address\n\n\tif len(firstAddress) == 0 {\n\t\tlogger.ErrorJ(m.lc, \"Empty email address\")\n\t\treturn\n\t}\n\n\tsubject, err := header.Subject()\n\tif err != nil {\n\t\tlogger.ErrorJ(m.lc, fmt.Sprint(\"Error parsing Subject header: \", err.Error()))\n\t\treturn\n\t}\n\n\tsubjectData := subjectData{}\n\n\tif err := json.Unmarshal([]byte(subject), &subjectData); err != nil {\n\t\tlogger.ErrorJ(m.lc, fmt.Sprint(\"Error parsing JSON data in Subject field: \", err.Error()))\n\t\treturn\n\t}\n\n\tif subjectData.Description != m.serviceMask {\n\t\tlogger.InfoJ(m.lc, \"Wrong service's name, skiped...\")\n\t\treturn\n\t}\n\n\tif subjectData.UUID != m.serviceID {\n\t\tlogger.InfoJ(m.lc, \"Wrong service's id, skiped...\")\n\t\treturn\n\t}\n\n\tm.parts(mailReader, firstAddress)\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
If the character has a golem, we'll read the item list for the golem, since an iron golem is made from an item, the properties of that item is stored.
|
func parseIronGolem(bfr io.ByteReader, char *Character) error {
// Make a buffer that can hold 3 bytes, which can hold the items header.
buf := make([]byte, 3)
_, err := io.ReadFull(bfr.(io.Reader), buf[:3])
if err != nil {
return err
}
golemHeaderData := golemData{}
err = binary.Read(bytes.NewBuffer(buf), binary.LittleEndian, &golemHeaderData)
if err != nil {
return err
}
if string(golemHeaderData.Header[:]) != "kf" {
return errors.New("failed to find the golem header")
}
if golemHeaderData.HasGolem == 1 {
item, err := ParseItemList(bfr, 1)
if err != nil {
return err
}
char.GolemItem = &item[0]
}
return nil
}
|
[
"func (c *Character) item(e rune, a action) (items.Item, error) {\n\tswitch a {\n\tcase ReadAction:\n\t\treturn c.inv.Read(e, c.Stats)\n\tcase DropAction:\n\t\treturn c.inv.Drop(e, c.Stats)\n\tcase WearAction:\n\t\treturn c.inv.Wear(e, c.Stats)\n\tcase WieldAction:\n\t\treturn c.inv.Wield(e, c.Stats)\n\tcase TakeOffAction:\n\t\treturn c.inv.TakeOff(e, c.Stats)\n\tcase QuaffAction:\n\t\treturn c.inv.Quaff(e, c.Stats)\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"Invalid action %v\", a)\n\t}\n}",
"func (p *parser) GetCharacter(a *goquery.Selection) []model.TopCharacter {\n\tv := character{area: a, cleanImg: p.cleanImg}\n\tv.setDetail()\n\treturn v.data\n}",
"func DecodeCharItem(b []byte) (*CharItem, error) {\n\tif len(b) < CharItemSize {\n\t\treturn nil, wlerr.Errorf(\n\t\t\t\"failed to parse item: data too short: have=%d want>=%d\",\n\t\t\tlen(b), CharItemSize)\n\t}\n\n\treturn &CharItem{\n\t\tID: int(b[0]),\n\t\tAmmo: int(b[1] & 0x7f),\n\t\tJammed: b[1]&0x80 != 0,\n\t}, nil\n}",
"func (i Iter) Item() Item { return i.Node().Item }",
"func parseItems(bfr io.ByteReader, char *Character) error {\n\t// Make a buffer that can hold 4 bytes, which can hold the items header.\n\tbuf := make([]byte, 4)\n\n\t_, err := io.ReadFull(bfr.(io.Reader), buf)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\titemHeaderData := itemData{}\n\tif err := binary.Read(bytes.NewBuffer(buf), binary.LittleEndian, &itemHeaderData); err != nil {\n\t\treturn err\n\t}\n\n\tif string(itemHeaderData.Header[:]) != \"JM\" {\n\t\treturn errors.New(\"failed to find the items header\")\n\t}\n\n\tchar.Items, err = ParseItemList(bfr, int(itemHeaderData.Count))\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}",
"func LoadItems(character string, path string, filename string) (charData CharData, FileData []byte) {\n\t// selected character\n\tcharacterPath := path + filename\n\t// log.Println(\"characterPath:\", characterPath)\n\n\t// read all data from selected character\n\tfullData := utils.ReadFileFromPath(characterPath)\n\n\t// log.Println(\"filesize:\", len(fullData))\n\n\t// parse file\n\tcharData = ParseFile(character, fullData)\n\n\treturn charData, fullData\n}",
"func (r *renderer) ListItem(w io.Writer, node *blackfriday.Node, entering bool) blackfriday.WalkStatus {\n\tif r.currentChange != nil {\n\t\tvar buf bytes.Buffer\n\t\tr.renderInline(&buf, node, entering)\n\t\titem := &chg.Item{Description: buf.String()}\n\t\tr.currentChange.Items = append(r.currentChange.Items, item)\n\t}\n\n\treturn blackfriday.SkipChildren\n}",
"func (e *Equipment) Unequip(alias string) (ok bool, item *Item) {\n\tok = false\n\n\tif e.Head != (*Item)(nil) {\n\t\tif strings.Contains(strings.ToLower(e.Head.Name), strings.ToLower(alias)) {\n\t\t\titem = e.Head\n\t\t\te.Head = (*Item)(nil)\n\t\t\tok = true\n\t\t}\n\t}\n\tif e.Chest != (*Item)(nil) {\n\t\tif strings.Contains(strings.ToLower(e.Chest.Name), strings.ToLower(alias)) {\n\t\t\titem = e.Chest\n\t\t\te.Chest = (*Item)(nil)\n\t\t\tok = true\n\t\t}\n\t}\n\tif e.Neck != (*Item)(nil) {\n\t\tif strings.Contains(strings.ToLower(e.Neck.Name), strings.ToLower(alias)) {\n\t\t\titem = e.Neck\n\t\t\te.Neck = (*Item)(nil)\n\t\t\tok = true\n\t\t}\n\t}\n\tif e.Legs != (*Item)(nil) {\n\t\tif strings.Contains(strings.ToLower(e.Legs.Name), strings.ToLower(alias)) {\n\t\t\titem = e.Legs\n\t\t\te.Legs = (*Item)(nil)\n\t\t\tok = true\n\t\t}\n\t}\n\tif e.Feet != (*Item)(nil) {\n\t\tif strings.Contains(strings.ToLower(e.Feet.Name), strings.ToLower(alias)) {\n\t\t\titem = e.Feet\n\t\t\te.Feet = (*Item)(nil)\n\t\t\tok = true\n\t\t}\n\t}\n\tif e.Arms != (*Item)(nil) {\n\t\tif strings.Contains(strings.ToLower(e.Arms.Name), strings.ToLower(alias)) {\n\t\t\titem = e.Arms\n\t\t\te.Arms = (*Item)(nil)\n\t\t\tok = true\n\t\t}\n\t}\n\tif e.Hands != (*Item)(nil) {\n\t\tif strings.Contains(strings.ToLower(e.Hands.Name), strings.ToLower(alias)) {\n\t\t\titem = e.Hands\n\t\t\te.Hands = (*Item)(nil)\n\t\t\tok = true\n\t\t}\n\t}\n\tif e.Ring1 != (*Item)(nil) {\n\t\tif strings.Contains(strings.ToLower(e.Ring1.Name), strings.ToLower(alias)) {\n\t\t\titem = e.Ring1\n\t\t\te.Ring1 = (*Item)(nil)\n\t\t\tok = true\n\t\t}\n\t}\n\tif e.Ring2 != (*Item)(nil) {\n\t\tif strings.Contains(strings.ToLower(e.Ring2.Name), strings.ToLower(alias)) {\n\t\t\titem = e.Ring2\n\t\t\te.Ring2 = (*Item)(nil)\n\t\t\tok = true\n\t\t}\n\t}\n\tif e.Main != (*Item)(nil) {\n\t\tif strings.Contains(strings.ToLower(e.Main.Name), strings.ToLower(alias)) {\n\t\t\titem = e.Main\n\t\t\te.Main = (*Item)(nil)\n\t\t\tok = true\n\t\t}\n\t}\n\tif e.Off != (*Item)(nil) {\n\t\tif strings.Contains(strings.ToLower(e.Off.Name), strings.ToLower(alias)) {\n\t\t\titem = e.Off\n\t\t\te.Off = (*Item)(nil)\n\t\t\tok = true\n\t\t}\n\t}\n\n\t// Update armor values\n\tif ok && item != (*Item)(nil) {\n\t\te.Armor -= item.Armor\n\t\te.Weight -= item.Weight\n\t}\n\treturn ok, item\n}",
"func (g *Game) findItem(hero *Hero) {\n\n items := []string{\"weapon\", \"tunic\", \"shield\", \"leggings\", \"ring\", \"gloves\", \"boots\", \"helm\", \"charm\", \"amulet\"}\n\n findChance := []float32{100.00, 91.93227152, 84.51542547, 77.69695042, 71.42857143, 65.66590823, 60.36816105, 55.49782173,\n 51.02040816, 46.90422016, 43.12011504, 39.64130124, 36.44314869, 33.5030144, 30.80008217, 28.31521517, 26.03082049,\n 23.93072457, 22.00005869, 20.22515369, 18.59344321, 17.0933747, 15.71432764, 14.44653835, 13.28103086, 12.20955335,\n 11.22451974, 10.31895597, 9.486450616, 8.721109539, 8.017514101, 7.370682832, 6.776036155, 6.229363956, 5.726795786,\n 5.264773452, 4.840025825, 4.449545683, 4.090568419, 3.760552466, 3.457161303, 3.178246916, 2.921834585, 2.686108904,\n 2.469400931, 2.270176369, 2.087024703, 1.918649217, 1.763857808, 1.621554549, 1.490731931}\n\n var itemType string\n var newItemLevel int\n var itemFoundChance float32\n found := false\n\n for i := hero.Level; i > 0; i-- {\n\n if i > 50 {\n //After Hero Level of 50, has a 1% chance to find an item.\n itemFoundChance = 1.0\n } else {\n itemFoundChance = findChance[i]\n }\n\n //Start with highest Level Item and subtract a level as it misses the chance\n if rand.Intn(100) <= int(itemFoundChance) {\n // Item found!\n found = true\n itemGainPercentage := float64(rand.Intn(100))\n newItemLevel = int(float64(i) + (float64(i) * (itemGainPercentage / 100)))\n itemType = items[rand.Intn(10)]\n break\n }\n }\n\n if found {\n currentItemLevel := hero.getItemLevel(itemType)\n\n log.Debugf(\"Item Found: %s | Hero Level: %d | Current Item Level: %d | New Item Level: %d\", itemType, hero.Level, currentItemLevel, newItemLevel)\n\n var message string\n verb := \"is\"\n\n if itemType == \"leggings\" || itemType == \"gloves\" || itemType == \"boots\" {\n verb = \"are\"\n }\n\n if newItemLevel > currentItemLevel {\n // Replace the current item value with the new one\n hero.updateItem(itemType, newItemLevel)\n message = fmt.Sprintf(\"%s found a level %d %s! Your current %s %s only level %d, so it seems luck is with you!\", hero.HeroName, newItemLevel, itemType, itemType, verb, currentItemLevel)\n } else {\n // Message back to player that current item level is better\n message = fmt.Sprintf(\"%s found a level %d %s! Your current %s %s level %d, so it seems Luck is against you. You toss the %s\", hero.HeroName, newItemLevel, itemType, itemType, verb, currentItemLevel, itemType)\n }\n\n g.sendEvent(message, hero)\n } else {\n log.Debugf(\"No items found for Hero: %s (ID: %d) | Level: %d\", hero.HeroName, hero.id, hero.Level)\n }\n}",
"func (c *Character) Gems() map[rune]*items.Gem {\n\tgems := make(map[rune]*items.Gem)\n\tfor r, item := range c.inv.inv {\n\t\tif g, ok := item.(*items.Gem); ok {\n\t\t\tgems[r] = g\n\t\t}\n\t}\n\n\treturn gems\n}",
"func (d *OPL) ReadWay(item gosmparse.Way) {\n\n\t// discard selected tags\n\titem.Tags = tags.Trim(item.Tags)\n\tDeleteTags(item.Tags, discardableTags)\n\tDeleteTags(item.Tags, uninterestingTags)\n\n\t// way\n\tvar parts []string\n\n\t// id\n\tparts = append(parts, \"w\"+strconv.FormatInt(item.ID, 10))\n\n\t// tags\n\tvar tags []string\n\tfor key, val := range item.Tags {\n\t\ttags = append(tags, key+\"=\"+encode(val))\n\t}\n\tparts = append(parts, \"T\"+strings.Join(tags, \",\"))\n\n\t// node refs\n\tvar refs []string\n\tfor _, val := range item.NodeIDs {\n\t\trefs = append(refs, \"n\"+strconv.FormatInt(val, 10))\n\t}\n\tparts = append(parts, \"N\"+strings.Join(refs, \",\"))\n\n\td.Mutex.Lock()\n\tfmt.Println(strings.Join(parts, \" \"))\n\td.Mutex.Unlock()\n}",
"func (client *BlizzardClient) GetCharacterEquipment(realmSlug, character, token string) (*data.Equipment, error) {\n\trealmSlug = strings.ToLower(realmSlug)\n\tcharacter = strings.ToLower(character)\n\tendpoint := fmt.Sprintf(\"profile/wow/character/%s/%s/equipment?namespace=profile-us&locale=en_US&access_token=%s\", realmSlug, character, token)\n\n\tresp, err := client.Get(client.BaseURL + endpoint)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tdefer resp.Body.Close()\n\n\tequipment := &data.Equipment{}\n\tjson.NewDecoder(resp.Body).Decode(&equipment)\n\n\treturn equipment, nil\n}",
"func (c *Cursor) Item() Item {\n\treturn c.item\n}",
"func (p *parser) GetCharacters(a *goquery.Selection) []model.Role {\n\tv := character{area: a, cleanImg: p.cleanImg}\n\tv.setDetail()\n\treturn v.data\n}",
"func Itemize(context *Context, text string, startIndex int32, length int32, attrs *AttrList, cachedIter *AttrIterator) *glib.List {\n\tc_context := (*C.PangoContext)(C.NULL)\n\tif context != nil {\n\t\tc_context = (*C.PangoContext)(context.ToC())\n\t}\n\n\tc_text := C.CString(text)\n\tdefer C.free(unsafe.Pointer(c_text))\n\n\tc_start_index := (C.int)(startIndex)\n\n\tc_length := (C.int)(length)\n\n\tc_attrs := (*C.PangoAttrList)(C.NULL)\n\tif attrs != nil {\n\t\tc_attrs = (*C.PangoAttrList)(attrs.ToC())\n\t}\n\n\tc_cached_iter := (*C.PangoAttrIterator)(C.NULL)\n\tif cachedIter != nil {\n\t\tc_cached_iter = (*C.PangoAttrIterator)(cachedIter.ToC())\n\t}\n\n\tretC := C.pango_itemize(c_context, c_text, c_start_index, c_length, c_attrs, c_cached_iter)\n\tretGo := glib.ListNewFromC(unsafe.Pointer(retC))\n\n\treturn retGo\n}",
"func (p *Player) UseItemScroll(item *cm.UserItem) bool {\n\tswitch item.Info.Shape {\n\tcase 0: //DE\n\t\ttemp := env.GetMap(p.BindMapIndex)\n\t\tfor i := 0; i < 20; i++ {\n\t\t\tx := int(p.BindLocation.X) + util.RandomInt(-100, 100)\n\t\t\ty := int(p.BindLocation.Y) + util.RandomInt(-100, 100)\n\t\t\tloc := cm.NewPoint(x, y)\n\t\t\tif p.Teleport(temp, loc) {\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\tcase 1: //TT\n\t\tif !p.Teleport(env.GetMap(p.BindMapIndex), p.BindLocation) {\n\t\t\treturn false\n\t\t}\n\tcase 2: //RT\n\t\tif !p.TeleportRandom(200, item.Info.Durability, p.Map) {\n\t\t\treturn true\n\t\t}\n\tcase 3: //BenedictionOil\n\t\t// if (!TryLuckWeapon()) {\n\t\t// \tEnqueue(p);\n\t\t// }\n\t\t/*\n\t\t\tcase 4: //RepairOil\n\t\t\t\ttemp = Info.Equipment[(int)EquipmentSlot.Weapon];\n\t\t\t\tif (temp == null || temp.MaxDura == temp.CurrentDura) {\n\t\t\t\t\tEnqueue(p);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (temp.Info.Bind.HasFlag(BindMode.DontRepair)) {\n\t\t\t\t\tEnqueue(p);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\ttemp.MaxDura = (ushort)Math.Max(0, temp.MaxDura - Math.Min(5000, temp.MaxDura - temp.CurrentDura) / 30);\n\n\t\t\t\ttemp.CurrentDura = (ushort)Math.Min(temp.MaxDura, temp.CurrentDura + 5000);\n\t\t\t\ttemp.DuraChanged = false;\n\n\t\t\t\tReceiveChat(\"Your weapon has been partially repaired\", ChatType.Hint);\n\t\t\t\tEnqueue(new S.ItemRepaired { UniqueID = temp.UniqueID, MaxDura = temp.MaxDura, CurrentDura = temp.CurrentDura });\n\t\t\tcase 5: //WarGodOil\n\t\t\t\ttemp = Info.Equipment[(int)EquipmentSlot.Weapon];\n\t\t\t\tif (temp == null || temp.MaxDura == temp.CurrentDura) {\n\t\t\t\t\tEnqueue(p);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (temp.Info.Bind.HasFlag(BindMode.DontRepair) || (temp.Info.Bind.HasFlag(BindMode.NoSRepair))) {\n\t\t\t\t\tEnqueue(p);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\ttemp.CurrentDura = temp.MaxDura;\n\t\t\t\ttemp.DuraChanged = false;\n\n\t\t\t\tReceiveChat(\"Your weapon has been completely repaired\", ChatType.Hint);\n\t\t\t\tEnqueue(new S.ItemRepaired { UniqueID = temp.UniqueID, MaxDura = temp.MaxDura, CurrentDura = temp.CurrentDura });\n\t\t\tcase 6: //ResurrectionScroll\n\t\t\t\tif (CurrentMap.Info.NoReincarnation) {\n\t\t\t\t\tReceiveChat(string.Format(\"Cannot use on this map\"), ChatType.System);\n\t\t\t\t\tEnqueue(p);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (Dead) {\n\t\t\t\t\tMP = MaxMP;\n\t\t\t\t\tRevive(MaxHealth, true);\n\t\t\t\t}\n\t\t\tcase 7: //CreditScroll\n\t\t\t\tif (item.Info.Price > 0)\n\t\t\t\t{\n\t\t\t\t\tGainCredit(item.Info.Price);\n\t\t\t\t\tReceiveChat(String.Format(\"{0} Credits have been added to your Account\", item.Info.Price), ChatType.Hint);\n\t\t\t\t}\n\t\t\tcase 8: //MapShoutScroll\n\t\t\t\tHasMapShout = true;\n\t\t\t\tReceiveChat(\"You have been given one free shout across your current map\", ChatType.Hint);\n\t\t\tcase 9://ServerShoutScroll\n\t\t\t\tHasServerShout = true;\n\t\t\t\tReceiveChat(\"You have been given one free shout across the server\", ChatType.Hint);\n\t\t\tcase 10://GuildSkillScroll\n\t\t\t\tMyGuild.NewBuff(item.Info.Effect, false);\n\t\t\tcase 11://HomeTeleport\n\t\t\t\tif (MyGuild != null && MyGuild.Conquest != null && !MyGuild.Conquest.WarIsOn && MyGuild.Conquest.PalaceMap != null && !TeleportRandom(200, 0, MyGuild.Conquest.PalaceMap)) {\n\t\t\t\t\tEnqueue(p);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\tcase 12://LotteryTicket\n\t\t\t\tif (Envir.Random.Next(item.Info.Effect * 32) == 1){ // 1st prize : 1,000,000\n\t\t\t\t\tReceiveChat(\"You won 1st Prize! Received 1,000,000 gold\", ChatType.Hint);\n\t\t\t\t\tGainGold(1000000);\n\t\t\t\t} else if (Envir.Random.Next(item.Info.Effect * 16) == 1) { // 2nd prize : 200,000\n\t\t\t\t\tReceiveChat(\"You won 2nd Prize! Received 200,000 gold\", ChatType.Hint);\n\t\t\t\t\tGainGold(200000);\n\t\t\t\t} else if (Envir.Random.Next(item.Info.Effect * 8) == 1) {// 3rd prize : 100,000\n\t\t\t\t\tReceiveChat(\"You won 3rd Prize! Received 100,000 gold\", ChatType.Hint);\n\t\t\t\t\tGainGold(100000);\n\t\t\t\t} else if (Envir.Random.Next(item.Info.Effect * 4) == 1) {// 4th prize : 10,000\n\t\t\t\t\tReceiveChat(\"You won 4th Prize! Received 10,000 gold\", ChatType.Hint);\n\t\t\t\t\tGainGold(10000);\n\t\t\t\t} else if (Envir.Random.Next(item.Info.Effect * 2) == 1) { // 5th prize : 1,000\n\t\t\t\t\tReceiveChat(\"You won 5th Prize! Received 1,000 gold\", ChatType.Hint);\n\t\t\t\t\tGainGold(1000);\n\t\t\t\t} else if (Envir.Random.Next(item.Info.Effect) == 1) {// 6th prize 500\n\t\t\t\t\tReceiveChat(\"You won 6th Prize! Received 500 gold\", ChatType.Hint);\n\t\t\t\t\tGainGold(500);\n\t\t\t\t} else {\n\t\t\t\t\tReceiveChat(\"You haven't won anything.\", ChatType.Hint);\n\t\t\t\t}\n\t\t*/\n\t}\n\n\treturn true\n}",
"func Useitem(item1 models.Item, action int, cp models.Player) (models.Item, models.Player) {\n\t//monster := models.Chosenmonsterget()\n\t//mid := monster.Number //number for chosen monster\n\tswitch {\n\tcase item1.Name == \"phone\":\n\t\tswitch action {\n\t\tcase 0:\n\t\t\tfmt.Println(\"You attempt to call and hear only silence. There is no reception.\")\n\t\tcase 1:\n\t\t\tfmt.Println(\"You attempt to call and hear only silence. There is no reception.\")\n\t\tcase 2:\n\t\t\tfmt.Println(\"You attempt to call and hear only silence. There is no reception.\")\n\t\tdefault:\n\t\t\tfmt.Println(\"OK\")\n\t\t}\n\tcase item1.Name == \"umbrella\":\n\t\tswitch action {\n\t\tcase 0:\n\t\t\tswitch item1.Toggle {\n\t\t\tcase true:\n\t\t\t\tfmt.Println(\"You open the umbrella. And now you are protected. From indoor rainstorms.\")\n\t\t\t\titem1.Toggle = false\n\t\t\tcase false:\n\t\t\t\tfmt.Println(\"You close it. And now you are protected from bad luck.\")\n\t\t\t\titem1.Toggle = true\n\t\t\t}\n\t\tcase 1:\n\t\t\tfmt.Println(\"You dance with your ella, ella, ella.\")\n\t\tdefault:\n\t\t\tfmt.Println(\"OK\")\n\t\t}\n\tcase item1.Name == \"front door\":\n\t\tswitch action {\n\t\tcase 0:\n\t\t\tswitch item1.Toggle {\n\t\t\tcase true:\n\t\t\t\tfmt.Println(\"You open the front door. Get a whiff of that nature.\")\n\t\t\t\titem1.Toggle = false\n\t\t\tcase false:\n\t\t\t\tfmt.Println(\"You close the front door. Generates a false sense of security.\")\n\t\t\t\titem1.Toggle = true\n\t\t\t}\n\t\tcase 1:\n\t\t\tswitch item1.Toggle {\n\t\t\tcase true:\n\t\t\t\tfmt.Println(\"But the door is the shut.\")\n\t\t\tcase false:\n\t\t\t\tfmt.Println(\"You go outside.\")\n\t\t\t\tcp = outside(cp)\n\t\t\t}\n\t\tdefault:\n\t\t\tfmt.Println(\"OK\")\n\t\t}\n\tcase item1.Name == \"ruins of front door\":\n\t\tswitch action {\n\t\tcase 0:\n\t\t\tfmt.Println(\"You step over the splintered remains and run out into the woods.\")\n\t\t\tcp = outside(cp)\n\t\tcase 1:\n\t\t\tfmt.Println(\"You grab a short length of scrap wood from the previous door.\")\n\t\t\tsw := models.ItemGet(\"scrap wood\")\n\t\t\tsw.Loc = 20\n\t\t\tmodels.Itemupdate(sw)\n\t\tdefault:\n\t\t\tfmt.Println(\"OK\")\n\t\t}\n\tcase item1.Name == \"scrap wood\":\n\t\tswitch action {\n\t\tcase 0:\n\t\t\tfmt.Println(\"With this conveniently splintered wood you build a fire.\")\n\t\t\titem1.Used = true\n\t\t\tcp = fire(cp)\n\t\tdefault:\n\t\t\tfmt.Println(\"OK\")\n\t\t}\n\tcase item1.Name == \"skillet\":\n\t\tswitch action {\n\t\tcase 0:\n\t\t\tif cp.Position == 2 {\n\t\t\t\t//call cook function\n\t\t\t\tcp, item1 = cook(cp, item1)\n\t\t\t} else {\n\t\t\t\tfmt.Println(\"You cannot cook here. You need heat.\")\n\t\t\t}\n\t\tdefault:\n\t\t\tfmt.Println(\"OK\")\n\t\t}\n\n\tcase item1.Name == \"fridge\":\n\t\tswitch action {\n\t\tcase 0:\n\t\t\tfmt.Println(\"Inside you see a massive supply of burgers, ketchup, and old mayo. No beer.\")\n\t\t\tbi := models.ItemGet(\"burger meat\")\n\t\t\tif bi.Loc == 10 {\n\t\t\t\tfmt.Println(\"Take some burger meat?\")\n\t\t\t\tfmt.Println(\"1. Yes\\n2. No\")\n\t\t\t\tr1 := inputs.Basicinput(\"?\")\n\t\t\t\tif r1 == 1 {\n\t\t\t\t\tfmt.Println(\"You take a handful of cold meat.\")\n\t\t\t\t\tbi := models.ItemGet(\"burger meat\")\n\t\t\t\t\tbi.Loc = 20\n\t\t\t\t\tmodels.Itemupdate(bi)\n\t\t\t\t}\n\t\t\t}\n\t\t\tif item1.Toggle == true {\n\t\t\t\tfmt.Println(\"Look in the freezer?\")\n\t\t\t\tfmt.Println(\"1. Yes\\n2. No\")\n\t\t\t\tr2 := inputs.Basicinput(\"?\")\n\t\t\t\tswitch r2 {\n\t\t\t\tcase 1:\n\t\t\t\t\tfmt.Println(\"This needs to be defrosted. But buried in the ice you see a bottle of vodka.\\nYou take the bottle.\\nNo point in leaving it for the next occupant.\")\n\t\t\t\t\titem1.Toggle = false\n\t\t\t\t\tvi := models.ItemGet(\"vodka bottle\")\n\t\t\t\t\tvi.Loc = 20\n\t\t\t\t\tmodels.Itemupdate(vi)\n\t\t\t\tdefault:\n\t\t\t\t\tfmt.Println(\"You close the fridge. To save electricity and keep the ketchup cold.\")\n\t\t\t\t}\n\t\t\t}\n\t\tdefault:\n\t\t\tfmt.Println(\"OK\")\n\t\t}\n\tcase item1.Name == \"vodka bottle\":\n\t\tswitch action {\n\t\tcase 0:\n\t\t\tfmt.Println(\"You take a short pull. It does nothing for your health but you feel better.\")\n\t\t\tcp.Charisma = cp.Charisma + 10\n\t\tcase 1:\n\t\t\tfmt.Println(\"You smash the bottle. Now there are glass shards and wasted vodka all over.\") //can place in the burgers\n\t\t\titem1.Used = true\n\t\t\tgsi := models.ItemGet(\"glass shards\")\n\t\t\tgsi.Loc = cp.Position\n\t\t\tmodels.Itemupdate(gsi)\n\t\tdefault:\n\t\t\tfmt.Println(\"OK\")\n\t\t}\n\tcase item1.Name == \"glass shards\":\n\t\tswitch action {\n\t\tcase 0:\n\t\t\tfmt.Println(\"Crunchy. And painful. Stupid idea.\")\n\t\t\tcp.Health = cp.Health - 25\n\t\tdefault:\n\t\t\tfmt.Println(\"OK\")\n\t\t}\n\tcase item1.Name == \"burger meat\":\n\t\tswitch action {\n\t\tcase 0:\n\t\t\tif cp.Position == 2 {\n\t\t\t\tcp, item1 = cook(cp, item1)\n\t\t\t} else {\n\t\t\t\tfmt.Println(\"Cannot cook here. Where's the heat for the meat?\")\n\t\t\t}\n\t\tcase 1:\n\t\t\tswitch item1.Toggle {\n\t\t\tcase true:\n\t\t\t\tfmt.Println(\"No, it's raw. Gross.\")\n\t\t\tcase false: // cooked\n\t\t\t\tgsi := models.ItemGet(\"glass shards\")\n\t\t\t\tcri := models.ItemGet(\"silver cross\")\n\t\t\t\tif gsi.Loc == 30 && gsi.Used == false { //glass is in burger and not used yet\n\t\t\t\t\tfmt.Println(\"You feel the glass puncture holes in your mouth, throat and stomach. Terrible idea.\")\n\t\t\t\t\tcp.Health = cp.Health - 60\n\t\t\t\t\titem1.Toggle = true\n\t\t\t\t\titem1.Loc = 10\n\t\t\t\t\tgsi.Used = true\n\t\t\t\t\tgsi.Loc = 40\n\t\t\t\t\tmodels.Itemupdate(gsi)\n\t\t\t\t} else if cri.Loc == 30 && cri.Used == false {\n\t\t\t\t\tfmt.Println(\"You barely notice the silver taste.\")\n\t\t\t\t\tcp.Health = cp.Health + 15\n\t\t\t\t\titem1.Toggle = true\n\t\t\t\t\titem1.Loc = 10\n\t\t\t\t\tcri.Used = true\n\t\t\t\t\tcri.Loc = 40\n\t\t\t\t\tmodels.Itemupdate(gsi)\n\t\t\t\t} else {\n\t\t\t\t\tfmt.Println(\"That was a tasty burger. You feel a bit better. And nothing attacked you this whole time.\")\n\t\t\t\t\tcp.Health = cp.Health + 15\n\t\t\t\t\titem1.Toggle = true\n\t\t\t\t\titem1.Loc = 10\n\t\t\t\t}\n\t\t\t}\n\t\tdefault:\n\t\t\tfmt.Println(\"OK\")\n\t\t}\n\tcase item1.Name == \"axe\":\n\t\tswitch action {\n\t\tcase 0:\n\t\t\tfd := models.ItemGet(\"front door\")\n\t\t\tif cp.Position == 1 {\n\t\t\t\tswitch fd.Used {\n\t\t\t\tcase true:\n\t\t\t\t\tfmt.Println(\"There is nothing here to chop. If you need scrap wood, something already destroyed the front door.\")\n\t\t\t\tcase false:\n\t\t\t\t\tfmt.Println(\"You destroy the front door with the axe. Do you suffer from cabin fever?\")\n\t\t\t\t\tfd.Used = true\n\t\t\t\t\tdfd := models.ItemGet(\"ruins of front door\")\n\t\t\t\t\tdfd.Loc = 1\n\t\t\t\t\tmodels.Itemupdate(fd)\n\t\t\t\t\tmodels.Itemupdate(dfd)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfmt.Println(\"There is nothing here to chop. Except the cabin itself. And that would be crazy.\")\n\t\t\t}\n\t\tdefault:\n\t\t\tfmt.Println(\"OK\")\n\t\t}\n\tcase item1.Name == \"bear trap\":\n\t\tswitch action {\n\t\tcase 0:\n\t\t\tfmt.Println(\"Carefully you pry apart the metal teeth. You have a rough idea how this works. You've seen it before in cartoons.\" +\n\t\t\t\t\"\\nYou try to move that center bit with your foot.\\nThe jaws slam shut around your leg.\\nOuch.\")\n\t\t\tcp.Health = cp.Health - 25\n\t\t\titem1.Used = true\n\t\tdefault:\n\t\t\tfmt.Println(\"OK\")\n\t\t}\n\tcase item1.Name == \"bed\":\n\t\tswitch action {\n\t\tcase 0:\n\t\t\tfmt.Println(\"You get under the stained covers. It's surprisingly comfortable. Soon you are in dreamland.\")\n\t\t\tcm := models.Spawnmonsterget()\n\t\t\tif cm.Spawn == false {\n\t\t\t\tfmt.Println(\"You wake up after a few hours of nightmare-ridden sleep.\")\n\t\t\t} else {\n\t\t\t\tswitch cm.Number {\n\t\t\t\tcase 3:\n\t\t\t\t\tfmt.Println(\"The morning light pierces the window and wakes you. That was a deep sleep.\" +\n\t\t\t\t\t\t\"On your chest, sits a present.\")\n\t\t\t\t\tcp = present(cp)\n\t\t\t\t\titem1.Used = true\n\t\t\t\tdefault:\n\t\t\t\t\tfmt.Println(\"You do not wake up when the\", cm.Name, \"enters the room.\\nYou wake up when they are standing next to your bed. And you are vulnerable as a babe.\")\n\t\t\t\t\tcp.Health = 0\n\t\t\t\t}\n\t\t\t}\n\t\tcase 1:\n\t\t\tfmt.Println(\"You hide under the bed. It's just you, the spiders and broken toys.\")\n\t\t\tcm := models.Spawnmonsterget()\n\t\t\tif cm.Spawn == false {\n\t\t\t\tfmt.Println(\"This is boring. You leave.\")\n\t\t\t\tcp.Charisma = cp.Charisma - 15\n\t\t\t} else {\n\t\t\t\t//make and call hide function, can be useful elswhere\n\t\t\t\tcp, item1 = hide(cp, cm, item1)\n\t\t\t}\n\t\tdefault:\n\t\t\tfmt.Println(\"OK\")\n\t\t}\n\tcase item1.Name == \"silver cross\":\n\t\tswitch action {\n\t\tcase 0:\n\t\t\tfmt.Println(\"It's an old cross on a necklace. You eat it. It's gone forever.\")\n\t\t\titem1.Used = true\n\t\t\titem1.Loc = 40\n\t\tdefault:\n\t\t\tfmt.Println(\"OK\")\n\t\t}\n\tcase item1.Name == \"red plunger\":\n\t\tswitch action {\n\t\tcase 0:\n\t\t\tif item1.Toggle == true {\n\t\t\t\tif cp.Position == 6 {\n\t\t\t\t\tfmt.Println(\"You look at the toilet. It is clogged. And really gross. Like ten sick babies used it. Sure you want to do this?\")\n\t\t\t\t\tfmt.Println(\"1.Yes\\n2.No\")\n\t\t\t\t\tr1 := inputs.Basicinput(\"?\")\n\t\t\t\t\tif r1 == 1 {\n\t\t\t\t\t\tfmt.Println(\"You plunge away. Filth and water spill over and onto your shoes. Keep plunging?\")\n\t\t\t\t\t\tfmt.Println(\"1.Yes\\n2.No\")\n\t\t\t\t\t\tr2 := inputs.Basicinput(\"?\")\n\t\t\t\t\t\tif r2 == 1 {\n\t\t\t\t\t\t\tfmt.Println(\"You keep going. The smell is terrible. You vomit in the tub multiple times.\" +\n\t\t\t\t\t\t\t\t\"Eventually you unclog it. It's a small bottle with a note in it. Read the note?\")\n\t\t\t\t\t\t\tfmt.Println(\"1.Yes\\n2.No\")\n\t\t\t\t\t\t\tr3 := inputs.Basicinput(\"?\")\n\t\t\t\t\t\t\tif r3 == 1 {\n\t\t\t\t\t\t\t\tfmt.Println(\"The note says: \\\"Kill Yourself. Use the razor and kill yourself.\\\"\")\n\t\t\t\t\t\t\t\titem1.Toggle = false\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tfmt.Println(\"Nothing here to plunge.\")\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfmt.Println(\"No. That was depressing.\")\n\t\t\t}\n\t\tdefault:\n\t\t\tfmt.Println(\"OK\")\n\t\t}\n\tcase item1.Name == \"rusty straight razor\":\n\t\tswitch action {\n\t\tcase 0:\n\t\t\tfmt.Println(\"You cut yourself. It's rusty and you're no barber.\")\n\t\t\tcp.Health = cp.Health - 15\n\t\t\tcm := models.Spawnmonsterget()\n\t\t\tif cm.Number == 2 && cm.Spawn == true {\n\t\t\t\tfmt.Println(\"Your blood drips on the floor.\")\n\t\t\t\tcm.Position = cp.Position\n\t\t\t\tmodels.Monsterupdate(cm)\n\t\t\t}\n\t\tdefault:\n\t\t\tfmt.Println(\"OK\")\n\t\t}\n\tcase item1.Name == \"tiny bell\":\n\t\tswitch action {\n\t\tcase 0:\n\t\t\tcm := models.Spawnmonsterget()\n\t\t\tif cm.Number == 3 {\n\t\t\t\tfmt.Println(\"The bell rings bizarrely loud. When you stop, silence. Outside the snow falls heavily.\")\n\t\t\t\titem1.Toggle = false\n\t\t\t\titem1.Used = true\n\t\t\t} else {\n\t\t\t\tfmt.Println(\"The bell rings weak and dissonant. It's the wrong season for this.\")\n\t\t\t\titem1.Used = true\n\t\t\t}\n\t\tdefault:\n\t\t\tfmt.Println(\"OK\")\n\t\t}\n\tcase item1.Name == \"present\":\n\t\tswitch action {\n\t\tcase 0:\n\t\t\tfmt.Println(\"Do you open the present: \\n1. Carefully\\n2. Hastily\")\n\t\t\tr1 := inputs.Basicinput(\"?\")\n\t\t\tswitch r1 {\n\t\t\tcase 1:\n\t\t\t\tfmt.Println(\"Carefully you unwrap the present, not damaging the pretty paper.\")\n\t\t\t\tcp.Charisma = cp.Charisma - 10\n\t\t\t\titem1.Used = true\n\t\t\tcase 2:\n\t\t\t\tfmt.Println(\"You tear through the paper with glee.\")\n\t\t\t\tcp.Charisma = cp.Charisma + 10\n\t\t\t\titem1.Used = true\n\t\t\tdefault:\n\t\t\t\tfmt.Println(\"OK\")\n\t\t\t\titem1.Used = true\n\t\t\t}\n\t\t\t//for now, make a heart\n\t\t\thitem := models.ItemGet(\"heart\")\n\t\t\thitem.Loc = 20\n\t\t\tfmt.Println(\"Inside the box you find an organ. A shriveled and bloody beating heart.\" +\n\t\t\t\t\"\\nYou are compelled to pocket it.\")\n\t\t\tmodels.Itemupdate(hitem)\n\t\tcase 1:\n\t\t\tfmt.Println(\"Using your innate pyromaniac skills, you manage to set the present on fire. It disappears in flame and smoke.\")\n\t\t\tcp = fire(cp)\n\t\tdefault:\n\t\t\tfmt.Println(\"OK\")\n\t\t}\n\tcase item1.Name == \"heart\":\n\t\tcm := models.Spawnmonsterget()\n\t\tswitch action {\n\t\tcase 0:\n\t\t\tfmt.Println(\"You place the pulsing heart on the floor. With relish, you step on it.\" +\n\t\t\t\t\"\\nIt squeaks, like a rubber chew toy.\")\n\t\t\tcm.Position = cp.Position\n\t\t\titem1.Loc = cp.Position\n\t\tcase 1:\n\t\t\tfmt.Println(\"You bite into the flesh. Blood runs down your chin like juice from a succulent peach.\" +\n\t\t\t\t\"\\nBut this tastes nothing like a peach. It tastes like a pig only fed black licorice and tears.\" +\n\t\t\t\t\"\\nYou get a vision, you know where your foe is.\")\n\t\t\tfmt.Println(\"He is in the \" + models.RoomGet(cm.Position).Name)\n\t\t\tcp.Charisma = cp.Charisma - 25\n\t\tcase 2:\n\t\t\trazeri := models.ItemGet(\"rusty straight razor\")\n\t\t\taxei := models.ItemGet(\"axe\")\n\t\t\tglassi := models.ItemGet(\"glass shards\")\n\t\t\tif razeri.Loc == 20 || razeri.Loc == cp.Position {\n\t\t\t\tfmt.Println(\"You slice the heart with the rusty razor. From the cut seeps thick, black blood.\")\n\t\t\t\tfmt.Println(\"The blood corrodes the blade and renders it unusable.\")\n\t\t\t\trazeri.Used = true\n\t\t\t\tcm.Health = cm.Health - 33\n\t\t\t\tcm.Position = cp.Position\n\t\t\t} else if axei.Loc == 20 || axei.Loc == cp.Position {\n\t\t\t\tfmt.Println(\"You cut the heart with the axe blade. You cannot cut it in half but you make a bloody mess.\")\n\t\t\t\tfmt.Println(\"The blood corrodes the blade and renders it unusable.\")\n\t\t\t\taxei.Used = true\n\t\t\t\tcm.Health = cm.Health - 33\n\t\t\t\tcm.Position = cp.Position\n\t\t\t} else if glassi.Loc == 20 || glassi.Loc == cp.Position {\n\t\t\t\tfmt.Println(\"You stab the heart with shards of glass. It is bloody brutal work.\")\n\t\t\t\tfmt.Println(\"The blood corrodes the blade and renders it unusable.\")\n\t\t\t\tglassi.Used = true\n\t\t\t\tcm.Health = cm.Health - 33\n\t\t\t\tcm.Position = cp.Position\n\t\t\t} else {\n\t\t\t\tfmt.Println(\"You have nothing sharp. You poke at it with your fingers to no effect.\")\n\t\t\t}\n\t\t\tmodels.Itemupdate(razeri)\n\t\t\tmodels.Itemupdate(axei)\n\t\t\tmodels.Itemupdate(glassi)\n\t\t\tif cm.Health <= 0 {\n\t\t\t\tcp.Continue = false\n\t\t\t\tfmt.Println(cm.Outrom)\n\t\t\t}\n\t\tcase 3:\n\t\t\tskilleti := models.ItemGet(\"skillet\")\n\t\t\tif cp.Position == 2 {\n\t\t\t\tif skilleti.Loc == 20 || skilleti.Loc == 2 {\n\t\t\t\t\tfmt.Println(\"Using the skillet and stove you cook the heart.\" +\n\t\t\t\t\t\t\"\\nBubbles appear across its surface. They pop releasing toxic smoke in the room.\" +\n\t\t\t\t\t\t\"\\nYou hear the man screaming.\" +\n\t\t\t\t\t\t\"\\nThe heart is gone and the skillet is ruined.\")\n\t\t\t\t\tif cp.Health > 10 {\n\t\t\t\t\t\tcp.Health = cp.Health - 10\n\t\t\t\t\t}\n\t\t\t\t\tcm.Health = cm.Health - 75\n\t\t\t\t\tskilleti.Used = true\n\t\t\t\t\titem1.Used = true\n\t\t\t\t} else {\n\t\t\t\t\tfmt.Println(\"You lack cookery.\")\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfmt.Println(\"Not a good place to cook.\")\n\t\t\t}\n\t\t\tmodels.Itemupdate(skilleti)\n\t\t\tif cm.Health <= 0 {\n\t\t\t\tcp.Continue = false\n\t\t\t\tfmt.Println(cm.Outrom)\n\t\t\t}\n\t\tdefault:\n\t\t\tfmt.Println(\"OK\")\n\t\t}\n\t\tmodels.Monsterupdate(cm)\n\t\t/*\n\t\t\t\t\t\tcase item1.Name == :\n\t\t\t\t\t\tswitch action{\n\t\t\t\t\tcase 0:\n\t\t\t\tdefault:\n\t\t\t\tfmt.Println(\"OK\")\n\t\t\t}\n\t\t*/\n\tdefault:\n\t\tfmt.Println(\"Surprisingly, it does not do anything\")\n\t}\n\treturn item1, cp\n}",
"func (a *Area) GetTileInfo(y, x int) (ch rune,\n\tblocks bool,\n\thasCreature *Creature,\n\thasItems []*Item) {\n\n\tif a == nil {\n\t\treturn ' ', false, nil, nil\n\t}\n\n\tvar c *Creature\n\tvar items []*Item\n\tvar RequestedTile = x + y*a.Width\n\n\t// Safety check, make sure the requested tile is a sane value.\n\tif RequestedTile < 0 || RequestedTile > len(a.Tiles) {\n\t\treturn ' ', false, nil, nil\n\t}\n\n\titems = make([]*Item, 0)\n\n\t// Read from the tiles array at the requested point to get the\n\t// specific Unicode rune value.\n\tch = a.Tiles[RequestedTile].Ch\n\n\t// Read from the tiles array at a given point to determine whether\n\t// or not a tile is blocking.\n\tblocks = a.Tiles[RequestedTile].BlockMove\n\n\t// Cycle thru every monster in the array...\n\tfor _, m := range a.Creatures {\n\n\t\t// If the Monster is alive and at (x,y) point.\n\t\tif m.Hp > 0 && m.X == x && m.Y == y {\n\n\t\t\t// Grab a reference to that creature and break.\n\t\t\tc = m\n\t\t\tbreak\n\t\t}\n\t}\n\n\t// Cycle thru every item in the array...\n\tfor _, itm := range a.Items {\n\n\t\t// If an item is located at (x,y) point...\n\t\tif itm.X == x && itm.Y == y {\n\n\t\t\t// Append it to the list of items.\n\t\t\titems = append(items, itm)\n\t\t}\n\t}\n\n\t// Return the rune, whether this is a blocking tile, and reference to\n\t// the creature (if any) and a reference to items laying on the ground\n\t// at the particular spot (if any).\n\treturn ch, blocks, c, items\n}",
"func (c *Character) Wielding() items.Item {\n\treturn c.inv.Item(c.inv.weapon)\n}",
"func (c *gomlCollection) Item(index int) Element {\n\tif index >= 0 && index < c.Length() {\n\t\treturn c.list[index]\n\t}\n\treturn nil\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
Parses the 108 bits of data all items have, both simple items and extended items.
|
func parseSimpleBits(br *bitReader, item *Item) error {
// offset: 0 "J"
j, err := br.ReadByte()
if err != nil {
return err
}
// offset: 8, "M"
m, err := br.ReadByte()
if err != nil {
return err
}
if string(j) != "J" || string(m) != "M" {
return errors.New("failed to find item header JM")
}
// offset: 16, unknown
br.ReadBits(4)
// offset: 20
if item.Identified, err = br.ReadBits(1); err != nil {
return err
}
// offset: 21, unknown
br.ReadBits(6)
// offset: 27
if item.Socketed, err = br.ReadBits(1); err != nil {
return err
}
// offset 28, unknown
br.ReadBits(1)
// offset 29
if item.New, err = br.ReadBits(1); err != nil {
return err
}
// offset 30, unknown
br.ReadBits(2)
// offset 32
if item.IsEar, err = br.ReadBits(1); err != nil {
return err
}
// offset 33
if item.StarterItem, err = br.ReadBits(1); err != nil {
return err
}
// offset 34, unknown
br.ReadBits(3)
// offset 37, if it's a simple item, it only contains 111 bits data
if item.SimpleItem, err = br.ReadBits(1); err != nil {
return err
}
// offset 38
if item.Ethereal, err = br.ReadBits(1); err != nil {
return err
}
// offset 39, unknown
br.ReadBits(1)
// offset 40
if item.Personalized, err = br.ReadBits(1); err != nil {
return err
}
// offset 41, unknown
br.ReadBits(1)
// offset 42
if item.GivenRuneword, err = br.ReadBits(1); err != nil {
return err
}
// offset 43, unknown
br.ReadBits(5)
// offset 48
if item.Version, err = br.ReadBits(8); err != nil {
return err
}
// offset 56, unknown
br.ReadBits(2)
// offset 58
if item.LocationID, err = br.ReadBits(3); err != nil {
return err
}
// offset 61
if item.EquippedID, err = br.ReadBits(4); err != nil {
return err
}
// offset 65
if item.PositionX, err = br.ReadBits(4); err != nil {
return err
}
// offset 69
if item.PositionY, err = br.ReadBits(3); err != nil {
return err
}
// offset 72
br.ReadBits(1)
// offset 73, if item is neither equipped or in the belt, this tells us where it is.
if item.AltPositionID, err = br.ReadBits(3); err != nil {
return err
}
if item.IsEar == 0 {
// offset 76, item type, 4 chars, each 8 bit (not byte aligned)
var itemType string
for j := 0; j < 4; j++ {
t, err := br.ReadBits(8)
if err != nil {
return err
}
itemType += fmt.Sprintf("%c", t)
}
item.Type = strings.Trim(itemType, " ")
item.TypeID = item.getTypeID()
switch item.TypeID {
case armor:
typeName, ok := armorCodes[item.Type]
if ok {
item.TypeName = typeName
}
case shield:
typeName, ok := shieldCodes[item.Type]
if ok {
item.TypeName = typeName
}
case weapon:
typeName, ok := weaponCodes[item.Type]
if ok {
item.TypeName = typeName
}
// Weapons have base damage, so we'll check our
// map for the base damage of this weapon type.
baseDamage, ok := weaponDamageMap[item.Type]
if ok {
// If the item is ethereal we need to add 50% enhanced
// damage to the base damage.
if item.Ethereal == 1 {
baseDamage.Min = int((float64(baseDamage.Min) * 1.5))
baseDamage.Max = int((float64(baseDamage.Max) * 1.5))
baseDamage.TwoMin = int((float64(baseDamage.TwoMin) * 1.5))
baseDamage.TwoMax = int((float64(baseDamage.TwoMax) * 1.5))
}
item.BaseDamage = &baseDamage
}
case other:
typeName, ok := miscCodes[item.Type]
if ok {
item.TypeName = typeName
}
}
// offset 108
// If sockets exist, read the items, they'll be 108 bit basic items * nrOfSockets
if item.NrOfItemsInSockets, err = br.ReadBits(3); err != nil {
return err
}
} else {
// offset 76, the item is an ear, we need to read the ear data.
earClass, err := br.ReadBits(3)
if err != nil {
return err
}
earLevel, err := br.ReadBits(7)
if err != nil {
return err
}
var name string
for {
c, err := br.ReadBits(7)
if err != nil {
return err
}
if c == 0 {
break
}
name += fmt.Sprintf("%c", c)
}
item.EarAttributes = earAttributes{
Class: earClass,
Level: earLevel,
Name: name,
}
// If the ear is not byte aligned, we'll have to byte align it before
// reading the next property.
br.Align()
}
return nil
}
|
[
"func parseItems(bfr io.ByteReader, char *Character) error {\n\t// Make a buffer that can hold 4 bytes, which can hold the items header.\n\tbuf := make([]byte, 4)\n\n\t_, err := io.ReadFull(bfr.(io.Reader), buf)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\titemHeaderData := itemData{}\n\tif err := binary.Read(bytes.NewBuffer(buf), binary.LittleEndian, &itemHeaderData); err != nil {\n\t\treturn err\n\t}\n\n\tif string(itemHeaderData.Header[:]) != \"JM\" {\n\t\treturn errors.New(\"failed to find the items header\")\n\t}\n\n\tchar.Items, err = ParseItemList(bfr, int(itemHeaderData.Count))\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}",
"func BytesParser(byteList []byte) (v interface{}, err error) {\n\tif byteList[17] != 0x09 {\n\t\treturn nil, fmt.Errorf(\"unknown header type %02x, expecting %02x\", byteList[14], 0x09)\n\t}\n\t// Don't know what's stored in byteList[23] ¯\\_(ツ)_/¯\n\tmessageTimestamp := byteArrayToTime(append(append([]byte{}, byteList[19:23]...), byteList[24:27]...))\n\n\tcursor := cursorType{17 + 2 + int(byteList[18])}\n\tif byteList[cursor.position] != 0x02 {\n\t\treturn nil, fmt.Errorf(\"unknown message type %02x, expecting %02x\", byteList[cursor.position], 0x02)\n\t}\n\n\t// Checksum everything except delimiters (start & end bytes) and checksum bytes\n\tpackageChecksum := uint16(byteList[len(byteList)-2])<<8 + uint16(byteList[len(byteList)-3])\n\tcalculatedChecksum := crc16.ChecksumCCITT(byteList[1 : len(byteList)-3])\n\tif calculatedChecksum != packageChecksum {\n\t\treturn nil, fmt.Errorf(\"Calculated checksum was %x but the transmitted checksum was %x\\n%s\", calculatedChecksum, packageChecksum, bytesToHexStrings(byteList[1:len(byteList)-1]))\n\t}\n\n\tmessageType := messageTypes(byteList[cursor.position+1])\n\tcursor.position += 2\n\n\tbaseItem := BaseItem{\n\t\tMeterTime: messageTimestamp,\n\t\tHostTime: time.Now(),\n\t\tMessageType: messageType,\n\t}\n\n\tswitch messageType {\n\tcase messageType1:\n\t\tv = &MessageType1{\n\t\t\tBaseItem: baseItem,\n\t\t\tActPowPos: extractInt(&cursor, byteList),\n\t\t}\n\tcase singleFaseMessageType2:\n\t\tv = &SingleFaseMessageType2{\n\t\t\tBaseItem: baseItem,\n\t\t\tObisListVersion: extractString(&cursor, byteList),\n\t\t\tGs1: extractString(&cursor, byteList),\n\t\t\tMeterModel: extractString(&cursor, byteList),\n\t\t\tActPowPos: extractInt(&cursor, byteList),\n\t\t\tActPowNeg: extractInt(&cursor, byteList),\n\t\t\tReactPowPos: extractInt(&cursor, byteList),\n\t\t\tReactPowNeg: extractInt(&cursor, byteList),\n\t\t\tCurrL1: extractInt(&cursor, byteList),\n\t\t\tVoltL1: extractInt(&cursor, byteList),\n\t\t}\n\tcase threeFaseMessageType2:\n\t\tv = &ThreeFaseMessageType2{\n\t\t\tBaseItem: baseItem,\n\t\t\tObisListVersion: extractString(&cursor, byteList),\n\t\t\tGs1: extractString(&cursor, byteList),\n\t\t\tMeterModel: extractString(&cursor, byteList),\n\t\t\tActPowPos: extractInt(&cursor, byteList),\n\t\t\tActPowNeg: extractInt(&cursor, byteList),\n\t\t\tReactPowPos: extractInt(&cursor, byteList),\n\t\t\tReactPowNeg: extractInt(&cursor, byteList),\n\t\t\tCurrL1: extractInt(&cursor, byteList),\n\t\t\tCurrL2: extractInt(&cursor, byteList),\n\t\t\tCurrL3: extractInt(&cursor, byteList),\n\t\t\tVoltL1: extractInt(&cursor, byteList),\n\t\t\tVoltL2: extractInt(&cursor, byteList),\n\t\t\tVoltL3: extractInt(&cursor, byteList),\n\t\t}\n\tcase singleFaseMessageType3:\n\t\tv = &SingleFaseMessageType3{\n\t\t\tBaseItem: baseItem,\n\t\t\tObisListVersion: extractString(&cursor, byteList),\n\t\t\tGs1: extractString(&cursor, byteList),\n\t\t\tMeterModel: extractString(&cursor, byteList),\n\t\t\tActPowPos: extractInt(&cursor, byteList),\n\t\t\tActPowNeg: extractInt(&cursor, byteList),\n\t\t\tReactPowPos: extractInt(&cursor, byteList),\n\t\t\tReactPowNeg: extractInt(&cursor, byteList),\n\t\t\tCurrL1: extractInt(&cursor, byteList),\n\t\t\tVoltL1: extractInt(&cursor, byteList),\n\t\t\tDateTime: extractTime(&cursor, byteList),\n\t\t\tActEnergyPos: extractInt(&cursor, byteList),\n\t\t\tActEnergyNeg: extractInt(&cursor, byteList),\n\t\t\tReactEnergyPos: extractInt(&cursor, byteList),\n\t\t\tReactEnergyNeg: extractInt(&cursor, byteList),\n\t\t}\n\tcase threeFaseMessageType3:\n\t\tv = &ThreeFaseMessageType3{\n\t\t\tBaseItem: baseItem,\n\t\t\tObisListVersion: extractString(&cursor, byteList),\n\t\t\tGs1: extractString(&cursor, byteList),\n\t\t\tMeterModel: extractString(&cursor, byteList),\n\t\t\tActPowPos: extractInt(&cursor, byteList),\n\t\t\tActPowNeg: extractInt(&cursor, byteList),\n\t\t\tReactPowPos: extractInt(&cursor, byteList),\n\t\t\tReactPowNeg: extractInt(&cursor, byteList),\n\t\t\tCurrL1: extractInt(&cursor, byteList),\n\t\t\tCurrL2: extractInt(&cursor, byteList),\n\t\t\tCurrL3: extractInt(&cursor, byteList),\n\t\t\tVoltL1: extractInt(&cursor, byteList),\n\t\t\tVoltL2: extractInt(&cursor, byteList),\n\t\t\tVoltL3: extractInt(&cursor, byteList),\n\t\t\tDateTime: extractTime(&cursor, byteList),\n\t\t\tActEnergyPa: extractInt(&cursor, byteList),\n\t\t\tActEnergyMa: extractInt(&cursor, byteList),\n\t\t\tActEnergyPr: extractInt(&cursor, byteList),\n\t\t\tActEnergyMr: extractInt(&cursor, byteList),\n\t\t}\n\t}\n\treturn\n}",
"func parseRareOrCraftedBits(br *bitReader, item *Item) error {\n\tnameID1, err := br.ReadBits(8)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tname1, ok := rareNames[nameID1]\n\tif !ok {\n\t\treturn fmt.Errorf(\"unknown rare name id: %d\", nameID1)\n\t}\n\n\titem.RareName = name1\n\n\tnameID2, err := br.ReadBits(8)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tname2, ok := rareNames[nameID2]\n\tif !ok {\n\t\treturn fmt.Errorf(\"unknown rare name id: %d\", nameID2)\n\t}\n\n\titem.RareName2 = name2\n\n\t// Array of 6 possible prefixes and suffixes. First read 1 bit. If 1, read 11 more\n\t// for the prefix/suffix id defined in MagicPrefix.txt and MagicSuffix.txt.\n\t// Even indices are prefixes, odd suffixes.\n\tfor i := 0; i < 6; i++ {\n\t\tprefix, err := br.ReadBits(1)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tif prefix == 1 {\n\t\t\tmagicalID, err := br.ReadBits(11)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\titem.MagicalNameIDs = append(item.MagicalNameIDs, magicalID)\n\t\t} else {\n\t\t\titem.MagicalNameIDs = append(item.MagicalNameIDs, 0)\n\t\t}\n\t}\n\n\treturn nil\n}",
"func parseMagicalList(br *bitReader) ([]MagicAttribute, error) {\n\tvar magicAttributes []MagicAttribute\n\tfor {\n\t\tid, err := br.ReadBits(9)\n\t\tif err != nil {\n\t\t\treturn magicAttributes, err\n\t\t}\n\n\t\t// If all 9 bits are set, we've hit the end of the stats section\n\t\t// at 0x1ff and exit the loop.\n\t\tif id == 0x1ff {\n\t\t\tbreak\n\t\t}\n\n\t\tprop, ok := magicalProperties[id]\n\t\tif !ok {\n\t\t\treturn magicAttributes, fmt.Errorf(\"unknown magical property: %d\", id)\n\t\t}\n\n\t\tvar values []int64\n\t\tfor _, bitLength := range prop.Bits {\n\t\t\tval, err := br.ReadBits(bitLength)\n\t\t\tif err != nil {\n\t\t\t\treturn magicAttributes, err\n\t\t\t}\n\n\t\t\tif prop.Bias != 0 {\n\t\t\t\tval -= prop.Bias\n\t\t\t}\n\n\t\t\tvalues = append(values, int64(val))\n\t\t}\n\n\t\tattr := MagicAttribute{\n\t\t\tID: id,\n\t\t\tName: prop.Name,\n\t\t\tValues: values,\n\t\t}\n\n\t\tmagicAttributes = append(magicAttributes, attr)\n\t}\n\n\treturn magicAttributes, nil\n}",
"func Parse(extra []byte) (map[uint16]ExtraField, error) {\n\tb := NewBuffer(extra)\n\n\tefs := make(map[uint16]ExtraField)\n\tfor b.Available() >= 4 {\n\t\tid := uint16(b.Read16())\n\t\tsize := int(b.Read16())\n\n\t\tif b.Available() < size {\n\t\t\treturn efs, io.ErrUnexpectedEOF\n\t\t}\n\n\t\tefs[id] = ExtraField(b.Bytes()[:size])\n\t\tb.Skip(size)\n\t}\n\n\treturn efs, nil\n}",
"func parseAATLookupFormat10(data []byte, isLong bool) (classFormat1, error) {\n\tbyteSize := 2\n\tif isLong {\n\t\tbyteSize = 4\n\t}\n\t// skip unit size\n\tif len(data) < 4 {\n\t\treturn classFormat1{}, errors.New(\"invalid AAT lookup format 10 (EOF)\")\n\t}\n\treturn parseClassFormat1(data[4:], byteSize)\n}",
"func parseMapData(data []byte, r *rep.Replay) error {\n\tmd := new(rep.MapData)\n\tr.MapData = md\n\n\t// Map data section is a sequence of sub-sections:\n\tfor sr, size := (sliceReader{b: data}), uint32(len(data)); sr.pos < size; {\n\t\tid := sr.getString(4)\n\t\tssSize := sr.getUint32() // sub-section size (remaining)\n\t\tssEndPos := sr.pos + ssSize // sub-section end position\n\n\t\tswitch id {\n\t\tcase \"VER \":\n\t\t\tmd.Version = sr.getUint16()\n\t\tcase \"ERA \": // Tile set sub-section\n\t\t\tmd.TileSet = repcore.TileSetByID(sr.getUint16() & 0x07)\n\t\tcase \"DIM \": // Dimension sub-section\n\t\t\t// If map has a non-standard size, the replay header contains\n\t\t\t// invalid map size, this is the correct one.\n\t\t\twidth := sr.getUint16()\n\t\t\theight := sr.getUint16()\n\t\t\tif width <= 256 && height <= 256 {\n\t\t\t\tif width > r.Header.MapWidth {\n\t\t\t\t\tr.Header.MapWidth = sr.getUint16()\n\t\t\t\t}\n\t\t\t\tif height > r.Header.MapHeight {\n\t\t\t\t\tr.Header.MapHeight = sr.getUint16()\n\t\t\t\t}\n\t\t\t}\n\t\tcase \"MTXM\": // Tile sub-section\n\t\t\t// map_width*map_height (a tile is an uint16 value)\n\t\t\tmaxI := ssSize / 2\n\t\t\t// Note: Sometimes map is broken into multiple sections.\n\t\t\t// The first one is the biggest (whole map size),\n\t\t\t// but the beginning of map is empty. The subsequent MTXM\n\t\t\t// sub-sections will fill the whole at the beginning.\n\t\t\t// An example was found when the first MTXM section was only\n\t\t\t// 8 elements, and the next was the whole map, beginning also filled.\n\t\t\t// Therefore if currently allocated Tile is small, a new one is allocated.\n\t\t\tif len(md.Tiles) < int(maxI) {\n\t\t\t\tmd.Tiles = make([]uint16, maxI)\n\t\t\t}\n\t\t\tfor i := uint32(0); i < maxI; i++ {\n\t\t\t\tmd.Tiles[i] = sr.getUint16()\n\t\t\t}\n\t\tcase \"UNIT\": // Unit sub-section\n\t\t\t// TODO When all UnitIDs (enums) are introduced, use those\n\t\t\tconst (\n\t\t\t\tunitIDMinField1 = 0xb0\n\t\t\t\tunitIDMinField2 = 0xb1\n\t\t\t\tunitIDMinField3 = 0xb2\n\t\t\t\tunitIDVespGeyser = 0xbc\n\t\t\t\tunitIDStartLoc = 0xd6\n\t\t\t)\n\t\t\tfor sr.pos < ssEndPos {\n\t\t\t\tunitEndPos := sr.pos + 36 // 36 bytes for each unit\n\n\t\t\t\tsr.pos += 4 // uint32 unit class instance (\"serial number\")\n\t\t\t\tx := sr.getUint16()\n\t\t\t\ty := sr.getUint16()\n\t\t\t\tunitID := sr.getUint16()\n\t\t\t\tsr.pos += 2 // uint16 Type of relation to another building (i.e. add-on, nydus link)\n\t\t\t\tsr.pos += 2 // uint16 Flags of special properties (e.g. cloacked, burrowed etc.)\n\t\t\t\tsr.pos += 2 // uint16 valid elements flag\n\t\t\t\townerID := sr.getByte() // 0-based SlotID\n\n\t\t\t\tswitch unitID {\n\t\t\t\tcase unitIDMinField1, unitIDMinField2, unitIDMinField3:\n\t\t\t\t\tmd.MineralFields = append(md.MineralFields, repcore.Point{X: x, Y: y})\n\t\t\t\tcase unitIDVespGeyser:\n\t\t\t\t\tmd.Geysers = append(md.Geysers, repcore.Point{X: x, Y: y})\n\t\t\t\tcase unitIDStartLoc:\n\t\t\t\t\tmd.StartLocations = append(md.StartLocations,\n\t\t\t\t\t\trep.StartLocation{Point: repcore.Point{X: x, Y: y}, SlotID: ownerID},\n\t\t\t\t\t)\n\t\t\t\t}\n\n\t\t\t\t// Skip unprocessed unit data:\n\t\t\t\tsr.pos = unitEndPos\n\t\t\t}\n\t\t}\n\n\t\t// Part or all of the sub-section might be unprocessed, skip the unprocessed bytes\n\t\tsr.pos = ssEndPos\n\t}\n\n\treturn nil\n}",
"func DecodeCharItem(b []byte) (*CharItem, error) {\n\tif len(b) < CharItemSize {\n\t\treturn nil, wlerr.Errorf(\n\t\t\t\"failed to parse item: data too short: have=%d want>=%d\",\n\t\t\tlen(b), CharItemSize)\n\t}\n\n\treturn &CharItem{\n\t\tID: int(b[0]),\n\t\tAmmo: int(b[1] & 0x7f),\n\t\tJammed: b[1]&0x80 != 0,\n\t}, nil\n}",
"func parseAATLookupFormat2(data []byte, isLong bool) (classFormat2, error) {\n\tconst headerSize = 12 // including classFormat\n\tif len(data) < headerSize {\n\t\treturn nil, errors.New(\"invalid AAT lookup format 2 (EOF)\")\n\t}\n\n\tunitSize := binary.BigEndian.Uint16(data[2:])\n\tnum := int(binary.BigEndian.Uint16(data[4:]))\n\t// 3 other field ignored\n\tif unitSize != 6 {\n\t\treturn nil, fmt.Errorf(\"unexpected AAT lookup segment size: %d\", unitSize)\n\t}\n\n\trecordSize := 6\n\tif isLong {\n\t\trecordSize = 8\n\t}\n\tif len(data) < headerSize+num*recordSize {\n\t\treturn nil, errors.New(\"invalid AAT lookup format 2 (EOF)\")\n\t}\n\n\tout := make(classFormat2, num)\n\tfor i := range out {\n\t\tout[i].end = gid(binary.BigEndian.Uint16(data[headerSize+i*recordSize:]))\n\t\tout[i].start = gid(binary.BigEndian.Uint16(data[headerSize+i*recordSize+2:]))\n\t\tif isLong {\n\t\t\tout[i].targetClassID = binary.BigEndian.Uint32(data[headerSize+i*recordSize+4:])\n\t\t} else {\n\t\t\tout[i].targetClassID = uint32(binary.BigEndian.Uint16(data[headerSize+i*recordSize+4:]))\n\t\t}\n\t}\n\treturn out, nil\n}",
"func Item(src *bytes.Buffer, x *ItemStack) error {\n\tx.NBTData = make(map[string]interface{})\n\tif err := Varint32(src, &x.NetworkID); err != nil {\n\t\treturn wrap(err)\n\t}\n\tif x.NetworkID == 0 {\n\t\t// The item was air, so there is no more data we should read for the item instance. After all, air\n\t\t// items aren't really anything.\n\t\tx.MetadataValue = 0\n\t\tx.Count = 0\n\t\tx.CanBePlacedOn, x.CanBreak = nil, nil\n\t\treturn nil\n\t}\n\tvar auxValue int32\n\tif err := Varint32(src, &auxValue); err != nil {\n\t\treturn wrap(err)\n\t}\n\tx.MetadataValue = int16(auxValue >> 8)\n\tx.Count = int16(auxValue & 0xff)\n\n\tvar userDataMarker int16\n\tif err := binary.Read(src, binary.LittleEndian, &userDataMarker); err != nil {\n\t\treturn wrap(err)\n\t}\n\tif userDataMarker == -1 {\n\t\tvar userDataVersion uint8\n\t\tif err := binary.Read(src, binary.LittleEndian, &userDataVersion); err != nil {\n\t\t\treturn wrap(err)\n\t\t}\n\t\tswitch userDataVersion {\n\t\tcase 1:\n\t\t\tif err := nbt.NewDecoder(src).Decode(&x.NBTData); err != nil {\n\t\t\t\treturn fmt.Errorf(\"%v: error decoding user data NBT: %v\", callFrame(), err)\n\t\t\t}\n\t\tdefault:\n\t\t\treturn fmt.Errorf(\"%v: unexpected item user data version %v\", callFrame(), userDataVersion)\n\t\t}\n\t} else if userDataMarker != 0 {\n\t\tif userDataMarker < 0 {\n\t\t\treturn fmt.Errorf(\"%v: invalid NBT length %v\", callFrame(), userDataMarker)\n\t\t}\n\t\tnbtData := src.Next(int(userDataMarker))\n\t\tif err := nbt.UnmarshalEncoding(nbtData, &x.NBTData, nbt.LittleEndian); err != nil {\n\t\t\treturn fmt.Errorf(\"%v: error decoding item NBT: %v\", callFrame(), err)\n\t\t}\n\t}\n\tvar count int32\n\tif err := Varint32(src, &count); err != nil {\n\t\treturn wrap(err)\n\t}\n\tif count < 0 {\n\t\treturn NegativeCountError{Type: \"item can be placed on\"}\n\t}\n\tif count > higherLimit {\n\t\treturn LimitHitError{Limit: higherLimit, Type: \"item can be placed on\"}\n\t}\n\tx.CanBePlacedOn = make([]string, count)\n\tfor i := int32(0); i < count; i++ {\n\t\tif err := String(src, &x.CanBePlacedOn[i]); err != nil {\n\t\t\treturn wrap(err)\n\t\t}\n\t}\n\tif err := Varint32(src, &count); err != nil {\n\t\treturn wrap(err)\n\t}\n\tif count < 0 {\n\t\treturn NegativeCountError{Type: \"item can break\"}\n\t}\n\tif count > higherLimit {\n\t\treturn LimitHitError{Limit: higherLimit, Type: \"item can break\"}\n\t}\n\tx.CanBreak = make([]string, count)\n\tfor i := int32(0); i < count; i++ {\n\t\tif err := String(src, &x.CanBreak[i]); err != nil {\n\t\t\treturn wrap(err)\n\t\t}\n\t}\n\tconst shieldID = 513\n\tif x.NetworkID == shieldID {\n\t\tvar blockingTick int64\n\t\tif err := Varint64(src, &blockingTick); err != nil {\n\t\t\treturn wrap(err)\n\t\t}\n\t}\n\treturn nil\n}",
"func RawFromItems(id [2]byte, sequence [2]byte, etype byte, value []byte) *Raw {\n\tvalLen, sizeLen := util.ReadULeb128(bytes.NewReader(value))\n\tval := value[sizeLen : valLen-1]\n\treturn &Raw{\n\t\ttrueValue: val,\n\t\tBase: Base{\n\t\t\tID: id,\n\t\t\tSeq: sequence,\n\t\t\tType: entry.TypeRaw,\n\t\t\tValue: value,\n\t\t},\n\t}\n}",
"func parseItemData(page string, itemid string, item string) WishlistItem {\n\n\tvar ret WishlistItem\n\n\t//\tfmt.Println(item)\n\n\t// Amazon Item ID\n\tr := regexp.MustCompile(\"href=\\\"/dp/(.+)/ref\") // get item id from link \"/dp/ITEM_ID/ref..\"\n\tawsnum := r.FindStringSubmatch(item)\n\tif len(awsnum) != 0 {\n\t\tret.amazonId = awsnum[1]\n\t}\n\n\t// Author and binding\n\tr = regexp.MustCompile(\"</h5>\\\\s*by (.*)\\\\n\") // author is in \"by John Smith (Paperback)\"\n\tauthor := r.FindStringSubmatch(item)\n\tif len(author) != 0 {\n\t\tr = regexp.MustCompile(\"(.*?)\\\\s\\\\((.*?)\\\\)\\\\s*\") // split to \"John Smith\" and \"Paperback\"\n\t\tauthAndBind := r.FindStringSubmatch(author[1])\n\t\tif len(authAndBind) == 0 {\n\t\t\tret.author = author[1]\n\t\t} else {\n\t\t\tret.author = authAndBind[1]\n\t\t\tret.binding = authAndBind[2]\n\t\t}\n\t}\n\n\t// Title\n\tr = regexp.MustCompile(\"title=\\\"(.*)\\\" href\") // title is an attribute in the itemName tag\n\ttitle := r.FindStringSubmatch(item)\n\tif len(title) != 0 {\n\t\tret.title = title[1]\n\t}\n\n\t// Image url\n\tr = regexp.MustCompile(\"<div id=\\\"itemImage_\" + itemid + \"\\\"\") // image url is in different tag, itemImage\n\timageDivIdx := r.FindStringIndex(page)\n\tif len(imageDivIdx) != 0 {\n\t\tidx := imageDivIdx[1]\n\t\tr = regexp.MustCompile(\"<img .*? src=\\\"(.*?)\\\"\") // get img tag source\n\t\timgUrl := r.FindStringSubmatch(page[idx : idx+1000])\n\t\tif len(imgUrl) != 0 {\n\t\t\tret.imageUrl = imgUrl[1]\n\t\t}\n\t}\n\n\t// Price\n\tr = regexp.MustCompile(\"<span id=\\\"itemPrice_\" + itemid + \"\\\"\") // price is in separate tag, itemPrice\n\timagePriceIdx := r.FindStringIndex(page)\n\tif len(imagePriceIdx) != 0 {\n\t\tidx := imagePriceIdx[1]\n\t\tr = regexp.MustCompile(\"<span .*?>\\\\s*(.*?)\\\\s*</span>\") // get span content\n\t\tprice := r.FindStringSubmatch(page[idx-50 : idx+150])\n\t\tif len(price) != 0 {\n\t\t\t// convert pound sign U+00A3 to \"GBP XXX.XX\", if present // TODO check other currencies\n\t\t\tif len(price[1]) > 0 && price[1][0] == 0xA3 {\n\t\t\t\tret.currency = \"GBP\"\n\t\t\t\tret.price = price[1][1:]\n\t\t\t} else {\n\t\t\t\tret.price = price[1]\n\t\t\t}\n\t\t}\n\t}\n\n\treturn ret\n}",
"func convertBytesToMeasure(b []byte) measure {\n\tvar measure measure\n\tfor _, n := range b {\n\t\tvar val bool\n\t\tif n == 0x01 {\n\t\t\tval = true\n\t\t}\n\t\tmeasure = append(measure, note(val))\n\t}\n\treturn measure\n}",
"func parseAATLookupFormat8(data []byte) (classFormat1, error) {\n\treturn parseClassFormat1(data[2:], 2)\n}",
"func (c *AuctionController) parse(rawAuctions *RawAuctions, characterName, serverType string) {\n\tvar auctions []Auction\n\tvar outerWait sync.WaitGroup\n\n\tc.ItemTrie = trie.NewTrie()\n\tc.ItemTrie.Add(\"selling\")\n\tc.ItemTrie.Add(\"buying\")\n\tc.ItemTrie.Add(\"wtb\")\n\tc.ItemTrie.Add(\"wts\")\n\tc.ItemTrie.Add(\"ea\")\n\tc.ItemTrie.Add(\"each\")\n\tc.ItemTrie.Add(\"per\")\n\n\t// Load all items into Trie structure\n\titemQuery := \"SELECT displayName, id FROM items ORDER BY displayName ASC\"\n\trows := DB.Query(itemQuery)\n\tif rows != nil {\n\t\tfor rows.Next() {\n\t\t\tvar itemName string\n\t\t\tvar itemId int64\n\n\t\t\trows.Scan(&itemName, &itemId)\n\t\t\tif itemId > 0 && itemName != \"\" {\n\t\t\t\tc.ItemTrie.Add(strings.ToLower(itemName))\n\t\t\t}\n\t\t}\n\t}\n\n\tfor _, line := range rawAuctions.Lines {\n\t\touterWait.Add(1)\n\t\tgo c.parseLine(line, characterName, serverType, &outerWait, &auctions)\n\t}\n\n\touterWait.Wait()\n\tfmt.Println(\"Processed all lines\")\n\n\tif len(auctions) > 0 {\n\t\tc.saveAuctionData(auctions)\n\t}\n}",
"func (e *EncodedTable) parseTable() error {\n\tvar (\n\t\tcodeTable []*Code\n\t\tprefLen, rangeLen, rangeLow int\n\t\ttemp uint64\n\t\terr error\n\t)\n\n\tr := e.StreamReader()\n\tcurRangeLow := e.HtLow()\n\n\t// Annex B.2 5) - decode table lines.\n\tfor curRangeLow < e.HtHigh() {\n\t\ttemp, err = r.ReadBits(byte(e.HtPS()))\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tprefLen = int(temp)\n\n\t\ttemp, err = r.ReadBits(byte(e.HtRS()))\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\trangeLen = int(temp)\n\n\t\tcodeTable = append(codeTable, NewCode(prefLen, rangeLen, rangeLow, false))\n\t\tcurRangeLow += (1 << uint(rangeLen))\n\t}\n\n\t// Annex B.2 6)\n\ttemp, err = r.ReadBits(byte(e.HtPS()))\n\tif err != nil {\n\t\treturn err\n\t}\n\tprefLen = int(temp)\n\n\t// Annex B.2 7)\n\trangeLen = 32\n\trangeLow = e.HtLow() - 1\n\tcodeTable = append(codeTable, NewCode(prefLen, rangeLen, rangeLow, true))\n\n\t// Annex B.2 8)\n\ttemp, err = r.ReadBits(byte(e.HtPS()))\n\tif err != nil {\n\t\treturn err\n\t}\n\tprefLen = int(temp)\n\n\t// Annex B.2 9)\n\trangeLen = 32\n\trangeLow = e.HtHigh()\n\tcodeTable = append(codeTable, NewCode(prefLen, rangeLen, rangeLow, false))\n\n\t//Annex B.2 10) OOB table line.\n\tif e.HtOOB() == 1 {\n\t\ttemp, err = r.ReadBits(byte(e.HtPS()))\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tprefLen = int(temp)\n\t\tcodeTable = append(codeTable, NewCode(prefLen, -1, -1, false))\n\t}\n\n\tif err = e.InitTree(codeTable); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}",
"func (g * Giphy) _parseDataArray(body []byte) (*giphyDataArray, error) {\n var data giphyDataArray\n\n if len(body) <= 0 {\n return nil, errors.New(\"_parseDataArray: No data in response body to parse.\")\n }\n\n err := json.Unmarshal(body, &data)\n if err != nil {\n return nil, err\n }\n\n return &data, nil\n}",
"func ModifyItemData(fullData []byte, items []Item) []byte {\n\tfor _, item := range items {\n\t\tbuf := make([]byte, 4)\n\t\tbinary.LittleEndian.PutUint32(buf, uint32(item.ModifiedCount))\n\t\tfor i, b := range buf {\n\t\t\tfullData[int(item.PayloadIndex)+i] = b\n\t\t}\n\t\t// log.Printf(\"Name: %s | current_lvl: %20x | new_lvl:%20x \\n\", item.Name, fullData[int(item.PayloadIndex)+item.LvlIndex], item.Lvl)\n\n\t\t// update item lvl\n\t\tfullData[int(item.PayloadIndex)+item.LvlIndex] = byte(item.ModifiedLvl)\n\t}\n\treturn fullData\n}",
"func parseSpecificItems(source []datasourcev1.SpecificValue) map[interface{}]int64 {\n\tret := make(map[interface{}]int64)\n\tif len(source) == 0 {\n\t\treturn ret\n\t}\n\tfor _, item := range source {\n\t\tswitch item.ValKind {\n\t\tcase \"KindInt\":\n\t\t\trealVal, err := strconv.Atoi(item.ValStr)\n\t\t\tif err != nil {\n\t\t\t\tlogging.Error(errors.Wrap(err, \"parseSpecificItems error\"), \"Failed to parse value for int specific item\", \"itemValKind\", item.ValKind, \"itemValStr\", item.ValStr)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tret[realVal] = item.Threshold\n\t\tcase \"KindString\":\n\t\t\tret[item.ValStr] = item.Threshold\n\t\tcase \"KindBool\":\n\t\t\trealVal, err := strconv.ParseBool(item.ValStr)\n\t\t\tif err != nil {\n\t\t\t\tlogging.Error(errors.Wrap(err, \"parseSpecificItems error\"), \"Failed to parse value for bool specific item\", \"itemValStr\", item.ValStr)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tret[realVal] = item.Threshold\n\t\tcase \"KindFloat64\":\n\t\t\trealVal, err := strconv.ParseFloat(item.ValStr, 64)\n\t\t\tif err != nil {\n\t\t\t\tlogging.Error(errors.Wrap(err, \"parseSpecificItems error\"), \"Failed to parse value for float specific item\", \"itemValStr\", item.ValStr)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\trealVal, err = strconv.ParseFloat(fmt.Sprintf(\"%.5f\", realVal), 64)\n\t\t\tif err != nil {\n\t\t\t\tlogging.Error(errors.Wrap(err, \"parseSpecificItems error\"), \"Failed to parse value for float specific item\", \"itemValStr\", item.ValStr)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tret[realVal] = item.Threshold\n\t\tdefault:\n\t\t\tlogging.Error(errors.New(\"unsupported kind for specific item\"), \"\", item.ValKind)\n\t\t}\n\t}\n\treturn ret\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
Parses the rare or crafted bits that only exists on rare and crafted items, the bit length may vary depending on how many properties the item have.
|
func parseRareOrCraftedBits(br *bitReader, item *Item) error {
nameID1, err := br.ReadBits(8)
if err != nil {
return err
}
name1, ok := rareNames[nameID1]
if !ok {
return fmt.Errorf("unknown rare name id: %d", nameID1)
}
item.RareName = name1
nameID2, err := br.ReadBits(8)
if err != nil {
return err
}
name2, ok := rareNames[nameID2]
if !ok {
return fmt.Errorf("unknown rare name id: %d", nameID2)
}
item.RareName2 = name2
// Array of 6 possible prefixes and suffixes. First read 1 bit. If 1, read 11 more
// for the prefix/suffix id defined in MagicPrefix.txt and MagicSuffix.txt.
// Even indices are prefixes, odd suffixes.
for i := 0; i < 6; i++ {
prefix, err := br.ReadBits(1)
if err != nil {
return err
}
if prefix == 1 {
magicalID, err := br.ReadBits(11)
if err != nil {
return err
}
item.MagicalNameIDs = append(item.MagicalNameIDs, magicalID)
} else {
item.MagicalNameIDs = append(item.MagicalNameIDs, 0)
}
}
return nil
}
|
[
"func parseSimpleBits(br *bitReader, item *Item) error {\n\t// offset: 0 \"J\"\n\tj, err := br.ReadByte()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// offset: 8, \"M\"\n\tm, err := br.ReadByte()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif string(j) != \"J\" || string(m) != \"M\" {\n\t\treturn errors.New(\"failed to find item header JM\")\n\t}\n\n\t// offset: 16, unknown\n\tbr.ReadBits(4)\n\n\t// offset: 20\n\tif item.Identified, err = br.ReadBits(1); err != nil {\n\t\treturn err\n\t}\n\n\t// offset: 21, unknown\n\tbr.ReadBits(6)\n\n\t// offset: 27\n\tif item.Socketed, err = br.ReadBits(1); err != nil {\n\t\treturn err\n\t}\n\n\t// offset 28, unknown\n\tbr.ReadBits(1)\n\n\t// offset 29\n\tif item.New, err = br.ReadBits(1); err != nil {\n\t\treturn err\n\t}\n\n\t// offset 30, unknown\n\tbr.ReadBits(2)\n\n\t// offset 32\n\tif item.IsEar, err = br.ReadBits(1); err != nil {\n\t\treturn err\n\t}\n\n\t// offset 33\n\tif item.StarterItem, err = br.ReadBits(1); err != nil {\n\t\treturn err\n\t}\n\n\t// offset 34, unknown\n\tbr.ReadBits(3)\n\n\t// offset 37, if it's a simple item, it only contains 111 bits data\n\tif item.SimpleItem, err = br.ReadBits(1); err != nil {\n\t\treturn err\n\t}\n\n\t// offset 38\n\tif item.Ethereal, err = br.ReadBits(1); err != nil {\n\t\treturn err\n\t}\n\n\t// offset 39, unknown\n\tbr.ReadBits(1)\n\n\t// offset 40\n\tif item.Personalized, err = br.ReadBits(1); err != nil {\n\t\treturn err\n\t}\n\n\t// offset 41, unknown\n\tbr.ReadBits(1)\n\n\t// offset 42\n\tif item.GivenRuneword, err = br.ReadBits(1); err != nil {\n\t\treturn err\n\t}\n\n\t// offset 43, unknown\n\tbr.ReadBits(5)\n\n\t// offset 48\n\tif item.Version, err = br.ReadBits(8); err != nil {\n\t\treturn err\n\t}\n\n\t// offset 56, unknown\n\tbr.ReadBits(2)\n\n\t// offset 58\n\tif item.LocationID, err = br.ReadBits(3); err != nil {\n\t\treturn err\n\t}\n\n\t// offset 61\n\tif item.EquippedID, err = br.ReadBits(4); err != nil {\n\t\treturn err\n\t}\n\n\t// offset 65\n\tif item.PositionX, err = br.ReadBits(4); err != nil {\n\t\treturn err\n\t}\n\n\t// offset 69\n\tif item.PositionY, err = br.ReadBits(3); err != nil {\n\t\treturn err\n\t}\n\n\t// offset 72\n\tbr.ReadBits(1)\n\n\t// offset 73, if item is neither equipped or in the belt, this tells us where it is.\n\tif item.AltPositionID, err = br.ReadBits(3); err != nil {\n\t\treturn err\n\t}\n\n\tif item.IsEar == 0 {\n\t\t// offset 76, item type, 4 chars, each 8 bit (not byte aligned)\n\t\tvar itemType string\n\t\tfor j := 0; j < 4; j++ {\n\t\t\tt, err := br.ReadBits(8)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\titemType += fmt.Sprintf(\"%c\", t)\n\t\t}\n\n\t\titem.Type = strings.Trim(itemType, \" \")\n\t\titem.TypeID = item.getTypeID()\n\n\t\tswitch item.TypeID {\n\t\tcase armor:\n\t\t\ttypeName, ok := armorCodes[item.Type]\n\t\t\tif ok {\n\t\t\t\titem.TypeName = typeName\n\t\t\t}\n\t\tcase shield:\n\t\t\ttypeName, ok := shieldCodes[item.Type]\n\t\t\tif ok {\n\t\t\t\titem.TypeName = typeName\n\t\t\t}\n\t\tcase weapon:\n\t\t\ttypeName, ok := weaponCodes[item.Type]\n\t\t\tif ok {\n\t\t\t\titem.TypeName = typeName\n\t\t\t}\n\n\t\t\t// Weapons have base damage, so we'll check our\n\t\t\t// map for the base damage of this weapon type.\n\t\t\tbaseDamage, ok := weaponDamageMap[item.Type]\n\t\t\tif ok {\n\n\t\t\t\t// If the item is ethereal we need to add 50% enhanced\n\t\t\t\t// damage to the base damage.\n\t\t\t\tif item.Ethereal == 1 {\n\t\t\t\t\tbaseDamage.Min = int((float64(baseDamage.Min) * 1.5))\n\t\t\t\t\tbaseDamage.Max = int((float64(baseDamage.Max) * 1.5))\n\t\t\t\t\tbaseDamage.TwoMin = int((float64(baseDamage.TwoMin) * 1.5))\n\t\t\t\t\tbaseDamage.TwoMax = int((float64(baseDamage.TwoMax) * 1.5))\n\t\t\t\t}\n\n\t\t\t\titem.BaseDamage = &baseDamage\n\t\t\t}\n\t\tcase other:\n\t\t\ttypeName, ok := miscCodes[item.Type]\n\t\t\tif ok {\n\t\t\t\titem.TypeName = typeName\n\t\t\t}\n\t\t}\n\n\t\t// offset 108\n\t\t// If sockets exist, read the items, they'll be 108 bit basic items * nrOfSockets\n\t\tif item.NrOfItemsInSockets, err = br.ReadBits(3); err != nil {\n\t\t\treturn err\n\t\t}\n\t} else {\n\t\t// offset 76, the item is an ear, we need to read the ear data.\n\t\tearClass, err := br.ReadBits(3)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tearLevel, err := br.ReadBits(7)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tvar name string\n\t\tfor {\n\t\t\tc, err := br.ReadBits(7)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tif c == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\tname += fmt.Sprintf(\"%c\", c)\n\t\t}\n\n\t\titem.EarAttributes = earAttributes{\n\t\t\tClass: earClass,\n\t\t\tLevel: earLevel,\n\t\t\tName: name,\n\t\t}\n\n\t\t// If the ear is not byte aligned, we'll have to byte align it before\n\t\t// reading the next property.\n\t\tbr.Align()\n\t}\n\n\treturn nil\n}",
"func (br *bitReader) moreBits() error {\n\tfor br.cnt < 16 {\n\t\tif br.off >= uint32(len(br.data)) {\n\t\t\treturn br.r.makeEOFError(int(br.off))\n\t\t}\n\t\tc := br.data[br.off]\n\t\tbr.off++\n\t\tbr.bits |= uint32(c) << br.cnt\n\t\tbr.cnt += 8\n\t}\n\treturn nil\n}",
"func parseMagicalList(br *bitReader) ([]MagicAttribute, error) {\n\tvar magicAttributes []MagicAttribute\n\tfor {\n\t\tid, err := br.ReadBits(9)\n\t\tif err != nil {\n\t\t\treturn magicAttributes, err\n\t\t}\n\n\t\t// If all 9 bits are set, we've hit the end of the stats section\n\t\t// at 0x1ff and exit the loop.\n\t\tif id == 0x1ff {\n\t\t\tbreak\n\t\t}\n\n\t\tprop, ok := magicalProperties[id]\n\t\tif !ok {\n\t\t\treturn magicAttributes, fmt.Errorf(\"unknown magical property: %d\", id)\n\t\t}\n\n\t\tvar values []int64\n\t\tfor _, bitLength := range prop.Bits {\n\t\t\tval, err := br.ReadBits(bitLength)\n\t\t\tif err != nil {\n\t\t\t\treturn magicAttributes, err\n\t\t\t}\n\n\t\t\tif prop.Bias != 0 {\n\t\t\t\tval -= prop.Bias\n\t\t\t}\n\n\t\t\tvalues = append(values, int64(val))\n\t\t}\n\n\t\tattr := MagicAttribute{\n\t\t\tID: id,\n\t\t\tName: prop.Name,\n\t\t\tValues: values,\n\t\t}\n\n\t\tmagicAttributes = append(magicAttributes, attr)\n\t}\n\n\treturn magicAttributes, nil\n}",
"func parseItems(bfr io.ByteReader, char *Character) error {\n\t// Make a buffer that can hold 4 bytes, which can hold the items header.\n\tbuf := make([]byte, 4)\n\n\t_, err := io.ReadFull(bfr.(io.Reader), buf)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\titemHeaderData := itemData{}\n\tif err := binary.Read(bytes.NewBuffer(buf), binary.LittleEndian, &itemHeaderData); err != nil {\n\t\treturn err\n\t}\n\n\tif string(itemHeaderData.Header[:]) != \"JM\" {\n\t\treturn errors.New(\"failed to find the items header\")\n\t}\n\n\tchar.Items, err = ParseItemList(bfr, int(itemHeaderData.Count))\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}",
"func parseAttributes(bfr io.ByteReader, char *Character) error {\n\t// Create a bit reader from the buffered reader to read the stats.\n\tbr := bitReader{r: bfr}\n\n\tfor {\n\t\tid, err := br.ReadBits(9)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\t// If all 9 bits are set, we've hit the end of the attributes section\n\t\t// at 0x1ff and exit the loop.\n\t\tif id == 0x1ff {\n\t\t\tbreak\n\t\t}\n\n\t\t// The attribute value bit length, so we'll know how many bits to read next.\n\t\tlength, ok := attributeBitMap[id]\n\t\tif !ok {\n\t\t\treturn fmt.Errorf(\"unknown attribute id: %d\", id)\n\t\t}\n\n\t\t// The attribute value.\n\t\tattr, err := br.ReadBits(length)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tswitch id {\n\t\tcase strength:\n\t\t\tchar.Attributes.Strength = attr\n\t\tcase energy:\n\t\t\tchar.Attributes.Energy = attr\n\t\tcase dexterity:\n\t\t\tchar.Attributes.Dexterity = attr\n\t\tcase vitality:\n\t\t\tchar.Attributes.Vitality = attr\n\t\tcase unusedStats:\n\t\t\tchar.Attributes.UnusedStats = attr\n\t\tcase unusedSkills:\n\t\t\tchar.Attributes.UnusedSkillPoints = attr\n\t\tcase currentHP:\n\t\t\tchar.Attributes.CurrentHP = attr / 256\n\t\tcase maxHP:\n\t\t\tchar.Attributes.MaxHP = attr / 256\n\t\tcase currentMana:\n\t\t\tchar.Attributes.CurrentMana = attr / 256\n\t\tcase maxMana:\n\t\t\tchar.Attributes.MaxMana = attr / 256\n\t\tcase currentStamina:\n\t\t\tchar.Attributes.CurrentStamina = attr / 256\n\t\tcase maxStamina:\n\t\t\tchar.Attributes.MaxStamina = attr / 256\n\t\tcase level:\n\t\t\tchar.Attributes.Level = attr\n\t\tcase experience:\n\t\t\tchar.Attributes.Experience = attr\n\t\tcase gold:\n\t\t\tchar.Attributes.Gold = attr\n\t\tcase stashedGold:\n\t\t\tchar.Attributes.StashedGold = attr\n\t\t}\n\t}\n\n\treturn nil\n}",
"func (b *block) getbit(i uint32) bool {\n\tbit := uint32(1) << (i % wordSize)\n\tx := (*b)[(i/wordSize)%blockWords] & bit\n\treturn x != 0\n}",
"func (r *Reader) ReadBitField(n uint) (map[int]bool, error) {\n\tvar m = make(map[int]bool)\n\tfor i := uint(0); i < n; i++ {\n\t\tb, err := r.ReadBool()\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"ReadBool failed: %s\", err.Error())\n\t\t}\n\t\tm[int(i)+1] = b\n\t}\n\treturn m, nil\n}",
"func (b *BitString) BitLength() uint16 {\n\treturn uint16(len(b.bytes) * 8)\n}",
"func parseMercItems(bfr io.ByteReader, char *Character) error {\n\tbr := bitReader{r: bfr}\n\n\t// offset: 0 \"j\"\n\tj, err := br.ReadByte()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// offset: 8, \"f\"\n\tf, err := br.ReadByte()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif string(j) != \"j\" || string(f) != \"f\" {\n\t\treturn errors.New(\"failed to find merc header jf\")\n\t}\n\n\t// If you have a merc, we'll read the item list of the merc here.\n\tif char.Header.MercID != 0 {\n\t\t// Make a buffer that can hold 4 bytes, which can hold the items header.\n\t\tbuf := make([]byte, 4)\n\n\t\t_, err := io.ReadFull(bfr.(io.Reader), buf[:4])\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\titemHeaderData := itemData{}\n\t\terr = binary.Read(bytes.NewBuffer(buf), binary.LittleEndian, &itemHeaderData)\n\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tif string(itemHeaderData.Header[:]) != \"JM\" {\n\t\t\treturn errors.New(\"failed to find the merc items header\")\n\t\t}\n\n\t\titems, err := ParseItemList(bfr, int(itemHeaderData.Count))\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tchar.MercItems = items\n\t}\n\n\treturn nil\n}",
"func bitLen_g(x Word) (n int) {\n\tfor ; x >= 0x8000; x >>= 16 {\n\t\tn += 16\n\t}\n\tif x >= 0x80 {\n\t\tx >>= 8\n\t\tn += 8\n\t}\n\tif x >= 0x8 {\n\t\tx >>= 4\n\t\tn += 4\n\t}\n\tif x >= 0x2 {\n\t\tx >>= 2\n\t\tn += 2\n\t}\n\tif x >= 0x1 {\n\t\tn++\n\t}\n\treturn\n}",
"func Item(src *bytes.Buffer, x *ItemStack) error {\n\tx.NBTData = make(map[string]interface{})\n\tif err := Varint32(src, &x.NetworkID); err != nil {\n\t\treturn wrap(err)\n\t}\n\tif x.NetworkID == 0 {\n\t\t// The item was air, so there is no more data we should read for the item instance. After all, air\n\t\t// items aren't really anything.\n\t\tx.MetadataValue = 0\n\t\tx.Count = 0\n\t\tx.CanBePlacedOn, x.CanBreak = nil, nil\n\t\treturn nil\n\t}\n\tvar auxValue int32\n\tif err := Varint32(src, &auxValue); err != nil {\n\t\treturn wrap(err)\n\t}\n\tx.MetadataValue = int16(auxValue >> 8)\n\tx.Count = int16(auxValue & 0xff)\n\n\tvar userDataMarker int16\n\tif err := binary.Read(src, binary.LittleEndian, &userDataMarker); err != nil {\n\t\treturn wrap(err)\n\t}\n\tif userDataMarker == -1 {\n\t\tvar userDataVersion uint8\n\t\tif err := binary.Read(src, binary.LittleEndian, &userDataVersion); err != nil {\n\t\t\treturn wrap(err)\n\t\t}\n\t\tswitch userDataVersion {\n\t\tcase 1:\n\t\t\tif err := nbt.NewDecoder(src).Decode(&x.NBTData); err != nil {\n\t\t\t\treturn fmt.Errorf(\"%v: error decoding user data NBT: %v\", callFrame(), err)\n\t\t\t}\n\t\tdefault:\n\t\t\treturn fmt.Errorf(\"%v: unexpected item user data version %v\", callFrame(), userDataVersion)\n\t\t}\n\t} else if userDataMarker != 0 {\n\t\tif userDataMarker < 0 {\n\t\t\treturn fmt.Errorf(\"%v: invalid NBT length %v\", callFrame(), userDataMarker)\n\t\t}\n\t\tnbtData := src.Next(int(userDataMarker))\n\t\tif err := nbt.UnmarshalEncoding(nbtData, &x.NBTData, nbt.LittleEndian); err != nil {\n\t\t\treturn fmt.Errorf(\"%v: error decoding item NBT: %v\", callFrame(), err)\n\t\t}\n\t}\n\tvar count int32\n\tif err := Varint32(src, &count); err != nil {\n\t\treturn wrap(err)\n\t}\n\tif count < 0 {\n\t\treturn NegativeCountError{Type: \"item can be placed on\"}\n\t}\n\tif count > higherLimit {\n\t\treturn LimitHitError{Limit: higherLimit, Type: \"item can be placed on\"}\n\t}\n\tx.CanBePlacedOn = make([]string, count)\n\tfor i := int32(0); i < count; i++ {\n\t\tif err := String(src, &x.CanBePlacedOn[i]); err != nil {\n\t\t\treturn wrap(err)\n\t\t}\n\t}\n\tif err := Varint32(src, &count); err != nil {\n\t\treturn wrap(err)\n\t}\n\tif count < 0 {\n\t\treturn NegativeCountError{Type: \"item can break\"}\n\t}\n\tif count > higherLimit {\n\t\treturn LimitHitError{Limit: higherLimit, Type: \"item can break\"}\n\t}\n\tx.CanBreak = make([]string, count)\n\tfor i := int32(0); i < count; i++ {\n\t\tif err := String(src, &x.CanBreak[i]); err != nil {\n\t\t\treturn wrap(err)\n\t\t}\n\t}\n\tconst shieldID = 513\n\tif x.NetworkID == shieldID {\n\t\tvar blockingTick int64\n\t\tif err := Varint64(src, &blockingTick); err != nil {\n\t\t\treturn wrap(err)\n\t\t}\n\t}\n\treturn nil\n}",
"func enrichBits(variable trapVariable, varMetadata VariableMetadata) (interface{}, string) {\n\t// do bitwise search\n\tbytes, ok := variable.Value.([]byte)\n\tif !ok {\n\t\tlog.Warnf(\"unable to enrich variable %q %s with BITS mapping, received value was not []byte, was %T\", varMetadata.Name, variable.OID, variable.Value)\n\t\treturn variable.Value, \"\"\n\t}\n\tenabledValues := make([]interface{}, 0)\n\tfor i, b := range bytes {\n\t\tfor j := 0; j < 8; j++ {\n\t\t\tposition := j + i*8 // position is the index in the current byte plus 8 * the position in the byte array\n\t\t\tenabled, err := isBitEnabled(uint8(b), j)\n\t\t\tif err != nil {\n\t\t\t\tlog.Debugf(\"unable to determine status at position %d: %s\", position, err.Error())\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tif enabled {\n\t\t\t\tif value, ok := varMetadata.Bits[position]; !ok {\n\t\t\t\t\tlog.Debugf(\"unable to find enum mapping for value %d variable %q\", i, varMetadata.Name)\n\t\t\t\t\tenabledValues = append(enabledValues, position)\n\t\t\t\t} else {\n\t\t\t\t\tenabledValues = append(enabledValues, value)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\thexString := fmt.Sprintf(\"0x%X\", bytes)\n\treturn enabledValues, hexString\n}",
"func bitpackingByteConsumed(bitWidth int, numValues int) int {\n\treturn ((bitWidth * numValues) + 7) / 8\n}",
"func (b *BloomFilter) Unpack(rawbytes []byte) error {\n\t/*\n\t\trawbytes, err := base64.StdEncoding.DecodeString(packed)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}*/\n\n\ttmp := [3]uint64{0, 0, 0}\n\tgr, err := gzip.NewReader(bytes.NewReader(rawbytes))\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = binary.Read(gr, binary.LittleEndian, &tmp)\n\tif err != nil {\n\t\treturn err\n\t}\n\tb.advised = 0\n\tb.estError = 0.0\n\tb.size = tmp[0]\n\tb.keys = tmp[1]\n\tb.nadded = tmp[2]\n\n\tb.parts = make([]uint64, 1+(b.size/64))\n\n\t// force reload on next hash\n\tb.h0State = b.h0State[:0]\n\tb.h1State = b.h1State[:0]\n\n\treturn binary.Read(gr, binary.LittleEndian, b.parts)\n}",
"func computeHuffLen(zeros, ones int) (huffLen uint, inv bool) {\n\tconst (\n\t\tmaxSyms = 257 // Maximum number of literal codes (with EOB marker)\n\t\tminHuffLen = 1 // Minimum number of bits for each Huffman code\n\t\tmaxHuffLen = 7 // Maximum number of bits for each Huffman code\n\t)\n\n\tif inv = ones > zeros; inv {\n\t\tzeros, ones = ones, zeros\n\t}\n\tfor huffLen = minHuffLen; huffLen <= maxHuffLen; huffLen++ {\n\t\tmaxOnes := 1 << uint(huffLen)\n\t\tif maxSyms-maxOnes >= zeros+8 && maxOnes >= ones+8 {\n\t\t\treturn huffLen, inv\n\t\t}\n\t}\n\treturn 0, false\n}",
"func decode(ops []uint8) (*gbOpcode, int, error) {\n\tif len(ops) == 0 {\n\t\treturn nil, 0, gbErrInvalidOpcode\n\t}\n\n\to := gbOpcode{\n\t\theader: (ops[0] & gbOpcodeMaskHeader) >> 6,\n\t\tfirst: (ops[0] & gbOpcodeMaskFirst) >> 3,\n\t\tsecond: (ops[0] & gbOpcodeMaskSecond),\n\t\tdata: ops[1:],\n\t}\n\n\tswitch o.header {\n\tcase gbOpcodeHeader01:\n\t\tfR := decodeRegisterType(o.first)\n\t\tsR := decodeRegisterType(o.second)\n\n\t\t// The 01 opcodes are all a single byte.\n\t\tif len(o.data) > 0 {\n\t\t\treturn nil, -len(o.data), gbErrWrongOpcodeSize\n\t\t}\n\n\t\tif o.first == gbOpcodePart110 {\n\t\t\to.tipe = gbOpcodeLDHlR\n\t\t\to.cycles = 2\n\t\t\treturn &o, 0, nil\n\t\t}\n\n\t\tif o.second == gbOpcodePart110 {\n\t\t\to.tipe = gbOpcodeLDRHl\n\t\t\to.cycles = 2\n\t\t\treturn &o, 0, nil\n\t\t}\n\n\t\tif fR != gbRegisterUnknown && sR != gbRegisterUnknown {\n\t\t\to.tipe = gbOpcodeLDRRp\n\t\t\to.cycles = 1\n\t\t\treturn &o, 0, nil\n\t\t}\n\n\tcase gbOpcodeHeader00:\n\t\tfR := decodeRegisterType(o.first)\n\n\t\tif fR != gbRegisterUnknown && o.second == gbOpcodePart110 {\n\t\t\tif len(o.data) != 1 {\n\t\t\t\treturn nil, 1 - len(o.data), gbErrWrongOpcodeSize\n\t\t\t}\n\n\t\t\to.tipe = gbOpcodeLDRN\n\t\t\to.cycles = 2\n\t\t\treturn &o, 0, nil\n\t\t}\n\n\t\tif o.first == gbOpcodePart110 && o.second == gbOpcodePart110 {\n\t\t\tif len(o.data) != 1 {\n\t\t\t\treturn nil, 1 - len(o.data), gbErrWrongOpcodeSize\n\t\t\t}\n\n\t\t\to.tipe = gbOpcodeLDHlN\n\t\t\to.cycles = 3\n\t\t\treturn &o, 0, nil\n\t\t}\n\t}\n\n\treturn nil, 0, gbErrInvalidOpcode\n}",
"func parseTagAndLength(bytes []byte) (elem element, length int, rest []byte, ok bool) {\n\trest = bytes\n\n\t// Parse the tag.\n\tvar tagOk bool\n\telem.tag, bytes, tagOk = parseTag(bytes)\n\tif !tagOk {\n\t\treturn\n\t}\n\n\t// Parse the length.\n\tif len(bytes) == 0 {\n\t\treturn\n\t}\n\tb := bytes[0]\n\tbytes = bytes[1:]\n\tif b < 0x80 {\n\t\t// Short form length.\n\t\tlength = int(b)\n\t} else if b == 0x80 {\n\t\tif !elem.tag.Constructed {\n\t\t\treturn // Indefinite-length elements must be constructed.\n\t\t}\n\t\telem.indefinite = true\n\t} else {\n\t\t// Long form length.\n\t\tb &= 0x7f\n\t\tif int(b) > len(bytes) {\n\t\t\treturn // Not enough room.\n\t\t}\n\t\tfor i := 0; i < int(b); i++ {\n\t\t\tif length >= 1<<23 {\n\t\t\t\treturn // Overflow.\n\t\t\t}\n\t\t\tlength <<= 8\n\t\t\tlength |= int(bytes[i])\n\t\t}\n\t\tif bytes[0] == 0 || length < 0x80 {\n\t\t\telem.longFormOverride = int(b) // Non-minimal length.\n\t\t}\n\t\tbytes = bytes[b:]\n\t}\n\tok = true\n\trest = bytes\n\treturn\n}",
"func GetFreqItems(fname string, t_hold float32, is_pcy bool) (map[int]int, int, int, map[int]bool) {\n\tn := GetLineCount(fname)\n\tif n == 0 {\n\t\treturn map[int]int{}, 0, 0, map[int]bool{}\n\t}\n\tf, err := os.Open(fname)\n\tif err != nil {\n\t\tfmt.Printf(\"%s\\n\", err)\n\t\treturn map[int]int{}, 0, 0, map[int]bool{}\n\t}\n\tdefer f.Close()\n\n\tn_bins := int(float64(n) * float64(0.3))\n\tc_items := make(map[int]bool)\n\tc_item_counts := make(map[int]int)\n\titemsets_hashtable := make([]int, n_bins)\n\titemsets_bitmap := make(map[int]bool)\n\tfr := bufio.NewReader(f)\n\tline, _, err := fr.ReadLine()\n\tfor err != io.EOF {\n\t\tint_line := []int{}\n\t\tfor _, str_item := range strings.Split(strings.TrimSuffix(string(line), FILE_SEP), FILE_SEP) {\n\t\t\tint_item, _ := strconv.Atoi(str_item)\n\t\t\tint_line = append(int_line, int_item)\n\t\t}\n\t\tGetItemCounts(int_line, c_items, c_item_counts, itemsets_hashtable, n_bins, is_pcy)\n\t\tline, _, err = fr.ReadLine()\n\t}\n\n\t// Calculate minimum support\n\tmin_supp := int(t_hold * float32(n))\n\n\tif is_pcy {\n\t\tHashtableToBitmap(itemsets_hashtable, itemsets_bitmap, min_supp)\n\t}\n\n\treturn c_item_counts, min_supp, n_bins, itemsets_bitmap\n}",
"func getBits(data []byte, i int, n int) (uint32, error) {\n\tvar tmpData = make([]byte, 4)\n\n\tlength := len(data) * 8\n\tnBits := n\n\tif i+nBits > length { // If there are no n bits available\n\t\tnBits = length - i // Copy all remaining bits\n\t}\n\n\tif err := copyBits(data, i, tmpData, len(tmpData)*8-n, nBits); err != nil {\n\t\treturn 0, err\n\t}\n\n\tvar rv uint32\n\tif err := binary.Read(bytes.NewBuffer(tmpData), binary.BigEndian, &rv); err != nil {\n\t\treturn 0, err\n\t}\n\treturn rv, nil\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
Parses the magical property list in the byte queue that belongs to an item and returns the list of properties.
|
func parseMagicalList(br *bitReader) ([]MagicAttribute, error) {
var magicAttributes []MagicAttribute
for {
id, err := br.ReadBits(9)
if err != nil {
return magicAttributes, err
}
// If all 9 bits are set, we've hit the end of the stats section
// at 0x1ff and exit the loop.
if id == 0x1ff {
break
}
prop, ok := magicalProperties[id]
if !ok {
return magicAttributes, fmt.Errorf("unknown magical property: %d", id)
}
var values []int64
for _, bitLength := range prop.Bits {
val, err := br.ReadBits(bitLength)
if err != nil {
return magicAttributes, err
}
if prop.Bias != 0 {
val -= prop.Bias
}
values = append(values, int64(val))
}
attr := MagicAttribute{
ID: id,
Name: prop.Name,
Values: values,
}
magicAttributes = append(magicAttributes, attr)
}
return magicAttributes, nil
}
|
[
"func create_property_list(jsonString string, t *testing.T) *[]Property {\n\tpa := make([]Property, 0, 10)\n\n\tif err := json.Unmarshal([]byte(jsonString), &pa); err != nil {\n\t\tt.Errorf(\"Error unmarshalling Property json string: %v error:%v\", jsonString, err)\n\t\treturn nil\n\t} else {\n\t\treturn &pa\n\t}\n}",
"func (l *IOTHubEndpointServiceBusQueueList) GetItems() []resource.Managed {\n\titems := make([]resource.Managed, len(l.Items))\n\tfor i := range l.Items {\n\t\titems[i] = &l.Items[i]\n\t}\n\treturn items\n}",
"func (m *OutlookTask) GetMultiValueExtendedProperties()([]MultiValueLegacyExtendedPropertyable) {\n val, err := m.GetBackingStore().Get(\"multiValueExtendedProperties\")\n if err != nil {\n panic(err)\n }\n if val != nil {\n return val.([]MultiValueLegacyExtendedPropertyable)\n }\n return nil\n}",
"func (s *SBQueueProperties) UnmarshalJSON(data []byte) error {\n\tvar rawMsg map[string]json.RawMessage\n\tif err := json.Unmarshal(data, &rawMsg); err != nil {\n\t\treturn err\n\t}\n\tfor key, val := range rawMsg {\n\t\tvar err error\n\t\tswitch key {\n\t\tcase \"accessedAt\":\n\t\t\terr = unpopulateTimeRFC3339(val, &s.AccessedAt)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"autoDeleteOnIdle\":\n\t\t\terr = unpopulate(val, &s.AutoDeleteOnIdle)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"countDetails\":\n\t\t\terr = unpopulate(val, &s.CountDetails)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"createdAt\":\n\t\t\terr = unpopulateTimeRFC3339(val, &s.CreatedAt)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"deadLetteringOnMessageExpiration\":\n\t\t\terr = unpopulate(val, &s.DeadLetteringOnMessageExpiration)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"defaultMessageTimeToLive\":\n\t\t\terr = unpopulate(val, &s.DefaultMessageTimeToLive)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"duplicateDetectionHistoryTimeWindow\":\n\t\t\terr = unpopulate(val, &s.DuplicateDetectionHistoryTimeWindow)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"enableBatchedOperations\":\n\t\t\terr = unpopulate(val, &s.EnableBatchedOperations)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"enableExpress\":\n\t\t\terr = unpopulate(val, &s.EnableExpress)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"enablePartitioning\":\n\t\t\terr = unpopulate(val, &s.EnablePartitioning)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"forwardDeadLetteredMessagesTo\":\n\t\t\terr = unpopulate(val, &s.ForwardDeadLetteredMessagesTo)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"forwardTo\":\n\t\t\terr = unpopulate(val, &s.ForwardTo)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"lockDuration\":\n\t\t\terr = unpopulate(val, &s.LockDuration)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"maxDeliveryCount\":\n\t\t\terr = unpopulate(val, &s.MaxDeliveryCount)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"maxMessageSizeInKilobytes\":\n\t\t\terr = unpopulate(val, &s.MaxMessageSizeInKilobytes)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"maxSizeInMegabytes\":\n\t\t\terr = unpopulate(val, &s.MaxSizeInMegabytes)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"messageCount\":\n\t\t\terr = unpopulate(val, &s.MessageCount)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"requiresDuplicateDetection\":\n\t\t\terr = unpopulate(val, &s.RequiresDuplicateDetection)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"requiresSession\":\n\t\t\terr = unpopulate(val, &s.RequiresSession)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"sizeInBytes\":\n\t\t\terr = unpopulate(val, &s.SizeInBytes)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"status\":\n\t\t\terr = unpopulate(val, &s.Status)\n\t\t\tdelete(rawMsg, key)\n\t\tcase \"updatedAt\":\n\t\t\terr = unpopulateTimeRFC3339(val, &s.UpdatedAt)\n\t\t\tdelete(rawMsg, key)\n\t\t}\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}",
"func (m *OutlookTask) GetSingleValueExtendedProperties()([]SingleValueLegacyExtendedPropertyable) {\n val, err := m.GetBackingStore().Get(\"singleValueExtendedProperties\")\n if err != nil {\n panic(err)\n }\n if val != nil {\n return val.([]SingleValueLegacyExtendedPropertyable)\n }\n return nil\n}",
"func (obj *Common) List(property string) *List {\n\tvalue := obj.Property(property)\n\tm, ok := value.(*List)\n\tif !ok {\n\t\tpanic(fmt.Sprintf(\"value of property %q is not a QML list: %#v\", property, value))\n\t}\n\treturn m\n}",
"func GetMetadataList(bytes []byte) ([]byte, []byte, error) {\n\tts := strings.SplitN(string(bytes), \"}#{\", 2)\n\tif ts == nil {\n\t\treturn nil, nil, errors.New(\"unexpected input with nil as result of SplitN\")\n\t}\n\n\t// Now we can assume that len >= 1\n\tlen := len(ts)\n\n\tmetaBuf := append([]byte(ts[0]), '}')\n\tif len == 1 {\n\t\treturn metaBuf, nil, nil\n\t}\n\n\ttreeBuf := append([]byte(\"{\"), []byte(ts[1])...)\n\n\treturn metaBuf, treeBuf, nil\n}",
"func ToProperties(input []byte) ([]Property, error) {\n\tvar properties []Property\n\tif err := toTypeArray(input, &properties); err != nil {\n\t\treturn nil, err\n\t}\n\treturn properties, nil\n}",
"func getList(item value.Value) (*value.List, error) {\n\tswitch item := item.(type) {\n\tcase value.AnnotatedValue:\n\t\tps := item.GetAttachment(\"list\")\n\t\tswitch ps := ps.(type) {\n\t\tcase *value.List:\n\t\t\treturn ps, nil\n\t\tdefault:\n\t\t\treturn nil, fmt.Errorf(\"Invalid list %v of type %T.\", ps, ps)\n\t\t}\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"Invalid %v of type %T.\", item, item)\n\t}\n}",
"func getItemsPtr(list runtime.Object) (interface{}, error) {\n\tv, err := conversion.EnforcePtr(list)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\titems := v.FieldByName(\"Items\")\n\tif !items.IsValid() {\n\t\treturn nil, errExpectFieldItems\n\t}\n\tswitch items.Kind() {\n\tcase reflect.Interface, reflect.Pointer:\n\t\ttarget := reflect.TypeOf(items.Interface()).Elem()\n\t\tif target.Kind() != reflect.Slice {\n\t\t\treturn nil, errExpectSliceItems\n\t\t}\n\t\treturn items.Interface(), nil\n\tcase reflect.Slice:\n\t\treturn items.Addr().Interface(), nil\n\tdefault:\n\t\treturn nil, errExpectSliceItems\n\t}\n}",
"func (c Items) mekeShopitemArray(itemlist string) []string {\n\titems := strings.Split(itemlist, \";\")\n\titemNumber := len(items) - 1\n\n\tvar list []string\n\n\tfor index, item := range items {\n\t\twords := []byte(item)\n\n\t\tif index != 0 {\n\t\t\tif len(words) > 2 {\n\t\t\t\twords = words[2:len(words)]\n\t\t\t}\n\t\t}\n\n\t\tstr := string(words)\n\t\tlist = append(list, str)\n\t}\n\n\tlist = list[:itemNumber]\n\n\treturn list\n}",
"func parseItems(bfr io.ByteReader, char *Character) error {\n\t// Make a buffer that can hold 4 bytes, which can hold the items header.\n\tbuf := make([]byte, 4)\n\n\t_, err := io.ReadFull(bfr.(io.Reader), buf)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\titemHeaderData := itemData{}\n\tif err := binary.Read(bytes.NewBuffer(buf), binary.LittleEndian, &itemHeaderData); err != nil {\n\t\treturn err\n\t}\n\n\tif string(itemHeaderData.Header[:]) != \"JM\" {\n\t\treturn errors.New(\"failed to find the items header\")\n\t}\n\n\tchar.Items, err = ParseItemList(bfr, int(itemHeaderData.Count))\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}",
"func (fieldlist *FieldList) Properties() *enigma.GenericObjectProperties {\n\tfieldlist.mutex.Lock()\n\tdefer fieldlist.mutex.Unlock()\n\treturn fieldlist.properties\n}",
"func (l *IOTHubEndpointServiceBusTopicList) GetItems() []resource.Managed {\n\titems := make([]resource.Managed, len(l.Items))\n\tfor i := range l.Items {\n\t\titems[i] = &l.Items[i]\n\t}\n\treturn items\n}",
"func (q QueueURL) GetProperties(ctx context.Context) (*QueueGetPropertiesResponse, error) {\n\treturn q.client.GetProperties(ctx, nil, nil)\n}",
"func Property(ctx context.Context, obj dbus.BusObject, p string) (interface{}, error) {\n\ti := strings.LastIndex(p, \".\")\n\tif i < 0 {\n\t\treturn dbus.MakeVariant(nil), errors.Errorf(\"invalid D-Bus property %q\", p)\n\t}\n\n\tconst dbusMethod = \"org.freedesktop.DBus.Properties.Get\"\n\tiface := p[:i]\n\tprop := p[i+1:]\n\tc := obj.CallWithContext(ctx, dbusMethod, 0, iface, prop)\n\tif c.Err != nil {\n\t\treturn nil, errors.Wrapf(c.Err, \"failed to get D-Bus property %q on interface %q\", prop, iface)\n\t}\n\n\tv := dbus.Variant{}\n\tif err := c.Store(&v); err != nil {\n\t\treturn nil, errors.Wrapf(c.Err, \"failed to extract D-Bus property %q on interface %q\", prop, iface)\n\t}\n\treturn v.Value(), nil\n}",
"func (builder ImageBuilder) GetNamedPropertiesList() render.NamedProperties {\n\treturn builder.NamedProperties\n}",
"func parseSimpleBits(br *bitReader, item *Item) error {\n\t// offset: 0 \"J\"\n\tj, err := br.ReadByte()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\t// offset: 8, \"M\"\n\tm, err := br.ReadByte()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tif string(j) != \"J\" || string(m) != \"M\" {\n\t\treturn errors.New(\"failed to find item header JM\")\n\t}\n\n\t// offset: 16, unknown\n\tbr.ReadBits(4)\n\n\t// offset: 20\n\tif item.Identified, err = br.ReadBits(1); err != nil {\n\t\treturn err\n\t}\n\n\t// offset: 21, unknown\n\tbr.ReadBits(6)\n\n\t// offset: 27\n\tif item.Socketed, err = br.ReadBits(1); err != nil {\n\t\treturn err\n\t}\n\n\t// offset 28, unknown\n\tbr.ReadBits(1)\n\n\t// offset 29\n\tif item.New, err = br.ReadBits(1); err != nil {\n\t\treturn err\n\t}\n\n\t// offset 30, unknown\n\tbr.ReadBits(2)\n\n\t// offset 32\n\tif item.IsEar, err = br.ReadBits(1); err != nil {\n\t\treturn err\n\t}\n\n\t// offset 33\n\tif item.StarterItem, err = br.ReadBits(1); err != nil {\n\t\treturn err\n\t}\n\n\t// offset 34, unknown\n\tbr.ReadBits(3)\n\n\t// offset 37, if it's a simple item, it only contains 111 bits data\n\tif item.SimpleItem, err = br.ReadBits(1); err != nil {\n\t\treturn err\n\t}\n\n\t// offset 38\n\tif item.Ethereal, err = br.ReadBits(1); err != nil {\n\t\treturn err\n\t}\n\n\t// offset 39, unknown\n\tbr.ReadBits(1)\n\n\t// offset 40\n\tif item.Personalized, err = br.ReadBits(1); err != nil {\n\t\treturn err\n\t}\n\n\t// offset 41, unknown\n\tbr.ReadBits(1)\n\n\t// offset 42\n\tif item.GivenRuneword, err = br.ReadBits(1); err != nil {\n\t\treturn err\n\t}\n\n\t// offset 43, unknown\n\tbr.ReadBits(5)\n\n\t// offset 48\n\tif item.Version, err = br.ReadBits(8); err != nil {\n\t\treturn err\n\t}\n\n\t// offset 56, unknown\n\tbr.ReadBits(2)\n\n\t// offset 58\n\tif item.LocationID, err = br.ReadBits(3); err != nil {\n\t\treturn err\n\t}\n\n\t// offset 61\n\tif item.EquippedID, err = br.ReadBits(4); err != nil {\n\t\treturn err\n\t}\n\n\t// offset 65\n\tif item.PositionX, err = br.ReadBits(4); err != nil {\n\t\treturn err\n\t}\n\n\t// offset 69\n\tif item.PositionY, err = br.ReadBits(3); err != nil {\n\t\treturn err\n\t}\n\n\t// offset 72\n\tbr.ReadBits(1)\n\n\t// offset 73, if item is neither equipped or in the belt, this tells us where it is.\n\tif item.AltPositionID, err = br.ReadBits(3); err != nil {\n\t\treturn err\n\t}\n\n\tif item.IsEar == 0 {\n\t\t// offset 76, item type, 4 chars, each 8 bit (not byte aligned)\n\t\tvar itemType string\n\t\tfor j := 0; j < 4; j++ {\n\t\t\tt, err := br.ReadBits(8)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\titemType += fmt.Sprintf(\"%c\", t)\n\t\t}\n\n\t\titem.Type = strings.Trim(itemType, \" \")\n\t\titem.TypeID = item.getTypeID()\n\n\t\tswitch item.TypeID {\n\t\tcase armor:\n\t\t\ttypeName, ok := armorCodes[item.Type]\n\t\t\tif ok {\n\t\t\t\titem.TypeName = typeName\n\t\t\t}\n\t\tcase shield:\n\t\t\ttypeName, ok := shieldCodes[item.Type]\n\t\t\tif ok {\n\t\t\t\titem.TypeName = typeName\n\t\t\t}\n\t\tcase weapon:\n\t\t\ttypeName, ok := weaponCodes[item.Type]\n\t\t\tif ok {\n\t\t\t\titem.TypeName = typeName\n\t\t\t}\n\n\t\t\t// Weapons have base damage, so we'll check our\n\t\t\t// map for the base damage of this weapon type.\n\t\t\tbaseDamage, ok := weaponDamageMap[item.Type]\n\t\t\tif ok {\n\n\t\t\t\t// If the item is ethereal we need to add 50% enhanced\n\t\t\t\t// damage to the base damage.\n\t\t\t\tif item.Ethereal == 1 {\n\t\t\t\t\tbaseDamage.Min = int((float64(baseDamage.Min) * 1.5))\n\t\t\t\t\tbaseDamage.Max = int((float64(baseDamage.Max) * 1.5))\n\t\t\t\t\tbaseDamage.TwoMin = int((float64(baseDamage.TwoMin) * 1.5))\n\t\t\t\t\tbaseDamage.TwoMax = int((float64(baseDamage.TwoMax) * 1.5))\n\t\t\t\t}\n\n\t\t\t\titem.BaseDamage = &baseDamage\n\t\t\t}\n\t\tcase other:\n\t\t\ttypeName, ok := miscCodes[item.Type]\n\t\t\tif ok {\n\t\t\t\titem.TypeName = typeName\n\t\t\t}\n\t\t}\n\n\t\t// offset 108\n\t\t// If sockets exist, read the items, they'll be 108 bit basic items * nrOfSockets\n\t\tif item.NrOfItemsInSockets, err = br.ReadBits(3); err != nil {\n\t\t\treturn err\n\t\t}\n\t} else {\n\t\t// offset 76, the item is an ear, we need to read the ear data.\n\t\tearClass, err := br.ReadBits(3)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tearLevel, err := br.ReadBits(7)\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tvar name string\n\t\tfor {\n\t\t\tc, err := br.ReadBits(7)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\n\t\t\tif c == 0 {\n\t\t\t\tbreak\n\t\t\t}\n\n\t\t\tname += fmt.Sprintf(\"%c\", c)\n\t\t}\n\n\t\titem.EarAttributes = earAttributes{\n\t\t\tClass: earClass,\n\t\t\tLevel: earLevel,\n\t\t\tName: name,\n\t\t}\n\n\t\t// If the ear is not byte aligned, we'll have to byte align it before\n\t\t// reading the next property.\n\t\tbr.Align()\n\t}\n\n\treturn nil\n}",
"func (p *PoolGProperty) GetPropList() []string {\n\treturn p.PropList\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
The ticker go routine starts a new election if this peer hasn't received heartsbeats recently.
|
func (rf *Raft) ticker() {
for rf.killed() == false {
time.Sleep(time.Duration(rf.election)*time.Millisecond)
// Your code here to check if a leader election should
// be started and to randomize sleeping time using
// time.Sleep().
}
}
|
[
"func (r *Raft) tickElection() {\n\tr.electionElapsed++\n\tif r.electionElapsed >= r.randomElectionTimeout {\n\t\tr.electionElapsed = 0\n\t\t// send message `MessageType_MsgHup` to self\n\t\tr.Step(pb.Message{MsgType: pb.MessageType_MsgHup, From: r.id})\n\t}\n}",
"func (rf *Raft) FollowerStartNewRouldOfElection() {\n\tfor {\n\t\t<-rf.startNewElectionSignalCh\n\t\t// fmt.Printf(\"## Candidate %d with term %d start a new round of election wiht logs: %v\\n\", rf.me, rf.currentTerm, rf.logs)\n\t\tvar replyArr = make([]RequestVoteReply, len(rf.peers))\n\t\tvar requestVoteArgs RequestVoteArgs\n\t\trf.mu.Lock()\n\t\trf.currentTerm++\n\t\trf.state = Candidate\n\t\trf.votedFor = rf.me\n\t\tif logSize := len(rf.logs); logSize > 0 {\n\t\t\trequestVoteArgs = RequestVoteArgs{Term: rf.currentTerm, CandidateID: rf.me, LastLogIndex: logSize, LastLogTerm: rf.logs[logSize-1].Term}\n\t\t} else {\n\t\t\trequestVoteArgs = RequestVoteArgs{Term: rf.currentTerm, CandidateID: rf.me, LastLogIndex: 0, LastLogTerm: 0}\n\t\t}\n\t\trf.mu.Unlock()\n\t\tfor peerID := 0; peerID < len(rf.peers); peerID++ {\n\t\t\tif peerID == rf.me {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tgo rf.sendRequestVote(peerID, &requestVoteArgs, &replyArr[peerID])\n\t\t}\n\t\trandTimeoutMilli := ElectionTimeoutMilli + ElectionTimeoutMilli/4 - rand.Intn(ElectionTimeoutMilli/2)\n\n\t\ttimeout := time.After(time.Duration(randTimeoutMilli) * time.Millisecond)\n\t\ttick := time.Tick(time.Duration(LeaderHeartbeatIntervalMilli) * time.Millisecond)\n\n\t\t// tick is for periodic check of votes, since normally we don't need to wait that long\n\t\telectionInterrupted := false\n\t\tvoteActuired := 1\n\t\tfor !electionInterrupted {\n\t\t\tselect {\n\t\t\tcase <-timeout:\n\t\t\t\telectionInterrupted = true\n\t\t\tcase <-tick:\n\t\t\t\tvoteActuired = 1\n\t\t\t\trf.mu.Lock()\n\t\t\t\tfor peerID := 0; peerID < len(rf.peers); peerID++ {\n\t\t\t\t\tif peerID == rf.me {\n\t\t\t\t\t\tcontinue\n\t\t\t\t\t}\n\t\t\t\t\tif replyArr[peerID].Term > rf.currentTerm {\n\t\t\t\t\t\trf.state = Follower\n\t\t\t\t\t\trf.currentTerm = replyArr[peerID].Term\n\t\t\t\t\t\trf.votedFor = -1\n\t\t\t\t\t} else if replyArr[peerID].VoteGranted {\n\t\t\t\t\t\tvoteActuired++\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telectionInterrupted = (voteActuired*2 > len(rf.peers)) || rf.state == Follower\n\t\t\t\trf.mu.Unlock()\n\t\t\t}\n\t\t}\n\t\trf.mu.Lock()\n\t\tif rf.state == Follower {\n\t\t\trf.mu.Unlock()\n\t\t\tcontinue\n\t\t}\n\t\tif voteActuired*2 > len(rf.peers) {\n\t\t\trf.state = Leader\n\t\t\t// unlock before sending to channel, could use defer here, but not that familiar for now\n\t\t\trf.mu.Unlock()\n\t\t\trf.winElectionSignalCh <- true\n\t\t} else {\n\t\t\trf.votedFor = -1\n\t\t\trf.mu.Unlock()\n\t\t\trf.startNewElectionSignalCh <- true\n\t\t}\n\t}\n}",
"func (rf *Raft) kickOffElection() {\n\tDPrintf(\"Raft # %d in function kickOffElection()\", rf.me)\n\t// send out requestVote RPCs\n\treplyChan := make(chan *RequestVoteReply)\n\targs := RequestVoteArgs{}\n\trf.mu.Lock()\n\tDPrintf(\"Raft # %d got the lock\", rf.me)\n\targs.Term = rf.currentTerm\n\tDPrintf(\"rf.currentTerm %d\", rf.currentTerm)\n\targs.CandidateId = rf.me\n\targs.LastLogIndex = len(rf.log) - 1\n\targs.LastLogTerm = rf.log[args.LastLogIndex].TermReceived\n\trf.mu.Unlock()\n\tcurrentVoteCounter := 1\n\tfor i := range rf.peers {\n\t\treply := RequestVoteReply{}\n\t\tif i != rf.me {\n\t\t\tgo rf.sendRequestVote(i, &args, &reply, replyChan)\n\t\t\tDPrintf(\"Raft # %d sent RequestVote to Peer # %d\", rf.me, i)\n\t\t\tDPrintf(\"Raft # %d sent RequestVote content: %v\", rf.me, args)\n\t\t\t// if the RPC times out, the go routine will return false\n\t\t\t// should the RequestVote RPC be sent again?\n\t\t}\n\t}\n\tfor { // request vote response handler\n\t\treply := <-replyChan\n\t\trf.mu.Lock()\n\t\tDPrintf(\"Raft # %d got the lock\", rf.me)\n\t\tDPrintf(\"Raft # %d got RequestVote reply from Peer\", rf.me)\n\t\tif rf.currentTerm > args.Term {\n\t\t\t// already timed out and kick started a new election\n\t\t\trf.mu.Unlock()\n\t\t\treturn\n\t\t}\n\t\tDPrintf(\"Raft # %d is in term # %d\", rf.me, rf.currentTerm)\n\t\tif reply.VoteGranted && reply.Term == rf.currentTerm {\n\t\t\tcurrentVoteCounter++\n\t\t\tif currentVoteCounter >= rf.majorityNeed && rf.currentState == candidate {\n\t\t\t\t// elected leader\n\t\t\t\tDPrintf(\"Raft # %d received enough votes and converted to leader\", rf.me)\n\t\t\t\trf.currentState = leader\n\t\t\t\trf.nextIndex = make([]int, len(rf.peers))\n\t\t\t\trf.matchIndex = make([]int, len(rf.peers))\n\t\t\t\tfor i := range rf.peers {\n\t\t\t\t\trf.nextIndex[i] = len(rf.log)\n\t\t\t\t\trf.matchIndex[i] = 0\n\t\t\t\t}\n\t\t\t\tgo rf.leaderRoutine()\n\t\t\t\trf.mu.Unlock()\n\t\t\t\treturn\n\t\t\t}\n\t\t} else {\n\t\t\t// vote not granted\n\t\t\t// may need to update the term\n\t\t\tif rf.currentTerm < reply.Term {\n\t\t\t\trf.currentTerm = reply.Term\n\t\t\t\trf.currentState = follower // voting conversion\n\t\t\t\trf.votedFor = -1\n\t\t\t\trf.electionTimerResetted = true\n\t\t\t\t// All Servers: if RPC response contain term > currentTerm\n\t\t\t\t// convert to follower\n\t\t\t\trf.persist()\n\t\t\t\trf.mu.Unlock()\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\t\trf.mu.Unlock() // don't hold the lock while listening on channel\n\t}\n}",
"func (rf *Raft) checkHeartBeat() {\n\tfor !rf.killed() {\n\t\trf.mu.Lock()\n\t\tok := time.Now().UnixNano()-rf.heartBeat > rf.timeout && rf.state != Leader\n\t\t//fmt.Printf(\"[%d] heartBeart %v %v\\n\", rf.me, time.Now().UnixNano()-rf.heartBeat, rf.state)\n\t\trf.mu.Unlock()\n\t\tif ok {\n\t\t\trf.AttemptRequestVote()\n\t\t}\n\t\ttime.Sleep(time.Millisecond * 20)\n\t}\n}",
"func (p *InteractiveBrokers) StartTicker(pair string) {\n}",
"func candidateLoop(sc *ServerConfig) {\n\t//\tdbg.Println(sc.basicCluster.Mypid, \"entered candidate\")\n\t// increment term\n\tsc.mutex.Lock()\n\tsc.term++\n\tsc.mutex.Unlock()\n\n\t// vote for self\n\tsetVotedFor(sc, sc.basicCluster.Mypid)\n\ttotalVotesRecieved := 1\n\t//reset timer\n\ttimeChan := RandomTimer(sc.electionTODuration)\n\t// send request for voting on all peers\n\n\tsc.basicCluster.Output <- &cluster.Envelope{SendTo: -1, SendBy: sc.basicCluster.Mypid, Term: getTerm(sc), Type: REQUESTVOTE, PrevLogIndex: len(sc.log) - 1, PrevLogTerm: sc.log[len(sc.log)-1].Term}\n\n\tfor getState(sc) == CANDIDATE {\n\n\t\tselect {\n\t\t// wait for inbox channel\n\t\tcase envelope := <-sc.basicCluster.Input:\n\n\t\t\t// if a lower term message is recieved, send a modify message...\n\t\t\tif envelope.Term < getTerm(sc) {\n\n\t\t\t\tsc.basicCluster.Output <- &cluster.Envelope{SendTo: envelope.SendBy, SendBy: sc.basicCluster.Mypid, Term: getTerm(sc), Type: MODIFY}\n\t\t\t\t// if recieved message term is greater than my term, end election, become follower, return\n\t\t\t} else if envelope.Type == HEARTBEAT || envelope.Type == APPEND {\n\t\t\t\tsetTerm(sc, envelope.Term)\n\t\t\t\tsetState(sc, FOLLOWER)\n\t\t\t\tsetVotedFor(sc, NONE)\n\t\t\t\tsetLeader(sc, envelope.SendBy)\n\n\t\t\t\treturn\n\t\t\t} else if envelope.Term > getTerm(sc) {\n\t\t\t\tsetTerm(sc, envelope.Term)\n\t\t\t\t// if bigger term peer requests for vote, give him vote without thinking, as your vote to yourself is stale\n\t\t\t\tif envelope.Type == REQUESTVOTE {\n\t\t\t\t\tsetVotedFor(sc, envelope.SendBy)\n\n\t\t\t\t\tsc.basicCluster.Output <- &cluster.Envelope{SendTo: envelope.SendBy, SendBy: sc.basicCluster.Mypid, Term: getTerm(sc), Type: GRANTVOTE, VoteTo: envelope.SendBy}\n\t\t\t\t}\n\t\t\t\tsetState(sc, FOLLOWER)\n\t\t\t\treturn\n\t\t\t\t// if vote is granted, add to total votes\n\t\t\t} else if envelope.Type == GRANTVOTE && envelope.VoteTo == sc.basicCluster.Mypid {\n\t\t\t\ttotalVotesRecieved++\n\n\t\t\t}\n\n\t\t\t// if majority votes recieved, become leader, return\n\t\t\tif totalVotesRecieved >= sc.majority {\n\t\t\t\tsetState(sc, LEADER)\n\t\t\t\tsetVotedFor(sc, NONE)\n\t\t\t\tsetLeader(sc, sc.basicCluster.Mypid)\n\n\t\t\t\t//setReady(sc, true)\n\t\t\t\tsc.ready <- true\n\t\t\t\treturn\n\t\t\t}\n\t\t\t// if timeout\n\t\tcase <-timeChan:\n\t\t\t// become follower, end election.\n\n\t\t\tsetVotedFor(sc, NONE)\n\t\t\tsetState(sc, FOLLOWER)\n\t\t\t// If error channel has some value.\n\t\tcase <-sc.ErrorChannel:\n\t\t\tcloseServer(sc)\n\t\t}\n\t}\n}",
"func (s *CheckForUpgradesScheduler) NeedLeaderElection() bool { return true }",
"func (cm *ConsensusModule) startElection() {\n cm.state = Candidate\n cm.currentTerm += 1\n savedCurrentTerm := cm.currentTerm\n cm.electionResetEvent = time.Now()\n cm.votedFor = cm.id\n cm.dlog(\"becomes Canddiate (currentTerm=%d); log=%v\", savedCurrentTerm, cm.log)\n\n // candidate votes for itself\n var votesReceived int32 = 1\n\n // Send RequestVote RPCs to peers\n for _, peerId := range cm.peerIds {\n go func(peerId int) {\n cm.mu.Lock()\n savedLastLogIndex, savedLastLogTerm := cm.lastLogIndexAndTerm()\n cm.mu.Unlock()\n\n args := RequestVoteArgs{\n Term: savedCurrentTerm,\n CandidateId: cm.id,\n LastLogIndex: savedLastLogIndex,\n LastLogTerm: savedLastLogTerm,\n }\n\n cm.dlog(\"sending RequestVote to %d: %+v\", peerId, args)\n var reply RequestVoteReply\n\n // each RPC issued in a separate goroutine (since RPC calls synchronous)\n // QUESTION: why are we using pointers for reply?\n if err := cm.server.Call(peerId, \"ConsensusModule.RequestVote\", args, &reply); err == nil {\n cm.mu.Lock()\n defer cm.mu.Unlock()\n cm.dlog(\"received RequestVoteReply %+v\", reply)\n\n // if RPC succeeds, some time has passed, so check current state\n // if no longer candidate, bail\n // (can happen if we won election because enough votes collected in other RPC calls\n // or we switched back to being a follower if one of the other RPC calls heard\n // from a server with a higher term\n if cm.state != Candidate {\n cm.dlog(\"while waiting for reply, state = %v\", cm.state)\n return\n }\n\n // if still candidate\n if reply.Term > savedCurrentTerm {\n // other candidate one while we were collecting votes\n cm.dlog(\"term out of date in RequestVoteReply\")\n cm.becomeFollower(reply.Term)\n return\n } else if reply.Term == savedCurrentTerm {\n if reply.VoteGranted {\n // use atomic to collect votes from multiple goroutines safely\n votes := int(atomic.AddInt32(&votesReceived, 1))\n if votes*2 > len(cm.peerIds) + 1 {\n // won the election\n cm.dlog(\"wins election with %d votes\", votes)\n cm.startLeader()\n return\n }\n }\n }\n }\n }(peerId)\n }\n\n // in case this election is not successful, run another election timer\n go cm.runElectionTimer()\n}",
"func (rf *Raft) FollowerCheckPeriodicHeartbeat() {\n\tfor {\n\t\ttimeout := FollowerHeartbeatTimeoutMilli + FollowerHeartbeatTimeoutMilli/4 -\n\t\t\trand.Intn(FollowerHeartbeatTimeoutMilli/2)\n\t\tselect {\n\t\tcase <-rf.heatbeatSignalCh:\n\t\tcase <-time.After(time.Duration(timeout) * time.Millisecond):\n\t\t\t// This does not require strict locking since\n\t\t\t// 1) don't lock around channels (might be blocking)\n\t\t\t// 2) Follower timeout does not need to be that precise, it is good to timeout it in next loop if server become Follower just after the judgement(we don't want elections to happen at the same time anyway)\n\t\t\trf.mu.Lock()\n\t\t\tif rf.state == Follower {\n\t\t\t\trf.mu.Unlock()\n\t\t\t\trf.startNewElectionSignalCh <- true\n\t\t\t} else {\n\t\t\t\trf.mu.Unlock()\n\t\t\t}\n\t\t}\n\t}\n\n}",
"func (rf *Raft) checkForTimeOut() {\n\tTrue := true\n\tfor True {\n\t\trf.mu.Lock()\n\t\tif !rf.isFunctional {\n\t\t\trf.mu.Unlock()\n\t\t\treturn\n\t\t}\n\t\t// if not leader and didn't hear from a leader\n\t\t// for an interval larger then the timout --> start election\n\t\tif !rf.isLeader && time.Since(rf.lastRecv).Nanoseconds()/1e6 >= rf.timeOut {\n\t\t\t rf.CurrentTerm = rf.CurrentTerm + 1\n\t\t\t rf.isCandidate = true\n\t\t\t rf.VotedFor = rf.me\n\t\t\t rf.timeOut = random()\n\t\t\t rf.votes = 0\n\t\t\t rf.lastRecv = time.Now()\n\t\t\t rf.persist()\n\t\t\t rf.requestCandindancy()\n\t\t }\n\t\trf.mu.Unlock()\n\t}\n\n}",
"func (r *Raft) runNormal() {\n\tstartElection := func() {\n\t\tr.mu.Lock()\n\t\tdefer r.mu.Unlock()\n\t\tif r.resetElection {\n\t\t\tr.resetElection = false\n\t\t\treturn\n\t\t}\n\n\t\tif r.state == Leader {\n\t\t\tr.logger.Warnln(\"Leader stepping down\")\n\t\t\t// Thesis §6.2: A leader in Raft steps down if\n\t\t\t// an election timeout elapses without a\n\t\t\t// successful round of heartbeats to a majority\n\t\t\t// of its cluster.\n\t\t\tr.becomeFollower(r.currentTerm)\n\t\t\treturn\n\t\t}\n\n\t\t// #F2 If election timeout elapses without\n\t\t// receiving AppendEntries RPC from current\n\t\t// leader or granting vote to candidate: convert\n\t\t// to candidate.\n\t\tr.startElection()\n\t}\n\n\tbaseline := func() {\n\t\tr.mu.Lock()\n\t\tdefer r.mu.Unlock()\n\t\tif r.state == Leader {\n\t\t\treturn\n\t\t}\n\t\tif r.resetBaseline {\n\t\t\tr.resetBaseline = false\n\t\t\treturn\n\t\t}\n\t\tr.heardFromLeader = false\n\t}\n\n\tbaselineTimeout := time.After(r.electionTimeout)\n\trndTimeout := randomTimeout(r.electionTimeout)\n\telectionTimeout := time.After(rndTimeout)\n\theartbeatTimeout := time.After(r.heartbeatTimeout)\n\n\tr.logger.WithField(\"electiontimeout\", rndTimeout).\n\t\tInfoln(\"Set election timeout\")\n\n\tfor {\n\t\tselect {\n\t\tcase <-baselineTimeout:\n\t\t\tbaselineTimeout = time.After(r.electionTimeout)\n\t\t\tbaseline()\n\t\tcase <-electionTimeout:\n\t\t\trndTimeout := randomTimeout(r.electionTimeout)\n\t\t\telectionTimeout = time.After(rndTimeout)\n\n\t\t\tr.logger.WithField(\"electiontimeout\", rndTimeout).\n\t\t\t\tInfoln(\"Set election timeout\")\n\n\t\t\tstartElection()\n\t\tcase <-r.startElectionNow:\n\t\t\trndTimeout := randomTimeout(r.electionTimeout)\n\t\t\telectionTimeout = time.After(rndTimeout)\n\n\t\t\tr.logger.WithField(\"electiontimeout\", rndTimeout).\n\t\t\t\tInfoln(\"Set election timeout\")\n\n\t\t\tstartElection()\n\t\tcase <-r.heartbeatNow:\n\t\t\theartbeatTimeout = time.After(r.heartbeatTimeout)\n\t\t\tif r.State() != Leader {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tr.sendAppendEntries()\n\t\tcase <-heartbeatTimeout:\n\t\t\theartbeatTimeout = time.After(r.heartbeatTimeout)\n\t\t\tif r.State() != Leader {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tr.sendAppendEntries()\n\t\tcase <-r.toggle:\n\t\t\treturn\n\t\tcase <-r.stop:\n\t\t\treturn\n\t\t}\n\t}\n}",
"func runHeartBeat(port int, heartbeatMsg string, signalHeartBeat <-chan bool) {\n\tlastTranmissionTime := time.Now()\n\n\trecvPeerCh := make(chan et.PeerUpdate)\n\tsendPeerCh := make(chan bool)\n\n\tgo p.Transmitter(port, heartbeatMsg, sendPeerCh)\n\tgo p.Receiver(port, recvPeerCh)\n\n\tfor {\n\n\t\tif time.Now().Sub(lastTranmissionTime) > HEARTBEATINTERVAL {\n\t\t\tsendPeerCh <- true\n\t\t\tlastTranmissionTime = time.Now()\n\t\t}\n\n\t\tselect {\n\n\t\tcase msg := <-recvPeerCh:\n\t\t\tlog.WithField(\"ID's:\", msg.Peers).Info(\"Change in active systems\")\n\t\t\tupdateSystemsInNetwork(msg)\n\n\t\tcase <-signalHeartBeatToStop:\n\t\t\treturn\n\n\t\tdefault:\n\t\t\tsendPeerCh <- false\n\t\t}\n\n\t}\n\n}",
"func (s *Server) curatorHeartbeatLoop() {\n\t// Maps from a partition ID to tracts that we store for that partition.\n\t// Used to send a subset of tracts to the right curator.\n\tvar tractsByPart map[core.PartitionID][]core.TractID\n\tvar shard uint64\n\n\tfor range time.Tick(s.cfg.CuratorHeartbeatInterval) {\n\t\t// pickSubset removes a subset of tractsByPart. When it's out of tracts we refresh it.\n\t\tif len(tractsByPart) == 0 {\n\t\t\ttractsByPart = s.store.GetSomeTractsByPartition(shard)\n\t\t\tshard++\n\t\t}\n\n\t\t// Send the same load vector to all curators.\n\t\tload := s.getLoad()\n\n\t\t// Protect s.curators as we iterate over it.\n\t\ts.lock.Lock()\n\t\tlog.V(2).Infof(\"sending heartbeats to %d curators\", len(s.curators))\n\t\tfor c, ci := range s.curators {\n\t\t\tsubset := s.pickSubset(ci.partitions, tractsByPart)\n\t\t\tgo s.beatToCurator(ci.partitions, c, subset, load)\n\t\t}\n\t\ts.lock.Unlock()\n\t}\n}",
"func (s *raftClusterSimulator) startElection(serverID int64, d time.Duration) {\n\ts.services[serverID].StartElection(d)\n}",
"func sendHeartBeat() {\n\t//check if there exists any primary\n\t//peers\n\tprimary := masterNode.peers\n\tif len(primary) != 0{\n\t\t//fmt.Println(\"Reached here\")\n\t\tfor k := range primary{\n\t\t\testablishConnection(k, \"\", \"primary\")\n\t\t\t//if there exists a backup node for the\n\t\t\t//primary\n\t\t\tif b, ok := masterNode.backupPeers[k];ok{\n\t\t\t\testablishConnection(b, k, \"backup\")\n\t\t\t}\n\t\t}\n\t}\n}",
"func (l *Leader) startElection() {\n\tfor !l.stopped {\n\t\tlog.WithField(\"instance_id\", l.instanceID).Info(\"leader: starting election\")\n\t\telection, err := leaderelection.NewElection(l.zk, l.zkPath, l.instanceID)\n\t\tl.election = election\n\t\tif err != nil {\n\t\t\tlog.WithError(err).Error(\"leader: failed to start new election, sleeping 5 seconds before retry...\")\n\t\t\ttime.Sleep(5 * time.Second)\n\t\t} else {\n\t\t\tgo election.ElectLeader()\n\t\t\tl.monitorElection(election)\n\t\t}\n\t}\n}",
"func (_m *BlacklistProvider) StartTicker(_a0 context.Context) {\n\t_m.Called(_a0)\n}",
"func (s *Service) InitiateElectionRequest(ctx context.Context, req *ElectionRequest) (res *Dummy, err error) {\n\t// must init a valid instance of Dummy struct\n\tres = &Dummy{}\n\n\t// add the logic to check whether Primary Broker has already been ELECTED before doing the ID comparison\n\t// if priamry available => do a broadcast instead (since every [ hm... ?? primary eligible] broker will know you have joined)\n\tif _, _, _, avail := s.GetElectedPrimaryBrokerInfo(); avail {\n\t\t// update the brokersMap to add in this instance too\n\t\ts._upsertBrokerToBrokersMap(req.BrokerID, req.BrokerName, req.BrokerAddr, true)\n\t\t// update version state as well since change in brokersMap content\n\t\ts._persist(true)\n\n\t\ts.log.Info(\"[InitiateElectionRequest] broadcast sent to brokers since Primary Broker already ELECTED\")\n\t\ts.initBroadcastMetaStateUpdates(false, false)\n\t\t// throttle the election interval (to reduce number of unecessary broadcast)\n\t\t<-time.NewTimer(intervalElectionDial * time.Millisecond).C\n\t\treturn\n\t}\n\n\ts.mux.Lock()\n\tdefer s.mux.Unlock()\n\n\t// compare the IDs and the min one wins and became the new Primary broker\n\t_win := false\n\t_compResult := strings.Compare(s.broker.GetBrokerID(), req.GetBrokerID())\n\n\tif _compResult < 0 {\n\t\t_win = true\n\t} else if _compResult == 0 {\n\t\t// use the addr to compare one more time (final bout)\n\t\tif strings.Compare(s.broker.GetBrokerAddr(), req.GetBrokerAddr()) < 0 {\n\t\t\t// - win\n\t\t\t_win = true\n\t\t}\n\t}\n\n\t// handling election results\n\tif _win {\n\t\t// - win\n\t\t// update this broker's primary states\n\t\ts.UpsertInMem(KeyPrimaryBroker, true, true)\n\t\ts._updateElectionWonInMemStates(s.broker.GetBrokerID(), s.broker.GetBrokerName(), s.broker.GetBrokerAddr())\n\t\t// [QQ] trigger the broadcast here after a throttle e.g. 2 seconds~~\n\t\t// no need since the upper Primary Broker Check would also trigger broadcast\n\n\t} else {\n\t\t// - lose\n\t\t// issue ACK request instead\n\t\t_gConn, err2 := grpc.Dial(req.GetBrokerAddr(), grpc.WithInsecure())\n\t\tdefer _gConn.Close()\n\n\t\tif err2 != nil {\n\t\t\ts.log.Errorf(\"[InitiateElectionRequest] unusual situation since the requester broker is offlined?? %v\\n\", err2)\n\t\t\terr = err2\n\t\t\treturn\n\t\t}\n\t\t_srv := NewMetastateServiceClient(_gConn)\n\t\t//s.log.Warnf(\"[InitiateElectionRequest] ** srv created , before calling GetACK %v, req [%v], current broker ID, name %v, %v\\n\", _srv, req, s.broker.GetBrokerID(), s.broker.GetBrokerName())\n\t\t_resp, err3 := _srv.GetElectedPrimaryACK(context.Background(), &ElectionDoneHandshakeRequest{\n\t\t\tPrimaryBrokerID: req.GetBrokerID(),\n\t\t\tPrimaryBrokerName: req.GetBrokerName(),\n\t\t\tPrimaryBrokerAddr: req.GetBrokerAddr(),\n\t\t\tSrcBrokerID: s.broker.GetBrokerID(),\n\t\t\tSrcBrokerName: s.broker.GetBrokerName(),\n\t\t\tSrcBrokerAddr: s.broker.GetBrokerAddr(),\n\t\t})\n\t\tif err3 != nil {\n\t\t\ts.log.Errorf(\"[InitiateElectionRequest] ACK request exception, reason: %v\\n\", err3)\n\t\t\terr = err3\n\t\t\treturn\n\t\t}\n\t\t//s.log.Warnf(\"[InitiateElectionRequest] ACK response %v\\n\", _resp)\n\t\t// validate the response and update the state's elected primary attributes\n\t\tif _resp.Code == ackStatusCode200 {\n\t\t\t// update this broker's primary states\n\t\t\ts.UpsertInMem(KeyPrimaryBroker, false, true)\n\t\t\ts._updateElectionWonInMemStates(req.GetBrokerID(), req.GetBrokerName(), req.GetBrokerAddr())\n\n\t\t\t// version number and ID (running num)\n\t\t\ts.UpsertInMem(KeyStateVersion, _resp.GetStateVersion(), false)\n\t\t\ts.Upsert(KeyStateVersionID, fmt.Sprintf(\"%v\", _resp.GetStateNum()), true, false, false)\n\t\t} else {\n\t\t\t// other status code should be EXCEPTION\n\t\t\terr = fmt.Errorf(\"[InitiateElectionRequest] ACK request exception, code [%v] - [%v]\",\n\t\t\t\t_resp.Code, s._electionDoneACKRespStatusTranslator(_resp.Code))\n\t\t\ts.log.Error(err)\n\t\t\treturn\n\t\t}\n\t}\n\ts.log.Infof(\"[InitiateElectionRequest] finally ... state [%v] vs in-mem state [%v], available broker map: {%v}\\n\",\n\t\ts.states, s.inMemStates, s.GetAvailableBrokersMap())\n\treturn\n}",
"func (b *Beacon) Start(seed []byte, period time.Duration) {\n\tb.Lock()\n\tb.newSig = make(chan []byte, 1)\n\tb.ticker = time.NewTicker(period)\n\tb.Unlock()\n\n\tvar counter uint64 = 1\n\tvar failed uint64\n\tb.newSig <- seed\n\tfor wt := range b.ticker.C {\n\t\toldSig := <-b.newSig\n\t\tt := wt.Unix()\n\t\tslog.Debugf(\"beacon: (round %d) BIP time %d\", counter, t)\n\t\tnow := time.Now().Unix()\n\t\tpartial := b.genPartialSignature(oldSig, now)\n\t\trequest := &BeaconRequest{\n\t\t\tPreviousSig: oldSig,\n\t\t\tTimestamp: now,\n\t\t}\n\t\tpacket := &DrandPacket{\n\t\t\tBeacon: &BeaconPacket{\n\t\t\t\tRequest: request,\n\t\t\t},\n\t\t}\n\t\tif err := b.r.Broadcast(b.group, packet); err != nil {\n\t\t\tfailed++\n\t\t\tslog.Infof(\"beacon: start round %d failed (%d total failed)\", counter, failed)\n\t\t\tcontinue\n\t\t}\n\n\t\t// send our own contribution\n\t\tpacket = &DrandPacket{\n\t\t\tBeacon: &BeaconPacket{\n\t\t\t\tReply: &BeaconReply{\n\t\t\t\t\tRequest: request,\n\t\t\t\t\tSignature: partial,\n\t\t\t\t},\n\t\t\t},\n\t\t}\n\t\tif err := b.r.Broadcast(b.group, packet); err != nil {\n\t\t\tslog.Infof(\"beacon: round %d failed to send own contribution: %s\", counter, err)\n\t\t}\n\t\tslog.Infof(\"beacon: (round %d) %d launched\", counter, t)\n\t\tcounter++\n\t}\n\tfmt.Println(\" << beacon ticker OUT >>\")\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
NewIncludes will create a new includes object.
|
func NewIncludes(queryString url.Values) (includes *Includes) {
includes = &Includes{}
if len(queryString) > 0 {
t := reflect.TypeOf(*includes)
elem := reflect.ValueOf(includes).Elem()
for i := 0; i < t.NumField(); i++ {
structField := t.Field(i)
field := elem.Field(i)
if field.CanSet() {
qsName := structField.Tag.Get("qs")
strVal := queryString.Get(qsName)
if val, err := strconv.ParseBool(strVal); err == nil {
field.SetBool(val)
}
}
}
}
return
}
|
[
"func NewIncludeFiles() IncludeFiles {\n\treturn IncludeFiles(map[string]struct{}{})\n}",
"func (in *ActionMailRecipientCreateMetaGlobalInput) SetIncludes(value string) *ActionMailRecipientCreateMetaGlobalInput {\n\tin.Includes = value\n\n\tif in._selectedParameters == nil {\n\t\tin._selectedParameters = make(map[string]interface{})\n\t}\n\n\tin._selectedParameters[\"Includes\"] = nil\n\treturn in\n}",
"func NewIncludeExcludeFilters(includes []string, excludes []string) *FieldFilters {\n\tfilters := []FieldFilter{}\n\n\tif nil == includes && nil == excludes {\n\t\treturn &FieldFilters{Filters: filters}\n\t}\n\n\tfor _, include := range includes {\n\t\tfilters = append(filters, FieldFilter{Name: include, Action: Include})\n\t}\n\n\tfor _, exclude := range excludes {\n\t\tfilters = append(filters, FieldFilter{Name: exclude, Action: Exclude})\n\t}\n\n\treturn &FieldFilters{Filters: filters}\n}",
"func (fsc *FetchSourceContext) Include(includes ...string) *FetchSourceContext {\n\tfsc.includes = append(fsc.includes, includes...)\n\treturn fsc\n}",
"func (b *HTTPRequestBuilder) AddIncludes(relationships ...string) RequestBuilder {\n\tp, ok := b.req.Context().Value(query.ContextKeyQueryParams).(*query.Params)\n\tif ok {\n\t\tif p.HasIncludes {\n\t\t\tp.Includes = append(p.Includes, relationships...)\n\t\t} else {\n\t\t\tp.Includes = relationships\n\t\t\tp.HasIncludes = true\n\t\t}\n\t} else {\n\t\tp = &query.Params{\n\t\t\tHasIncludes: true,\n\t\t\tIncludes: relationships,\n\t\t}\n\t}\n\tctx := context.WithValue(b.req.Context(), query.ContextKeyQueryParams, p)\n\tb.req = b.req.WithContext(ctx)\n\treturn b\n}",
"func (inf IncludeFiles) AddIncludeFile(includeFile string) {\n\tinf[includeFile] = struct{}{}\n}",
"func NewWith(queries []WithQuery) With {\n\treturn With{\n\t\tQueries: queries,\n\t}\n}",
"func (p *Profile) Includes() template.HTML {\n\tif !Enable(p.r) {\n\t\treturn \"\"\n\t}\n\n\tcurrent := p.Id\n\tauthorized := true\n\n\tv := map[string]interface{}{\n\t\t\"ids\": current,\n\t\t\"path\": PATH,\n\t\t\"version\": Version,\n\t\t\"position\": Position,\n\t\t\"showTrivial\": ShowTrivial,\n\t\t\"showChildren\": ShowChildren,\n\t\t\"maxTracesToShow\": MaxTracesToShow,\n\t\t\"showControls\": ShowControls,\n\t\t\"currentId\": current,\n\t\t\"authorized\": authorized,\n\t\t\"toggleShortcut\": ToggleShortcut,\n\t\t\"startHidden\": StartHidden,\n\t\t\"trivialMilliseconds\": TrivialMilliseconds,\n\t}\n\n\tvar w bytes.Buffer\n\tif err := includePartialHtmlTmpl.Execute(&w, v); err != nil {\n\t\tlog.Print(err)\n\t\treturn \"\"\n\t}\n\treturn template.HTML(w.String())\n}",
"func (a *Appender) SetIncludes(includes ...string) {\n\tin := make([]string, len(includes))\n\tcopy(in, includes)\n\tsort.Strings(in)\n\ta.includes = in\n}",
"func (s *SSIElement) SetFilterIncludes(h string) error {\n\tif h == \"false\" {\n\t\ts.filterIncludes = false\n\t} else {\n\t\ts.filterIncludes = true\n\t}\n\treturn nil\n}",
"func (in *IncludeParams) DeepCopy() *IncludeParams {\n\tif in == nil {\n\t\treturn nil\n\t}\n\tout := new(IncludeParams)\n\tin.DeepCopyInto(out)\n\treturn out\n}",
"func (f *FieldFilters) Includes() []FieldFilter {\n\tfilters := []FieldFilter{}\n\tfor _, f := range f.Filters {\n\t\tif f.Action == Include {\n\t\t\tfilters = append(filters, f)\n\t\t}\n\t}\n\n\treturn filters\n}",
"func (f DomainFilter) Include(domainIDs map[string]struct{}) DomainFilter {\n\tfilter := f.copy()\n\tfor domainID := range domainIDs {\n\t\tif !filter.ReverseMatch {\n\t\t\tfilter.DomainIDs[domainID] = struct{}{}\n\t\t} else {\n\t\t\tdelete(filter.DomainIDs, domainID)\n\t\t}\n\t}\n\treturn filter\n}",
"func (q *TransactionQuery) Include(fields ...string) *TransactionQuery {\n\tq.query.Include(fields...)\n\treturn q\n}",
"func WithRDBInclude(includes ...rdb.IncludeOption) ControllerOption {\n\treturn func(ctrl Controller) {\n\t\tstorage := ctrl.rdbStorage()\n\t\tif storage == nil {\n\t\t\tpanic(\"cannot use WithRDBInclude in a SQL paginator\")\n\t\t}\n\n\t\tstorage.includes = append(storage.includes, includes...)\n\t}\n}",
"func includeStackImpl(clone Includer, includes []string) ([]string, error) {\n\tincs := *clone.IncludesPtr()\n\tni := len(incs)\n\tif ni == 0 {\n\t\treturn includes, nil\n\t}\n\tfor i := ni - 1; i >= 0; i-- {\n\t\tincludes = append(includes, incs[i]) // reverse order so later overwrite earlier\n\t}\n\tvar errs []error\n\tfor _, inc := range incs {\n\t\t*clone.IncludesPtr() = nil\n\t\terr := toml.OpenFromPaths(clone, inc, IncludePaths)\n\t\tif err == nil {\n\t\t\tincludes, err = includeStackImpl(clone, includes)\n\t\t\tif err != nil {\n\t\t\t\terrs = append(errs, err)\n\t\t\t}\n\t\t} else {\n\t\t\terrs = append(errs, err)\n\t\t}\n\t}\n\treturn includes, kit.AllErrors(errs, 10)\n}",
"func (*MetricsRouterV3) NewInclusionFilterPrototype(operand string, operator string, values []string) (_model *InclusionFilterPrototype, err error) {\n\t_model = &InclusionFilterPrototype{\n\t\tOperand: core.StringPtr(operand),\n\t\tOperator: core.StringPtr(operator),\n\t\tValues: values,\n\t}\n\terr = core.ValidateStruct(_model, \"required parameters\")\n\treturn\n}",
"func (s *ScanResourceCriteria) SetInclude(v map[string]*ScanCondition) *ScanResourceCriteria {\n\ts.Include = v\n\treturn s\n}",
"func (q *IndexQuery) IncludeFields(fields []string) *IndexQuery {\n\tif len(fields) > 0 {\n\t\tdata, err := json.Marshal(fields)\n\t\tif err == nil {\n\t\t\tq.URLValues.Set(\"include_fields\", string(data[:]))\n\t\t}\n\t}\n\treturn q\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
ChainAt invokes the specified `HeightHandler` when the chain reaches the specified height+confidence threshold. If the chain is rolledback under the specified height, `RevertHandler` will be called. ts passed to handlers is the tipset at the specified epoch, or above if lower tipsets were null. The context governs cancellations of this call, it won't cancel the event handler.
|
func (e *heightEvents) ChainAt(ctx context.Context, hnd HeightHandler, rev RevertHandler, confidence int, h abi.ChainEpoch) error {
if abi.ChainEpoch(confidence) > e.gcConfidence {
// Need this to be able to GC effectively.
return xerrors.Errorf("confidence cannot be greater than gcConfidence: %d > %d", confidence, e.gcConfidence)
}
handler := &heightHandler{
height: h,
handle: hnd,
revert: rev,
}
triggerAt := h + abi.ChainEpoch(confidence)
// Here we try to jump onto a moving train. To avoid stopping the train, we release the lock
// while calling the API and/or the trigger functions. Unfortunately, it's entirely possible
// (although unlikely) to go back and forth across the trigger heights, so we need to keep
// going back and forth here till we're synced.
//
// TODO: Consider using a worker goroutine so we can just drop the handler in a channel? The
// downside is that we'd either need a tipset cache, or we'd need to potentially fetch
// tipsets in-line inside the event loop.
e.lk.Lock()
for {
head := e.head
if head.Height() >= h {
// Head is past the handler height. We at least need to stash the tipset to
// avoid doing this from the main event loop.
e.lk.Unlock()
var ts *types.TipSet
if head.Height() == h {
ts = head
} else {
var err error
ts, err = e.api.ChainGetTipSetAfterHeight(ctx, handler.height, head.Key())
if err != nil {
return xerrors.Errorf("events.ChainAt: failed to get tipset: %s", err)
}
}
// If we've applied the handler on the wrong tipset, revert.
if handler.called && !ts.Equals(handler.ts) {
ctx, span := trace.StartSpan(ctx, "events.HeightRevert")
span.AddAttributes(trace.BoolAttribute("immediate", true))
err := handler.revert(ctx, handler.ts)
span.End()
if err != nil {
return err
}
handler.called = false
}
// Save the tipset.
handler.ts = ts
// If we've reached confidence and haven't called, call.
if !handler.called && head.Height() >= triggerAt {
ctx, span := trace.StartSpan(ctx, "events.HeightApply")
span.AddAttributes(trace.BoolAttribute("immediate", true))
err := handler.handle(ctx, handler.ts, head.Height())
span.End()
if err != nil {
return err
}
handler.called = true
// If we've reached gcConfidence, return without saving anything.
if head.Height() >= h+e.gcConfidence {
return nil
}
}
e.lk.Lock()
} else if handler.called {
// We're not passed the head (anymore) but have applied the handler. Revert, try again.
e.lk.Unlock()
ctx, span := trace.StartSpan(ctx, "events.HeightRevert")
span.AddAttributes(trace.BoolAttribute("immediate", true))
err := handler.revert(ctx, handler.ts)
span.End()
if err != nil {
return err
}
handler.called = false
e.lk.Lock()
} // otherwise, we changed heads but the change didn't matter.
// If we managed to get through this without the head changing, we're finally done.
if head.Equals(e.head) {
e.triggerHeights[triggerAt] = append(e.triggerHeights[triggerAt], handler)
e.tsHeights[h] = append(e.tsHeights[h], handler)
e.lk.Unlock()
return nil
}
}
}
|
[
"func (c *ConfigTracker) OnNewLongestChain(_ context.Context, h *evmtypes.Head) {\n\tc.setLatestBlockHeight(*h)\n}",
"func waitForHeight(ctx context.Context, t *testing.T, node test.TestNode, height abi.ChainEpoch) {\n\tatHeight := make(chan struct{})\n\tchainEvents := events.NewEvents(ctx, node)\n\terr := chainEvents.ChainAt(func(ctx context.Context, ts *types.TipSet, curH abi.ChainEpoch) error {\n\t\tclose(atHeight)\n\t\treturn nil\n\t}, nil, 1, height)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tselect {\n\tcase <-atHeight:\n\tcase <-ctx.Done():\n\t}\n}",
"func (_m *EvmFeeEstimator) OnNewLongestChain(ctx context.Context, head *evmtypes.Head) {\n\t_m.Called(ctx, head)\n}",
"func (api *API) explorerBlocksHandler(w http.ResponseWriter, req *http.Request, ps httprouter.Params) {\n\t// Parse the height that's being requested.\n\tvar height types.BlockHeight\n\t_, err := fmt.Sscan(ps.ByName(\"height\"), &height)\n\t//if the height is not found in the params, looks for to/from.\n\tif err != nil {\n\t\tqueryValues := req.URL.Query()\n\t\tfromStr := queryValues.Get(\"from\")\n\t\t//if the \"height\" is not found in the params and \"from\" is not found in the params, throw an error\n\t\tif fromStr == \"\" {\n\t\t\tWriteError(w, Error{fmt.Sprintf(\"Must provide a 'from' parameter when not specifiying 'height' \")}, http.StatusBadRequest)\n\t\t\treturn\n\t\t}\n\t\tfromInt, err := strconv.Atoi(fromStr)\n\t\tif err != nil {\n\t\t\tWriteError(w, Error{fmt.Sprintf(\"Invalid 'from' parameter: %s. Error: %s\", fromStr, err)}, http.StatusBadRequest)\n\t\t\treturn\n\t\t}\n\t\tfrom := types.BlockHeight(fromInt)\n\n\t\ttoStr := queryValues.Get(\"to\")\n\t\tvar to types.BlockHeight\n\t\t//if \"to\" isn't found, set \"to\" equal to the Height\n\t\tif toStr == \"\" {\n\t\t\tto = api.cs.Height()\n\t\t} else {\n\t\t\ttoInt, err := strconv.Atoi(toStr)\n\t\t\tif err != nil {\n\t\t\t\tWriteError(w, Error{fmt.Sprintf(\"Invalid 'to' parameter: %s. Error: %s\", fromStr, err)}, http.StatusBadRequest)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tto = types.BlockHeight(toInt)\n\t\t}\n\n\t\t//if from > to, throw an exception, because that's impossible query condition\n\t\tif from > to {\n\t\t\tWriteError(w, Error{\"from paramter must be less than the to parameter\"}, http.StatusBadRequest)\n\t\t\treturn\n\t\t}\n\n\t\t//if \"to\" is greater than the current consensus Height, that's an impossible query condition\n\t\tif to > api.cs.Height() {\n\t\t\tWriteError(w, Error{fmt.Sprintf(\"to paramater must be less than the current block height of: %d\", api.cs.Height())}, http.StatusBadRequest)\n\t\t\treturn\n\t\t}\n\n\t\tif to-from > MaxBlocksRequest {\n\t\t\tWriteError(w, Error{fmt.Sprintf(\"to paramater must be less than the current block height of: %d\", api.cs.Height())}, http.StatusBadRequest)\n\t\t\treturn\n\t\t}\n\n\t\tvar blockGet ExplorerBlockGET\n\t\tfor blockHeight := from; blockHeight <= to; blockHeight++ {\n\t\t\tblock, exists := api.cs.BlockAtHeight(blockHeight)\n\t\t\tif !exists {\n\t\t\t\tWriteError(w, Error{fmt.Sprintf(\"no block found at height %d in call to /explorer/block. This is a server error, please contact the operator of this explorer\", blockHeight)}, http.StatusInternalServerError)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tblockGet.Blocks = append(blockGet.Blocks, api.buildExplorerBlock(blockHeight, block))\n\t\t}\n\t\t// Fetch and return the explorer blocks.\n\t\tWriteJSON(w, blockGet)\n\t\treturn\n\t}\n\t// Fetch and return the explorer block.\n\tblock, exists := api.cs.BlockAtHeight(height)\n\tif !exists {\n\t\tWriteError(w, Error{\"no block found at input height in call to /explorer/block\"}, http.StatusBadRequest)\n\t\treturn\n\t}\n\tWriteJSON(w, ExplorerBlockGET{\n\t\tBlocks: []ExplorerBlock{api.buildExplorerBlock(height, block)},\n\t})\n}",
"func (_RootChain *RootChainTransactor) RespondWithHistoricalCheckpoint(opts *bind.TransactOpts, uid *big.Int, checkpointRoot [32]byte, checkpointProof []byte, historicalCheckpointRoot [32]byte, historicalCheckpointProof []byte, challengeTx []byte, moreNonce *big.Int) (*types.Transaction, error) {\n\treturn _RootChain.contract.Transact(opts, \"respondWithHistoricalCheckpoint\", uid, checkpointRoot, checkpointProof, historicalCheckpointRoot, historicalCheckpointProof, challengeTx, moreNonce)\n}",
"func (g *BgBlkTmplGenerator) handleTrackSideChainsTimeout(ctx context.Context, state *regenHandlerState) {\n\t// Don't allow side chain variants to override the current tip when it\n\t// already has the minimum required votes.\n\tif state.awaitingMinVotesHash == nil {\n\t\treturn\n\t}\n\n\t// Reorganize the chain to a valid sibling of the current tip that has at\n\t// least the minimum number of required votes while preferring the most\n\t// votes.\n\t//\n\t// Also, while looping, add each tip the map of side chain blocks to monitor\n\t// for votes in the event there are not currently any eligible candidates\n\t// since they may become eligible as votes arrive.\n\tsortedSiblings := g.tipSiblingsSortedByVotes(state)\n\tfor _, sibling := range sortedSiblings {\n\t\tif sibling.NumVotes >= g.minVotesRequired {\n\t\t\terr := g.tg.cfg.ForceHeadReorganization(*state.awaitingMinVotesHash,\n\t\t\t\tsibling.Hash)\n\t\t\tif err != nil {\n\t\t\t\t// Try the next block in the case of failure to reorg.\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\t// Prevent votes on other tip candidates from causing reorg again\n\t\t\t// since the new chain tip has enough votes. The reorg event clears\n\t\t\t// the state, but, since there is a backing queue for the events,\n\t\t\t// and the reorg itself might haven taken a bit of time, it could\n\t\t\t// allow new side chain blocks or votes on existing ones in before\n\t\t\t// the reorg events are processed. Thus, update the state to\n\t\t\t// indicate the next template is to be built on the new tip to\n\t\t\t// prevent any possible logic races.\n\t\t\tstate.awaitingMinVotesHash = nil\n\t\t\tstate.clearSideChainTracking()\n\t\t\tstate.stopRegenTimer()\n\t\t\tstate.failedGenRetryTimeout = nil\n\t\t\tstate.baseBlockHash = sibling.Hash\n\t\t\treturn\n\t\t}\n\n\t\tstate.awaitingSideChainMinVotes[sibling.Hash] = struct{}{}\n\t}\n\n\t// Generate a new template building on the parent of the current tip when\n\t// there is not already an existing template and the initial timeout has\n\t// elapsed upon receiving the new tip without receiving votes for it. There\n\t// will typically only not be an existing template when the generator is\n\t// first instantiated and after a chain reorganization.\n\tif state.baseBlockHash == zeroHash {\n\t\tchainTip := g.tg.cfg.BestSnapshot()\n\t\tstate.failedGenRetryTimeout = nil\n\t\tstate.baseBlockHash = chainTip.PrevHash\n\t\tstate.baseBlockHeight = uint32(chainTip.Height - 1)\n\t\tg.genTemplateAsync(ctx, TURNewParent)\n\t\treturn\n\t}\n\n\t// At this point, no viable candidates to change the current template were\n\t// found, so reset the regen timer for the current template.\n\tstate.resetRegenTimer(templateRegenSecs * time.Second)\n}",
"func (chainAPI *ChainAPI) ChainGetTipSetByHeight(ctx context.Context, ts *block.TipSet, height abi.ChainEpoch, prev bool) (*block.TipSet, error) {\n\treturn chainAPI.chain.ChainReader.GetTipSetByHeight(ctx, ts, height, prev)\n}",
"func (client *Client) DescribeSpotAdviceWithCallback(request *DescribeSpotAdviceRequest, callback func(response *DescribeSpotAdviceResponse, err error)) <-chan int {\n\tresult := make(chan int, 1)\n\terr := client.AddAsyncTask(func() {\n\t\tvar response *DescribeSpotAdviceResponse\n\t\tvar err error\n\t\tdefer close(result)\n\t\tresponse, err = client.DescribeSpotAdvice(request)\n\t\tcallback(response, err)\n\t\tresult <- 1\n\t})\n\tif err != nil {\n\t\tdefer close(result)\n\t\tcallback(nil, err)\n\t\tresult <- 0\n\t}\n\treturn result\n}",
"func (suite *KeeperTestSuite) TestGetTimestampAtHeight() {\n\tcases := []struct {\n\t\tmsg string\n\t\tmalleate func()\n\t\texpPass bool\n\t}{\n\t\t{\"verification success\", func() {\n\t\t\tsuite.chainA.CreateClient(suite.chainB)\n\t\t}, true},\n\t\t{\"client state not found\", func() {}, false},\n\t}\n\n\tfor i, tc := range cases {\n\t\tsuite.Run(fmt.Sprintf(\"Case %s\", tc.msg), func() {\n\t\t\tsuite.SetupTest() // reset\n\n\t\t\ttc.malleate()\n\t\t\t// create and store a connection to chainB on chainA\n\t\t\tconnection := suite.chainA.createConnection(testConnectionIDA, testConnectionIDB, testClientIDB, testClientIDA, types.OPEN)\n\n\t\t\tactualTimestamp, err := suite.chainA.App.IBCKeeper.ConnectionKeeper.GetTimestampAtHeight(\n\t\t\t\tsuite.chainA.GetContext(), connection, uint64(suite.chainB.Header.Height),\n\t\t\t)\n\n\t\t\tif tc.expPass {\n\t\t\t\tsuite.Require().NoError(err, \"valid test case %d failed: %s\", i, tc.msg)\n\t\t\t\tsuite.Require().EqualValues(uint64(suite.chainB.Header.Time.UnixNano()), actualTimestamp)\n\t\t\t} else {\n\t\t\t\tsuite.Require().Error(err, \"invalid test case %d passed: %s\", i, tc.msg)\n\t\t\t}\n\t\t})\n\t}\n}",
"func (*HandlerT) BacktraceAt(location string) error {\n\treturn glogger.BacktraceAt(location)\n}",
"func ethAnteHandler(\n\tctx sdk.Context, ethTx *evmtypes.MsgEthereumTx, ak auth.AccountKeeper,\n) (newCtx sdk.Context, res sdk.Result, abort bool) {\n\n\treturn ctx, sdk.Result{}, false\n}",
"func ReceivedAt(v time.Time) predicate.Beacon {\n\treturn predicate.Beacon(func(s *sql.Selector) {\n\t\ts.Where(sql.EQ(s.C(FieldReceivedAt), v))\n\t})\n}",
"func (e *heightEventsObserver) updateHead(h *types.TipSet) {\n\te.lk.Lock()\n\tdefer e.lk.Unlock()\n\te.head = h\n\n\tif e.head.Height() < e.lastGc+e.gcConfidence*2 {\n\t\treturn\n\t}\n\te.lastGc = h.Height()\n\n\ttargetGcHeight := e.head.Height() - e.gcConfidence\n\tfor h := range e.tsHeights {\n\t\tif h >= targetGcHeight {\n\t\t\tcontinue\n\t\t}\n\t\tdelete(e.tsHeights, h)\n\t}\n\tfor h := range e.triggerHeights {\n\t\tif h >= targetGcHeight {\n\t\t\tcontinue\n\t\t}\n\t\tdelete(e.triggerHeights, h)\n\t}\n}",
"func HandlePriceTargetHistory(cf cfg.Cfg) http.HandlerFunc {\n\treturn priceHistory(cf, tool.TargetPriceHistory)\n}",
"func BiggerThan(first, second gbt.AlgoHandler) gbt.AlgoHandler {\n\treturn &biggerThanAlgo{\n\t\tfirst: first,\n\t\tsecond: second,\n\t}\n}",
"func (f *FailedPolicyHandler) Handle(ctx workflow.Context, revision revision.Revision, roots map[string]revision.RootInfo, failingTerraformWorkflows []terraform.Response) {\n\tscope := f.Scope.SubScopeWithTags(map[string]string{metricNames.RevisionTag: revision.Revision})\n\tif len(failingTerraformWorkflows) == 0 {\n\t\treturn\n\t}\n\n\tvar action Action\n\ts := temporalInternal.SelectorWithTimeout{\n\t\tSelector: workflow.NewSelector(ctx),\n\t}\n\ts.AddReceive(ctx.Done(), func(c workflow.ReceiveChannel, more bool) {\n\t\taction = onShutdown\n\t\tscope.Counter(metricNames.ContextCancel).Inc(1)\n\t})\n\ts.AddReceive(f.ReviewSignalChannel, func(c workflow.ReceiveChannel, more bool) {\n\t\taction = onReviewSignal\n\t\tif !more {\n\t\t\treturn\n\t\t}\n\t\tvar reviewRequest NewReviewRequest\n\t\tc.Receive(ctx, &reviewRequest)\n\t\t// skip signal if it's not for the current revision\n\t\tif reviewRequest.Revision != revision.Revision {\n\t\t\taction = onSkip\n\t\t}\n\t\tscope.SubScopeWithTags(map[string]string{metricNames.SignalNameTag: \"pr-review\"}).\n\t\t\tCounter(metricNames.SignalReceive).\n\t\t\tInc(1)\n\t})\n\tonTimeout := func(f workflow.Future) {\n\t\t_ = f.Get(ctx, nil)\n\t\taction = onPollTick\n\t\tscope.SubScopeWithTags(map[string]string{metricNames.PollNameTag: \"pr-review\"}).\n\t\t\tCounter(metricNames.PollTick).\n\t\t\tInc(1)\n\t}\n\t// perform initial check immediately (subsequent polls can occur at larger intervals)\n\tcancelTimer, _ := s.AddTimeout(ctx, time.Millisecond, onTimeout)\n\n\tfor {\n\t\tif len(failingTerraformWorkflows) == 0 {\n\t\t\tbreak\n\t\t}\n\t\ts.Select(ctx)\n\t\tswitch action {\n\t\tcase onShutdown:\n\t\t\treturn\n\t\tcase onSkip:\n\t\t\tcontinue\n\t\tcase onPollTick:\n\t\t\t// TODO: evaluate a better polling rate for approvals, or remove all together\n\t\t\tcancelTimer()\n\t\t\tcancelTimer, _ = s.AddTimeout(ctx, time.Hour, onTimeout)\n\t\t}\n\n\t\t// onPollTick and onReviewSignal actions, filter out failing policies that have been approved and identify if\n\t\t// any previously failing terraform workflows are now successful\n\t\tremainingFailedPolicies := f.filterOutBypassedPolicies(ctx, revision, failingTerraformWorkflows)\n\t\tsuccessfulTerraformWorkflows := partitionWorkflowsByResult(failingTerraformWorkflows, remainingFailedPolicies, true)\n\t\tfailingTerraformWorkflows = partitionWorkflowsByResult(failingTerraformWorkflows, remainingFailedPolicies, false)\n\t\t// for newly successful workflows, update their corresponding check statuses to passing\n\t\tf.updateCheckStatuses(ctx, roots, successfulTerraformWorkflows)\n\t}\n}",
"func (met *Metropolis) OnCommit(height, round agtypes.INT, block *agtypes.BlockCache) (interface{}, error) {\n\tvar err error\n\n\tif met.state.OrgStateHash, err = met.OrgState.Commit(); err != nil {\n\t\tmet.logger.Error(\"fail to commit orgState\", zap.Error(err))\n\t\treturn nil, err\n\t}\n\tif met.state.EventStateHash, err = met.EventState.Commit(); err != nil {\n\t\tmet.logger.Error(\"fail to commit eventState\", zap.Error(err))\n\t\treturn nil, err\n\t}\n\n\tif met.config.GetBool(\"enable_incentive\") {\n\t\tif met.state.AccStateHash, err = met.accState.Commit(); err != nil {\n\t\t\tmet.logger.Error(\"fail to commit accState\", zap.Error(err))\n\t\t\treturn nil, err\n\t\t}\n\t\tif met.state.PowerStateHash, err = met.powerState.Commit(); err != nil {\n\t\t\tmet.logger.Error(\"fail to commit powerState\", zap.Error(err))\n\t\t\treturn nil, err\n\t\t}\n\t}\n\n\tmet.state.OrgHeights = sterilizeOrgHeights(met.state.OrgHeights)\n\n\tlastBlock := LastBlockInfo{Height: height, Hash: met.Hash()}\n\tmet.Database.SetSync(lastBlock.Hash, met.state.ToBytes())\n\tmet.SaveLastBlock(lastBlock)\n\n\tdefer func() {\n\t\tmet.OrgState.Reload(met.state.OrgStateHash)\n\t\tmet.EventState.Reload(met.state.EventStateHash)\n\t\tif met.config.GetBool(\"enable_incentive\") {\n\t\t\tmet.accState.Reload(met.state.AccStateHash)\n\t\t\tmet.powerState.Reload(met.state.PowerStateHash)\n\t\t}\n\t}()\n\n\tfmt.Println(\"height:\", height, \"fee:\", met.FeeAccum.String(), \"account size:\", met.accState.Size(), \"power size:\", met.powerState.Size())\n\n\treturn agtypes.CommitResult{AppHash: lastBlock.Hash}, nil\n}",
"func HandlePriceMarketHistory(cf cfg.Cfg) http.HandlerFunc {\n\treturn priceHistory(cf, tool.MarketPriceHistory)\n}",
"func (_RootChain *RootChainSession) RespondWithHistoricalCheckpoint(uid *big.Int, checkpointRoot [32]byte, checkpointProof []byte, historicalCheckpointRoot [32]byte, historicalCheckpointProof []byte, challengeTx []byte, moreNonce *big.Int) (*types.Transaction, error) {\n\treturn _RootChain.Contract.RespondWithHistoricalCheckpoint(&_RootChain.TransactOpts, uid, checkpointRoot, checkpointProof, historicalCheckpointRoot, historicalCheckpointProof, challengeTx, moreNonce)\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
Updates the head and garbage collects if we're 2x over our garbage collection confidence period.
|
func (e *heightEventsObserver) updateHead(h *types.TipSet) {
e.lk.Lock()
defer e.lk.Unlock()
e.head = h
if e.head.Height() < e.lastGc+e.gcConfidence*2 {
return
}
e.lastGc = h.Height()
targetGcHeight := e.head.Height() - e.gcConfidence
for h := range e.tsHeights {
if h >= targetGcHeight {
continue
}
delete(e.tsHeights, h)
}
for h := range e.triggerHeights {
if h >= targetGcHeight {
continue
}
delete(e.triggerHeights, h)
}
}
|
[
"func (h *Head) gc() {\n\t// Only data strictly lower than this timestamp must be deleted.\n\tmint := h.MinTime()\n\n\t// Drop old chunks and remember series IDs and hashes if they can be\n\t// deleted entirely.\n\tdeleted, groupsRemoved := h.series.gc(mint)\n\tseriesRemoved := len(deleted)\n\n\th.metrics.seriesRemoved.Add(float64(seriesRemoved))\n\th.metrics.series.Sub(float64(seriesRemoved))\n\th.metrics.groupsRemoved.Add(float64(groupsRemoved))\n\th.metrics.groups.Sub(float64(groupsRemoved))\n\n\t// Remove deleted series IDs from the postings lists.\n\th.postings.Delete(deleted)\n\n\tif h.wal != nil {\n\t\t_, last, _ := h.wal.Segments()\n\t\th.deletedMtx.Lock()\n\t\t// Keep series records until we're past segment 'last'\n\t\t// because the WAL will still have samples records with\n\t\t// this ref ID. If we didn't keep these series records then\n\t\t// on start up when we replay the WAL, or any other code\n\t\t// that reads the WAL, wouldn't be able to use those\n\t\t// samples since we would have no labels for that ref ID.\n\t\tfor ref := range deleted {\n\t\t\th.deleted[ref] = last\n\t\t}\n\t\th.deletedMtx.Unlock()\n\t}\n\n\t// Rebuild symbols and label value indices from what is left in the postings terms.\n\tsymbols := make(map[string]struct{}, len(h.symbols))\n\tvalues := make(map[string]stringset, len(h.values))\n\n\tif err := h.postings.Iter(func(t labels.Label, _ index.Postings) error {\n\t\tsymbols[t.Name] = struct{}{}\n\t\tsymbols[t.Value] = struct{}{}\n\n\t\tss, ok := values[t.Name]\n\t\tif !ok {\n\t\t\tss = stringset{}\n\t\t\tvalues[t.Name] = ss\n\t\t}\n\t\tss.set(t.Value)\n\t\treturn nil\n\t}); err != nil {\n\t\t// This should never happen, as the iteration function only returns nil.\n\t\tpanic(err)\n\t}\n\n\th.symMtx.Lock()\n\n\th.symbols = symbols\n\th.values = values\n\n\th.symMtx.Unlock()\n}",
"func (i *heartbeatStore) gc() {\n\ti.mutex.Lock()\n\tdefer i.mutex.Unlock()\n\n\tfor identity, lifesign := range i.lastLifesign {\n\t\tif time.Since(lifesign) > 10*i.timeout {\n\t\t\tlog.WithField(logfields.Identity, identity).Debug(\"Removing unused heartbeat entry\")\n\t\t\tdelete(i.lastLifesign, identity)\n\t\t}\n\t}\n}",
"func (t *Thread) updateHead(heads []string, store bool) error {\n\terr := t.datastore.Threads().UpdateHead(t.Id, heads)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif !store {\n\t\treturn nil\n\t}\n\treturn t.store()\n}",
"func (h *Head) Truncate(mint int64) (err error) {\n\tdefer func() {\n\t\tif err != nil {\n\t\t\th.metrics.headTruncateFail.Inc()\n\t\t}\n\t}()\n\tinitialize := h.MinTime() == math.MaxInt64\n\n\tif h.MinTime() >= mint && !initialize {\n\t\treturn nil\n\t}\n\tatomic.StoreInt64(&h.minTime, mint)\n\tatomic.StoreInt64(&h.minValidTime, mint)\n\n\t// Ensure that max time is at least as high as min time.\n\tfor h.MaxTime() < mint {\n\t\tatomic.CompareAndSwapInt64(&h.maxTime, h.MaxTime(), mint)\n\t}\n\n\t// This was an initial call to Truncate after loading blocks on startup.\n\t// We haven't read back the WAL yet, so do not attempt to truncate it.\n\tif initialize {\n\t\treturn nil\n\t}\n\n\th.metrics.headTruncateTotal.Inc()\n\tstart := time.Now()\n\n\th.gc()\n\tlevel.Info(h.logger).Log(\"msg\", \"head GC completed\", \"duration\", time.Since(start))\n\th.metrics.gcDuration.Observe(time.Since(start).Seconds())\n\n\tif h.wal == nil {\n\t\treturn nil\n\t}\n\tstart = time.Now()\n\n\tfirst, last, err := h.wal.Segments()\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"get segment range\")\n\t}\n\t// Start a new segment, so low ingestion volume TSDB don't have more WAL than\n\t// needed.\n\terr = h.wal.NextSegment()\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"next segment\")\n\t}\n\tlast-- // Never consider last segment for checkpoint.\n\tif last < 0 {\n\t\treturn nil // no segments yet.\n\t}\n\t// The lower third of segments should contain mostly obsolete samples.\n\t// If we have less than three segments, it's not worth checkpointing yet.\n\tlast = first + (last-first)/3\n\tif last <= first {\n\t\treturn nil\n\t}\n\n\tkeep := func(id uint64) bool {\n\t\tif h.series.getByID(id) != nil {\n\t\t\treturn true\n\t\t}\n\t\th.deletedMtx.Lock()\n\t\t_, ok := h.deleted[id]\n\t\th.deletedMtx.Unlock()\n\t\treturn ok\n\t}\n\th.metrics.checkpointCreationTotal.Inc()\n\tif _, err = Checkpoint(h.wal, first, last, keep, mint); err != nil {\n\t\th.metrics.checkpointCreationFail.Inc()\n\t\treturn errors.Wrap(err, \"create checkpoint\")\n\t}\n\tif err := h.wal.Truncate(last + 1); err != nil {\n\t\t// If truncating fails, we'll just try again at the next checkpoint.\n\t\t// Leftover segments will just be ignored in the future if there's a checkpoint\n\t\t// that supersedes them.\n\t\tlevel.Error(h.logger).Log(\"msg\", \"truncating segments failed\", \"err\", err)\n\t}\n\n\t// The checkpoint is written and segments before it is truncated, so we no\n\t// longer need to track deleted series that are before it.\n\th.deletedMtx.Lock()\n\tfor ref, segment := range h.deleted {\n\t\tif segment < first {\n\t\t\tdelete(h.deleted, ref)\n\t\t}\n\t}\n\th.deletedMtx.Unlock()\n\n\th.metrics.checkpointDeleteTotal.Inc()\n\tif err := DeleteCheckpoints(h.wal.Dir(), last); err != nil {\n\t\t// Leftover old checkpoints do not cause problems down the line beyond\n\t\t// occupying disk space.\n\t\t// They will just be ignored since a higher checkpoint exists.\n\t\tlevel.Error(h.logger).Log(\"msg\", \"delete old checkpoints\", \"err\", err)\n\t\th.metrics.checkpointDeleteFail.Inc()\n\t}\n\th.metrics.walTruncateDuration.Observe(time.Since(start).Seconds())\n\n\tlevel.Info(h.logger).Log(\"msg\", \"WAL checkpoint complete\",\n\t\t\"first\", first, \"last\", last, \"duration\", time.Since(start))\n\n\treturn nil\n}",
"func (c *Controller) gcNode() {\n\tc.nodeLock.Lock()\n\tdefer c.nodeLock.Unlock()\n\n\t// nodes are stale after 5 missed ArtPoll's\n\t//staleAfter, _ := time.ParseDuration(fmt.Sprintf(\"%ds\", 5*pollInterval))\n\tstaleAfter := 7 * time.Second\n\nstart:\n\tfor i := range c.Nodes {\n\t\tif c.Nodes[i].LastSeen.Add(staleAfter).Before(time.Now()) {\n\t\t\t// it has been more then X seconds since we saw this node. remove it now.\n\t\t\tc.log.With(Fields{\"node\": c.Nodes[i].Node.Name, \"ip\": c.Nodes[i].Node.IP.String()}).Debug(\"remove stale node\")\n\n\t\t\t// remove references to this node from the output map\n\t\t\tfor _, port := range c.Nodes[i].Node.OutputPorts {\n\t\t\t\tdelete(c.OutputAddress, port.Address)\n\t\t\t}\n\t\t\tfor _, port := range c.Nodes[i].Node.InputPorts {\n\t\t\t\tdelete(c.InputAddress, port.Address)\n\t\t\t}\n\t\t\t// remove node\n\t\t\tc.Nodes = append(c.Nodes[:i], c.Nodes[i+1:]...)\n\t\t\tgoto start\n\t\t}\n\t}\n}",
"func (s *store) evictHead() {\n\tfront := s.l.Front().Value.(*edge)\n\ts.evictEdge(front.key)\n}",
"func (ps *peerStore) collectGarbage(cutoff time.Time) error {\n\tselect {\n\tcase <-ps.closed:\n\t\treturn nil\n\tdefault:\n\t}\n\n\tcutoffUnix := cutoff.UnixNano()\n\tstart := time.Now()\n\n\tfor _, shard := range ps.shards {\n\t\tshard.RLock()\n\t\tvar infohashes []bittorrent.InfoHash\n\t\tfor ih := range shard.swarms {\n\t\t\tinfohashes = append(infohashes, ih)\n\t\t}\n\t\tshard.RUnlock()\n\t\truntime.Gosched()\n\n\t\tfor _, ih := range infohashes {\n\t\t\tshard.Lock()\n\n\t\t\tif _, stillExists := shard.swarms[ih]; !stillExists {\n\t\t\t\tshard.Unlock()\n\t\t\t\truntime.Gosched()\n\t\t\t\tcontinue\n\t\t\t}\n\n\t\t\tfor pk, mtime := range shard.swarms[ih].leechers {\n\t\t\t\tif mtime <= cutoffUnix {\n\t\t\t\t\tshard.numLeechers--\n\t\t\t\t\tdelete(shard.swarms[ih].leechers, pk)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor pk, mtime := range shard.swarms[ih].seeders {\n\t\t\t\tif mtime <= cutoffUnix {\n\t\t\t\t\tshard.numSeeders--\n\t\t\t\t\tdelete(shard.swarms[ih].seeders, pk)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif len(shard.swarms[ih].seeders)|len(shard.swarms[ih].leechers) == 0 {\n\t\t\t\tdelete(shard.swarms, ih)\n\t\t\t}\n\n\t\t\tshard.Unlock()\n\t\t\truntime.Gosched()\n\t\t}\n\n\t\truntime.Gosched()\n\t}\n\n\trecordGCDuration(time.Since(start))\n\n\treturn nil\n}",
"func (ht *HeadTracker) backfill(ctx context.Context, head *models.Head, baseHeight int64) error {\n\tif head.Number <= baseHeight {\n\t\treturn nil\n\t}\n\tmark := time.Now()\n\tfetched := 0\n\tdefer func() {\n\t\tvar headNumber int64 = 0\n\t\tif head != nil {\n\t\t\theadNumber = head.Number\n\t\t}\n\t\tht.logger.Debugw(\"HeadTracker: finished backfill\",\n\t\t\t\"fetched\", fetched,\n\t\t\t\"blockNumber\", headNumber,\n\t\t\t\"time\", time.Since(mark),\n\t\t\t\"id\", \"head_tracker\",\n\t\t\t\"n\", headNumber-baseHeight,\n\t\t\t\"fromBlockHeight\", baseHeight,\n\t\t\t\"toBlockHeight\", headNumber-1)\n\t}()\n\n\tfor i := int64(head.Number - 1); i >= int64(baseHeight); i-- {\n\t\t// NOTE: Sequential requests here mean it's a potential performance bottleneck, be aware!\n\t\texistingHead, err := ht.store.HeadByHash(head.ParentHash)\n\t\tif err != nil {\n\t\t\treturn errors.Wrap(err, \"HeadByHash failed\")\n\t\t}\n\t\tif existingHead != nil {\n\t\t\thead = existingHead\n\t\t\tcontinue\n\t\t}\n\t\thead, err = ht.fetchAndSaveHead(ctx, uint64(i))\n\t\tfetched++\n\t\tif err != nil {\n\t\t\tif errors.Cause(err) == ethereum.NotFound {\n\t\t\t\tht.logger.Errorw(\"HeadTracker: backfill failed to fetch head (not found), chain will be truncated for this head\", \"headNum\", i)\n\t\t\t} else if errors.Cause(err) == context.DeadlineExceeded {\n\t\t\t\tht.logger.Infow(\"HeadTracker: backfill deadline exceeded, chain will be truncated for this head\", \"headNum\", i)\n\t\t\t} else {\n\t\t\t\tht.logger.Errorw(\"HeadTracker: backfill encountered unknown error, chain will be truncated for this head\", \"headNum\", i, \"err\", err)\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\t}\n\treturn nil\n}",
"func (s *store) expire() {\n\ts.mtx.RLock()\n\tif !s.shouldEvictHead() {\n\t\ts.mtx.RUnlock()\n\t\treturn\n\t}\n\ts.mtx.RUnlock()\n\n\ts.mtx.Lock()\n\tdefer s.mtx.Unlock()\n\n\tfor s.shouldEvictHead() {\n\t\ts.evictHead()\n\t}\n}",
"func (s *memorySeriesStorage) maintainMemorySeries(fp clientmodel.Fingerprint, beforeTime clientmodel.Timestamp) {\n\tvar headChunkToPersist *chunkDesc\n\ts.fpLocker.Lock(fp)\n\tdefer func() {\n\t\ts.fpLocker.Unlock(fp)\n\t\t// Queue outside of lock!\n\t\tif headChunkToPersist != nil {\n\t\t\ts.persistQueue <- persistRequest{fp, headChunkToPersist}\n\t\t\t// Count that a head chunk was persisted, but only best effort, i.e. we\n\t\t\t// don't want to block here.\n\t\t\tselect {\n\t\t\tcase s.countPersistedHeadChunks <- struct{}{}: // Counted.\n\t\t\tdefault: // Meh...\n\t\t\t}\n\t\t}\n\t}()\n\n\tseries, ok := s.fpToSeries.get(fp)\n\tif !ok {\n\t\t// Series is actually not in memory, perhaps archived or dropped in the meantime.\n\t\treturn\n\t}\n\n\tdefer s.seriesOps.WithLabelValues(memoryMaintenance).Inc()\n\n\tif s.purgeMemorySeries(fp, series, beforeTime) {\n\t\t// Series is gone now, we are done.\n\t\treturn\n\t}\n\n\tiOldestNotEvicted := -1\n\tfor i, cd := range series.chunkDescs {\n\t\tif !cd.isEvicted() {\n\t\t\tiOldestNotEvicted = i\n\t\t\tbreak\n\t\t}\n\t}\n\n\t// Archive if all chunks are evicted.\n\tif iOldestNotEvicted == -1 {\n\t\ts.fpToSeries.del(fp)\n\t\ts.numSeries.Dec()\n\t\t// Make sure we have a head chunk descriptor (a freshly\n\t\t// unarchived series has none).\n\t\tif len(series.chunkDescs) == 0 {\n\t\t\tcds, err := s.loadChunkDescs(fp, clientmodel.Latest)\n\t\t\tif err != nil {\n\t\t\t\tglog.Errorf(\n\t\t\t\t\t\"Could not load chunk descriptors prior to archiving metric %v, metric will not be archived: %v\",\n\t\t\t\t\tseries.metric, err,\n\t\t\t\t)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tseries.chunkDescs = cds\n\t\t}\n\t\tif err := s.persistence.archiveMetric(\n\t\t\tfp, series.metric, series.firstTime(), series.head().lastTime(),\n\t\t); err != nil {\n\t\t\tglog.Errorf(\"Error archiving metric %v: %v\", series.metric, err)\n\t\t\treturn\n\t\t}\n\t\ts.seriesOps.WithLabelValues(archive).Inc()\n\t\treturn\n\t}\n\t// If we are here, the series is not archived, so check for chunkDesc\n\t// eviction next and then if the head chunk needs to be persisted.\n\tseries.evictChunkDescs(iOldestNotEvicted)\n\tif !series.headChunkPersisted && time.Now().Sub(series.head().lastTime().Time()) > headChunkTimeout {\n\t\tseries.headChunkPersisted = true\n\t\t// Since we cannot modify the head chunk from now on, we\n\t\t// don't need to bother with cloning anymore.\n\t\tseries.headChunkUsedByIterator = false\n\t\theadChunkToPersist = series.head()\n\t}\n}",
"func (c *InstanceCache) gc(ctx context.Context, state *messages.InstanceCache) {\n\tgarbageSize := len(state.Entries) - instanceCacheMaxSize\n\tif garbageSize <= 0 {\n\t\treturn\n\t}\n\n\t// Compute cutoff date by putting all access times to a heap\n\t// and pop from it garbageSize times.\n\tlastAccessTimes := make(timeHeap, 0, len(state.Entries))\n\tfor _, s := range state.Entries {\n\t\tlastAccessTimes = append(lastAccessTimes, s.LastAccess.Time())\n\t}\n\theap.Init(&lastAccessTimes)\n\tfor i := 0; i < garbageSize-1; i++ {\n\t\theap.Pop(&lastAccessTimes)\n\t}\n\tcutOff := heap.Pop(&lastAccessTimes).(time.Time)\n\n\t// First garbageSize instances that were last accessed on or before cutOff are garbage.\n\tgarbage := make([]string, 0, garbageSize)\n\t// Map iteration is not deterministic, but it is fine.\n\tfor id, e := range state.Entries {\n\t\tif !e.LastAccess.Time().After(cutOff) {\n\t\t\tgarbage = append(garbage, id)\n\t\t\tif len(garbage) == cap(garbage) {\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\n\tcollected := 0\n\tfor _, id := range garbage {\n\t\tpath, err := c.fs.RootRelToAbs(id)\n\t\tif err != nil {\n\t\t\tpanic(\"impossible\")\n\t\t}\n\t\tif c.fs.EnsureFileGone(ctx, path) != nil {\n\t\t\t// EnsureFileGone logs errors.\n\t\t\tcontinue\n\t\t}\n\t\tdelete(state.Entries, id)\n\t\tcollected++\n\t}\n\tlogging.Infof(ctx, \"cipd: instance cache collected %d instances\", collected)\n}",
"func (cs *ChunkServer) garbageCollection() error {\n\tgfs.DebugMsgToFile(\"chunk server garbageCollection start\", gfs.CHUNKSERVER, cs.id)\n\tdefer gfs.DebugMsgToFile(\"chunk server garbageCollection end\", gfs.CHUNKSERVER, cs.id)\n\tcs.lock.Lock()\n\tdefer cs.lock.Unlock()\n\n\tfor _, h := range cs.garbage {\n\t\terr := cs.deleteChunk(h)\n\t\tif err != nil {\n\t\t\tgfs.DebugMsgToFile(fmt.Sprintf(\"garbageCollection delete chunk error <%s>\", err), gfs.CHUNKSERVER, cs.id)\n\t\t}\n\t}\n\tcs.garbage = make([]int64, 0)\n\treturn nil\n}",
"func (s *store) shouldEvictHead() bool {\n\th := s.l.Front()\n\tif h == nil {\n\t\treturn false\n\t}\n\tts := h.Value.(*edge).expiration\n\t//TODO: This should use a steady monotonic clock? Otherwise if the time is adjusted this will not work properly\n\treturn ts < time.Now().Unix()\n}",
"func (c *seriesCache) garbageCollect() error {\n\tcpDir, cpNum, err := tsdb.LastCheckpoint(c.dir)\n\tif errors.Cause(err) == tsdb.ErrNotFound {\n\t\treturn nil // Nothing to do.\n\t}\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"find last checkpoint\")\n\t}\n\tif cpNum <= c.lastCheckpoint {\n\t\treturn nil\n\t}\n\tsr, err := wal.NewSegmentsReader(cpDir)\n\tif err != nil {\n\t\treturn errors.Wrap(err, \"open segments\")\n\t}\n\tdefer sr.Close()\n\n\t// Scan all series records in the checkpoint and build a set of existing\n\t// references.\n\tvar (\n\t\tr = wal.NewReader(sr)\n\t\texists = map[uint64]struct{}{}\n\t\tdec tsdb.RecordDecoder\n\t\tseries []tsdb.RefSeries\n\t)\n\tfor r.Next() {\n\t\trec := r.Record()\n\t\tif dec.Type(rec) != tsdb.RecordSeries {\n\t\t\tcontinue\n\t\t}\n\t\tseries, err = dec.Series(rec, series[:0])\n\t\tif err != nil {\n\t\t\treturn errors.Wrap(err, \"decode series\")\n\t\t}\n\t\tfor _, s := range series {\n\t\t\texists[s.Ref] = struct{}{}\n\t\t}\n\t}\n\tif r.Err() != nil {\n\t\treturn errors.Wrap(err, \"read checkpoint records\")\n\t}\n\n\t// We can cleanup series in our cache that were neither in the current checkpoint nor\n\t// defined in WAL segments after the checkpoint.\n\t// References are monotonic but may be inserted into the WAL out of order. Thus we\n\t// consider the highest possible segment a series was created in.\n\tc.mtx.Lock()\n\tdefer c.mtx.Unlock()\n\n\tfor ref, entry := range c.entries {\n\t\tif _, ok := exists[ref]; !ok && entry.maxSegment <= cpNum {\n\t\t\tdelete(c.entries, ref)\n\t\t}\n\t}\n\tc.lastCheckpoint = cpNum\n\treturn nil\n}",
"func (g *genericCache) preWriteCleanup() {\n\tif g.BackgroundEvictFrequency > 0 {\n\t\treturn\n\t}\n\tfor key := range g.data {\n\t\tif g.isExpired(g.data[key]) {\n\t\t\tg.evict(key, RemovalReasonExpired)\n\t\t}\n\t}\n}",
"func gcObjects(ctx *downloaderContext) {\n\tlog.Debugf(\"gcObjects()\\n\")\n\tpublications := []pubsub.Publication{\n\t\tctx.pubAppImgStatus,\n\t\tctx.pubBaseOsStatus,\n\t\tctx.pubCertObjStatus,\n\t}\n\tfor _, pub := range publications {\n\t\titems := pub.GetAll()\n\t\tfor _, st := range items {\n\t\t\tstatus := st.(types.DownloaderStatus)\n\t\t\tif status.RefCount != 0 {\n\t\t\t\tlog.Debugf(\"gcObjects: skipping RefCount %d: %s\\n\",\n\t\t\t\t\tstatus.RefCount, status.Key())\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\ttimePassed := time.Since(status.LastUse)\n\t\t\tif timePassed < downloadGCTime {\n\t\t\t\tlog.Debugf(\"gcObjects: skipping recently used %s remains %d seconds\\n\",\n\t\t\t\t\tstatus.Key(),\n\t\t\t\t\t(timePassed-downloadGCTime)/time.Second)\n\t\t\t\tcontinue\n\t\t\t}\n\t\t\tlog.Infof(\"gcObjects: expiring status for %s; LastUse %v now %v\\n\",\n\t\t\t\tstatus.Key(), status.LastUse, time.Now())\n\t\t\tstatus.Expired = true\n\t\t\tpublishDownloaderStatus(ctx, &status)\n\t\t}\n\t}\n}",
"func periodicMerging() {\n\tticker := time.NewTicker(5 * time.Second)\n\tdirtyMap := make(map[uint64]struct{}, 1000)\n\tdsize := 0\n\tfor {\n\t\tselect {\n\t\tcase key := <-dirtyChan:\n\t\t\tdirtyMap[key] = struct{}{}\n\n\t\tcase <-ticker.C:\n\t\t\tif len(dirtyMap) != dsize {\n\t\t\t\tdsize = len(dirtyMap)\n\t\t\t\tlog.Printf(\"Dirty map size: %d\\n\", dsize)\n\t\t\t}\n\n\t\t\ttotMemory := getMemUsage()\n\t\t\tif totMemory > *maxmemory {\n\t\t\t\t// Acquire lock, so no new posting lists are given out.\n\t\t\t\tstopTheWorld.Lock()\n\n\t\t\tDIRTYLOOP:\n\t\t\t\t// Flush out the dirtyChan after acquiring lock. This allow posting lists which\n\t\t\t\t// are currently being processed to not get stuck on dirtyChan, which won't be\n\t\t\t\t// processed until aggressive evict finishes.\n\t\t\t\tfor {\n\t\t\t\t\tselect {\n\t\t\t\t\tcase <-dirtyChan:\n\t\t\t\t\t\t// pass\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tbreak DIRTYLOOP\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\taggressivelyEvict()\n\t\t\t\tfor k := range dirtyMap {\n\t\t\t\t\tdelete(dirtyMap, k)\n\t\t\t\t}\n\t\t\t\tstopTheWorld.Unlock()\n\t\t\t} else {\n\t\t\t\tgentleMerge(dirtyMap)\n\t\t\t}\n\t\t}\n\t}\n}",
"func (w *ThinPoolWatcher) Refresh() error {\n\tw.lock.Lock()\n\tdefer w.lock.Unlock()\n\n\tcurrentlyReserved, err := w.checkReservation(w.poolName)\n\tif err != nil {\n\t\terr = fmt.Errorf(\"error determining whether snapshot is reserved: %v\", err)\n\t\treturn err\n\t}\n\n\tif currentlyReserved {\n\t\tklog.V(5).Infof(\"metadata for %v is currently reserved; releasing\", w.poolName)\n\t\t_, err = w.dmsetup.Message(w.poolName, 0, releaseMetadataMessage)\n\t\tif err != nil {\n\t\t\terr = fmt.Errorf(\"error releasing metadata snapshot for %v: %v\", w.poolName, err)\n\t\t\treturn err\n\t\t}\n\t}\n\n\tklog.V(5).Infof(\"reserving metadata snapshot for thin-pool %v\", w.poolName)\n\t// NOTE: \"0\" in the call below is for the 'sector' argument to 'dmsetup\n\t// message'. It's not needed for thin pools.\n\tif output, err := w.dmsetup.Message(w.poolName, 0, reserveMetadataMessage); err != nil {\n\t\terr = fmt.Errorf(\"error reserving metadata for thin-pool %v: %v output: %v\", w.poolName, err, string(output))\n\t\treturn err\n\t}\n\tklog.V(5).Infof(\"reserved metadata snapshot for thin-pool %v\", w.poolName)\n\n\tdefer func() {\n\t\tklog.V(5).Infof(\"releasing metadata snapshot for thin-pool %v\", w.poolName)\n\t\t_, err := w.dmsetup.Message(w.poolName, 0, releaseMetadataMessage)\n\t\tif err != nil {\n\t\t\tklog.Warningf(\"Unable to release metadata snapshot for thin-pool %v: %s\", w.poolName, err)\n\t\t}\n\t}()\n\n\tklog.V(5).Infof(\"running thin_ls on metadata device %v\", w.metadataDevice)\n\tnewCache, err := w.thinLsClient.ThinLs(w.metadataDevice)\n\tif err != nil {\n\t\terr = fmt.Errorf(\"error performing thin_ls on metadata device %v: %v\", w.metadataDevice, err)\n\t\treturn err\n\t}\n\n\tw.cache = newCache\n\treturn nil\n}",
"func (r *responseHandler) collectGarbageCallback() {\n\ttimeout := r.collectInterval\n\tT := time.NewTicker(timeout)\n\n\tfor {\n\t\tselect {\n\t\tcase <-T.C:\n\t\t\tfor seq, cb := range r.callbacks {\n\t\t\t\tif time.Now().Sub(cb.created) > timeout {\n\t\t\t\t\tdelete(r.callbacks, seq)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
BagsEqual compares two bags and returns true if their properties match exactly
|
func BagsEqual(a, b Bag) bool {
// Bags are equal if Descriptor and Colour match
if a.Descriptor == b.Descriptor && a.Colour == b.Colour {
return true
}
return false
}
|
[
"func BoolsAreEqual(a []bool, b []bool) bool {\n\treturn Equal(boolSlice(a), boolSlice(b))\n}",
"func EqualTags(tag1, tag2 *Tag) bool {\n if tag1.Type != tag2.Type {\n return false\n }\n if !equalMaps(tag1.Attributes, tag2.Attributes) {\n return false\n }\n\n return true\n}",
"func objSetsEqual(setA []*unstructured.Unstructured, setB []*unstructured.Unstructured) bool {\n\tif len(setA) != len(setB) {\n\t\treturn false\n\t}\n\tmapA := map[string]bool{}\n\tobjMetasA := object.UnstructuredsToObjMetasOrDie(setA)\n\tfor _, objMetaA := range objMetasA {\n\t\tmapA[objMetaA.String()] = true\n\t}\n\tobjMetasB := object.UnstructuredsToObjMetasOrDie(setB)\n\tfor _, objMetaB := range objMetasB {\n\t\tif _, ok := mapA[objMetaB.String()]; !ok {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}",
"func (b *ballot) eq(other *ballot) bool {\n\treturn b.n == other.n && b.id == other.id\n}",
"func (b *BagMatcher) HasBags(str string) bool {\n\treturn !b.NoBagMatcher.MatchString(str)\n}",
"func (b *PropertyBagMemberType) Equals(t astmodel.Type, override astmodel.EqualityOverrides) bool {\n\tother, ok := t.(*PropertyBagMemberType)\n\treturn ok && other.element.Equals(b.element, override)\n}",
"func AggregateEquals(megabuf []byte, bufs ...[]byte) bool {\n\tmegabuflen := len(megabuf)\n\n\taggregatelen := 0\n\tfor _, buf := range bufs {\n\t\taggregatelen = aggregatelen + len(buf)\n\t}\n\tif megabuflen != aggregatelen {\n\t\treturn false\n\t}\n\n\tk := 0\n\tfor i := 0; i < len(bufs); i++ {\n\t\tfor j := 0; j < len(bufs[i]); j++ {\n\t\t\t//\t\t\tfmt.Printf(\"megabuf[%v] = %v, bufs[%v][%v] = %v\\n\", k, megabuf[k], i, j, bufs[i][j])\n\t\t\tif megabuf[k] != bufs[i][j] {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tk++\n\t\t}\n\t}\n\n\treturn true\n}",
"func (tg *TargetGroup) IsEqual(other *TargetGroup) bool {\n\n\tif !tg.IsAttrEqual(other) {\n\t\treturn false\n\t}\n\n\tadds, dels := tg.GetDiffBackend(other)\n\tupdates := tg.GetUpdateBackend(other)\n\tif len(adds) == 0 && len(dels) == 0 && len(updates) == 0 {\n\t\treturn true\n\t}\n\treturn false\n}",
"func BindVariablesEqual(x, y map[string]*querypb.BindVariable) bool {\n\treturn proto.Equal(&querypb.BoundQuery{BindVariables: x}, &querypb.BoundQuery{BindVariables: y})\n}",
"func (p Props) Equal(b Props) bool {\n\treturn p.Mtime == b.Mtime &&\n\t\tp.Size == b.Size &&\n\t\tp.Inode == b.Inode &&\n\t\tp.Volume == b.Volume &&\n\t\tp.Mode == b.Mode &&\n\t\tp.UserID == b.UserID &&\n\t\tp.GroupID == b.GroupID\n}",
"func (b Balance) Equal(ob Balance) bool {\n\treturn b.ID == ob.ID && b.Note == ob.Note && b.Balance.Equal(ob.Balance)\n}",
"func assertGraphEquals(t *testing.T, a, b *OrderBookGraph) {\n\tassert.Equalf(t, len(a.venuesForBuyingAsset), len(b.venuesForBuyingAsset),\n\t\t\"expected same # of buying venues but got %v %v\",\n\t\ta.venuesForBuyingAsset, b.venuesForBuyingAsset)\n\n\tassert.Equalf(t, len(a.venuesForSellingAsset), len(b.venuesForSellingAsset),\n\t\t\"expected same # of selling venues but got %v %v\",\n\t\ta.venuesForSellingAsset, b.venuesForSellingAsset)\n\n\tassert.Equalf(t, len(a.tradingPairForOffer), len(b.tradingPairForOffer),\n\t\t\"expected same # of trading pairs but got %v %v\", a, b)\n\n\tfor sellingAsset, edgeSet := range a.venuesForSellingAsset {\n\t\totherEdgeSet := b.venuesForSellingAsset[sellingAsset]\n\n\t\tassert.Equalf(t, len(edgeSet), len(otherEdgeSet),\n\t\t\t\"expected edge set for %v to have same length but got %v %v\",\n\t\t\tsellingAsset, edgeSet, otherEdgeSet)\n\n\t\tfor _, edge := range edgeSet {\n\t\t\tvenues := edge.value\n\t\t\totherVenues := findByAsset(otherEdgeSet, edge.key)\n\n\t\t\tassert.Equalf(t, venues.pool, otherVenues.pool,\n\t\t\t\t\"expected pools for %v to be equal\")\n\n\t\t\tassert.Equalf(t, len(venues.offers), len(otherVenues.offers),\n\t\t\t\t\"expected offers for %v to have same length but got %v %v\",\n\t\t\t\tedge.key, venues.offers, otherVenues.offers,\n\t\t\t)\n\n\t\t\tassertOfferListEquals(t, venues.offers, otherVenues.offers)\n\t\t}\n\t}\n\n\tfor offerID, pair := range a.tradingPairForOffer {\n\t\totherPair := b.tradingPairForOffer[offerID]\n\n\t\tassert.Equalf(t, pair.buyingAsset, otherPair.buyingAsset,\n\t\t\t\"expected trading pair to match but got %v %v\", pair, otherPair)\n\n\t\tassert.Equalf(t, pair.sellingAsset, otherPair.sellingAsset,\n\t\t\t\"expected trading pair to match but got %v %v\", pair, otherPair)\n\t}\n}",
"func (b1 *Backend) Equal(b2 *Backend) bool {\n\tif b1 == b2 {\n\t\treturn true\n\t}\n\tif b1 == nil || b2 == nil {\n\t\treturn false\n\t}\n\tif b1.Name != b2.Name {\n\t\treturn false\n\t}\n\n\tif b1.Service != b2.Service {\n\t\tif b1.Service == nil || b2.Service == nil {\n\t\t\treturn false\n\t\t}\n\t\tif b1.Service.GetNamespace() != b2.Service.GetNamespace() {\n\t\t\treturn false\n\t\t}\n\t\tif b1.Service.GetName() != b2.Service.GetName() {\n\t\t\treturn false\n\t\t}\n\t}\n\n\tmatch := compareEndpoints(b1.Endpoints, b2.Endpoints)\n\tif !match {\n\t\treturn false\n\t}\n\n\treturn true\n}",
"func equals(a, b *corev1.ConfigMap) bool {\n\tif a.Name != b.Name {\n\t\treturn false\n\t}\n\tif a.Namespace != b.Namespace {\n\t\treturn false\n\t}\n\tif !reflect.DeepEqual(a.Annotations, b.Annotations) {\n\t\treturn false\n\t}\n\n\tvar source, dest map[string]interface{}\n\t{\n\t\tsource = make(map[string]interface{})\n\t\tdest = make(map[string]interface{})\n\n\t\terr := yaml.Unmarshal([]byte(a.Data[\"values\"]), &source)\n\t\tif err != nil {\n\t\t\treturn false\n\t\t}\n\n\t\terr = yaml.Unmarshal([]byte(b.Data[\"values\"]), &dest)\n\t\tif err != nil {\n\t\t\treturn false\n\t\t}\n\t}\n\n\tif !reflect.DeepEqual(source, dest) {\n\t\treturn false\n\t}\n\tif !reflect.DeepEqual(a.Labels, b.Labels) {\n\t\treturn false\n\t}\n\n\treturn true\n}",
"func allMatch(a, b [][]Subset) bool {\n\tbms := make([]sset, len(b))\n\tfor i, bs := range b {\n\t\tbms[i] = smap(bs...)\n\t}\n\tfor _, as := range a {\n\t\tam := smap(as...)\n\t\tvar ok bool\n\t\tfor j, bm := range bms {\n\t\t\tif reflect.DeepEqual(am, bm) {\n\t\t\t\t// Match each element of b only once\n\t\t\t\tbms[j], bms = bms[len(bms)-1], bms[:len(bms)-1]\n\t\t\t\tok = true\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t\tif !ok {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}",
"func caBundleConfigmapsEqual(a, b *corev1.ConfigMap) bool {\n\treturn reflect.DeepEqual(a.Data, b.Data)\n}",
"func labelValuesEqual(it labelJoin, cur labelJoinCursor) bool {\n\tif n := cur.lEnd - cur.lBeg; n != (cur.rEnd - cur.rBeg) {\n\t\treturn false\n\t} else {\n\t\tfor i := 0; i != n; i++ {\n\t\t\tif it.setL[cur.lBeg+i].Value != it.setR[cur.rBeg+i].Value {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\t}\n\treturn true\n}",
"func SameFacets(a []*facetsp.Facet, b []*facetsp.Facet) bool {\n\tif len(a) != len(b) {\n\t\treturn false\n\t}\n\tla := len(a)\n\tfor i := 0; i < la; i++ {\n\t\tif (a[i].ValType != b[i].ValType) ||\n\t\t\t(a[i].Key != b[i].Key) ||\n\t\t\t!bytes.Equal(a[i].Value, b[i].Value) {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}",
"func objectsAreEqual(expected, actual interface{}) bool {\n\tif expected == nil || actual == nil {\n\t\treturn expected == actual\n\t}\n\n\tif reflect.DeepEqual(expected, actual) {\n\t\treturn true\n\t}\n\n\treturn false\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
WillContainBag searches recursively for a target bag given some outermost bag and a ruleset of bags in a bag
|
func WillContainBag(outerBag, targetBag Bag, ruleset map[Bag]map[Bag]int) bool {
// The terminating cases are 1) the outer bag's contents contains the target (true) or 2) the outer bag contains no bags (false)
// If neither of these are met, then return true if the bag within is going to contain the target
// If the bag inside won't contain the target, don't return false until all the bags inside are checked
bagsInside := ruleset[outerBag]
if bagsInside == nil {
return false
}
for bagInside := range bagsInside {
if BagsEqual(bagInside, targetBag) {
return true
}
if WillContainBag(bagInside, targetBag, ruleset) {
return true
}
}
return false
}
|
[
"func (b *Bag) BagsWhichContainMe() map[string]*Bag {\n\tcontained := make(map[string]*Bag)\n\tfor _, c := range b.ContainedIn {\n\t\tcontained[c.ID] = c\n\t\tbContained := c.BagsWhichContainMe()\n\t\tfor k, v := range bContained {\n\t\t\tcontained[k] = v\n\t\t}\n\t}\n\treturn contained\n}",
"func BagsInside(outerBag Bag, ruleset map[Bag]map[Bag]int) int {\n\t// The terminating case is when there is no bag inside the given bag; this returns 0\n\tbagsInside := ruleset[outerBag]\n\tif bagsInside == nil {\n\t\treturn 0\n\t}\n\ttotalBagsInside := 0\n\tfor bagInside, countBagInside := range bagsInside {\n\t\ttotalBagsInside += countBagInside * (1 + BagsInside(bagInside, ruleset))\n\t}\n\treturn totalBagsInside\n}",
"func (b *Bag) BagsThatINeedToHold() int {\n\tvar holded int\n\tfor _, c := range b.Contains {\n\t\thold := c.Bag.BagsThatINeedToHold()\n\t\tholded += c.Qty\n\t\tholded += c.Qty * hold\n\t}\n\treturn holded\n}",
"func (b *Bag) CanHoldBag(color string, bags map[string]*Bag) bool {\n\tif len(b.contents) == 0 {\n\t\treturn false\n\t}\n\tfor c := range b.contents {\n\t\tif c == color {\n\t\t\treturn true\n\t\t}\n\t\tif b, ok := bags[c]; ok {\n\t\t\tif b.CanHoldBag(color, bags) {\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\t}\n\treturn false\n}",
"func (b *BagMatcher) HasBags(str string) bool {\n\treturn !b.NoBagMatcher.MatchString(str)\n}",
"func (b *Bag) NestedBags(bags map[string]*Bag) int {\n\tif len(b.contents) == 0 {\n\t\treturn 0\n\t}\n\n\tcount := 0\n\tfor c, num := range b.contents {\n\t\tif b, ok := bags[c]; ok {\n\t\t\tcount += num + num*b.NestedBags(bags)\n\t\t}\n\t}\n\treturn count\n}",
"func BFSearch(root *Node, target int) bool {\n\tvar leavesOnCurrLevel []*Node\n\n\tif root == nil {\n\t\treturn false\n\t} \n\t\n\tleavesOnCurrLevel = append(leavesOnCurrLevel, root)\n\n\tfor len(leavesOnCurrLevel) > 0 {\n\t\tfor _, it := range leavesOnCurrLevel {\n\t\t\tif it.Val == target {\n\t\t\t\treturn true\n\t\t\t}\n\t\t\tif it.Left != nil {\n\t\t\t\tleavesOnCurrLevel = append(leavesOnCurrLevel, it.Left)\n\t\t\t}\n\t\t\tif it.Right != nil {\n\t\t\t\tleavesOnCurrLevel = append(leavesOnCurrLevel, it.Right)\n\t\t\t}\n\t\t\tleavesOnCurrLevel = leavesOnCurrLevel[1:]\n\t\t}\n\t}\n\treturn false\n}",
"func (recv *RelationSet) ContainsTarget(relationship RelationType, target *Object) bool {\n\tc_relationship := (C.AtkRelationType)(relationship)\n\n\tc_target := (*C.AtkObject)(C.NULL)\n\tif target != nil {\n\t\tc_target = (*C.AtkObject)(target.ToC())\n\t}\n\n\tretC := C.atk_relation_set_contains_target((*C.AtkRelationSet)(recv.native), c_relationship, c_target)\n\tretGo := retC == C.TRUE\n\n\treturn retGo\n}",
"func (this *Bag) Contains(value interface{}) bool {\n\tcheckval := reflect.TypeOf(value)\n\tfor _, v := range this.data {\n\t\tif checkval == reflect.TypeOf(v) {\n\t\t\treturn true\n\t\t}\n\t}\n\n\treturn false\n}",
"func NewBagMatcher() (*BagMatcher, error) {\n\tbagID := `(\\w+\\s\\w+)`\n\tnumberOfBags := `(\\d+)`\n\tbagColorMatcher, err := regexp.Compile(\"^\" + bagID + \" bags contain\")\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tnoBagMatcher, err := regexp.Compile(`no other bags`)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tcontainedBagMatcher, err := regexp.Compile(numberOfBags + \" \" + bagID + ` bags?,?`)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &BagMatcher{\n\t\tBagColorMatcher: bagColorMatcher,\n\t\tNoBagMatcher: noBagMatcher,\n\t\tContainedBagsMatcher: containedBagMatcher,\n\t}, nil\n}",
"func (b *BinaryTree) Contains(target Comparable) bool {\n\treturn b.search(target) != nil\n}",
"func (c *csTrieMatcher) bLookup(i *iNode, b *branch, words []string) ([]subscriber, bool) {\n\tif len(words) > 1 {\n\t\t// If more than 1 key is present in the path, the tree must be\n\t\t// traversed deeper.\n\t\tif b.iNode == nil {\n\t\t\t// If the branch doesn't point to an I-node, no subscribers\n\t\t\t// exist.\n\t\t\treturn make([]subscriber, 0), true\n\t\t}\n\t\t// If the branch has an I-node, ilookup is called recursively.\n\t\treturn c.ilookup(b.iNode, i, words[1:])\n\t}\n\n\t// Retrieve the subscribers from the branch.\n\treturn b.subscribers(), true\n}",
"func AsBag(e ld.Entity) Bag { return Bag{AsContainer(e)} }",
"func parseLine(line string) Bag {\n\tpat := regexp.MustCompile(\n\t\t` bags\\.| bags, | bag\\.| bag, | bags contain no other bags\\.| bags contain `)\n\tmatches := pat.Split(line, -1)\n\tif matches == nil {\n\t\tlog.Fatalf(\"line '%s' didn't parse!\", line)\n\t}\n\t_, bag := parseBag(matches[0])\n\tfor _, m := range matches[1:] {\n\t\tif m == \"\" {\n\t\t\tcontinue\n\t\t}\n\t\tn, child := parseBag(m)\n\t\tbag.children = append(bag.children, Containment{\n\t\t\tqty: n,\n\t\t\tname: child.Name(),\n\t\t})\n\t}\n\treturn bag\n}",
"func packBag(id string, workDir string) string {\n\n\tb := bagit.New()\n\n\tstr := \"\"\n\toutDir := fmt.Sprintf(\"tmp/%s\", id)\n\talgo := \"sha512\"\n\theaderfile := fmt.Sprintf(\"tmp/%s.json\", id)\n\n\t//vers := false\n\tb.SrcDir = &workDir // \"Create bag. Expects path to source directory\"\n\tb.OutDir = &outDir // \"Output directory for bag. Used with create flag\"\n\t//tarit := false // \"Create a tar archive when creating a bag\"\n\t//zipit := true // \"Create a tar archive when creating a bag\"\n\tb.HashAlg = &algo // \"Hash algorithm used for manifest file when creating a bag [sha1, sha256, sha512, md5]\"\n\tverbose := false // \"Verbose output\"\n\tb.AddHeader = &headerfile // \"Additional headers for bag-info.txt. Expects path to json file\"\n\tb.FetchFile = &str // \"Adds optional fetch file to bag. Expects path to fetch.txt file and switch manifetch\")\n\tb.FetchManifest = &str // \"Path to manifest file for optional fetch.txt file. Mandatory if fetch switch is used\")\n\tb.TagManifest = &algo // \"Hash algorithm used for tag manifest file [sha1, sha256, sha512, md5]\")\n\n\tif len(*b.SrcDir) != 0 {\n\t\t_, err := os.Stat(*b.SrcDir)\n\t\tif err != nil {\n\t\t\tlog.Println(\"Cannot read source directory\")\n\t\t\treturn \"\"\n\t\t}\n\n\t\t_, err = os.Stat(*b.OutDir)\n\t\tif err == nil {\n\t\t\tlog.Println(\"Output directory already exists. Refusing to overwrite. Quitting.\")\n\t\t\treturn \"\"\n\t\t}\n\n\t\tb.Create_without_root(verbose, skipRoot)\n\n\t\tz := archiver.Zip{\n\t\t\tCompressionLevel: flate.DefaultCompression,\n\t\t\tMkdirAll: false,\n\t\t\tSelectiveCompression: true,\n\t\t\tContinueOnError: false,\n\t\t\tOverwriteExisting: false,\n\t\t\tImplicitTopLevelFolder: false,\n\t\t}\n\n\t\tfiles, err := ioReadDir(*b.OutDir)\n\n\t\terr = z.Archive(files, *b.OutDir+\".zip\")\n\t\tif err != nil {\n\t\t\tlog.Println(err)\n\t\t}\n\t}\n\n\t//log.Printf(\"Finish packaging of %s\", id)\n\n\treturn *b.OutDir + \".zip\"\n}",
"func NewBag(id string) *Bag {\n\treturn &Bag{\n\t\tID: id,\n\t\tContains: make([]BagRelationShip, 0),\n\t\tContainedIn: make([]*Bag, 0),\n\t}\n}",
"func backtrack(depth int, board [][]rune, word []rune, x, y int, used map[int]bool) bool {\n\tif len(word) == 0 {\n\t\treturn true\n\t}\n\tlookPairs := findPairs(board, x, y, used)\n\tfor _, pair := range lookPairs {\n\t\ti, j := pair[0], pair[1]\n\t\tif board[i][j] == word[0] {\n\t\t\tused[coded(pair, board)] = true\n\t\t\tif backtrack(depth+1, board, word[1:], i, j, used) {\n\t\t\t\treturn true\n\t\t\t}\n\t\t\tused[coded(pair, board)] = false\n\t\t}\n\t}\n\n\treturn false\n}",
"func (c *ArtifactBuilder) containsArtifact(name string, stack []profilesv1.Artifact) (profilesv1.Artifact, bool) {\n\tfor _, a := range stack {\n\t\tif a.Name == name {\n\t\t\treturn a, true\n\t\t}\n\t}\n\treturn profilesv1.Artifact{}, false\n}",
"func (stack *Stack) Contains(name string) bool {\n\tfor _, target := range stack.Targets {\n\t\tif name == target.Name {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
BagsInside searches recursively to find out the total number of bags contained within a given bag given some ruleset of bags in a bag
|
func BagsInside(outerBag Bag, ruleset map[Bag]map[Bag]int) int {
// The terminating case is when there is no bag inside the given bag; this returns 0
bagsInside := ruleset[outerBag]
if bagsInside == nil {
return 0
}
totalBagsInside := 0
for bagInside, countBagInside := range bagsInside {
totalBagsInside += countBagInside * (1 + BagsInside(bagInside, ruleset))
}
return totalBagsInside
}
|
[
"func (b *Bag) BagsThatINeedToHold() int {\n\tvar holded int\n\tfor _, c := range b.Contains {\n\t\thold := c.Bag.BagsThatINeedToHold()\n\t\tholded += c.Qty\n\t\tholded += c.Qty * hold\n\t}\n\treturn holded\n}",
"func (b *Bag) NestedBags(bags map[string]*Bag) int {\n\tif len(b.contents) == 0 {\n\t\treturn 0\n\t}\n\n\tcount := 0\n\tfor c, num := range b.contents {\n\t\tif b, ok := bags[c]; ok {\n\t\t\tcount += num + num*b.NestedBags(bags)\n\t\t}\n\t}\n\treturn count\n}",
"func WillContainBag(outerBag, targetBag Bag, ruleset map[Bag]map[Bag]int) bool {\n\t// The terminating cases are 1) the outer bag's contents contains the target (true) or 2) the outer bag contains no bags (false)\n\t// If neither of these are met, then return true if the bag within is going to contain the target\n\t// If the bag inside won't contain the target, don't return false until all the bags inside are checked\n\tbagsInside := ruleset[outerBag]\n\tif bagsInside == nil {\n\t\treturn false\n\t}\n\tfor bagInside := range bagsInside {\n\t\tif BagsEqual(bagInside, targetBag) {\n\t\t\treturn true\n\t\t}\n\t\tif WillContainBag(bagInside, targetBag, ruleset) {\n\t\t\treturn true\n\t\t}\n\t}\n\treturn false\n}",
"func (b *Bag) BagsWhichContainMe() map[string]*Bag {\n\tcontained := make(map[string]*Bag)\n\tfor _, c := range b.ContainedIn {\n\t\tcontained[c.ID] = c\n\t\tbContained := c.BagsWhichContainMe()\n\t\tfor k, v := range bContained {\n\t\t\tcontained[k] = v\n\t\t}\n\t}\n\treturn contained\n}",
"func main() {\n fmt.Println(bagOfTokensScore([]int{100},50))//0\n fmt.Println(bagOfTokensScore([]int{100,200},150))//1\n fmt.Println(bagOfTokensScore([]int{100,200,300,400},200))//2\n fmt.Println(bagOfTokensScore([]int{52,65,35,88,28,1,4,68,56,95},94))\n fmt.Println(bagOfTokensScore([]int{87,24,32},87))//1\n //*/\n //fmt.Println(bagOfTokensScore([]int{48,26,87},81))//2\n //fmt.Println(bagOfTokensScore([]int{35,18,50,3},10))//2\n fmt.Println(bagOfTokensScore([]int{52,65,35,88,28,1,4,68,56,95},94))//5\n\n}",
"func (b *BagMatcher) HasBags(str string) bool {\n\treturn !b.NoBagMatcher.MatchString(str)\n}",
"func isBinTree(genome []*gene) bool {\n\tn := len(genome) - 1\n\tcnt0, cnt1 := 0, 0\n\n\tfor i := 0; i < n; i++ {\n\t\tif genome[i].isEmpty() {\n\t\t\tcnt0++\n\t\t} else {\n\t\t\tcnt1++\n\t\t}\n\n\t\tif cnt0 > cnt1 {\n\t\t\treturn false\n\t\t}\n\t}\n\n\treturn genome[n].isEmpty()\n}",
"func parseLine(line string) Bag {\n\tpat := regexp.MustCompile(\n\t\t` bags\\.| bags, | bag\\.| bag, | bags contain no other bags\\.| bags contain `)\n\tmatches := pat.Split(line, -1)\n\tif matches == nil {\n\t\tlog.Fatalf(\"line '%s' didn't parse!\", line)\n\t}\n\t_, bag := parseBag(matches[0])\n\tfor _, m := range matches[1:] {\n\t\tif m == \"\" {\n\t\t\tcontinue\n\t\t}\n\t\tn, child := parseBag(m)\n\t\tbag.children = append(bag.children, Containment{\n\t\t\tqty: n,\n\t\t\tname: child.Name(),\n\t\t})\n\t}\n\treturn bag\n}",
"func (b *Bag) CanHoldBag(color string, bags map[string]*Bag) bool {\n\tif len(b.contents) == 0 {\n\t\treturn false\n\t}\n\tfor c := range b.contents {\n\t\tif c == color {\n\t\t\treturn true\n\t\t}\n\t\tif b, ok := bags[c]; ok {\n\t\t\tif b.CanHoldBag(color, bags) {\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\t}\n\treturn false\n}",
"func (self *node) sizeBetween(prefix, min, max []Nibble, mincmp, maxcmp, use int) (result int) {\n\tprefix = append(prefix, self.segment...)\n\tif !self.empty && (use == 0 || self.use&use != 0) && (min == nil || nComp(prefix, min) > mincmp) && (max == nil || nComp(prefix, max) < maxcmp) {\n\t\tif use == 0 || self.use&use&byteValue != 0 {\n\t\t\tresult++\n\t\t}\n\t\tif use == 0 || self.use&use&treeValue != 0 {\n\t\t\tresult += self.treeValue.Size()\n\t\t}\n\t}\n\tfor _, child := range self.children {\n\t\tif child != nil {\n\t\t\tchildKey := make([]Nibble, len(prefix)+len(child.segment))\n\t\t\tcopy(childKey, prefix)\n\t\t\tcopy(childKey[len(prefix):], child.segment)\n\t\t\tmmi := len(childKey)\n\t\t\tif mmi > len(min) {\n\t\t\t\tmmi = len(min)\n\t\t\t}\n\t\t\tmma := len(childKey)\n\t\t\tif mma > len(max) {\n\t\t\t\tmma = len(max)\n\t\t\t}\n\t\t\tmires := nComp(childKey[:mmi], min[:mmi])\n\t\t\tmares := nComp(childKey[:mma], max[:mma])\n\t\t\tif (min == nil || mires > -1) && (max == nil || mares < 1) {\n\t\t\t\tif (min == nil || mires > 0) && (max == nil || mares < 0) {\n\t\t\t\t\tif use == 0 {\n\t\t\t\t\t\tresult += child.realSize\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif use&byteValue != 0 {\n\t\t\t\t\t\t\tresult += child.byteSize\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif use&treeValue != 0 {\n\t\t\t\t\t\t\tresult += child.treeSize\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tresult += child.sizeBetween(prefix, min, max, mincmp, maxcmp, use)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn\n}",
"func BedIn(vs ...int) predicate.Roomdetail {\n\tv := make([]interface{}, len(vs))\n\tfor i := range v {\n\t\tv[i] = vs[i]\n\t}\n\treturn predicate.Roomdetail(func(s *sql.Selector) {\n\t\t// if not arguments were provided, append the FALSE constants,\n\t\t// since we can't apply \"IN ()\". This will make this predicate falsy.\n\t\tif len(v) == 0 {\n\t\t\ts.Where(sql.False())\n\t\t\treturn\n\t\t}\n\t\ts.Where(sql.In(s.C(FieldBed), v...))\n\t})\n}",
"func numberOfTrees(inputFile string, down int, right int) (nTrees int) {\n\tfile, err := os.Open(inputFile)\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tdefer file.Close()\n\n\tscanner := bufio.NewScanner(file)\n\n\txPostition := 0\n\tyPosition := 0\n\tnTrees = 0\n\n\tfor scanner.Scan() {\n\t\tif yPosition%down != 0 {\n\t\t\tyPosition += 1\n\t\t\tcontinue\n\t\t}\n\t\ttrees, err := parseTreeLine(scanner.Text())\n\t\tif err != nil {\n\t\t\tfmt.Println(err)\n\t\t}\n\t\tif trees[xPostition%len(trees)] {\n\t\t\tnTrees += 1\n\t\t}\n\t\txPostition += right\n\t\tyPosition += 1\n\t}\n\tif err := scanner.Err(); err != nil {\n\t\tlog.Fatal(err)\n\t}\n\n\treturn\n}",
"func BathroomIn(vs ...int) predicate.Roomtype {\n\tv := make([]interface{}, len(vs))\n\tfor i := range v {\n\t\tv[i] = vs[i]\n\t}\n\treturn predicate.Roomtype(func(s *sql.Selector) {\n\t\t// if not arguments were provided, append the FALSE constants,\n\t\t// since we can't apply \"IN ()\". This will make this predicate falsy.\n\t\tif len(v) == 0 {\n\t\t\ts.Where(sql.False())\n\t\t\treturn\n\t\t}\n\t\ts.Where(sql.In(s.C(FieldBathroom), v...))\n\t})\n}",
"func checkSurroundings(field [][]Box, y, x int, box *Box) {\n\tvar bombCount byte = 0\n\tfor i := -1; i <= 1; i++ {\n\t\tfor j := -1; j <= 1; j++ {\n\t\t\t// Ensure to skip own box and outside edges\n\t\t\tif !(i == 0 && j == 0) && ((x+j) >= 0 && (y+i) >= 0) && ((x+j) < len(field[0]) && (y+i) < len(field)) {\n\t\t\t\tif field[y+i][x+j].hasBomb {\n\t\t\t\t\tbombCount++\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tbox.neighbouringBombs = bombCount\n}",
"func checkThrees(collection []string) int {\n\tisThrees := 0\n\n\t// creating a map to store the moves in the collection\n\telements := make(map[string]int)\n\n\tfor _, pat := range collection {\n\t\tif pat != \"_\" {\n\t\t\t// checking if the element exists\n\t\t\t_, ok := elements[pat]\n\t\t\tif !ok {\n\t\t\t\telements[pat] = 1\n\t\t\t} else {\n\t\t\t\telements[pat] += 1\n\t\t\t\t// if the total element count adds up to 3, set the flag = 1\n\t\t\t\tif elements[pat] == 3 {\n\t\t\t\t\tisThrees = 1\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn isThrees\n}",
"func NumberOfBoomerangs(points [][]int) int {\n\tnum := 0 // number of boomerangs\n\n\tfor i := range points {\n\t\tht := make(map[int]int, len(points))\n\t\tfor j := range points {\n\t\t\tif i != j {\n\t\t\t\tdist := dist(points[i], points[j])\n\t\t\t\tif cnt, ok := ht[dist]; ok {\n\t\t\t\t\tnum += cnt * 2\n\t\t\t\t}\n\t\t\t\tht[dist]++\n\t\t\t}\n\t\t}\n\t}\n\n\treturn num\n}",
"func (surface Surface) CountBoxes() int8 {\n\tcount := int8(0)\n\tfor y := 0; y < len(surface); y++ {\n\t\tfor x := 0; x < len(surface[y]); x++ {\n\t\t\tif surface[y][x].Box != EMPTY {\n\t\t\t\tcount++\n\t\t\t}\n\t\t}\n\t}\n\treturn count\n}",
"func BoxSetCount(boxIDs ...string) int {\n\tvar twice int\n\tvar thrice int\n\tfor _, boxID := range boxIDs {\n\t\ta, b := BoxLetterCount(boxID)\n\t\ttwice = twice + a\n\t\tthrice = thrice + b\n\t}\n\treturn twice * thrice\n}",
"func countofBuilds(st,et time.Time) int {\n\tcountbuilds:= 0\n\tfor i := 0; i < 100; i++ {\n\t\tif Buildrecord[i].starttime.After(st) {\n\t\t\tif Buildrecord[i].endtime.Before(et) {\n\t\t\t\tcountbuilds++\n\t\t\t}\n\t\t}\n\t}\n\treturn countbuilds\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
NewViaModifier returns a new Via modifier.
|
func NewViaModifier(requestedBy string) martian.RequestResponseModifier {
return &viaModifier{
requestedBy: requestedBy,
}
}
|
[
"func NewModifier(w io.Writer) *Modifier {\n\treturn &Modifier{\n\t\ts: NewStream(w),\n\t}\n}",
"func NewModifier(m *config.ModifierConfig) Modifier {\n\treturn &simpleModifier{skipSteps: m.SkipSteps}\n}",
"func New(mm ...Modifier) Graph {\n\tg := &adjacency.List{}\n\tfor _, m := range mm {\n\t\tm(g)\n\t}\n\treturn g\n}",
"func (env environment) newGoModCommand(ctx context.Context, args ...string) *exec.Cmd {\n\targs = append([]string{\"mod\"}, args...)\n\tcmd := env.newCommand(ctx, utils.GetGo(), args...)\n\treturn parseAndAppendFlags(cmd, env.modFlags)\n}",
"func New(spec *Spec) *PathAdaptor {\n\tif spec.RegexpReplace != nil {\n\t\tvar err error\n\t\tspec.RegexpReplace.re, err = regexp.Compile(spec.RegexpReplace.Regexp)\n\t\tif err != nil {\n\t\t\tlogger.Errorf(\"BUG: compile regexp %s failed: %v\",\n\t\t\t\tspec.RegexpReplace.Regexp, err)\n\t\t}\n\t}\n\n\treturn &PathAdaptor{\n\t\tspec: spec,\n\t}\n}",
"func newPublicAssignment(v interface{}) Assignment {\n\ttoReturn := Assignment{\n\t\tValue: elementFromInterface(v),\n\t\tIsPublic: true,\n\t}\n\treturn toReturn\n}",
"func NewMethodWithName(name string) EncryptThings {\n\tif target, ok := globalTable[name]; ok {\n\t\treturn createObject(target)\n\t}\n\treturn nil\n}",
"func NewDagModifier(ctx context.Context, from ipld.Node, serv ipld.DAGService, spl chunker.SplitterGen) (*DagModifier, error) {\n\tswitch from.(type) {\n\tcase *mdag.ProtoNode, *mdag.RawNode:\n\t\t// ok\n\tdefault:\n\t\treturn nil, ErrNotUnixfs\n\t}\n\n\tprefix := from.Cid().Prefix()\n\tprefix.Codec = cid.DagProtobuf\n\trawLeaves := false\n\tif prefix.Version > 0 {\n\t\trawLeaves = true\n\t}\n\n\treturn &DagModifier{\n\t\tcurNode: from.Copy(),\n\t\tdagserv: serv,\n\t\tsplitter: spl,\n\t\tctx: ctx,\n\t\tPrefix: prefix,\n\t\tRawLeaves: rawLeaves,\n\t}, nil\n}",
"func New() *Repl {\n\tr := &Repl{}\n\treturn r\n}",
"func New(raw []byte, method KubeMethod) CodeGen {\n\treturn CodeGen{\n\t\traw: raw,\n\t\tmethod: method,\n\t\textraFuncs: make(map[string]string),\n\t}\n}",
"func NewMethodInfo(methodHandler MethodHandler, newArgsFunc, newResultFunc func() interface{}, oneWay bool) MethodInfo {\n\treturn methodInfo{\n\t\thandler: methodHandler,\n\t\tnewArgsFunc: newArgsFunc,\n\t\tnewResultFunc: newResultFunc,\n\t\toneWay: oneWay,\n\t}\n}",
"func New(cfg portal.Cfg) Portal {\n\ts := &Protocol{}\n\treturn struct {\n\t\tportal.ReadOnly\n\t\t*Protocol\n\t}{\n\t\tReadOnly: portal.MakePortal(cfg, s),\n\t\tProtocol: s,\n\t}\n}",
"func newPrivateAssignment(v interface{}) Assignment {\n\treturn Assignment{Value: elementFromInterface(v)}\n}",
"func New(source *m.GolangMigrationSource, updateVersion UpdateVersion, applied AppliedVersions) (m.Driver, error) {\n\treturn &Driver{\n\t\tsource: source,\n\t\tupdateVersion: updateVersion,\n\t\tapplied: applied,\n\t}, nil\n}",
"func New(nref, artAdjNoun, prep string, mass, bulk interface{},\n toggleable bool) *Doorway {\n \n ni := thing.NewItem(nref, artAdjNoun, prep, false, mass, bulk)\n ndwy := Doorway{ Item: *ni, WillToggle: toggleable, binder: nil, }\n ref.Register(&ndwy)\n return &ndwy\n}",
"func NewUniform() Uniform {\n\treturn &uniformReplacer{}\n}",
"func New(\n\tem exact.ExactMatcher,\n\tfm fuzzy.FuzzyMatcher,\n\tvm virus.VirusMatcher,\n\tcfg config.Config,\n) GNmatcher {\n\tgnm := gnmatcher{cfg: cfg}\n\tgnm.matcher = matcher.NewMatcher(em, fm, vm, cfg)\n\tgnm.matcher.Init()\n\treturn gnm\n}",
"func New() *VK {\n\treturn &VK{\n\t\tBaseURL: \"http://vkontakte.ru/share.php\",\n\t}\n}",
"func newCommand(name string, restricted bool, handler Handler) *Command {\n\tc := new(Command)\n\tc.Name = strings.ToLower(name)\n\tc.Restricted = restricted\n\tc.Handler = handler\n\treturn c\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
ModifyRequest sets the Via header and provides loopdetection. If Via is already present, it will be appended to the existing value. If a loop is detected an error is added to the context and the request round trip is skipped.
|
func (m *viaModifier) ModifyRequest(req *http.Request) error {
via := fmt.Sprintf("%d.%d %s", req.ProtoMajor, req.ProtoMinor, m.requestedBy)
if v := req.Header.Get("Via"); v != "" {
if m.hasLoop(v) {
err := fmt.Errorf("via: detected request loop, header contains %s", m.requestedBy)
ctx := martian.NewContext(req)
ctx.Set(viaLoopKey, err)
ctx.SkipRoundTrip()
return err
}
via = fmt.Sprintf("%s, %s", v, via)
}
req.Header.Set("Via", via)
return nil
}
|
[
"func (svc *Service) ModifyRequest(reqID ulid.ULID, modReq *http.Request, modifyResponse *bool) error {\n\tsvc.reqMu.RLock()\n\treq, ok := svc.requests[reqID]\n\tsvc.reqMu.RUnlock()\n\n\tif !ok {\n\t\treturn ErrRequestNotFound\n\t}\n\n\t*modReq = *modReq.WithContext(req.req.Context())\n\tif modifyResponse != nil {\n\t\t*modReq = *modReq.WithContext(WithInterceptResponse(modReq.Context(), *modifyResponse))\n\t}\n\n\tselect {\n\tcase <-req.done:\n\t\treturn ErrRequestDone\n\tcase req.ch <- modReq:\n\t\treturn nil\n\t}\n}",
"func (m *Modifier) ModifyRequest(req *http.Request) error {\n\tctx := martian.NewContext(req)\n\treturn m.s.LogRequest(ctx.ID(), req)\n}",
"func (svc *Service) RequestModifier(next proxy.RequestModifyFunc) proxy.RequestModifyFunc {\n\treturn func(req *http.Request) {\n\t\t// This is a blocking operation, that gets unblocked when either a modified request is returned or an error\n\t\t// (typically `context.Canceled`).\n\t\tmodifiedReq, err := svc.InterceptRequest(req.Context(), req)\n\n\t\tswitch {\n\t\tcase errors.Is(err, ErrRequestAborted):\n\t\t\tsvc.logger.Debugw(\"Stopping intercept, request was aborted.\")\n\t\t\t// Prevent further processing by replacing req.Context with a cancelled context value.\n\t\t\t// This will cause the http.Roundtripper in the `proxy` package to\n\t\t\t// handle this request as an error.\n\t\t\tctx, cancel := context.WithCancel(context.Background())\n\t\t\tcancel()\n\n\t\t\t*req = *req.WithContext(ctx)\n\t\tcase errors.Is(err, context.Canceled):\n\t\t\tsvc.logger.Debugw(\"Stopping intercept, context was cancelled.\")\n\t\tcase err != nil:\n\t\t\tsvc.logger.Errorw(\"Failed to intercept request.\",\n\t\t\t\t\"error\", err)\n\t\tdefault:\n\t\t\t*req = *modifiedReq\n\t\t\tnext(req)\n\t\t}\n\t}\n}",
"func IncPeerProxiedRequest(ctx context.Context, status string) {\n\tpeerProxiedRequestsTotal.WithContext(ctx).WithLabelValues(status).Add(1)\n}",
"func (r Request) ContextVary(headers ...string) {\n\tr.varyMutex.Lock()\n\tdefer r.varyMutex.Unlock()\n\n\tfor _, header := range headers {\n\t\tr.vary[header]++\n\t}\n\n\tgo func() {\n\t\t<-r.Done()\n\t\tr.varyMutex.Lock()\n\t\tdefer r.varyMutex.Unlock()\n\n\t\tfor _, header := range headers {\n\t\t\tif r.vary[header] == 1 {\n\t\t\t\tdelete(r.vary, header)\n\t\t\t} else {\n\t\t\t\tr.vary[header]--\n\t\t\t}\n\t\t}\n\t}()\n}",
"func (tx *Transaction) ProcessRequest(req *http.Request) (*Interruption, error) {\n\tvar client string\n\tcport := 0\n\t//IMPORTANT: Some http.Request.RemoteAddr implementations will not contain port or contain IPV6: [2001:db8::1]:8080\n\tspl := strings.Split(req.RemoteAddr, \":\")\n\tif len(spl) > 1 {\n\t\tclient = strings.Join(spl[0:len(spl)-1], \"\")\n\t\tcport, _ = strconv.Atoi(spl[len(spl)-1])\n\t}\n\tvar in *Interruption\n\t// There is no socket access in the request object so we don't know the server client or port\n\ttx.ProcessConnection(client, cport, \"\", 0)\n\ttx.ProcessUri(req.URL.String(), req.Method, req.Proto)\n\ttx.ExtractArguments(\"GET\", req.URL.RawQuery)\n\tfor k, vr := range req.Header {\n\t\tfor _, v := range vr {\n\t\t\ttx.AddRequestHeader(k, v)\n\t\t}\n\t}\n\t// Host will always be removed from req.Headers(), so we manually add it\n\tif req.Host != \"\" {\n\t\ttx.AddRequestHeader(\"Host\", req.Host)\n\t}\n\n\tin = tx.ProcessRequestHeaders()\n\tif in != nil {\n\t\treturn in, nil\n\t}\n\t_, err := io.Copy(tx.RequestBodyBuffer, req.Body)\n\tif err != nil {\n\t\treturn tx.Interruption, err\n\t}\n\treq.Body = io.NopCloser(tx.RequestBodyBuffer.Reader())\n\treturn tx.ProcessRequestBody()\n}",
"func (svc *Service) InterceptRequest(ctx context.Context, req *http.Request) (*http.Request, error) {\n\treqID, ok := proxy.RequestIDFromContext(ctx)\n\tif !ok {\n\t\tsvc.logger.Errorw(\"Failed to intercept: context doesn't have an ID.\")\n\t\treturn req, nil\n\t}\n\n\tif !svc.requestsEnabled {\n\t\t// If request intercept is disabled, return the incoming request as-is.\n\t\tsvc.logger.Debugw(\"Bypassed request interception: feature disabled.\")\n\t\treturn req, nil\n\t}\n\n\tif svc.reqFilter != nil {\n\t\tmatch, err := MatchRequestFilter(req, svc.reqFilter)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"intercept: failed to match request rules for request (id: %v): %w\",\n\t\t\t\treqID.String(), err,\n\t\t\t)\n\t\t}\n\n\t\tif !match {\n\t\t\tsvc.logger.Debugw(\"Bypassed request interception: request rules don't match.\")\n\t\t\treturn req, nil\n\t\t}\n\t}\n\n\tch := make(chan *http.Request)\n\tdone := make(chan struct{})\n\n\tsvc.reqMu.Lock()\n\tsvc.requests[reqID] = Request{\n\t\treq: req,\n\t\tch: ch,\n\t\tdone: done,\n\t}\n\tsvc.reqMu.Unlock()\n\n\t// Whatever happens next (modified request returned, or a context cancelled error), any blocked channel senders\n\t// should be unblocked, and the request should be removed from the requests queue.\n\tdefer func() {\n\t\tclose(done)\n\t\tsvc.reqMu.Lock()\n\t\tdefer svc.reqMu.Unlock()\n\t\tdelete(svc.requests, reqID)\n\t}()\n\n\tselect {\n\tcase modReq := <-ch:\n\t\tif modReq == nil {\n\t\t\treturn nil, ErrRequestAborted\n\t\t}\n\n\t\treturn modReq, nil\n\tcase <-ctx.Done():\n\t\treturn nil, ctx.Err()\n\t}\n}",
"func (s *TxnStore) AddRequest(id uint64, req *http.Request, edited bool) error {\n\tvar reqDump bytes.Buffer\n\terr := req.WriteProxy(&reqDump)\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = s.Update(func(txn *badger.Txn) error {\n\t\t// TODO: what if the key already exists?\n\t\treturn txn.Set(Key{ID: id, Type: ReqType, Edited: edited}.Bytes(), reqDump.Bytes())\n\t})\n\tif err != nil {\n\t\treturn err\n\t}\n\tif s.OnUpdate != nil {\n\t\ts.OnUpdate(id)\n\t}\n\treturn nil\n}",
"func iamRequestFilter(sysCli *sys.Sys, w http.ResponseWriter, req *http.Request) error {\n\tisAuthorized, err := checkRequestAuthorization(sysCli, req)\n\tif err != nil {\n\t\treturn errf.New(http.StatusInternalServerError, err.Error())\n\t}\n\tif !isAuthorized {\n\t\treturn errf.New(types.UnauthorizedErrorCode, \"authorized failed\")\n\t}\n\n\trid := getRid(req.Header)\n\treq.Header.Set(constant.RidKey, rid)\n\n\t// set rid to response header, used to troubleshoot the problem.\n\tw.Header().Set(client.RequestIDHeader, rid)\n\n\t// use sys language as bscp language\n\treq.Header.Set(constant.LanguageKey, req.Header.Get(\"Blueking-Language\"))\n\n\tuser := req.Header.Get(constant.UserKey)\n\tif len(user) == 0 {\n\t\treq.Header.Set(constant.UserKey, \"auth\")\n\t}\n\n\tappCode := req.Header.Get(constant.AppCodeKey)\n\tif len(appCode) == 0 {\n\t\treq.Header.Set(constant.AppCodeKey, client.SystemIDIAM)\n\t}\n\n\treturn nil\n}",
"func (tracerObj *traceHandler) continueReqSpan(reqId string, header http.Header) {\n\tvar err error\n\n\ttracerObj.reqSpanCtx, err = tracerObj.tracer.Extract(\n\t\topentracing.HTTPHeaders,\n\t\topentracing.HTTPHeadersCarrier(header),\n\t)\n\tif err != nil {\n\t\tfmt.Printf(\"[Request %s] failed to continue req span for tracing, error %v\\n\", reqId, err)\n\t\treturn\n\t}\n\n\ttracerObj.reqSpan = nil\n\t// TODO: Its not Supported to get span from spanContext as of now\n\t// https://github.com/opentracing/specification/issues/81\n\t// it will support us to extend the request span for nodes\n\t//reqSpan = opentracing.SpanFromContext(reqSpanCtx)\n}",
"func (a *ACL) Request(ctx context.Context, request *networkservice.NetworkServiceRequest) (*connection.Connection, error) {\n\tctx = WithConfig(ctx) // Guarantees we will retrieve a non-nil VppAgentConfig from context.Context\n\tvppAgentConfig := Config(ctx)\n\n\tctx = WithConnectionMap(ctx) // Guarantees we will retrieve a non-nil Connectionmap from context.Context\n\tconnectionMap := ConnectionMap(ctx)\n\n\tiface := connectionMap[request.GetConnection().GetId()]\n\n\tif iface == nil || iface.Name == \"\" {\n\t\terr := errors.New(\"found empty incoming connection name\")\n\t\treturn nil, err\n\t}\n\n\terr := a.appendDataChange(vppAgentConfig, iface.Name)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif endpoint.Next(ctx) != nil {\n\t\treturn endpoint.Next(ctx).Request(ctx, request)\n\t}\n\n\treturn request.GetConnection(), nil\n}",
"func RequestCtx(r *http.Request, k, v interface{}) {\n\treq := r.WithContext(context.WithValue(r.Context(), k, v))\n\t*r = *req\n}",
"func (m *viaModifier) ModifyResponse(res *http.Response) error {\n\tctx := martian.NewContext(res.Request)\n\n\tif err, _ := ctx.Get(viaLoopKey); err != nil {\n\t\tres.StatusCode = 400\n\t\tres.Status = http.StatusText(400)\n\n\t\treturn err.(error)\n\t}\n\n\treturn nil\n}",
"func (r Request) Vary(headers ...string) {\n\tr.varyMutex.Lock()\n\tdefer r.varyMutex.Unlock()\n\n\tfor _, header := range headers {\n\t\tr.vary[header]++\n\t}\n}",
"func (xt *HTTPSubsegments) WroteRequest(info httptrace.WroteRequestInfo) {\n\txt.mu.Lock()\n\tdefer xt.mu.Unlock()\n\tif xt.reqCtx != nil && GetSegment(xt.opCtx).safeInProgress() {\n\t\tGetSegment(xt.reqCtx).Close(info.Err)\n\t\tresCtx, _ := BeginSubsegment(xt.opCtx, \"response\")\n\t\txt.responseCtx = resCtx\n\t}\n\n\t// In case the GotConn http trace handler wasn't called,\n\t// we close the connection subsegment since a connection\n\t// had to have been acquired before attempting to write\n\t// the request.\n\tif xt.connCtx != nil && GetSegment(xt.connCtx).safeInProgress() {\n\t\tGetSegment(xt.connCtx).Close(nil)\n\t}\n}",
"func (s *Store) UpdateRequest(ctx context.Context, userID string, request *Request) error {\n\trequest.Updated = NewEvent(userID)\n\t_, err := s.Client.Collection(RequestsCollection).Doc(request.ID).Set(ctx, request)\n\treturn err\n}",
"func (m *LBMetrics) IncInflightRequest() {\n\tatomic.AddInt64(&m.inflightRequests, 1)\n}",
"func PatchRequest(\n\tctx context.Context,\n\treturnValuePointer interface{},\n\tbaseUrl string, requestPath string,\n\trequestParams url.Values,\n\tdata interface{}, authInjector interfaces.AuthenticationInjector) errors.EdgeX {\n\n\treq, err := createRequestWithRawData(ctx, http.MethodPatch, baseUrl, requestPath, requestParams, data)\n\tif err != nil {\n\t\treturn errors.NewCommonEdgeXWrapper(err)\n\t}\n\n\tres, err := sendRequest(ctx, req, authInjector)\n\tif err != nil {\n\t\treturn errors.NewCommonEdgeXWrapper(err)\n\t}\n\tif err := json.Unmarshal(res, returnValuePointer); err != nil {\n\t\treturn errors.NewCommonEdgeX(errors.KindContractInvalid, \"failed to parse the response body\", err)\n\t}\n\treturn nil\n}",
"func (tx *Transaction) SetRequestLine(method string, protocol string, requestUri string) {\n tx.GetCollection(\"request_method\").AddToKey(\"\", method)\n tx.GetCollection(\"request_uri\").AddToKey(\"\", requestUri)\n tx.GetCollection(\"request_protocol\").AddToKey(\"\", protocol)\n tx.GetCollection(\"request_line\").AddToKey(\"\", fmt.Sprintf(\"%s %s %s\", method, requestUri, protocol))\n\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
ModifyResponse sets the status code to 400 Bad Request if a loop was detected in the request.
|
func (m *viaModifier) ModifyResponse(res *http.Response) error {
ctx := martian.NewContext(res.Request)
if err, _ := ctx.Get(viaLoopKey); err != nil {
res.StatusCode = 400
res.Status = http.StatusText(400)
return err.(error)
}
return nil
}
|
[
"func (svc *Service) ModifyResponse(reqID ulid.ULID, modRes *http.Response) error {\n\tsvc.resMu.RLock()\n\tres, ok := svc.responses[reqID]\n\tsvc.resMu.RUnlock()\n\n\tif !ok {\n\t\treturn ErrRequestNotFound\n\t}\n\n\tif modRes != nil {\n\t\tmodRes.Request = res.res.Request\n\t}\n\n\tselect {\n\tcase <-res.done:\n\t\treturn ErrRequestDone\n\tcase res.ch <- modRes:\n\t\treturn nil\n\t}\n}",
"func (m *Modifier) ModifyResponse(res *http.Response) error {\n\tctx := martian.NewContext(res.Request)\n\treturn m.s.LogResponse(ctx.ID(), res)\n}",
"func RewriteResponse(response *http.Response, newResponseData interface{}, statusCode int) error {\n\tdata, err := marshal(getContentType(response), newResponseData)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tbody := io.NopCloser(bytes.NewReader(data))\n\n\tresponse.StatusCode = statusCode\n\tresponse.Body = body\n\tresponse.ContentLength = int64(len(data))\n\n\tif response.Header == nil {\n\t\tresponse.Header = make(http.Header)\n\t}\n\tresponse.Header.Set(\"Content-Length\", strconv.Itoa(len(data)))\n\n\treturn nil\n}",
"func invalidResponse(w http.ResponseWriter, r *http.Request) {\n\tw.Header().Set(\"Content-Type\", \"application/json\")\n\tw.Write([]byte(\"[1, 2\"))\n}",
"func (svc *Service) ResponseModifier(next proxy.ResponseModifyFunc) proxy.ResponseModifyFunc {\n\treturn func(res *http.Response) error {\n\t\t// This is a blocking operation, that gets unblocked when either a modified response is returned or an error.\n\t\t//nolint:bodyclose\n\t\tmodifiedRes, err := svc.InterceptResponse(res.Request.Context(), res)\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"failed to intercept response: %w\", err)\n\t\t}\n\n\t\t*res = *modifiedRes\n\n\t\treturn next(res)\n\t}\n}",
"func Respond400(w http.ResponseWriter, err, detail string) {\n\tRespondError(w, 400, err, detail)\n}",
"func (o *ListEventLoopBadRequest) Code() int {\n\treturn 400\n}",
"func H400(w http.ResponseWriter) {\n\tw.WriteHeader(400)\n}",
"func CreateModifyLoadBalancerAttributeResponse() (response *ModifyLoadBalancerAttributeResponse) {\n\tresponse = &ModifyLoadBalancerAttributeResponse{\n\t\tBaseResponse: &responses.BaseResponse{},\n\t}\n\treturn\n}",
"func (o *UpdateRTResponsePoliciesBadRequest) Code() int {\n\treturn 400\n}",
"func DeclineResponse(writer http.ResponseWriter) {\n\twriter.WriteHeader(http.StatusUnauthorized)\n\twriter.Write([]byte(\"denied\"))\n\tlog.Printf(\"Denied request\")\n}",
"func NewModifyUpdateBadRequestResponseBody(res *goa.ServiceError) *ModifyUpdateBadRequestResponseBody {\n\tbody := &ModifyUpdateBadRequestResponseBody{\n\t\tName: res.Name,\n\t\tID: res.ID,\n\t\tMessage: res.Message,\n\t\tTemporary: res.Temporary,\n\t\tTimeout: res.Timeout,\n\t\tFault: res.Fault,\n\t}\n\treturn body\n}",
"func (o *PatchEntitiesAlertsV2BadRequest) Code() int {\n\treturn 400\n}",
"func (w *WorkerContext) SetResponse(status string, payload Payload, err error) error {\n\tif w.finishedRequest {\n\t\treturn ErrWorkerFinished\n\t}\n\n\tw.workerErr = err\n\tw.end = time.Now()\n\tw.workerStatus = status\n\tw.responseBody = payload\n\tw.finishedRequest = true\n\treturn nil\n}",
"func (o *UpdateMTOServiceItemBadRequest) Code() int {\n\treturn 400\n}",
"func RespondBadRequest(w http.ResponseWriter, err error) {\n\tw.WriteHeader(http.StatusBadRequest)\n\tmarshaled := types.MarshalError(err)\n\tif _, err := fmt.Fprint(w, string(marshaled[:])); err != nil {\n\t\tlog.Error(err)\n\t}\n}",
"func (r *Request) ProcessStatusCode() Error {\n\tLogger.Println(\"ProcessStatusCode: started\")\n\tresp := r.Response\n\tif (resp.StatusCode >= 300) || (resp.StatusCode < 200) {\n\t\tLogger.Printf(\"Non-2XX response: (%d) %s\", resp.StatusCode, resp.Status)\n\t\tswitch {\n\t\tcase resp.StatusCode == 404:\n\t\t\treturn BaseError{resp.StatusCode, resp.Status, fmt.Errorf(\"Request: Not Found: %s\", resp.Status)}\n\t\tcase resp.StatusCode >= 400 && resp.StatusCode < 500:\n\t\t\treturn BaseError{resp.StatusCode, resp.Status, fmt.Errorf(\"Request: Request Error: %s\", resp.Status)}\n\t\tcase resp.StatusCode >= 500 && resp.StatusCode < 600:\n\t\t\treturn BaseError{resp.StatusCode, resp.Status, fmt.Errorf(\"Request: Server Error: %s\", resp.Status)}\n\t\tdefault:\n\t\t\treturn BaseError{0, \"Unhandled Status\", fmt.Errorf(\"Unhandled StatusCode: %s\", resp.Status)}\n\t\t}\n\t}\n\n\tLogger.Println(\"ProcessStatusCode: completed\")\n\treturn nil\n}",
"func CreateModifyDiskWarningLineResponse() (response *ModifyDiskWarningLineResponse) {\n\tresponse = &ModifyDiskWarningLineResponse{\n\t\tBaseResponse: &responses.BaseResponse{},\n\t}\n\treturn\n}",
"func GenerateFailedResponse(w http.ResponseWriter, message string, err error) {\r\n\tstatusCode := http.StatusBadRequest\r\n\tvar errResp ErrorData\r\n\tif err != nil {\r\n\t\terrCode := \"400\"\r\n\t\terrMsg := err.Error()\r\n\t\terrResp = ErrorData{\r\n\t\t\tCode: errCode,\r\n\t\t\tMessage: errMsg,\r\n\t\t}\r\n\t}\r\n\tresp := HTTPResponse{\r\n\t\tMessage: message,\r\n\t\tData: nil,\r\n\t\tError: &errResp,\r\n\t}\r\n\tbytes, _ := json.Marshal(resp)\r\n\tw.Header().Set(\"Content-Type\", \"application/json\")\r\n\tw.WriteHeader(statusCode)\r\n\tw.Write(bytes)\r\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
hasLoop parses via and attempts to match requestedBy against the contained pseudonyms/host:port pairs.
|
func (m *viaModifier) hasLoop(via string) bool {
for _, v := range strings.Split(via, ",") {
parts := whitespace.Split(strings.TrimSpace(v), 3)
// No pseudonym or host:port, assume there is no loop.
if len(parts) < 2 {
continue
}
if m.requestedBy == parts[1] {
return true
}
}
return false
}
|
[
"func (s *DefaultServer) Loop() {\n\tdefer func() {\n\t\tif r := recover(); r != nil {\n\t\t\tif r != io.EOF {\n\t\t\t\tlog.Println(\"Recovered from runtime panic:\", r)\n\t\t\t\tlog.Println(\"Panic location: \", identifyPanic())\n\t\t\t}\n\n\t\t\tabort(s.conns, fmt.Errorf(\"Runtime panic: %v\", r))\n\t\t}\n\t}()\n\n\tfor {\n\t\trequest, reqType, start, err := s.rp.Parse()\n\t\tif err != nil {\n\t\t\tif err == common.ErrBadRequest ||\n\t\t\t\terr == common.ErrBadLength ||\n\t\t\t\terr == common.ErrBadFlags ||\n\t\t\t\terr == common.ErrBadExptime {\n\t\t\t\ts.orca.Error(nil, common.RequestUnknown, err)\n\t\t\t\tcontinue\n\t\t\t} else {\n\t\t\t\t// Otherwise IO error. Abort!\n\t\t\t\tabort(s.conns, err)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\n\t\tmetrics.IncCounter(MetricCmdTotal)\n\n\t\t// TODO: handle nil\n\t\tswitch reqType {\n\t\tcase common.RequestSet:\n\t\t\tmetrics.IncCounter(MetricCmdSet)\n\t\t\terr = s.orca.Set(request.(common.SetRequest))\n\t\tcase common.RequestAdd:\n\t\t\tmetrics.IncCounter(MetricCmdAdd)\n\t\t\terr = s.orca.Add(request.(common.SetRequest))\n\t\tcase common.RequestReplace:\n\t\t\tmetrics.IncCounter(MetricCmdReplace)\n\t\t\terr = s.orca.Replace(request.(common.SetRequest))\n\t\tcase common.RequestAppend:\n\t\t\tmetrics.IncCounter(MetricCmdAppend)\n\t\t\terr = s.orca.Append(request.(common.SetRequest))\n\t\tcase common.RequestPrepend:\n\t\t\tmetrics.IncCounter(MetricCmdPrepend)\n\t\t\terr = s.orca.Prepend(request.(common.SetRequest))\n\t\tcase common.RequestDelete:\n\t\t\tmetrics.IncCounter(MetricCmdDelete)\n\t\t\terr = s.orca.Delete(request.(common.DeleteRequest))\n\t\tcase common.RequestTouch:\n\t\t\tmetrics.IncCounter(MetricCmdTouch)\n\t\t\terr = s.orca.Touch(request.(common.TouchRequest))\n\t\tcase common.RequestGet:\n\t\t\tmetrics.IncCounter(MetricCmdGet)\n\t\t\terr = s.orca.Get(request.(common.GetRequest))\n\t\tcase common.RequestGetE:\n\t\t\tmetrics.IncCounter(MetricCmdGetE)\n\t\t\terr = s.orca.GetE(request.(common.GetRequest))\n\t\tcase common.RequestGat:\n\t\t\tmetrics.IncCounter(MetricCmdGat)\n\t\t\terr = s.orca.Gat(request.(common.GATRequest))\n\t\tcase common.RequestNoop:\n\t\t\tmetrics.IncCounter(MetricCmdNoop)\n\t\t\terr = s.orca.Noop(request.(common.NoopRequest))\n\t\tcase common.RequestQuit:\n\t\t\tmetrics.IncCounter(MetricCmdQuit)\n\t\t\ts.orca.Quit(request.(common.QuitRequest))\n\t\t\tabort(s.conns, err)\n\t\t\treturn\n\t\tcase common.RequestVersion:\n\t\t\tmetrics.IncCounter(MetricCmdVersion)\n\t\t\terr = s.orca.Version(request.(common.VersionRequest))\n\t\tcase common.RequestUnknown:\n\t\t\tmetrics.IncCounter(MetricCmdUnknown)\n\t\t\terr = s.orca.Unknown(request)\n\t\t}\n\n\t\tif err != nil {\n\t\t\tif common.IsAppError(err) {\n\t\t\t\tif err != common.ErrKeyNotFound {\n\t\t\t\t\tmetrics.IncCounter(MetricErrAppError)\n\t\t\t\t}\n\t\t\t\ts.orca.Error(request, reqType, err)\n\t\t\t} else {\n\t\t\t\tmetrics.IncCounter(MetricErrUnrecoverable)\n\t\t\t\tabort(s.conns, err)\n\t\t\t\treturn\n\t\t\t}\n\t\t}\n\n\t\tdur := timer.Since(start)\n\t\tswitch reqType {\n\t\tcase common.RequestSet:\n\t\t\tmetrics.ObserveHist(HistSet, dur)\n\t\tcase common.RequestAdd:\n\t\t\tmetrics.ObserveHist(HistAdd, dur)\n\t\tcase common.RequestReplace:\n\t\t\tmetrics.ObserveHist(HistReplace, dur)\n\t\tcase common.RequestDelete:\n\t\t\tmetrics.ObserveHist(HistDelete, dur)\n\t\tcase common.RequestTouch:\n\t\t\tmetrics.ObserveHist(HistTouch, dur)\n\t\tcase common.RequestGet:\n\t\t\tmetrics.ObserveHist(HistGet, dur)\n\t\tcase common.RequestGetE:\n\t\t\tmetrics.ObserveHist(HistGetE, dur)\n\t\tcase common.RequestGat:\n\t\t\tmetrics.ObserveHist(HistGat, dur)\n\t\t}\n\t}\n}",
"func (h *BoruterImpl) loop() {\n\tdefer h.looper.Done()\n\tfor {\n\t\tselect {\n\t\tcase <-h.finish:\n\t\t\treturn\n\t\tcase <-time.After(h.borutaCheckPeriod):\n\t\t}\n\n\t\t// TODO use filter with slice of ReqIDs when implemented in Boruta.\n\t\trequests, err := h.boruta.ListRequests(nil)\n\t\tif err != nil {\n\t\t\t// TODO log error\n\t\t\tcontinue\n\t\t}\n\n\t\tfor _, rinfo := range requests {\n\t\t\tstatus, j := h.updateStatus(rinfo)\n\n\t\t\tswitch status {\n\t\t\tcase boruta.INPROGRESS:\n\t\t\t\th.acquire(j, rinfo)\n\t\t\tcase boruta.CANCEL:\n\t\t\t\th.remove(j, rinfo.ID)\n\t\t\tcase boruta.DONE:\n\t\t\t\th.remove(j, rinfo.ID)\n\t\t\tcase boruta.TIMEOUT:\n\t\t\t\th.remove(j, rinfo.ID)\n\t\t\t\th.SendFail(j, \"Timeout in Boruta.\")\n\t\t\tcase boruta.INVALID:\n\t\t\t\th.remove(j, rinfo.ID)\n\t\t\t\th.SendFail(j, \"No suitable device in Boruta to run test.\")\n\t\t\tcase boruta.FAILED:\n\t\t\t\th.remove(j, rinfo.ID)\n\t\t\t\th.SendFail(j, \"Boruta failed during request execution.\")\n\t\t\t}\n\t\t}\n\t}\n}",
"func (nr *Request) DetectLoop() bool {\n\t_, ok := nr.context[nr.topic]\n\treturn ok\n}",
"func (n *nodeSession) loopForDialing() error { // no error returned actually\n\tfor {\n\t\tselect {\n\t\tcase <-n.tom.Dying():\n\t\t\treturn nil\n\t\tcase <-n.redialc:\n\t\t\tif n.ConnState() != rpc.ConnStateReady {\n\t\t\t\tn.dial()\n\t\t\t}\n\t\t}\n\t}\n}",
"func (ssn *Session) loop() {\n\tdefer func() {\n\t\trecover() // Kill the loop quietly (on carrier death) and cleanup\n\t\tssn.clunk()\n\t}()\n\tfor {\n\t\tid, pay := ssn.recv()\n\t\tu := ssn.lookup(id)\n\t\tif u == nil {\n\t\t\tlog.Printf(\"no connection [%s] for message [%s]\", id, pay)\n\t\t\tcontinue\n\t\t}\n\t\tu.accept(pay)\n\t}\n}",
"func (r *Puber) lookupdLoop() {\r\n\t// add some jitter so that multiple consumers discovering the same topic,\r\n\t// when restarted at the same time, dont all connect at once.\r\n\tr.rngMtx.Lock()\r\n\tjitter := time.Duration(int64(r.rng.Float64() *\r\n\t\tr.config.LookupdPollJitter * float64(r.config.LookupdPollInterval)))\r\n\tr.rngMtx.Unlock()\r\n\tvar ticker *time.Ticker\r\n\r\n\tselect {\r\n\tcase <-time.After(jitter):\r\n\tcase <-r.exitChan:\r\n\t\tgoto exit\r\n\t}\r\n\r\n\tticker = time.NewTicker(r.config.LookupdPollInterval)\r\n\r\n\tfor {\r\n\t\tselect {\r\n\t\tcase <-ticker.C:\r\n\t\t\tr.queryLookupd()\r\n\t\tcase <-r.lookupdRecheckChan:\r\n\t\t\tr.queryLookupd()\r\n\t\tcase <-r.exitChan:\r\n\t\t\tgoto exit\r\n\t\t}\r\n\t}\r\n\r\nexit:\r\n\tif ticker != nil {\r\n\t\tticker.Stop()\r\n\t}\r\n\tr.log(LogLevelInfo, \"exiting lookupdLoop\")\r\n\tr.wg.Done()\r\n}",
"func (engine *Engine) NetworkLoop() error {\n\tserverAddr, err := net.ResolveUDPAddr(\"udp\", engine.ListenAddress)\n\tassertSuccessOrExit(err)\n\n\tserverConn, err := net.ListenUDP(\"udp\", serverAddr)\n\tassertSuccessOrExit(err)\n\n\tLogger.Info(\"listening on %s\", serverAddr)\n\tbuf := make([]byte, payloadLength)\n\tfor {\n\t\tn, addr, err := serverConn.ReadFromUDP(buf)\n\t\tif err != nil {\n\t\t\tLogger.Crit(\"network server died\")\n\t\t\tos.Exit(1)\n\t\t}\n\n\t\tif bytes.Contains(buf, []byte(\"info\")) {\n\t\t\tengine.Info()\n\t\t\tcontinue\n\t\t}\n\n\t\tif n != payloadLength {\n\t\t\tLogger.Warning(\"bad network payload\")\n\t\t\tcontinue\n\t\t}\n\n\t\tpayload, err := NewPayload(buf)\n\t\tif err != nil {\n\t\t\tLogger.Warning(\"unparseable payload\")\n\t\t} else {\n\t\t\tengine.UpdatePeer(*addr, payload)\n\t\t}\n\t}\n}",
"func (srv *MultiChannelServer) listenLoop(listener net.Listener) {\n\tdefer srv.loopWG.Done()\n\tsrv.logger.Info(\"RLPx listener up\", \"self\", srv.makeSelf(listener, srv.ntab))\n\n\ttokens := defaultMaxPendingPeers\n\tif srv.MaxPendingPeers > 0 {\n\t\ttokens = srv.MaxPendingPeers\n\t}\n\tslots := make(chan struct{}, tokens)\n\tfor i := 0; i < tokens; i++ {\n\t\tslots <- struct{}{}\n\t}\n\n\tfor {\n\t\t// Wait for a handshake slot before accepting.\n\t\t<-slots\n\n\t\tvar (\n\t\t\tfd net.Conn\n\t\t\terr error\n\t\t)\n\t\tfor {\n\t\t\tfd, err = listener.Accept()\n\t\t\tif tempErr, ok := err.(tempError); ok && tempErr.Temporary() {\n\t\t\t\tsrv.logger.Debug(\"Temporary read error\", \"err\", err)\n\t\t\t\tcontinue\n\t\t\t} else if err != nil {\n\t\t\t\tsrv.logger.Debug(\"Read error\", \"err\", err)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\n\t\t// Reject connections that do not match NetRestrict.\n\t\tif srv.NetRestrict != nil {\n\t\t\tif tcp, ok := fd.RemoteAddr().(*net.TCPAddr); ok && !srv.NetRestrict.Contains(tcp.IP) {\n\t\t\t\tsrv.logger.Debug(\"Rejected conn (not whitelisted in NetRestrict)\", \"addr\", fd.RemoteAddr())\n\t\t\t\tfd.Close()\n\t\t\t\tslots <- struct{}{}\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\n\t\tfd = newMeteredConn(fd, true)\n\t\tsrv.logger.Trace(\"Accepted connection\", \"addr\", fd.RemoteAddr())\n\t\tgo func() {\n\t\t\tsrv.SetupConn(fd, inboundConn, nil)\n\t\t\tslots <- struct{}{}\n\t\t}()\n\t}\n}",
"func loop(wait int ,list string, timeout int) {\n var wg sync.WaitGroup\n\tfor {\n servers, err := GetList(list)\n if err == nil {\n if len(servers) > 0 {\n for _, host := range servers {\n wg.Add(1)\n go CheckHost(&wg, host, timeout)\n }\n wg.Wait()\n } else {\n color.Yellow(\"no hosts in hosts file: \" + list)\n }\n } else {\n color.Yellow(\"unable to read hosts file: \" + err.Error())\n }\n\t\ttime.Sleep(time.Duration(wait) * time.Second)\n }\n}",
"func runMatchLoop(c *http.Client, ps net.PlayerSession, ms net.MatchSession) error {\n\tconn, err := ws.CreateSession()\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tfor {\n\t\tmsgID := getUserAction()\n\t\tmsg, err := ws.NewMessage(msgID, ps, ms)\n\n\t\tif err != nil {\n\t\t\treturn err\n\t\t} else if err = conn.WriteJSON(msg); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tvar data []byte\n\t\t_, data, err = conn.ReadMessage()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\tif msgID == ws.PlayerListMessageID {\n\t\t\tprintPlayerList(ms.ID.Type, data)\n\t\t} else if msgID == ws.QuitMessageID {\n\t\t\tbreak\n\t\t}\n\t}\n\n\treturn nil\n}",
"func (b *loopOutBuilder) inUse(traffic *swapTraffic, peer route.Vertex,\n\tchannels []lnwire.ShortChannelID) error {\n\n\tfor _, chanID := range channels {\n\t\tlastFail, recentFail := traffic.failedLoopOut[chanID]\n\t\tif recentFail {\n\t\t\tlog.Debugf(\"Channel: %v not eligible for suggestions, \"+\n\t\t\t\t\"was part of a failed swap at: %v\", chanID,\n\t\t\t\tlastFail)\n\n\t\t\treturn newReasonError(ReasonFailureBackoff)\n\t\t}\n\n\t\tif traffic.ongoingLoopOut[chanID] {\n\t\t\tlog.Debugf(\"Channel: %v not eligible for suggestions, \"+\n\t\t\t\t\"ongoing loop out utilizing channel\", chanID)\n\n\t\t\treturn newReasonError(ReasonLoopOut)\n\t\t}\n\t}\n\n\tif traffic.ongoingLoopIn[peer] {\n\t\tlog.Debugf(\"Peer: %x not eligible for suggestions ongoing \"+\n\t\t\t\"loop in utilizing peer\", peer)\n\n\t\treturn newReasonError(ReasonLoopIn)\n\t}\n\n\treturn nil\n}",
"func (t *udp) handleReply(from common.NodeID, fromIP net.IP, req packet) bool {\n\tmatched := make(chan bool, 1)\n\tselect {\n\tcase t.gotreply <- reply{from, fromIP, req, matched}:\n\t\t// loop will handle it\n\t\treturn <-matched\n\tcase <-t.closing:\n\t\treturn false\n\t}\n}",
"func (proxy *ProxyServer) readLoop(listener net.PacketConn) {\n\tpacketBuffer := make([]byte, maxMTU)\n\n\tfor !proxy.dead.IsSet() {\n\t\terr := proxy.processDataFromClients(listener, packetBuffer)\n\t\tif err != nil {\n\t\t\tlogger.Printf(\"Error while processing client data: %s\\n\", err)\n\t\t}\n\t}\n\n\tlogger.Printf(\"Listener shut down: %s\\n\", listener.LocalAddr())\n}",
"func setup(c *netlink.Conn) bool {\n\treturn request(c, magicNumber, true) == magicNumberResp\n}",
"func requester(n chan string, r chan []byte, wg *sync.WaitGroup) {\n\tfor h := range n {\n\t\tc, err := net.DialTimeout(\"tcp\",\n\t\t\th+\":\"+Settings.port,\n\t\t\ttime.Duration(time.Millisecond*time.Duration(Settings.t)))\n\t\tif err != nil {\n\t\t\tcontinue\n\t\t}\n\n\t\tfmt.Fprintf(c, \"stats\")\n\t\tresp, err := bufio.NewReader(c).ReadBytes(10)\n\t\tif err != nil {\n\t\t\tcontinue\n\t\t} else {\n\t\t\tr <- resp\n\t\t}\n\t}\n\twg.Done()\n}",
"func (lu *Lu) lookupCycle(done chan struct{}, entriesCh chan *entry) {\n\tfor {\n\t\tselect {\n\t\tcase <-done:\n\t\t\tclose(entriesCh)\n\t\t\treturn\n\t\tdefault:\n\t\t\tif !lu.scanner.Scan() {\n\t\t\t\tclose(entriesCh)\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\treq := strings.TrimSpace(lu.scanner.Text())\n\t\t\tif req != \"\" {\n\t\t\t\tentry := &entry{Request: req}\n\t\t\t\tfor _, lang := range lu.opts.ToLangs {\n\t\t\t\t\ttranslations := lu.lookup(req, lang)\n\t\t\t\t\tresp := &response{Lang: lang, Translations: translations}\n\t\t\t\t\tentry.Responses = append(entry.Responses, resp)\n\t\t\t\t}\n\t\t\t\tentriesCh <- entry\n\t\t\t\tlu.history = append(lu.history, entry)\n\t\t\t}\n\t\t}\n\t}\n}",
"func validateLoopOutRequest(ctx context.Context, lnd lndclient.LightningClient,\n\tchainParams *chaincfg.Params, req *clientrpc.LoopOutRequest,\n\tsweepAddr btcutil.Address, maxParts uint32) (int32, error) {\n\n\t// Check that the provided destination address has the correct format\n\t// for the active network.\n\tif !sweepAddr.IsForNet(chainParams) {\n\t\treturn 0, fmt.Errorf(\"%w: Current active network is %s\",\n\t\t\terrIncorrectChain, chainParams.Name)\n\t}\n\n\t// Check that the provided destination address is a supported\n\t// address format.\n\tswitch sweepAddr.(type) {\n\tcase *btcutil.AddressTaproot,\n\t\t*btcutil.AddressWitnessScriptHash,\n\t\t*btcutil.AddressWitnessPubKeyHash,\n\t\t*btcutil.AddressScriptHash,\n\t\t*btcutil.AddressPubKeyHash:\n\n\tdefault:\n\t\treturn 0, errInvalidAddress\n\t}\n\n\t// Check that the label is valid.\n\tif err := labels.Validate(req.Label); err != nil {\n\t\treturn 0, err\n\t}\n\n\tchannels, err := lnd.ListChannels(ctx, false, false)\n\tif err != nil {\n\t\treturn 0, err\n\t}\n\n\tunlimitedChannels := len(req.OutgoingChanSet) == 0\n\toutgoingChanSetMap := make(map[uint64]bool)\n\tfor _, chanID := range req.OutgoingChanSet {\n\t\toutgoingChanSetMap[chanID] = true\n\t}\n\n\tvar activeChannelSet []lndclient.ChannelInfo\n\tfor _, c := range channels {\n\t\t// Don't bother looking at inactive channels.\n\t\tif !c.Active {\n\t\t\tcontinue\n\t\t}\n\n\t\t// If no outgoing channel set was specified then all active\n\t\t// channels are considered. However, if a channel set was\n\t\t// specified then only the specified channels are considered.\n\t\tif unlimitedChannels || outgoingChanSetMap[c.ChannelID] {\n\t\t\tactiveChannelSet = append(activeChannelSet, c)\n\t\t}\n\t}\n\n\t// Determine if the loop out request is theoretically possible given\n\t// the amount requested, the maximum possible routing fees,\n\t// the available channel set and the fact that equal splitting is\n\t// used for MPP.\n\trequiredBalance := btcutil.Amount(req.Amt + req.MaxSwapRoutingFee)\n\tisRoutable, _ := hasBandwidth(activeChannelSet, requiredBalance,\n\t\tint(maxParts))\n\tif !isRoutable {\n\t\treturn 0, fmt.Errorf(\"%w: Requested swap amount of %d \"+\n\t\t\t\"sats along with the maximum routing fee of %d sats \"+\n\t\t\t\"is more than what can be routed given current state \"+\n\t\t\t\"of the channel set\", errBalanceTooLow, req.Amt,\n\t\t\treq.MaxSwapRoutingFee)\n\t}\n\n\treturn validateConfTarget(\n\t\treq.SweepConfTarget, loop.DefaultSweepConfTarget,\n\t)\n}",
"func (dt *DetectorClient) recvLoop(streamCli deadlockPb.Deadlock_DetectClient) {\n\tvar (\n\t\terr error\n\t\tresp *deadlockPb.DeadlockResponse\n\t)\n\tfor {\n\t\tresp, err = streamCli.Recv()\n\t\tif err != nil {\n\t\t\tlog.Warn(\"recv from failed, stop receive\", zap.Error(err))\n\t\t\tbreak\n\t\t}\n\t\t// here only detection request will get response from leader\n\t\tdt.waitMgr.WakeUpForDeadlock(resp)\n\t}\n}",
"func (srv *BaseServer) listenLoop() {\n\tdefer srv.loopWG.Done()\n\tsrv.logger.Info(\"RLPx listener up\", \"self\", srv.makeSelf(srv.listener, srv.ntab))\n\n\ttokens := defaultMaxPendingPeers\n\tif srv.MaxPendingPeers > 0 {\n\t\ttokens = srv.MaxPendingPeers\n\t}\n\tslots := make(chan struct{}, tokens)\n\tfor i := 0; i < tokens; i++ {\n\t\tslots <- struct{}{}\n\t}\n\n\tfor {\n\t\t// Wait for a handshake slot before accepting.\n\t\t<-slots\n\n\t\tvar (\n\t\t\tfd net.Conn\n\t\t\terr error\n\t\t)\n\t\tfor {\n\t\t\tfd, err = srv.listener.Accept()\n\t\t\tif tempErr, ok := err.(tempError); ok && tempErr.Temporary() {\n\t\t\t\tsrv.logger.Debug(\"Temporary read error\", \"err\", err)\n\t\t\t\tcontinue\n\t\t\t} else if err != nil {\n\t\t\t\tsrv.logger.Debug(\"Read error\", \"err\", err)\n\t\t\t\treturn\n\t\t\t}\n\t\t\tbreak\n\t\t}\n\n\t\t// Reject connections that do not match NetRestrict.\n\t\tif srv.NetRestrict != nil {\n\t\t\tif tcp, ok := fd.RemoteAddr().(*net.TCPAddr); ok && !srv.NetRestrict.Contains(tcp.IP) {\n\t\t\t\tsrv.logger.Debug(\"Rejected conn (not whitelisted in NetRestrict)\", \"addr\", fd.RemoteAddr())\n\t\t\t\tfd.Close()\n\t\t\t\tslots <- struct{}{}\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\n\t\tfd = newMeteredConn(fd, true)\n\t\tsrv.logger.Trace(\"Accepted connection\", \"addr\", fd.RemoteAddr())\n\t\tgo func() {\n\t\t\tsrv.SetupConn(fd, inboundConn, nil)\n\t\t\tslots <- struct{}{}\n\t\t}()\n\t}\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
GetType returns the ARM Type of the resource. This is always "Microsoft.Network/privateDnsZones/virtualNetworkLinks"
|
func (link *PrivateDnsZones_VirtualNetworkLink_Spec_ARM) GetType() string {
return "Microsoft.Network/privateDnsZones/virtualNetworkLinks"
}
|
[
"func (group *PrivateEndpoints_PrivateDnsZoneGroup_Spec_ARM) GetType() string {\n\treturn \"Microsoft.Network/privateEndpoints/privateDnsZoneGroups\"\n}",
"func (rule *DnsForwardingRulesets_ForwardingRule_Spec_ARM) GetType() string {\n\treturn \"Microsoft.Network/dnsForwardingRulesets/forwardingRules\"\n}",
"func (policy *Servers_ConnectionPolicy_Spec_ARM) GetType() string {\n\treturn \"Microsoft.Sql/servers/connectionPolicies\"\n}",
"func (record *PrivateDnsZonesCNAMERecord) GetType() string {\n\treturn \"Microsoft.Network/privateDnsZones/CNAME\"\n}",
"func (r Resource) Type() string {\n\treturn snakeToTitleCase(r.DCLName())\n}",
"func (group *Servers_FailoverGroup_Spec_ARM) GetType() string {\n\treturn \"Microsoft.Sql/servers/failoverGroups\"\n}",
"func (a *ResourcePool) GetType() string {\n\treturn GetType()\n}",
"func GetType(typename string) (RType, Type, error) {\n\tswitch typename {\n\tcase \"certificate\":\n\t\treturn Certificate, &CertificateResource{}, nil\n\tcase \"dns\":\n\t\treturn DNS, &DNSResource{}, nil\n\tdefault:\n\t\treturn RType(\"\"), nil, errors.New(\"Resource type \" + typename + \" does not exist\")\n\t}\n}",
"func (r *ResourceBase) GetType() string {\n\tif r.delegate != nil {\n\t\treturn r.delegate.GetType()\n\t}\n\treturn \"\"\n}",
"func (record *PrivateDnsZonesTXTRecord) GetType() string {\n\treturn \"Microsoft.Network/privateDnsZones/TXT\"\n}",
"func (o DnsAuthorizationDnsResourceRecordOutput) Type() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v DnsAuthorizationDnsResourceRecord) *string { return v.Type }).(pulumi.StringPtrOutput)\n}",
"func (table *StorageAccounts_TableServices_Table_Spec_ARM) GetType() string {\n\treturn \"Microsoft.Storage/storageAccounts/tableServices/tables\"\n}",
"func (cl CIDRList) Type() string {\n\treturn \"cidrList\"\n}",
"func (policy *Servers_Databases_BackupShortTermRetentionPolicy_Spec_ARM) GetType() string {\n\treturn \"Microsoft.Sql/servers/databases/backupShortTermRetentionPolicies\"\n}",
"func (obj LabelableObject) GetResourceType() resource.Type {\n\tswitch obj {\n\tcase RuntimeLabelableObject:\n\t\treturn resource.RuntimeLabel\n\tcase RuntimeContextLabelableObject:\n\t\treturn resource.RuntimeContextLabel\n\tcase ApplicationLabelableObject:\n\t\treturn resource.ApplicationLabel\n\tcase TenantLabelableObject:\n\t\treturn resource.TenantLabel\n\t}\n\treturn \"\"\n}",
"func (r Rule) Type() string {\n\tif r.ForIPv6 {\n\t\treturn RuleV6Typename\n\t}\n\treturn RuleV4Typename\n}",
"func (s Resource) GetType() resource.PipelineResourceType {\n\treturn resource.PipelineResourceTypeCluster\n}",
"func (r *Resource) Kind() ResourceKind {\n\tswitch {\n\tcase r.File != nil:\n\t\treturn KindFile\n\tcase r.Process != nil:\n\t\treturn KindProcess\n\tcase r.Group != nil:\n\t\treturn KindGroup\n\tcase r.Command != nil:\n\t\treturn KindCommand\n\tcase r.Audit != nil:\n\t\treturn KindAudit\n\tcase r.Docker != nil:\n\t\treturn KindDocker\n\tcase r.KubeApiserver != nil:\n\t\treturn KindKubernetes\n\tcase r.Custom != nil:\n\t\treturn KindCustom\n\tdefault:\n\t\treturn KindInvalid\n\t}\n}",
"func (r *IPtablesRule) GetType() string {\n\treturn \"iptables\"\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
Strategy behavioral design pattern enables an algorithm's behavior to be selected at runtime.
|
func TestStrategy(t *testing.T) {
multi := Operation{Multiplication{}}
t.Log(multi.Operate(3, 5))
add := Operation{Addition{}}
t.Log(add.Operate(3, 5))
}
|
[
"func (s *Service) StrategyOperation(strategy string, provider string, operation string, duration time.Duration) {\n}",
"func (p *Program) ApplyStrategy(strategy Strategy, terminals []SymbolicExpression,\n\tnonTerminals []SymbolicExpression, depth int) (err error) {\n\n\tswitch strategy {\n\tcase StrategyDeleteNonTerminal: // CHANGE TO DeleteNonTerminal\n\t\terr = p.T.DeleteNonTerminal()\n\t\tbreak\n\n\tcase StrategyDeleteMalicious:\n\t\terr = p.T.DeleteMalicious()\n\t\tbreak\n\n\tcase StrategyDeleteTerminal:\n\t\terr = p.T.DeleteTerminal()\n\t\tbreak\n\n\tcase StrategyMutateNonTerminal:\n\t\terr = p.T.MutateNonTerminal(nonTerminals)\n\t\tbreak\n\n\tcase StrategyMutateTerminal:\n\t\terr = p.T.MutateTerminal(terminals)\n\t\tbreak\n\n\tcase StrategyReplaceBranch:\n\t\tvar tree *DualTree\n\t\ttree, err = GenerateRandomTree(depth, terminals, nonTerminals)\n\t\terr = p.T.ReplaceBranch(*tree)\n\t\tbreak\n\n\tcase StrategyReplaceBranchX:\n\t\tvar tree *DualTree\n\t\ttree, err = GenerateRandomTreeEnforceIndependentVariable(depth, terminals[0], terminals, nonTerminals)\n\t\terr = p.T.ReplaceBranch(*tree)\n\t\tbreak\n\tcase StrategyAddRandomSubTree:\n\t\tvar tree *DualTree\n\t\ttree, err = GenerateRandomTree(depth, terminals, nonTerminals)\n\t\terr = p.T.AddSubTree(tree)\n\t\tbreak\n\n\tcase StrategyAddToLeafX:\n\t\tvar tree *DualTree\n\t\ttree, err = GenerateRandomTreeEnforceIndependentVariable(depth, terminals[0], terminals, nonTerminals)\n\t\terr = p.T.AddToLeaf(*tree)\n\t\tbreak\n\n\tcase StrategyAddToLeaf:\n\t\tvar tree *DualTree\n\t\ttree, err = GenerateRandomTree(depth, terminals, nonTerminals)\n\t\terr = p.T.AddToLeaf(*tree)\n\t\tbreak\n\n\tcase StrategyAddTreeWithMult:\n\t\tvar tree *DualTree\n\t\ttree, err = GenerateRandomTree(depth, terminals, []SymbolicExpression{{arity: 2, value: \"*\", kind: 1}})\n\t\terr = p.T.AddToLeaf(*tree)\n\t\tbreak\n\tcase StrategyAddTreeWithDiv:\n\t\tvar tree *DualTree\n\t\ttree, err = GenerateRandomTree(depth, terminals, []SymbolicExpression{{arity: 2, value: \"/\", kind: 1}})\n\t\terr = p.T.AddToLeaf(*tree)\n\t\tbreak\n\tcase StrategyAddTreeWithSub:\n\t\tvar tree *DualTree\n\t\ttree, err = GenerateRandomTree(depth, terminals,\n\t\t\t[]SymbolicExpression{{arity: 2, value: \"-\", kind: 1}})\n\t\terr = p.T.AddToLeaf(*tree)\n\t\tbreak\n\n\tcase StrategyAddTreeWithAdd:\n\t\tvar tree *DualTree\n\t\ttree, err = GenerateRandomTree(depth, terminals,\n\t\t\t[]SymbolicExpression{{arity: 2, value: \"+\", kind: 1}})\n\t\terr = p.T.AddToLeaf(*tree)\n\t\tbreak\n\n\t// DETERMINISTIC STRATEGIES\n\tcase StrategySkip:\n\t\t// Do nothing\n\t\tbreak\n\tcase StrategyFellTree:\n\t\terr = p.T.FellTree()\n\t\tbreak\n\tcase StrategyMultXD:\n\t\trootExpr := SymbolicExpression{arity: 2, value: \"*\", kind: 1}\n\t\trightExpr := SymbolicExpression{arity: 0, value: \"x\", kind: 0}\n\t\troot := rootExpr.ToDualTreeNode(RandString(2))\n\t\tright := rightExpr.ToDualTreeNode(RandString(2))\n\t\ttree := &DualTree{root: root}\n\t\ttree.root.right = right\n\n\t\terr = p.T.AttachSubTree(tree)\n\t\tbreak\n\tcase StrategyAddXD:\n\t\trootExpr := SymbolicExpression{arity: 2, value: \"+\", kind: 1}\n\t\trightExpr := SymbolicExpression{arity: 0, value: \"x\", kind: 0}\n\t\troot := rootExpr.ToDualTreeNode(RandString(2))\n\t\tright := rightExpr.ToDualTreeNode(RandString(2))\n\t\ttree := &DualTree{root: root}\n\t\ttree.root.right = right\n\n\t\terr = p.T.AttachSubTree(tree)\n\t\tbreak\n\tcase StrategySubXD:\n\t\trootExpr := SymbolicExpression{arity: 2, value: \"-\", kind: 1}\n\t\trightExpr := SymbolicExpression{arity: 0, value: \"x\", kind: 0}\n\t\troot := rootExpr.ToDualTreeNode(RandString(2))\n\t\tright := rightExpr.ToDualTreeNode(RandString(2))\n\t\ttree := &DualTree{root: root}\n\t\ttree.root.right = right\n\n\t\terr = p.T.AttachSubTree(tree)\n\t\tbreak\n\tcase StrategyDivXD:\n\t\trootExpr := SymbolicExpression{arity: 2, value: \"/\", kind: 1}\n\t\trightExpr := SymbolicExpression{arity: 0, value: \"x\", kind: 0}\n\t\troot := rootExpr.ToDualTreeNode(RandString(2))\n\t\tright := rightExpr.ToDualTreeNode(RandString(2))\n\t\ttree := &DualTree{root: root}\n\t\ttree.root.right = right\n\n\t\terr = p.T.AttachSubTree(tree)\n\t\tbreak\n\n\tdefault:\n\t\tbreak\n\t}\n\treturn err\n}",
"func (m *Manager) Run() error {\n\tm.Logger.Info(\"Executing strategy\")\n\trec, err := m.Strategy.Evaluate()\n\tm.Config.SetDefault(\"scale_up\", true)\n\tm.Config.SetDefault(\"scale_down\", true)\n\tinvName, stratName, monName := m.Config.GetString(\"inventory.name\"), m.Config.GetString(\"strategy.name\"), m.Config.GetString(\"monitor.name\")\n\tif err == nil {\n\t\tswitch *rec {\n\t\tcase SCALEUP:\n\t\t\tif m.Config.GetBool(\"scale_up\") {\n\t\t\t\terr = m.Inventory.Increase()\n\t\t\t\tif err != nil {\n\t\t\t\t\tm.Logger.Infof(\"Can't scale up: %s\", err.Error())\n\t\t\t\t} else {\n\t\t\t\t\tm.Logger.Warnf(\"Scaling up our %s inventory based on the %s strategy using information from %s\", invName, stratName, monName)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tm.Logger.Warnf(\"I would have scaled up our %s inventory based on the %s strategy using information from %s but am running in advisory mode\", invName, stratName, monName)\n\t\t\t}\n\t\tcase HOLD:\n\t\t\tm.Logger.Info(\"Doing nothing\")\n\t\tcase SCALEDOWN:\n\t\t\tif m.Config.GetBool(\"scale_down\") {\n\t\t\t\terr = m.Inventory.Decrease()\n\t\t\t\tif err != nil {\n\t\t\t\t\tm.Logger.Infof(\"Can't scale down: %s\", err.Error())\n\t\t\t\t} else {\n\t\t\t\t\tm.Logger.Warnf(\"Scaling down our %s inventory based on the %s strategy using information from %s\", invName, stratName, monName)\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tm.Logger.Warnf(\"I would have scaled down our %s inventory based on the %s strategy using information from %s but am running in advisory mode\", invName, stratName, monName)\n\t\t\t}\n\t\tdefault:\n\t\t\terr = errors.New(\"Unknown recommendation\")\n\n\t\t}\n\t}\n\treturn err\n\n}",
"func (h *HubBub) ExecuteStrategy(ctx context.Context, client *github.Client, s Strategy) (*Result, error) {\n\tklog.Infof(\"executing strategy %q\", s.ID)\n\tos := []Outcome{}\n\tseen := map[int]bool{}\n\n\tfor _, tid := range s.TacticIDs {\n\t\tt, err := h.LookupTactic(tid)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\n\t\tcs, err := h.ExecuteTactic(ctx, client, t)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"tactic %q: %v\", t.Name, err)\n\t\t}\n\t\tos = append(os, SummarizeOutcome(t, cs, seen))\n\t}\n\n\tr := SummarizeResult(os)\n\tr.Time = time.Now()\n\treturn r, nil\n}",
"func NewStrategy(s string) Strategy {\n\tswitch s {\n\tcase \"random\":\n\t\treturn &RandomStrategy{}\n\tcase \"fifo\":\n\t\treturn &FIFOStrategy{}\n\tcase \"round\":\n\t\tfallthrough\n\tdefault:\n\t\treturn &RoundStrategy{}\n\t}\n}",
"func (dm *DataManager) QueryStrategy(ctx context.Context, req *pb.QueryStrategyReq) (*pb.QueryStrategyResp, error) {\n\trtime := time.Now()\n\tlogger.V(2).Infof(\"QueryStrategy[%d]| input[%+v]\", req.Seq, req)\n\tresponse := &pb.QueryStrategyResp{Seq: req.Seq, ErrCode: pbcommon.ErrCode_E_OK, ErrMsg: \"OK\"}\n\n\tdefer func() {\n\t\tcost := dm.collector.StatRequest(\"QueryStrategy\", response.ErrCode, rtime, time.Now())\n\t\tlogger.V(2).Infof(\"QueryStrategy[%d]| output[%dms][%+v]\", req.Seq, cost, response)\n\t}()\n\n\taction := strategyaction.NewQueryAction(dm.viper, dm.smgr, req, response)\n\tdm.executor.Execute(action)\n\n\treturn response, nil\n}",
"func selectStrategy(s *database.Store, f *filter.Filter) strategy {\n\tf = filter.Optimize(f)\n\n\tif f == nil {\n\t\t// if there's no filter, scan everything\n\t\treturn &scanRecords{s, nil}\n\t} else if len(f.Conditions) == 0 {\n\t\t// or if the filter matches nothing, perform a noop\n\t\treturn &noop{}\n\t}\n\n\tconds := &conditions{}\n\tif _, err := f.Accept(conds); err != nil {\n\t\tpanic(err)\n\t}\n\n\t// find which condition type is the MOST constrained\n\t//\n\t// TODO(jmalloc): the initial cost should probably be derived from the number\n\t// of documents in the store, likewise the number of keys for key-related\n\t// strategies, however I don't think this should get any more complex until\n\t// there are benchmarks in place.\n\tcheapest := math.MaxUint32\n\tvar qs strategy = &scanRecords{s, f}\n\n\tif conds.IsOneOfCondition != nil {\n\t\tcheapest = len(conds.IsOneOfCondition.Values)\n\t\tqs = &useIDFirst{s, conds}\n\t}\n\n\tif conds.HasUniqueKeyInCondition != nil {\n\t\tcost := len(conds.HasUniqueKeyInCondition.Values)\n\t\tif cost < cheapest {\n\t\t\tcheapest = cost\n\t\t\tqs = &useUniqueKeyFirst{s, conds}\n\t\t}\n\t}\n\n\tif conds.HasKeysCondition != nil {\n\t\tcost := len(conds.HasKeysCondition.Values)\n\t\tif cost < cheapest {\n\t\t\tqs = &useKeysFirst{s, conds}\n\t\t}\n\t}\n\n\treturn qs\n}",
"func HandleAlgorithmCalls(receivedData GuiRequestData) JsonResponse {\n\tfmt.Println(\"[INFO] Called algorithmHandler.go\")\n\n\tgraphObject := adjGraph.MakeConflictGraphOutOfConnectionGraph(buildGraphObjectFromJSON(receivedData))\n\n\tif receivedData.Settings.Algorithm == BASIC_GREEDY {\n\t\tresultGraphWithNodeNames := algorithms.BasicGreedy(graphObject)\n\t\tfmt.Println(\"[DEBUG] generated result graph with Basic Greedy Algorithm \", resultGraphWithNodeNames)\n\n\t\tresultGraphWithLetters := changeNodeNumbersToLetters(resultGraphWithNodeNames, graphObject.Entries)\n\n\t\treturn JsonResponse{true, resultGraphWithLetters}\n\t} else if receivedData.Settings.Algorithm == WELSH_POWELL {\n\t\tresultGraphWithNodeNames := algorithms.WelshPowell(graphObject)\n\t\tfmt.Println(\"[DEBUG]generated result graph with Welsh Powell Algorithm\", resultGraphWithNodeNames)\n\n\t\tresultGraphWithLetters := changeNodeNumbersToLetters(resultGraphWithNodeNames, graphObject.Entries)\n\n\t\treturn JsonResponse{true, resultGraphWithLetters}\n\t} else if receivedData.Settings.Algorithm == BRON_KERBOSCH {\n\n\t\tcompGraph := adjGraph.MakeCompatibilityGraph(graphObject)\n\n\t\tresultGraphWithNodeNames := algorithms.GetMaxCliques(compGraph)\n\t\tfmt.Println(\"[DEBUG] generated result graph with Bron Kerbosch Algorithm \", resultGraphWithNodeNames)\n\n\t\tresultGraphWithLetters := changeNodeNumbersToLetters(resultGraphWithNodeNames, graphObject.Entries)\n\n\t\treturn JsonResponse{true, resultGraphWithLetters}\n\t} else {\n\t\treturn JsonResponse{false, nil}\n\t}\n}",
"func NewStrategy() *Strategy {\n\treturn &Strategy{monitor.Scheme, namesutil.Generator}\n}",
"func NewStrategy() *Strategy {\n\n\tpositions := make([]*Position, 100)\n\n\tfor i := 0; i < 100; i++ {\n\t\trow := i / 10\n\t\tcol := i % 10\n\t\tpositions[i] = &Position{\n\t\t\tIndex: i,\n\t\t\tProbability: 0,\n\t\t\tOccupied: false,\n\t\t\tFired: false,\n\t\t\tHit: false,\n\t\t\tConfirmed: false,\n\t\t\tRow: row,\n\t\t\tCol: col,\n\t\t\tDirections: map[string]*Position{\n\t\t\t\t\"W\": nil,\n\t\t\t\t\"E\": nil,\n\t\t\t\t\"S\": nil,\n\t\t\t\t\"N\": nil,\n\t\t\t},\n\t\t}\n\t}\n\n\t// Set references to adjacent tiles\n\tfor i := 0; i < 100; i++ {\n\t\tif i != 0 && positions[i-1].Row == positions[i].Row {\n\t\t\tpositions[i].Directions[\"W\"] = positions[i-1]\n\t\t} else {\n\t\t\tpositions[i].Directions[\"W\"] = nil\n\t\t}\n\t\tif i < 99 && positions[i+1].Row == positions[i].Row {\n\t\t\tpositions[i].Directions[\"E\"] = positions[i+1]\n\t\t} else {\n\t\t\tpositions[i].Directions[\"E\"] = nil\n\t\t}\n\t\tif i-10 > 0 {\n\t\t\tpositions[i].Directions[\"N\"] = positions[i-10]\n\t\t} else {\n\t\t\tpositions[i].Directions[\"N\"] = nil\n\t\t}\n\t\tif i+10 < 99 {\n\t\t\tpositions[i].Directions[\"S\"] = positions[i+10]\n\t\t} else {\n\t\t\tpositions[i].Directions[\"S\"] = nil\n\t\t}\n\t}\n\n\treturn &Strategy{\n\t\tGrid: positions,\n\t\tShips: map[string]*Ship{\n\t\t\t\"battleship\": &Ship{\n\t\t\t\tAlive: true,\n\t\t\t\tSize: 4,\n\t\t\t\tPosition: 0,\n\t\t\t\tOrientation: vertical,\n\t\t\t},\n\t\t\t\"destroyer\": &Ship{\n\t\t\t\tAlive: true,\n\t\t\t\tSize: 2,\n\t\t\t\tPosition: 0,\n\t\t\t\tOrientation: vertical,\n\t\t\t},\n\t\t\t\"carrier\": &Ship{\n\t\t\t\tAlive: true,\n\t\t\t\tSize: 5,\n\t\t\t\tPosition: 0,\n\t\t\t\tOrientation: vertical,\n\t\t\t},\n\t\t\t\"submarine\": &Ship{\n\t\t\t\tAlive: true,\n\t\t\t\tSize: 3,\n\t\t\t\tPosition: 0,\n\t\t\t\tOrientation: vertical,\n\t\t\t},\n\t\t\t\"cruiser\": &Ship{\n\t\t\t\tAlive: true,\n\t\t\t\tSize: 3,\n\t\t\t\tPosition: 0,\n\t\t\t\tOrientation: vertical,\n\t\t\t},\n\t\t},\n\t\tGameOver: false,\n\t}\n}",
"func NewStrategy(name string) Strategy {\n\tswitch strings.ToLower(name) {\n\tcase \"daily\":\n\t\treturn Strategy{DailyRotation, \"\"}\n\tdefault:\n\t\treturn Strategy{SignalRotation, filepath.Base(os.Args[0])}\n\t}\n}",
"func AimStrategy(id string, fn func(Visitor) Params) AudienceAim {\n\treturn &strategyAim{id, fn}\n}",
"func chooseHost(hosts []Host) (int, Strategy, error) {\n\tif len(hosts) == 1 {\n\t\treturn 0, NoStrategy, nil\n\t}\n\thaveLoadInfo := false\n\thaveOnlineHost := false\n\tfor _, host := range hosts {\n\t\tswitch host.Status {\n\t\tcase OnlineWithLoad:\n\t\t\thaveLoadInfo = true\n\t\tcase Online:\n\t\t\thaveOnlineHost = true\n\t\t}\n\t}\n\tif !haveOnlineHost && !haveLoadInfo {\n\t\treturn -1, NoStrategy, errors.New(\"Every target host was offline\")\n\t}\n\t// Note some of this code is optimized for easy comprehension. Not performance\n\tif !haveLoadInfo {\n\t\t// Round Robin\n\t\t// First find the very first online host\n\t\treturn roundRobinStrategy(hosts)\n\t} else {\n\t\treturn lowestLoadStrategy(hosts)\n\t}\n}",
"func OptionsStrategy(options map[string]interface{}) TraversalStrategy {\n\treturn &traversalStrategy{name: decorationNamespace + \"OptionsStrategy\", configuration: options}\n}",
"func NewStrategy(cfg string, opts ...sim.Option) (*Strategy, error) {\n\toptions := sim.NewOptions(opts)\n\n\t// Create the directory where the data will be stored.\n\terr := os.MkdirAll(options.OutputDir, 0755)\n\tif err != nil {\n\t\treturn nil, xerrors.Errorf(\"couldn't create the data folder: %v\", err)\n\t}\n\n\tclientcfg := newClientConfig(\n\t\t&clientcmd.ClientConfigLoadingRules{ExplicitPath: cfg},\n\t\t&clientcmd.ConfigOverrides{},\n\t)\n\n\trestcfg, err := clientcfg.ClientConfig()\n\tif err != nil {\n\t\treturn nil, xerrors.Errorf(\"config: %v\", err)\n\t}\n\n\tnamespace, _, err := clientcfg.Namespace()\n\tif err != nil {\n\t\treturn nil, xerrors.Errorf(\"couldn't read the namespace: %v\", err)\n\t}\n\n\tengine, err := newKubeEngine(restcfg, namespace, options)\n\tif err != nil {\n\t\treturn nil, xerrors.Errorf(\"couldn't create the engine: %v\", err)\n\t}\n\n\treturn &Strategy{\n\t\tengine: engine,\n\t\ttun: sim.NewDefaultTunnel(options.OutputDir),\n\t\tnamespace: namespace,\n\t\toptions: options,\n\t\tmakeEncoder: makeJSONEncoder,\n\t}, nil\n}",
"func ProductiveByStrategy(config ProductiveByStrategyConfig) TraversalStrategy {\n\tconfigMap := make(map[string]interface{})\n\tconfigMap[\"productiveKeys\"] = config.ProductiveKeys\n\n\treturn &traversalStrategy{name: optimizationNamespace + \"ProductiveByStrategy\", configuration: configMap}\n}",
"func (a *Algorithm) Run(algType string) {\n\ta.Array = generateArray(a.ArraySize)\n\ta.Comps = 0\n\n\tswitch algType {\n\tcase MERGE:\n\t\ta.MergeSort(a.Array)\n\t\tbreak\n\tcase QUICK:\n\t\ta.QuickSort(a.Array)\n\t\tbreak\n\tdefault:\n\t\tlog.Panic(\"Invalid algorithm type\")\n\t}\n}",
"func (algo smallerThanAlgo) Run(s gbt.StrategyHandler) (bool, error) {\n\tokFirst, err := algo.first.Run(s)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\n\tokSecond, err := algo.second.Run(s)\n\tif err != nil {\n\t\treturn false, err\n\t}\n\n\tif !okFirst || !okSecond {\n\t\treturn false, nil\n\t}\n\n\tresult := algo.first.Value() < algo.second.Value()\n\n\treturn result, nil\n}",
"func (rb *RoutingBuilder) Strategy(strategy metapb.RoutingStrategy) *RoutingBuilder {\n\trb.value.Strategy = strategy\n\treturn rb\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
List all zones rcode0 API docs:
|
func (s *ZoneManagementService) List(options *ListOptions) (zones []*Zone, page *Page, err error) {
resp, err := s.client.NewRequest().
SetQueryParam("page_size", options.PageSizeAsString()).
SetQueryParam("page", options.PageNumberAsString()).
Get(
s.client.BaseURL.String() +
s.client.APIVersion +
RC0Zones,
)
if err != nil {
return nil, nil, err
}
err = json.Unmarshal(resp.Body(), &page)
if err != nil {
return nil, nil, err
}
err = mapstructure.WeakDecode(page.Data, &zones)
if err != nil {
return nil, nil, err
}
return zones, page, nil
}
|
[
"func (c *Client) zonesList(filter ListFilter) (*Zones, error) {\n\tzones := &Zones{}\n\terr := resourceRequest(c, zonesListEP(c, filter), \"GET\", nil, zones)\n\tif err != nil {\n\t\treturn zones, err\n\t}\n\n\treturn zones, nil\n}",
"func (s *DNSService) ListZones(ctx context.Context) ([]*Zone, *http.Response, error) {\n\tpath := \"api/xdns/2019-05-27/zones\"\n\tbody, resp, err := s.client.get(ctx, path, url.Values{}, new(zoneResponse))\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn body.(*zoneResponse).Data, resp, nil\n}",
"func (zaw *ZoneAPIWrapper) ListZones(project string) ([]string, error) {\n\tcall := zaw.Service.List(project)\n\n\tvar zones []string\n\tf := func(page *compute.ZoneList) error {\n\t\tfor _, zone := range page.Items {\n\t\t\tzones = append(zones, zone.Name)\n\t\t}\n\t\treturn nil\n\t}\n\n\tif err := call.Pages(zaw.Context, f); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn zones, nil\n}",
"func (h Handlers) GetZones(ctx echo.Context) error {\n\tclient := ctx.(*CustomContext).Ns1Client\n\tzones, _, err := client.Zones.List()\n\tif err != nil {\n\t\treturn err\n\t}\n\treturn ctx.JSON(http.StatusOK, zones)\n}",
"func (operator *AccessOperator) ListZones(cxt context.Context, appName, clusterName string) ([]*common.Zone, error) {\n\tbusiness, app, err := getBusinessAndApp(operator, operator.Business, appName)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif business == nil {\n\t\tlogger.V(3).Infof(\"ListZone: no relative business %s\", operator.Business)\n\t\treturn nil, fmt.Errorf(\"No relative business %s\", operator.Business)\n\t}\n\tif app == nil {\n\t\tlogger.V(3).Infof(\"ListZone: no relative Application %s\", appName)\n\t\treturn nil, fmt.Errorf(\"No relative Application %s\", appName)\n\t}\n\tcluster, err := operator.innerGetClusterByID(cxt, business.Bid, app.Appid, clusterName)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tif cluster == nil {\n\t\tlogger.V(3).Infof(\"ListZone: no relative cluster %s\", clusterName)\n\t\treturn nil, fmt.Errorf(\"No relative cluster %s\", clusterName)\n\t}\n\trequest := &accessserver.QueryZoneListReq{\n\t\tSeq: pkgcommon.Sequence(),\n\t\tBid: business.Bid,\n\t\tClusterid: cluster.Clusterid,\n\t\tIndex: operator.index,\n\t\tLimit: operator.limit,\n\t}\n\tgrpcOptions := []grpc.CallOption{\n\t\tgrpc.WaitForReady(true),\n\t}\n\tresponse, err := operator.Client.QueryZoneList(cxt, request, grpcOptions...)\n\tif err != nil {\n\t\tlogger.V(3).Infof(\"ListZones failed, %s\", err.Error())\n\t\treturn nil, err\n\t}\n\tif response.ErrCode != common.ErrCode_E_OK {\n\t\tlogger.V(3).Infof(\"ListZones all successfully, but response Err, %s\", response.ErrMsg)\n\t\treturn nil, fmt.Errorf(\"%s\", response.ErrMsg)\n\t}\n\treturn response.Zones, nil\n}",
"func (c *Controller) GetZones(ctx *gin.Context) {\n\tif err := c.refreshDB(); err != nil {\n\t\tlog.Println(\"unable to refresh db: \", err)\n\t}\n\n\t// TODO: handle errors properly\n\tzones, err := c.usecases.GetZones()\n\tif err != nil {\n\t\tctx.JSON(http.StatusNotFound, gin.H{\"no zones found\": err})\n\t\treturn\n\t}\n\n\tctx.JSON(http.StatusOK, gin.H{\"zones\": zones})\n}",
"func (c *Client) ListZones(ctx context.Context) ([]DNSZone, error) {\n\tendpoint := c.baseURL.JoinPath(\"v1\", \"zones\")\n\n\treq, err := newJSONRequest(ctx, http.MethodGet, endpoint, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tvar zones []DNSZone\n\terr = c.do(req, &zones)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"could not list zones: %w\", err)\n\t}\n\n\treturn zones, nil\n}",
"func (c Client) GetZones(ctx context.Context, query string, limit, offset int) ([]Zone, error) {\n\tendpoint := c.baseURL.JoinPath(\"user\", \"v1\", \"zones\")\n\n\tvalues := endpoint.Query()\n\tvalues.Set(\"query\", query)\n\n\tif limit > 0 {\n\t\tvalues.Set(\"limit\", strconv.Itoa(limit))\n\t}\n\n\tif offset > 0 {\n\t\tvalues.Set(\"offset\", strconv.Itoa(offset))\n\t}\n\n\tendpoint.RawQuery = values.Encode()\n\n\treq, err := newJSONRequest(ctx, http.MethodGet, endpoint, nil)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"create request: %w\", err)\n\t}\n\n\tresult := apiResponse[[]Zone]{}\n\terr = c.do(req, &result)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn result.Data, nil\n}",
"func GetZoneList(c eurodnsgo.Client) ([]string, error) {\n\tvar v zoneList\n\n\tsr := eurodnsgo.NewSoapRequest(\"zone\", \"list\", &v)\n\n\terr := schedule(c, sr)\n\n\treturn v.Zones, err\n}",
"func (sdk *SDK) ListZones(region string) ([]*cvm.ZoneInfo, error) {\n\tparams := sdk.publicParameters()\n\tparams.Set(\"Action\", \"DescribeZones\")\n\tparams.Set(\"Region\", region)\n\n\tvar resp *cvm.DescribeZonesResponse\n\tif err := sdk.apiCall(params, &resp); err != nil {\n\t\treturn nil, err\n\t}\n\n\treturn resp.Response.ZoneSet, nil\n}",
"func (m *Metadata) AllZones(ctx context.Context) (Zones, error) {\n\tsess, err := m.Session(ctx)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"unable to get aws session to populate zone details\")\n\t}\n\tazs, err := describeAvailabilityZones(ctx, sess, m.Region, []string{})\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"unable to gather availability zones\")\n\t}\n\tzoneDesc := make(Zones, len(azs))\n\tfor _, az := range azs {\n\t\tzoneName := awssdk.StringValue(az.ZoneName)\n\t\tzoneDesc[zoneName] = &Zone{\n\t\t\tName: zoneName,\n\t\t\tGroupName: awssdk.StringValue(az.GroupName),\n\t\t\tType: awssdk.StringValue(az.ZoneType),\n\t\t}\n\t\tif az.ParentZoneName != nil {\n\t\t\tzoneDesc[zoneName].ParentZoneName = awssdk.StringValue(az.ParentZoneName)\n\t\t}\n\t}\n\treturn zoneDesc, nil\n}",
"func listZones(contractID string) ([]string, error) {\n\tqueryArgs := dnsv2.ZoneListQueryArgs{\n\t\tContractIds: contractID,\n\t\tShowAll: true,\n\t}\n\n\tzoneListResp, err := dnsv2.ListZones(queryArgs)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"zone list retrieval failed. error: %s\", err.Error())\n\t}\n\n\tedgeDNSZones := zoneListResp.Zones // what we have\n\tvar zones []string // what we return\n\n\tfor _, edgeDNSZone := range edgeDNSZones {\n\t\tzones = append(zones, edgeDNSZone.Zone)\n\t}\n\n\treturn zones, nil\n}",
"func (r *Repository) GetAll() ([]AvailabilityZone, error) {\n\tvar response availabilityZonesResponse\n\tavRequest := rest.Request{Endpoint: \"/availability-zones\"}\n\terr := r.Client.Get(avRequest, &response)\n\n\treturn response.AvailabilityZones, err\n}",
"func AvailabilityZones(project, region string) ([]string, error) {\n\tctx, cancel := context.WithTimeout(context.Background(), 1*time.Minute)\n\tdefer cancel()\n\n\tssn, err := gcpconfig.GetSession(ctx)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"failed to get session\")\n\t}\n\n\tsvc, err := compute.NewService(ctx, option.WithCredentials(ssn.Credentials))\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"failed to create compute service\")\n\t}\n\n\tregionURL := fmt.Sprintf(\"https://www.googleapis.com/compute/v1/projects/%s/regions/%s\",\n\t\tproject, region)\n\tfilter := fmt.Sprintf(\"(region eq %s) (status eq UP)\", regionURL)\n\tzones, err := gcpconfig.GetZones(ctx, svc, project, filter)\n\tif err != nil {\n\t\treturn nil, errors.New(\"no zone was found\")\n\t}\n\n\tzoneNames := make([]string, 0, len(zones))\n\tfor _, z := range zones {\n\t\tzoneNames = append(zoneNames, z.Name)\n\t}\n\n\tsort.Strings(zoneNames)\n\treturn zoneNames, nil\n}",
"func (client CloudFlareClient) getZones() (*ZonesJsonResponse, error) {\n\theaders := client.getRequestHeaders()\n\n\tstatusCode, responseBytes, err := PerformHttpRequest(\n\t\thttp.MethodGet,\n\t\t\"https://api.cloudflare.com/client/v4/zones\",\n\t\t\"\",\n\t\t\"\",\n\t\tnil,\n\t\t*headers)\n\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\tif statusCode != http.StatusOK {\n\t\treturn nil, fmt.Errorf(\"%s zones GET returned http status code %d and response \\n%s\",\n\t\t\tclient.ServiceConfig.ServiceType, statusCode, string(responseBytes))\n\t}\n\n\tvar zonesJson ZonesJsonResponse\n\tif err = json.Unmarshal(responseBytes, &zonesJson); err != nil {\n\t\treturn nil, err\n\t}\n\n\tif !zonesJson.Success {\n\t\treturn nil, fmt.Errorf(\"%s zones GET returned an unsuccessful response \\n%s\",\n\t\t\tclient.ServiceConfig.ServiceType, string(responseBytes))\n\t}\n\n\tlog.Printf(\"%s zones GET returned %d zone(s) for processing\",\n\t\tclient.ServiceConfig.ServiceType, len(zonesJson.Zones))\n\n\treturn &zonesJson, nil\n}",
"func GetZones(ctx *pulumi.Context) string {\n\treturn config.Get(ctx, \"sakuracloud:zones\")\n}",
"func (cf Cloudflare) Zones() (map[string]string, error) {\n\tvar result = map[string]string{}\n\n\tvar page = 1\n\tfor {\n\t\tendpoint := cf.API + \"/zones\"\n\t\tu, err := url.Parse(endpoint)\n\t\tif err != nil {\n\t\t\treturn nil, errors.Wrap(err, \"cloudflare:\")\n\t\t}\n\n\t\tv := url.Values{}\n\t\tmaxPerPageValue := 50\n\t\tv.Add(\"per_page\", strconv.Itoa(maxPerPageValue))\n\t\tv.Add(\"page\", strconv.Itoa(page))\n\t\tu.RawQuery = v.Encode()\n\n\t\treq, err := http.NewRequest(\"GET\", u.String(), nil)\n\t\tif err != nil {\n\t\t\treturn nil, errors.Wrap(err, \"cloudflare:\")\n\t\t}\n\n\t\tcf.setAuthHeaders(req)\n\n\t\tres, err := cf.Client.Do(req)\n\t\tif err != nil {\n\t\t\treturn nil, errors.Wrap(err, \"cloudflare:\")\n\t\t}\n\t\tdefer res.Body.Close()\n\n\t\tdata := response{}\n\t\tif err := json.NewDecoder(res.Body).Decode(&data); err != nil {\n\t\t\treturn nil, errors.Wrap(err, \"cloudflare:\")\n\t\t}\n\n\t\tif !data.Success {\n\t\t\treturn nil, errors.New(data.Errors[0].Message)\n\t\t}\n\n\t\tfor _, res := range data.Result {\n\t\t\tresult[res.ID] = res.Name\n\t\t}\n\n\t\tif page < data.ResultInfo.TotalPages {\n\t\t\tpage++\n\t\t\tcontinue\n\t\t}\n\t\tbreak\n\t}\n\n\treturn result, nil\n}",
"func GetZones(full bool, tenant string) ([]Zone, error) {\n\ttenantStr := func() string {\n\t\tif len(tenant) == 0 {\n\t\t\treturn \"\"\n\t\t}\n\t\treturn \"-tenant=\" + tenant\n\t}()\n\tfullStr := func() string {\n\t\tif full {\n\t\t\treturn \"-full\"\n\t\t}\n\t\treturn \"\"\n\t}()\n\n\toutput, err := RunCmd(fmt.Sprintf(\"%s api -fetch-zone-apps %s %s\", ActlPath, fullStr, tenantStr))\n\tif err != nil {\n\t\treturn []Zone{}, err\n\t}\n\tlistOfZones := []Zone{}\n\tyaml.Unmarshal([]byte(output), &listOfZones)\n\treturn listOfZones, nil\n}",
"func ZonesHandler(c *gin.Context) {\n\tzones, err := DistinctQuery(\"zones\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\tc.JSON(200, zones)\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
Get a single zone rcode0 API docs:
|
func (s *ZoneManagementService) Get(zone string) (*Zone, error) {
resp, err := s.client.NewRequest().
SetPathParams(
map[string]string{
"zone": zone,
}).
Get(
s.client.BaseURL.String() +
s.client.APIVersion +
RC0Zone,
)
if err != nil {
return nil, err
}
var z *Zone
err = json.Unmarshal(resp.Body(), &z)
if err != nil {
return nil, err
}
return z, nil
}
|
[
"func (client ZonesClient) Get(resourceGroupName string, zoneName string) (result Zone, err error) {\n\treq, err := client.GetPreparer(resourceGroupName, zoneName)\n\tif err != nil {\n\t\treturn result, autorest.NewErrorWithError(err, \"dns.ZonesClient\", \"Get\", nil, \"Failure preparing request\")\n\t}\n\n\tresp, err := client.GetSender(req)\n\tif err != nil {\n\t\tresult.Response = autorest.Response{Response: resp}\n\t\treturn result, autorest.NewErrorWithError(err, \"dns.ZonesClient\", \"Get\", resp, \"Failure sending request\")\n\t}\n\n\tresult, err = client.GetResponder(resp)\n\tif err != nil {\n\t\terr = autorest.NewErrorWithError(err, \"dns.ZonesClient\", \"Get\", resp, \"Failure responding to request\")\n\t}\n\n\treturn\n}",
"func (c *Client) GetZone(resourceGroup, zoneName string) (*Zone, *int, error) {\n\turlParams := url.Values{\n\t\t\"api-version\": []string{apiVersion},\n\t}\n\n\t// Create the url.\n\turi := api.ResolveRelative(BaseURI, zoneURLPath)\n\turi += \"?\" + urlParams.Encode()\n\n\t// Create the request.\n\treq, err := http.NewRequest(\"GET\", uri, nil)\n\tif err != nil {\n\t\treturn nil, nil, fmt.Errorf(\"Creating get zone uri request failed: %v\", err)\n\t}\n\n\t// Add the parameters to the url.\n\tif err := api.ExpandURL(req.URL, map[string]string{\n\t\t\"subscriptionId\": c.auth.SubscriptionID,\n\t\t\"resourceGroup\": resourceGroup,\n\t\t\"zoneName\": zoneName,\n\t}); err != nil {\n\t\treturn nil, nil, fmt.Errorf(\"Expanding URL with parameters failed: %v\", err)\n\t}\n\n\t// Send the request.\n\tresp, err := c.hc.Do(req)\n\tif err != nil {\n\t\treturn nil, &resp.StatusCode, fmt.Errorf(\"Sending get zone request failed: %v\", err)\n\t}\n\tdefer resp.Body.Close()\n\n\t// 200 (OK) is a success response.\n\tif err := api.CheckResponse(resp); err != nil {\n\t\treturn nil, &resp.StatusCode, err\n\t}\n\n\t// Decode the body from the response.\n\tif resp.Body == nil {\n\t\treturn nil, &resp.StatusCode, errors.New(\"Get zone returned an empty body in the response\")\n\t}\n\tvar z Zone\n\tif err := json.NewDecoder(resp.Body).Decode(&z); err != nil {\n\t\treturn nil, &resp.StatusCode, fmt.Errorf(\"Decoding get zone response body failed: %v\", err)\n\t}\n\n\treturn &z, &resp.StatusCode, nil\n}",
"func (c *ZoneClient) Get(ctx context.Context, id int) (*Zone, error) {\n\treturn c.Query().Where(zone.ID(id)).Only(ctx)\n}",
"func (s *DNSService) GetZone(ctx context.Context, zoneUUID string) (*Zone, *http.Response, error) {\n\tpath := fmt.Sprintf(\"api/xdns/2019-05-27/zones/%v\", zoneUUID)\n\tbody, resp, err := s.client.get(ctx, path, url.Values{}, new(zoneResponse))\n\tif err != nil {\n\t\treturn nil, resp, err\n\t}\n\n\treturn body.(*zoneResponse).Data[0], resp, nil\n}",
"func GetZone(ctx *pulumi.Context,\n\tname string, id pulumi.IDInput, state *ZoneState, opts ...pulumi.ResourceOption) (*Zone, error) {\n\tvar resource Zone\n\terr := ctx.ReadResource(\"google-native:dataplex/v1:Zone\", name, id, state, &resource, opts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &resource, nil\n}",
"func GetZone(ctx *pulumi.Context) string {\n\tv, err := config.Try(ctx, \"sakuracloud:zone\")\n\tif err == nil {\n\t\treturn v\n\t}\n\treturn getEnvOrDefault(\"is1b\", nil, \"SAKURACLOUD_ZONE\").(string)\n}",
"func pdnsGetZone(zoneName string) (pdnsZone, error) {\n\turl := fmt.Sprintf(\"%s/api/v1/servers/%s/zones/%s\", config.BaseURL, config.ServerID, zoneName)\n\n\tvar zone pdnsZone\n\n\tresp, err := pdnsCallAPI(\"GET\", url, nil)\n\tif err != nil {\n\t\treturn zone, fmt.Errorf(\"error calling API: %v\", err)\n\t}\n\n\tif resp.StatusCode == 404 {\n\t\treturn zone, errNoSuchZone\n\t}\n\n\terr = json.NewDecoder(resp.Body).Decode(&zone)\n\tif err != nil {\n\t\treturn zone, fmt.Errorf(\"error decoding JSON: %v\", err)\n\t}\n\n\treturn zone, nil\n}",
"func (r *ZoneViewsService) Get(projectName string, zone string, resourceViewName string) *ZoneViewsGetCall {\n\treturn &ZoneViewsGetCall{\n\t\ts: r.s,\n\t\tprojectName: projectName,\n\t\tzone: zone,\n\t\tresourceViewName: resourceViewName,\n\t\tcaller_: googleapi.JSONCall{},\n\t\tparams_: make(map[string][]string),\n\t\tpathTemplate_: \"{projectName}/zones/{zone}/resourceViews/{resourceViewName}\",\n\t\tcontext_: googleapi.NoContext,\n\t}\n}",
"func firstZone(t *testing.T) dnsprovider.Zone {\n\tt.Logf(\"Getting zones\")\n\tzones, err := zones(t).List()\n\tif err != nil {\n\t\tt.Fatalf(\"Failed to list zones: %v\", err)\n\t} else {\n\t\tt.Logf(\"Got zone list: %v\\n\", zones)\n\t}\n\tif len(zones) < 1 {\n\t\tt.Fatalf(\"Zone listing returned %d, expected >= %d\", len(zones), 1)\n\t} else {\n\t\tt.Logf(\"Got at least 1 zone in list:%v\\n\", zones[0])\n\t}\n\treturn zones[0]\n}",
"func (d *DebugDNSProvider) GetZone(name string) (dns.Zone, error) {\n\tlogrus.WithFields(logrus.Fields{\n\t\t\"zone\": name,\n\t}).Debug(\"Calling GetZone\")\n\n\tzone, err := d.p.GetZone(name)\n\n\tlogrus.WithFields(logrus.Fields{\n\t\t\"zone\": zone.String(),\n\t\t\"err\": err,\n\t}).Debug(\"Called GetZone\")\n\n\treturn zone, err\n}",
"func GetZoneInfo(c eurodnsgo.Client, domain string) (Zone, error) {\n\tvar v zoneInfo\n\n\tsr := eurodnsgo.NewSoapRequest(\"zone\", \"info\", &v)\n\tsr.AddParam(eurodnsgo.NewParam(\"zone\", \"name\", domain))\n\n\terr := schedule(c, sr)\n\n\treturn v.Zone, err\n}",
"func GetZoneRecord(ctx *pulumi.Context,\n\tname string, id pulumi.IDInput, state *ZoneRecordState, opts ...pulumi.ResourceOption) (*ZoneRecord, error) {\n\tvar resource ZoneRecord\n\terr := ctx.ReadResource(\"alicloud:pvtz/zoneRecord:ZoneRecord\", name, id, state, &resource, opts...)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &resource, nil\n}",
"func (o ConnectionProfileCloudsqlSettingsOutput) Zone() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v ConnectionProfileCloudsqlSettings) *string { return v.Zone }).(pulumi.StringPtrOutput)\n}",
"func (o EndpointPatchOutput) Zone() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v EndpointPatch) *string { return v.Zone }).(pulumi.StringPtrOutput)\n}",
"func (dm *DataManager) QueryZone(ctx context.Context, req *pb.QueryZoneReq) (*pb.QueryZoneResp, error) {\n\trtime := time.Now()\n\tlogger.V(2).Infof(\"QueryZone[%d]| input[%+v]\", req.Seq, req)\n\tresponse := &pb.QueryZoneResp{Seq: req.Seq, ErrCode: pbcommon.ErrCode_E_OK, ErrMsg: \"OK\"}\n\n\tdefer func() {\n\t\tcost := dm.collector.StatRequest(\"QueryZone\", response.ErrCode, rtime, time.Now())\n\t\tlogger.V(2).Infof(\"QueryZone[%d]| output[%dms][%+v]\", req.Seq, cost, response)\n\t}()\n\n\taction := zoneaction.NewQueryAction(dm.viper, dm.smgr, req, response)\n\tdm.executor.Execute(action)\n\n\treturn response, nil\n}",
"func (o EndpointOutput) Zone() pulumi.StringPtrOutput {\n\treturn o.ApplyT(func(v Endpoint) *string { return v.Zone }).(pulumi.StringPtrOutput)\n}",
"func (o NetworkEndpointGroupLbNetworkEndpointGroupResponseOutput) Zone() pulumi.StringOutput {\n\treturn o.ApplyT(func(v NetworkEndpointGroupLbNetworkEndpointGroupResponse) string { return v.Zone }).(pulumi.StringOutput)\n}",
"func GetRandomZone(t testing.TestingT, projectID string, approvedZones []string, forbiddenZones []string, forbiddenRegions []string) string {\n\tzone, err := GetRandomZoneE(t, projectID, approvedZones, forbiddenZones, forbiddenRegions)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\treturn zone\n}",
"func Zone(width int, height int, options ...*Option) (*C.VipsImage, error) {\n\tvar out *C.VipsImage\n\tvar err error\n\toptions = append(options,\n\t\tInputInt(\"width\", width),\n\t\tInputInt(\"height\", height),\n\t\tOutputImage(\"out\", &out),\n\t)\n\tincOpCounter(\"zone\")\n\terr = vipsCall(\"zone\", options)\n\treturn out, err\n}"
] |
{
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.