diff --git a/AMPVersion.txt b/AMPVersion.txt index 5667fd3..d4a9d9e 100644 --- a/AMPVersion.txt +++ b/AMPVersion.txt @@ -1 +1 @@ -2.6.0.8 \ No newline at end of file +2.6.2.0 \ No newline at end of file diff --git a/APISpec.json b/APISpec.json index a4c071c..a403aa6 100644 --- a/APISpec.json +++ b/APISpec.json @@ -130,6 +130,63 @@ "ReturnTypeName": "ActionResult", "IsComplexType": true }, + "AttachADSWithPairingCode": { + "Description": null, + "Returns": null, + "Parameters": [ + { + "Description": "", + "Name": "PairingCode", + "Optional": false, + "ParamEnumValues": null, + "TypeName": "String" + }, + { + "Description": "", + "Name": "Friendly", + "Optional": false, + "ParamEnumValues": null, + "TypeName": "String" + }, + { + "Description": "", + "Name": "IsHTTPS", + "Optional": false, + "ParamEnumValues": null, + "TypeName": "Boolean" + }, + { + "Description": "", + "Name": "Host", + "Optional": false, + "ParamEnumValues": null, + "TypeName": "String" + }, + { + "Description": "", + "Name": "Port", + "Optional": false, + "ParamEnumValues": null, + "TypeName": "Int32" + }, + { + "Description": "", + "Name": "InstanceID", + "Optional": false, + "ParamEnumValues": null, + "TypeName": "Guid" + } + ], + "ReturnTypeName": "ActionResult", + "IsComplexType": true + }, + "CancelPairing": { + "Description": null, + "Returns": null, + "Parameters": [], + "ReturnTypeName": "Void", + "IsComplexType": false + }, "CloneTemplate": { "Description": null, "Returns": null, @@ -282,6 +339,13 @@ "Optional": true, "ParamEnumValues": null, "TypeName": "Int32" + }, + { + "Description": "", + "Name": "Group", + "Optional": true, + "ParamEnumValues": null, + "TypeName": "String" } ], "ReturnTypeName": "ActionResult", @@ -339,6 +403,13 @@ "Optional": true, "ParamEnumValues": null, "TypeName": "Int32" + }, + { + "Description": "", + "Name": "Group", + "Optional": true, + "ParamEnumValues": null, + "TypeName": "String" } ], "ReturnTypeName": "ActionResult", @@ -724,6 +795,13 @@ "ReturnTypeName": "JObject", "IsComplexType": true }, + "GetTargetPairingCode": { + "Description": null, + "Returns": null, + "Parameters": [], + "ReturnTypeName": "ActionResult", + "IsComplexType": true + }, "HandoutInstanceConfigs": { "Description": null, "Returns": null, @@ -968,6 +1046,42 @@ "ReturnTypeName": "ActionResult", "IsComplexType": true }, + "RegisterTargetWithCode": { + "Description": null, + "Returns": null, + "Parameters": [ + { + "Description": "", + "Name": "controllerUrl", + "Optional": false, + "ParamEnumValues": null, + "TypeName": "String" + }, + { + "Description": "", + "Name": "myUrl", + "Optional": false, + "ParamEnumValues": null, + "TypeName": "String" + }, + { + "Description": "", + "Name": "code", + "Optional": false, + "ParamEnumValues": null, + "TypeName": "String" + }, + { + "Description": "", + "Name": "friendlyName", + "Optional": false, + "ParamEnumValues": null, + "TypeName": "String" + } + ], + "ReturnTypeName": "ActionResult", + "IsComplexType": true + }, "RepairDatastore": { "Description": null, "Returns": null, @@ -1081,6 +1195,20 @@ "Optional": false, "ParamEnumValues": null, "TypeName": "Dictionary" + }, + { + "Description": "", + "Name": "ApplicationIP", + "Optional": true, + "ParamEnumValues": null, + "TypeName": "String" + }, + { + "Description": "", + "Name": "mustStop", + "Optional": true, + "ParamEnumValues": null, + "TypeName": "Boolean" } ], "ReturnTypeName": "ActionResult", @@ -1168,42 +1296,6 @@ "ReturnTypeName": "ActionResult", "IsComplexType": true }, - "TestADSLoginDetails": { - "Description": null, - "Returns": null, - "Parameters": [ - { - "Description": "", - "Name": "url", - "Optional": false, - "ParamEnumValues": null, - "TypeName": "String" - }, - { - "Description": "", - "Name": "username", - "Optional": false, - "ParamEnumValues": null, - "TypeName": "String" - }, - { - "Description": "", - "Name": "password", - "Optional": false, - "ParamEnumValues": null, - "TypeName": "String" - }, - { - "Description": "", - "Name": "twoFactorToken", - "Optional": false, - "ParamEnumValues": null, - "TypeName": "String" - } - ], - "ReturnTypeName": "ActionResult", - "IsComplexType": true - }, "UpdateDatastore": { "Description": null, "Returns": null, @@ -1332,6 +1424,34 @@ "Optional": true, "ParamEnumValues": null, "TypeName": "String" + }, + { + "Description": "", + "Name": "DisplayGroup", + "Optional": true, + "ParamEnumValues": null, + "TypeName": "String" + }, + { + "Description": "", + "Name": "CustomMountBindings", + "Optional": true, + "ParamEnumValues": null, + "TypeName": "Dictionary" + }, + { + "Description": "", + "Name": "ExtraContainerPackages", + "Optional": true, + "ParamEnumValues": null, + "TypeName": "List" + }, + { + "Description": "", + "Name": "IsMultiIPAware", + "Optional": true, + "ParamEnumValues": null, + "TypeName": "Boolean" } ], "ReturnTypeName": "ActionResult", @@ -2152,6 +2272,28 @@ "ReturnTypeName": "Guid", "IsComplexType": false }, + "GetOIDCLoginURL": { + "Description": null, + "Returns": null, + "Parameters": [ + { + "Description": "", + "Name": "state", + "Optional": true, + "ParamEnumValues": null, + "TypeName": "String" + }, + { + "Description": "", + "Name": "redirect_uri", + "Optional": true, + "ParamEnumValues": null, + "TypeName": "String" + } + ], + "ReturnTypeName": "String", + "IsComplexType": false + }, "GetPermissionsSpec": { "Description": null, "Returns": null, @@ -2411,6 +2553,35 @@ "ReturnTypeName": "Void", "IsComplexType": false }, + "OIDCLogin": { + "Description": null, + "Returns": null, + "Parameters": [ + { + "Description": "", + "Name": "code", + "Optional": false, + "ParamEnumValues": null, + "TypeName": "String" + }, + { + "Description": "", + "Name": "redirect_uri", + "Optional": false, + "ParamEnumValues": null, + "TypeName": "String" + }, + { + "Description": "", + "Name": "serverId", + "Optional": false, + "ParamEnumValues": null, + "TypeName": "Nullable" + } + ], + "ReturnTypeName": "JObject", + "IsComplexType": true + }, "RefreshSettingValueList": { "Description": null, "Returns": null, @@ -2731,6 +2902,21 @@ "ReturnTypeName": "ActionResult", "IsComplexType": true }, + "UpdatePublicKey": { + "Description": null, + "Returns": null, + "Parameters": [ + { + "Description": "", + "Name": "PubKey", + "Optional": false, + "ParamEnumValues": null, + "TypeName": "String" + } + ], + "ReturnTypeName": "ActionResult", + "IsComplexType": true + }, "UpdateUserInfo": { "Description": null, "Returns": null, @@ -3218,6 +3404,7 @@ "IsComplexType": true } }, + "FiveMModule": {}, "GenericModule": { "ImportConfig": { "Description": null, @@ -3240,6 +3427,13 @@ "Parameters": [], "ReturnTypeName": "Void", "IsComplexType": false + }, + "RequestServerInfo": { + "Description": null, + "Returns": null, + "Parameters": [], + "ReturnTypeName": "Void", + "IsComplexType": false } }, "LocalFileBackupPlugin": { @@ -3371,6 +3565,20 @@ "ParamEnumValues": null, "TypeName": "Boolean" }, + { + "Description": "", + "Name": "Local", + "Optional": true, + "ParamEnumValues": null, + "TypeName": "Boolean" + }, + { + "Description": "", + "Name": "S3", + "Optional": true, + "ParamEnumValues": null, + "TypeName": "Boolean" + }, { "Description": "", "Name": "WasCreatedAutomatically", @@ -3663,6 +3871,13 @@ "ReturnTypeName": "IEnumerable", "IsComplexType": true }, + "RejectEULA": { + "Description": null, + "Returns": null, + "Parameters": [], + "ReturnTypeName": "Boolean", + "IsComplexType": false + }, "RemoveOPEntry": { "Description": null, "Returns": null, diff --git a/FriendlySpec.txt b/FriendlySpec.txt index 34a3c04..a074dcc 100644 --- a/FriendlySpec.txt +++ b/FriendlySpec.txt @@ -2,10 +2,12 @@ ADSModule.AddDatastore(newDatastore: InstanceDatastore) -> ActionResult ADSModule.ApplyInstanceConfiguration(InstanceID: Guid, Args: Dictionary, RebuildConfiguration: Boolean) -> ActionResult ADSModule.ApplyTemplate(InstanceID: Guid, TemplateID: Int32, NewFriendlyName: String, Secret: String, RestartIfPreviouslyRunning: Boolean) -> ActionResult ADSModule.AttachADS(Friendly: String, IsHTTPS: Boolean, Host: String, Port: Int32, InstanceID: Guid) -> ActionResult +ADSModule.AttachADSWithPairingCode(PairingCode: String, Friendly: String, IsHTTPS: Boolean, Host: String, Port: Int32, InstanceID: Guid) -> ActionResult +ADSModule.CancelPairing() -> Void ADSModule.CloneTemplate(Id: Int32, NewName: String) -> ActionResult ADSModule.CreateDeploymentTemplate(Name: String) -> ActionResult -ADSModule.CreateInstance(TargetADSInstance: Guid, NewInstanceId: Guid, Module: String, InstanceName: String, FriendlyName: String, IPBinding: String, PortNumber: Int32, AdminUsername: String, AdminPassword: String, ProvisionSettings: Dictionary, AutoConfigure: Boolean, StartOnBoot: Boolean, DisplayImageSource: String, TargetDatastore: Int32, PostCreate: PostCreateAppActions) -> ActionResult -ADSModule.CreateInstanceFromSpec(SpecId: Guid, TargetADSInstance: Guid, FriendlyName: String, PostCreate: PostCreateAppActions, StartOnBoot: Boolean, TargetDatastore: Int32) -> ActionResult +ADSModule.CreateInstance(TargetADSInstance: Guid, NewInstanceId: Guid, Module: String, InstanceName: String, FriendlyName: String, IPBinding: String, PortNumber: Int32, AdminUsername: String, AdminPassword: String, ProvisionSettings: Dictionary, AutoConfigure: Boolean, StartOnBoot: Boolean, DisplayImageSource: String, TargetDatastore: Int32, PostCreate: PostCreateAppActions, Group: String) -> ActionResult +ADSModule.CreateInstanceFromSpec(SpecId: Guid, TargetADSInstance: Guid, FriendlyName: String, PostCreate: PostCreateAppActions, StartOnBoot: Boolean, TargetDatastore: Int32, Group: String) -> ActionResult ADSModule.CreateLocalInstance(Instance: LocalAMPInstance, PostCreate: PostCreateAppActions) -> ActionResult ADSModule.DeleteDatastore(id: Int32) -> ActionResult ADSModule.DeleteDeploymentTemplate(Id: Int32) -> ActionResult @@ -30,6 +32,7 @@ ADSModule.GetProvisionFitness() -> ProvisionFitness ADSModule.GetSupportedAppSummaries() -> List ADSModule.GetSupportedApplications() -> List ADSModule.GetTargetInfo() -> RemoteTargetInfo +ADSModule.GetTargetPairingCode() -> ActionResult ADSModule.HandoutInstanceConfigs(ForModule: String, SettingNode: String, Values: List) -> ActionResult ADSModule.ManageInstance(InstanceId: Guid) -> ActionResult ADSModule.ModifyCustomFirewallRule(instanceId: Guid, PortNumber: Int32, Range: Int32, Protocol: PortProtocol, Description: String, Open: Boolean) -> ActionResult @@ -41,21 +44,21 @@ ADSModule.RefreshGroup(GroupId: Guid) -> ActionResult ADSModule.RefreshInstanceConfig(InstanceId: String) -> ActionResult ADSModule.RefreshRemoteConfigStores(force: Boolean) -> Void ADSModule.RegisterTarget(controllerUrl: String, myUrl: String, username: String, password: String, twoFactorToken: String, friendlyName: String) -> ActionResult +ADSModule.RegisterTargetWithCode(controllerUrl: String, myUrl: String, code: String, friendlyName: String) -> ActionResult ADSModule.RepairDatastore(id: Int32) -> RunningTask ADSModule.RequestDatastoreSizeCalculation(datastoreId: Int32) -> RunningTask ADSModule.RestartInstance(InstanceName: String) -> ActionResult ADSModule.Servers(Data: JObject, RealIP: IPAddress) -> JSONRawResponse ADSModule.SetInstanceConfig(InstanceName: String, SettingNode: String, Value: String) -> ActionResult -ADSModule.SetInstanceNetworkInfo(InstanceId: Guid, PortMappings: Dictionary) -> ActionResult +ADSModule.SetInstanceNetworkInfo(InstanceId: Guid, PortMappings: Dictionary, ApplicationIP: String, mustStop: Boolean) -> ActionResult ADSModule.SetInstanceSuspended(InstanceName: String, Suspended: Boolean) -> ActionResult ADSModule.StartAllInstances(TargetADSInstance: Guid) -> ActionResult ADSModule.StartInstance(InstanceName: String) -> ActionResult ADSModule.StopAllInstances(TargetADSInstance: Guid) -> ActionResult ADSModule.StopInstance(InstanceName: String) -> ActionResult -ADSModule.TestADSLoginDetails(url: String, username: String, password: String, twoFactorToken: String) -> ActionResult ADSModule.UpdateDatastore(updatedDatastore: InstanceDatastore) -> ActionResult ADSModule.UpdateDeploymentTemplate(templateToUpdate: DeploymentTemplate) -> ActionResult -ADSModule.UpdateInstanceInfo(InstanceId: String, FriendlyName: String, Description: String, StartOnBoot: Boolean, Suspended: Boolean, ExcludeFromFirewall: Boolean, RunInContainer: Boolean, ContainerMemory: Int32, MemoryPolicy: ContainerMemoryPolicy, ContainerMaxCPU: Float, ContainerImage: String, ContainerSwap: Int32, WelcomeMessage: String) -> ActionResult +ADSModule.UpdateInstanceInfo(InstanceId: String, FriendlyName: String, Description: String, StartOnBoot: Boolean, Suspended: Boolean, ExcludeFromFirewall: Boolean, RunInContainer: Boolean, ContainerMemory: Int32, MemoryPolicy: ContainerMemoryPolicy, ContainerMaxCPU: Float, ContainerImage: String, ContainerSwap: Int32, WelcomeMessage: String, DisplayGroup: String, CustomMountBindings: Dictionary, ExtraContainerPackages: List, IsMultiIPAware: Boolean) -> ActionResult ADSModule.UpdateTarget(TargetID: Guid) -> Void ADSModule.UpdateTargetInfo(Id: Guid, FriendlyName: String, Url: Uri, Description: String, Tags: List) -> ActionResult ADSModule.UpgradeAllInstances(RestartRunning: Boolean, TargetADSInstance: Guid) -> ActionResult @@ -100,6 +103,7 @@ Core.GetConfigs(nodes: List) -> List Core.GetDiagnosticsInfo() -> Dictionary Core.GetModuleInfo() -> ModuleInfo Core.GetNewGuid() -> Guid +Core.GetOIDCLoginURL(state: String, redirect_uri: String) -> String Core.GetPermissionsSpec() -> List Core.GetPortSummaries() -> List Core.GetProvisionSpec() -> List @@ -124,6 +128,7 @@ Core.GetWebauthnCredentialSummaries() -> List Core.Kill() -> Void Core.Login(username: String, password: String, token: String, rememberMe: Boolean) -> LoginResponse Core.Logout() -> Void +Core.OIDCLogin(code: String, redirect_uri: String, serverId: Nullable) -> JObject Core.RefreshSettingValueList(Node: String) -> ActionResult Core.RefreshSettingsSourceCache() -> Void Core.RenameRole(RoleId: Guid, NewName: String) -> ActionResult @@ -147,6 +152,7 @@ Core.Suspend() -> Void Core.UpdateAMPInstance() -> Void Core.UpdateAccountInfo(EmailAddress: String, TwoFactorPIN: String) -> ActionResult Core.UpdateApplication() -> ActionResult +Core.UpdatePublicKey(PubKey: String) -> ActionResult Core.UpdateUserInfo(Username: String, Disabled: Boolean, PasswordExpires: Boolean, CannotChangePassword: Boolean, MustChangePassword: Boolean, EmailAddress: String) -> ActionResult Core.UpgradeAMP() -> Void Core.WebauthnRegister(attestationObject: String, clientDataJSON: String, description: String) -> ActionResult @@ -172,6 +178,7 @@ FileManagerPlugin.TrashFile(Filename: String) -> ActionResult FileManagerPlugin.WriteFileChunk(Filename: String, Data: String, Offset: Int64, FinalChunk: Boolean) -> ActionResult GenericModule.ImportConfig(filename: String) -> Dictionary GenericModule.ReloadGenericConfig() -> Void +GenericModule.RequestServerInfo() -> Void LocalFileBackupPlugin.DeleteFromS3(BackupId: Guid) -> ActionResult LocalFileBackupPlugin.DeleteLocalBackup(BackupId: Guid) -> Void LocalFileBackupPlugin.DownloadFromS3(BackupId: Guid) -> RunningTask @@ -179,7 +186,7 @@ LocalFileBackupPlugin.GetBackups() -> List LocalFileBackupPlugin.RefreshBackupList() -> Void LocalFileBackupPlugin.RestoreBackup(BackupId: Guid, DeleteExistingData: Boolean) -> ActionResult LocalFileBackupPlugin.SetBackupSticky(BackupId: Guid, Sticky: Boolean) -> Void -LocalFileBackupPlugin.TakeBackup(Title: String, Description: String, Sticky: Boolean, WasCreatedAutomatically: Boolean) -> ActionResult +LocalFileBackupPlugin.TakeBackup(Title: String, Description: String, Sticky: Boolean, WasCreatedAutomatically: Boolean, Local: Boolean, S3: Boolean) -> ActionResult LocalFileBackupPlugin.UploadToS3(BackupId: Guid) -> RunningTask MinecraftModule.AcceptEULA() -> Boolean MinecraftModule.AddOPEntry(UserOrUUID: String) -> ActionResult @@ -201,6 +208,7 @@ MinecraftModule.GetWhitelist() -> List MinecraftModule.KickUserByID(ID: String) -> Void MinecraftModule.KillByID(ID: String) -> Void MinecraftModule.LoadOPList() -> List +MinecraftModule.RejectEULA() -> Boolean MinecraftModule.RemoveOPEntry(UserOrUUID: String) -> Void MinecraftModule.RemoveWhitelistEntry(UserOrUUID: String) -> Void MinecraftModule.SmiteByID(ID: String) -> Void diff --git a/LICENSE.md b/LICENSE.md index a3bfd30..47fe06a 100755 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2024 Dylan Sperrer +Copyright (c) 2024-2025 Dylan Sperrer Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/ModuleInheritance.json b/ModuleInheritance.json index 348ecb8..eb941f4 100644 --- a/ModuleInheritance.json +++ b/ModuleInheritance.json @@ -6,6 +6,15 @@ "EmailSenderPlugin", "FileManagerPlugin" ], + "FiveM": [ + "AnalyticsPlugin", + "CommonCorePlugin", + "Core", + "EmailSenderPlugin", + "FileManagerPlugin", + "FiveMModule", + "LocalFileBackupPlugin" + ], "GenericModule": [ "AnalyticsPlugin", "CommonCorePlugin", diff --git a/TypedAPISpec.json b/TypedAPISpec.json index 7901a9a..6a5e2eb 100644 --- a/TypedAPISpec.json +++ b/TypedAPISpec.json @@ -110,6 +110,63 @@ "ReturnTypeName": "ActionResult", "IsComplexType": true }, + "AttachADSWithPairingCode": { + "Description": null, + "Returns": null, + "Parameters": [ + { + "Description": "", + "Name": "PairingCode", + "Optional": false, + "ParamEnumValues": null, + "TypeName": "String" + }, + { + "Description": "", + "Name": "Friendly", + "Optional": false, + "ParamEnumValues": null, + "TypeName": "String" + }, + { + "Description": "", + "Name": "IsHTTPS", + "Optional": false, + "ParamEnumValues": null, + "TypeName": "Boolean" + }, + { + "Description": "", + "Name": "Host", + "Optional": false, + "ParamEnumValues": null, + "TypeName": "String" + }, + { + "Description": "", + "Name": "Port", + "Optional": false, + "ParamEnumValues": null, + "TypeName": "Int32" + }, + { + "Description": "", + "Name": "InstanceID", + "Optional": false, + "ParamEnumValues": null, + "TypeName": "Guid" + } + ], + "ReturnTypeName": "ActionResult", + "IsComplexType": true + }, + "CancelPairing": { + "Description": null, + "Returns": null, + "Parameters": [], + "ReturnTypeName": "Void", + "IsComplexType": false + }, "CloneTemplate": { "Parameters": [ { @@ -239,6 +296,13 @@ "StartAlways": 5 }, "TypeName": "PostCreateAppActions" + }, + { + "Description": "", + "Name": "Group", + "Optional": true, + "ParamEnumValues": null, + "TypeName": "String" } ], "ReturnTypeName": "ActionResult", @@ -289,6 +353,13 @@ "Name": "TargetDatastore", "Optional": true, "TypeName": "Int32" + }, + { + "Description": "", + "Name": "Group", + "Optional": true, + "ParamEnumValues": null, + "TypeName": "String" } ], "ReturnTypeName": "ActionResult", @@ -602,6 +673,13 @@ "ReturnTypeName": "RemoteTargetInfo", "IsComplexType": true }, + "GetTargetPairingCode": { + "Description": null, + "Returns": null, + "Parameters": [], + "ReturnTypeName": "ActionResult", + "IsComplexType": true + }, "HandoutInstanceConfigs": { "Parameters": [ { @@ -803,6 +881,42 @@ "ReturnTypeName": "ActionResult", "IsComplexType": true }, + "RegisterTargetWithCode": { + "Description": null, + "Returns": null, + "Parameters": [ + { + "Description": "", + "Name": "controllerUrl", + "Optional": false, + "ParamEnumValues": null, + "TypeName": "String" + }, + { + "Description": "", + "Name": "myUrl", + "Optional": false, + "ParamEnumValues": null, + "TypeName": "String" + }, + { + "Description": "", + "Name": "code", + "Optional": false, + "ParamEnumValues": null, + "TypeName": "String" + }, + { + "Description": "", + "Name": "friendlyName", + "Optional": false, + "ParamEnumValues": null, + "TypeName": "String" + } + ], + "ReturnTypeName": "ActionResult", + "IsComplexType": true + }, "RepairDatastore": { "Parameters": [ { @@ -894,6 +1008,20 @@ "Name": "PortMappings", "Optional": false, "TypeName": "Dictionary" + }, + { + "Description": "", + "Name": "ApplicationIP", + "Optional": true, + "ParamEnumValues": null, + "TypeName": "String" + }, + { + "Description": "", + "Name": "mustStop", + "Optional": true, + "ParamEnumValues": null, + "TypeName": "Boolean" } ], "ReturnTypeName": "ActionResult", @@ -965,36 +1093,6 @@ "ReturnTypeName": "ActionResult", "IsComplexType": true }, - "TestADSLoginDetails": { - "Parameters": [ - { - "Description": "", - "Name": "url", - "Optional": false, - "TypeName": "String" - }, - { - "Description": "", - "Name": "username", - "Optional": false, - "TypeName": "String" - }, - { - "Description": "", - "Name": "password", - "Optional": false, - "TypeName": "String" - }, - { - "Description": "", - "Name": "twoFactorToken", - "Optional": false, - "TypeName": "String" - } - ], - "ReturnTypeName": "ActionResult", - "IsComplexType": true - }, "UpdateDatastore": { "Parameters": [ { @@ -1103,6 +1201,34 @@ "Name": "WelcomeMessage", "Optional": true, "TypeName": "String" + }, + { + "Description": "", + "Name": "DisplayGroup", + "Optional": true, + "ParamEnumValues": null, + "TypeName": "String" + }, + { + "Description": "", + "Name": "CustomMountBindings", + "Optional": true, + "ParamEnumValues": null, + "TypeName": "Dictionary" + }, + { + "Description": "", + "Name": "ExtraContainerPackages", + "Optional": true, + "ParamEnumValues": null, + "TypeName": "List" + }, + { + "Description": "", + "Name": "IsMultiIPAware", + "Optional": true, + "ParamEnumValues": null, + "TypeName": "Boolean" } ], "ReturnTypeName": "ActionResult", @@ -1778,6 +1904,28 @@ "ReturnTypeName": "Guid", "IsComplexType": false }, + "GetOIDCLoginURL": { + "Description": null, + "Returns": null, + "Parameters": [ + { + "Description": "", + "Name": "state", + "Optional": true, + "ParamEnumValues": null, + "TypeName": "String" + }, + { + "Description": "", + "Name": "redirect_uri", + "Optional": true, + "ParamEnumValues": null, + "TypeName": "String" + } + ], + "ReturnTypeName": "String", + "IsComplexType": false + }, "GetPermissionsSpec": { "Parameters": [], "ReturnTypeName": "List", @@ -1983,6 +2131,35 @@ "ReturnTypeName": "Void", "IsComplexType": false }, + "OIDCLogin": { + "Description": null, + "Returns": null, + "Parameters": [ + { + "Description": "", + "Name": "code", + "Optional": false, + "ParamEnumValues": null, + "TypeName": "String" + }, + { + "Description": "", + "Name": "redirect_uri", + "Optional": false, + "ParamEnumValues": null, + "TypeName": "String" + }, + { + "Description": "", + "Name": "serverId", + "Optional": false, + "ParamEnumValues": null, + "TypeName": "Nullable" + } + ], + "ReturnTypeName": "JObject", + "IsComplexType": true + }, "RefreshSettingValueList": { "Parameters": [ { @@ -2242,6 +2419,21 @@ "ReturnTypeName": "ActionResult", "IsComplexType": true }, + "UpdatePublicKey": { + "Description": null, + "Returns": null, + "Parameters": [ + { + "Description": "", + "Name": "PubKey", + "Optional": false, + "ParamEnumValues": null, + "TypeName": "String" + } + ], + "ReturnTypeName": "ActionResult", + "IsComplexType": true + }, "UpdateUserInfo": { "Parameters": [ { @@ -2650,6 +2842,7 @@ "IsComplexType": false } }, + "FiveMModule": {}, "GenericModule": { "ImportConfig": { "Parameters": [ @@ -2667,6 +2860,13 @@ "Parameters": [], "ReturnTypeName": "Void", "IsComplexType": false + }, + "RequestServerInfo": { + "Description": null, + "Returns": null, + "Parameters": [], + "ReturnTypeName": "Void", + "IsComplexType": false } }, "LocalFileBackupPlugin": { @@ -2777,6 +2977,20 @@ "Name": "WasCreatedAutomatically", "Optional": true, "TypeName": "Boolean" + }, + { + "Description": "", + "Name": "Local", + "Optional": true, + "ParamEnumValues": null, + "TypeName": "Boolean" + }, + { + "Description": "", + "Name": "S3", + "Optional": true, + "ParamEnumValues": null, + "TypeName": "Boolean" } ], "ReturnTypeName": "ActionResult", @@ -3006,6 +3220,13 @@ "ReturnTypeName": "List", "IsComplexType": true }, + "RejectEULA": { + "Description": null, + "Returns": null, + "Parameters": [], + "ReturnTypeName": "Boolean", + "IsComplexType": false + }, "RemoveOPEntry": { "Parameters": [ { diff --git a/libraries/java/build.gradle.kts b/libraries/java/build.gradle.kts index fe44a69..086104f 100644 --- a/libraries/java/build.gradle.kts +++ b/libraries/java/build.gradle.kts @@ -1,20 +1,20 @@ plugins { id("java") id("maven-publish") - id("com.diffplug.spotless") version("7.0.2") - id("xyz.wagyourtail.jvmdowngrader") version("1.2.2") + id("com.diffplug.spotless") version("7.0.4") + id("xyz.wagyourtail.jvmdowngrader") version("1.3.0") } group = "dev.neuralnexus" -version = "2608.3.0" +version = "2620.4.0" repositories { - mavenCentral() + maven("https://maven.neuralnexus.dev/mirror") } dependencies { - compileOnly("org.jetbrains:annotations:24.1.0") - implementation("com.google.code.gson:gson:2.12.1") + compileOnly("org.jetbrains:annotations:26.0.2") + implementation("com.google.code.gson:gson:2.13.1") implementation("com.github.sviperll:result4j:1.2.0") } @@ -26,6 +26,7 @@ spotless { endWithNewline() } java { + toggleOffOn() importOrder() removeUnusedImports() cleanthat() diff --git a/libraries/java/settings.gradle.kts b/libraries/java/settings.gradle.kts index 6155248..1ca2eb4 100644 --- a/libraries/java/settings.gradle.kts +++ b/libraries/java/settings.gradle.kts @@ -4,7 +4,5 @@ pluginManagement { repositories { mavenLocal() maven("https://maven.neuralnexus.dev/mirror") - mavenCentral() - gradlePluginPortal() } } diff --git a/libraries/java/src/main/java/dev/neuralnexus/ampapi/AMPError.java b/libraries/java/src/main/java/dev/neuralnexus/ampapi/AMPError.java index f1f5103..9335063 100644 --- a/libraries/java/src/main/java/dev/neuralnexus/ampapi/AMPError.java +++ b/libraries/java/src/main/java/dev/neuralnexus/ampapi/AMPError.java @@ -4,6 +4,8 @@ */ package dev.neuralnexus.ampapi; +import org.jetbrains.annotations.NotNull; + /** * AMPError * @@ -13,7 +15,7 @@ */ public record AMPError(String Title, String Message, String StackTrace) { @Override - public String toString() { + public @NotNull String toString() { return this.Title + ": " + this.Message + "\n" + this.StackTrace; } } diff --git a/libraries/java/src/main/java/dev/neuralnexus/ampapi/modules/FiveM.java b/libraries/java/src/main/java/dev/neuralnexus/ampapi/modules/FiveM.java new file mode 100644 index 0000000..814c43c --- /dev/null +++ b/libraries/java/src/main/java/dev/neuralnexus/ampapi/modules/FiveM.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) 2025 Dylan Sperrer - dylan@sperrer.ca + * This project is Licensed under MIT + */ +package dev.neuralnexus.ampapi.modules; + +import dev.neuralnexus.ampapi.auth.AuthProvider; +import dev.neuralnexus.ampapi.plugins.*; + +/** FiveM Module */ +public class FiveM extends CommonAPI { + /** AnalyticsPlugin plugin */ + public final AnalyticsPlugin AnalyticsPlugin; + + /** FiveMModule plugin */ + public final FiveMModule FiveMModule; + + /** LocalFileBackupPlugin plugin */ + public final LocalFileBackupPlugin LocalFileBackupPlugin; + + /** + * Constructor + * + * @param authProvider The AuthProvider to use + */ + public FiveM(AuthProvider authProvider) { + super(authProvider); + this.AnalyticsPlugin = new AnalyticsPlugin(authProvider); + this.FiveMModule = new FiveMModule(authProvider); + this.LocalFileBackupPlugin = new LocalFileBackupPlugin(authProvider); + } +} diff --git a/libraries/java/src/main/java/dev/neuralnexus/ampapi/plugins/ADSModule.java b/libraries/java/src/main/java/dev/neuralnexus/ampapi/plugins/ADSModule.java index e2a4319..e17bcdb 100644 --- a/libraries/java/src/main/java/dev/neuralnexus/ampapi/plugins/ADSModule.java +++ b/libraries/java/src/main/java/dev/neuralnexus/ampapi/plugins/ADSModule.java @@ -179,6 +179,78 @@ public CompletionStage> AttachADSAsync( () -> this.AttachADS(Friendly, IsHTTPS, Host, Port, InstanceID)); } + /** + * Name Description + * + * @param PairingCode + * @param Friendly + * @param IsHTTPS + * @param Host + * @param Port + * @param InstanceID + * @return ActionResult + */ + public Result AttachADSWithPairingCode( + String PairingCode, + String Friendly, + Boolean IsHTTPS, + String Host, + Integer Port, + UUID InstanceID) { + Map args = new HashMap<>(); + args.put("PairingCode", PairingCode); + args.put("Friendly", Friendly); + args.put("IsHTTPS", IsHTTPS); + args.put("Host", Host); + args.put("Port", Port); + args.put("InstanceID", InstanceID); + Type type = new TypeToken() {}.getType(); + return this.APICall("ADSModule/AttachADSWithPairingCode", args, type); + } + + /** + * Name Description + * + * @param PairingCode + * @param Friendly + * @param IsHTTPS + * @param Host + * @param Port + * @param InstanceID + * @return ActionResult + */ + public CompletionStage> AttachADSWithPairingCodeAsync( + String PairingCode, + String Friendly, + Boolean IsHTTPS, + String Host, + Integer Port, + UUID InstanceID) { + return CompletableFuture.supplyAsync( + () -> + this.AttachADSWithPairingCode( + PairingCode, Friendly, IsHTTPS, Host, Port, InstanceID)); + } + + /** + * Name Description + * + * @return Void + */ + public Result CancelPairing() { + Type type = new TypeToken() {}.getType(); + return this.APICall("ADSModule/CancelPairing", type); + } + + /** + * Name Description + * + * @return Void + */ + public CompletionStage> CancelPairingAsync() { + return CompletableFuture.supplyAsync(() -> this.CancelPairing()); + } + /** * Name Description * @@ -249,6 +321,7 @@ public CompletionStage> CreateDeploymentTemplateA * @param DisplayImageSource * @param TargetDatastore * @param PostCreate + * @param Group * @return ActionResult */ public Result CreateInstance( @@ -266,7 +339,8 @@ public Result CreateInstance( @Nullable Boolean StartOnBoot, @Nullable String DisplayImageSource, @Nullable Integer TargetDatastore, - @Nullable PostCreateAppActions PostCreate) { + @Nullable PostCreateAppActions PostCreate, + @Nullable String Group) { Map args = new HashMap<>(); args.put("TargetADSInstance", TargetADSInstance); args.put("NewInstanceId", NewInstanceId); @@ -283,6 +357,7 @@ public Result CreateInstance( args.put("DisplayImageSource", DisplayImageSource); args.put("TargetDatastore", TargetDatastore); args.put("PostCreate", PostCreate); + args.put("Group", Group); Type type = new TypeToken() {}.getType(); return this.APICall("ADSModule/CreateInstance", args, type); } @@ -306,6 +381,7 @@ public Result CreateInstance( * @param DisplayImageSource * @param TargetDatastore * @param PostCreate + * @param Group * @return ActionResult */ public CompletionStage> CreateInstanceAsync( @@ -323,7 +399,8 @@ public CompletionStage> CreateInstanceAsync( @Nullable Boolean StartOnBoot, @Nullable String DisplayImageSource, @Nullable Integer TargetDatastore, - @Nullable PostCreateAppActions PostCreate) { + @Nullable PostCreateAppActions PostCreate, + @Nullable String Group) { return CompletableFuture.supplyAsync( () -> this.CreateInstance( @@ -341,7 +418,8 @@ public CompletionStage> CreateInstanceAsync( StartOnBoot, DisplayImageSource, TargetDatastore, - PostCreate)); + PostCreate, + Group)); } /** @@ -353,6 +431,7 @@ public CompletionStage> CreateInstanceAsync( * @param PostCreate * @param StartOnBoot * @param TargetDatastore + * @param Group * @return ActionResult */ public Result CreateInstanceFromSpec( @@ -361,7 +440,8 @@ public Result CreateInstanceFromSpec( String FriendlyName, @Nullable PostCreateAppActions PostCreate, @Nullable Boolean StartOnBoot, - @Nullable Integer TargetDatastore) { + @Nullable Integer TargetDatastore, + @Nullable String Group) { Map args = new HashMap<>(); args.put("SpecId", SpecId); args.put("TargetADSInstance", TargetADSInstance); @@ -369,6 +449,7 @@ public Result CreateInstanceFromSpec( args.put("PostCreate", PostCreate); args.put("StartOnBoot", StartOnBoot); args.put("TargetDatastore", TargetDatastore); + args.put("Group", Group); Type type = new TypeToken() {}.getType(); return this.APICall("ADSModule/CreateInstanceFromSpec", args, type); } @@ -382,6 +463,7 @@ public Result CreateInstanceFromSpec( * @param PostCreate * @param StartOnBoot * @param TargetDatastore + * @param Group * @return ActionResult */ public CompletionStage> CreateInstanceFromSpecAsync( @@ -390,7 +472,8 @@ public CompletionStage> CreateInstanceFromSpecAsy String FriendlyName, @Nullable PostCreateAppActions PostCreate, @Nullable Boolean StartOnBoot, - @Nullable Integer TargetDatastore) { + @Nullable Integer TargetDatastore, + @Nullable String Group) { return CompletableFuture.supplyAsync( () -> this.CreateInstanceFromSpec( @@ -399,7 +482,8 @@ public CompletionStage> CreateInstanceFromSpecAsy FriendlyName, PostCreate, StartOnBoot, - TargetDatastore)); + TargetDatastore, + Group)); } /** @@ -1031,6 +1115,25 @@ public CompletionStage> GetTargetInfoAsync() return CompletableFuture.supplyAsync(() -> this.GetTargetInfo()); } + /** + * Name Description + * + * @return ActionResult<String> + */ + public Result, AMPError> GetTargetPairingCode() { + Type type = new TypeToken>() {}.getType(); + return this.APICall("ADSModule/GetTargetPairingCode", type); + } + + /** + * Name Description + * + * @return ActionResult<String> + */ + public CompletionStage, AMPError>> GetTargetPairingCodeAsync() { + return CompletableFuture.supplyAsync(() -> this.GetTargetPairingCode()); + } + /** * Name Description * @@ -1359,6 +1462,41 @@ public CompletionStage> RegisterTargetAsync( friendlyName)); } + /** + * Name Description + * + * @param controllerUrl + * @param myUrl + * @param code + * @param friendlyName + * @return ActionResult + */ + public Result RegisterTargetWithCode( + String controllerUrl, String myUrl, String code, String friendlyName) { + Map args = new HashMap<>(); + args.put("controllerUrl", controllerUrl); + args.put("myUrl", myUrl); + args.put("code", code); + args.put("friendlyName", friendlyName); + Type type = new TypeToken() {}.getType(); + return this.APICall("ADSModule/RegisterTargetWithCode", args, type); + } + + /** + * Name Description + * + * @param controllerUrl + * @param myUrl + * @param code + * @param friendlyName + * @return ActionResult + */ + public CompletionStage> RegisterTargetWithCodeAsync( + String controllerUrl, String myUrl, String code, String friendlyName) { + return CompletableFuture.supplyAsync( + () -> this.RegisterTargetWithCode(controllerUrl, myUrl, code, friendlyName)); + } + /** * Name Description * @@ -1496,13 +1634,20 @@ public CompletionStage> SetInstanceConfigAsync( * * @param InstanceId * @param PortMappings + * @param ApplicationIP + * @param mustStop * @return ActionResult */ public Result SetInstanceNetworkInfo( - UUID InstanceId, Map PortMappings) { + UUID InstanceId, + Map PortMappings, + @Nullable String ApplicationIP, + @Nullable Boolean mustStop) { Map args = new HashMap<>(); args.put("InstanceId", InstanceId); args.put("PortMappings", PortMappings); + args.put("ApplicationIP", ApplicationIP); + args.put("mustStop", mustStop); Type type = new TypeToken() {}.getType(); return this.APICall("ADSModule/SetInstanceNetworkInfo", args, type); } @@ -1512,12 +1657,19 @@ public Result SetInstanceNetworkInfo( * * @param InstanceId * @param PortMappings + * @param ApplicationIP + * @param mustStop * @return ActionResult */ public CompletionStage> SetInstanceNetworkInfoAsync( - UUID InstanceId, Map PortMappings) { + UUID InstanceId, + Map PortMappings, + @Nullable String ApplicationIP, + @Nullable Boolean mustStop) { return CompletableFuture.supplyAsync( - () -> this.SetInstanceNetworkInfo(InstanceId, PortMappings)); + () -> + this.SetInstanceNetworkInfo( + InstanceId, PortMappings, ApplicationIP, mustStop)); } /** @@ -1643,41 +1795,6 @@ public CompletionStage> StopInstanceAsync(String return CompletableFuture.supplyAsync(() -> this.StopInstance(InstanceName)); } - /** - * Name Description - * - * @param url - * @param username - * @param password - * @param twoFactorToken - * @return ActionResult - */ - public Result TestADSLoginDetails( - String url, String username, String password, String twoFactorToken) { - Map args = new HashMap<>(); - args.put("url", url); - args.put("username", username); - args.put("password", password); - args.put("twoFactorToken", twoFactorToken); - Type type = new TypeToken() {}.getType(); - return this.APICall("ADSModule/TestADSLoginDetails", args, type); - } - - /** - * Name Description - * - * @param url - * @param username - * @param password - * @param twoFactorToken - * @return ActionResult - */ - public CompletionStage> TestADSLoginDetailsAsync( - String url, String username, String password, String twoFactorToken) { - return CompletableFuture.supplyAsync( - () -> this.TestADSLoginDetails(url, username, password, twoFactorToken)); - } - /** * Name Description * @@ -1743,6 +1860,10 @@ public CompletionStage> UpdateDeploymentTemplateA * @param ContainerImage * @param ContainerSwap * @param WelcomeMessage + * @param DisplayGroup + * @param CustomMountBindings + * @param ExtraContainerPackages + * @param IsMultiIPAware * @return ActionResult */ public Result UpdateInstanceInfo( @@ -1758,7 +1879,11 @@ public Result UpdateInstanceInfo( Float ContainerMaxCPU, String ContainerImage, Integer ContainerSwap, - @Nullable String WelcomeMessage) { + @Nullable String WelcomeMessage, + @Nullable String DisplayGroup, + @Nullable Map CustomMountBindings, + @Nullable List ExtraContainerPackages, + @Nullable Boolean IsMultiIPAware) { Map args = new HashMap<>(); args.put("InstanceId", InstanceId); args.put("FriendlyName", FriendlyName); @@ -1773,6 +1898,10 @@ public Result UpdateInstanceInfo( args.put("ContainerImage", ContainerImage); args.put("ContainerSwap", ContainerSwap); args.put("WelcomeMessage", WelcomeMessage); + args.put("DisplayGroup", DisplayGroup); + args.put("CustomMountBindings", CustomMountBindings); + args.put("ExtraContainerPackages", ExtraContainerPackages); + args.put("IsMultiIPAware", IsMultiIPAware); Type type = new TypeToken() {}.getType(); return this.APICall("ADSModule/UpdateInstanceInfo", args, type); } @@ -1793,6 +1922,10 @@ public Result UpdateInstanceInfo( * @param ContainerImage * @param ContainerSwap * @param WelcomeMessage + * @param DisplayGroup + * @param CustomMountBindings + * @param ExtraContainerPackages + * @param IsMultiIPAware * @return ActionResult */ public CompletionStage> UpdateInstanceInfoAsync( @@ -1808,7 +1941,11 @@ public CompletionStage> UpdateInstanceInfoAsync( Float ContainerMaxCPU, String ContainerImage, Integer ContainerSwap, - @Nullable String WelcomeMessage) { + @Nullable String WelcomeMessage, + @Nullable String DisplayGroup, + @Nullable Map CustomMountBindings, + @Nullable List ExtraContainerPackages, + @Nullable Boolean IsMultiIPAware) { return CompletableFuture.supplyAsync( () -> this.UpdateInstanceInfo( @@ -1824,7 +1961,11 @@ public CompletionStage> UpdateInstanceInfoAsync( ContainerMaxCPU, ContainerImage, ContainerSwap, - WelcomeMessage)); + WelcomeMessage, + DisplayGroup, + CustomMountBindings, + ExtraContainerPackages, + IsMultiIPAware)); } /** diff --git a/libraries/java/src/main/java/dev/neuralnexus/ampapi/plugins/Core.java b/libraries/java/src/main/java/dev/neuralnexus/ampapi/plugins/Core.java index fee5eae..b671cb8 100644 --- a/libraries/java/src/main/java/dev/neuralnexus/ampapi/plugins/Core.java +++ b/libraries/java/src/main/java/dev/neuralnexus/ampapi/plugins/Core.java @@ -1029,6 +1029,34 @@ public CompletionStage> GetNewGuidAsync() { return CompletableFuture.supplyAsync(() -> this.GetNewGuid()); } + /** + * Name Description + * + * @param state + * @param redirect_uri + * @return String + */ + public Result GetOIDCLoginURL( + @Nullable String state, @Nullable String redirect_uri) { + Map args = new HashMap<>(); + args.put("state", state); + args.put("redirect_uri", redirect_uri); + Type type = new TypeToken() {}.getType(); + return this.APICall("Core/GetOIDCLoginURL", args, type); + } + + /** + * Name Description + * + * @param state + * @param redirect_uri + * @return String + */ + public CompletionStage> GetOIDCLoginURLAsync( + @Nullable String state, @Nullable String redirect_uri) { + return CompletableFuture.supplyAsync(() -> this.GetOIDCLoginURL(state, redirect_uri)); + } + /** * Name Description * @@ -1547,6 +1575,37 @@ public CompletionStage> LogoutAsync() { return CompletableFuture.supplyAsync(() -> this.Logout()); } + /** + * Name Description + * + * @param code + * @param redirect_uri + * @param serverId + * @return Map<String, Object> + */ + public Result, AMPError> OIDCLogin( + String code, String redirect_uri, UUID serverId) { + Map args = new HashMap<>(); + args.put("code", code); + args.put("redirect_uri", redirect_uri); + args.put("serverId", serverId); + Type type = new TypeToken>() {}.getType(); + return this.APICall("Core/OIDCLogin", args, type); + } + + /** + * Name Description + * + * @param code + * @param redirect_uri + * @param serverId + * @return Map<String, Object> + */ + public CompletionStage, AMPError>> OIDCLoginAsync( + String code, String redirect_uri, UUID serverId) { + return CompletableFuture.supplyAsync(() -> this.OIDCLogin(code, redirect_uri, serverId)); + } + /** * Name Description * @@ -2077,6 +2136,29 @@ public CompletionStage> UpdateApplicationAsync() return CompletableFuture.supplyAsync(() -> this.UpdateApplication()); } + /** + * Name Description + * + * @param PubKey + * @return ActionResult + */ + public Result UpdatePublicKey(String PubKey) { + Map args = new HashMap<>(); + args.put("PubKey", PubKey); + Type type = new TypeToken() {}.getType(); + return this.APICall("Core/UpdatePublicKey", args, type); + } + + /** + * Name Description + * + * @param PubKey + * @return ActionResult + */ + public CompletionStage> UpdatePublicKeyAsync(String PubKey) { + return CompletableFuture.supplyAsync(() -> this.UpdatePublicKey(PubKey)); + } + /** * Name Description * diff --git a/libraries/java/src/main/java/dev/neuralnexus/ampapi/plugins/FiveMModule.java b/libraries/java/src/main/java/dev/neuralnexus/ampapi/plugins/FiveMModule.java new file mode 100644 index 0000000..77242ad --- /dev/null +++ b/libraries/java/src/main/java/dev/neuralnexus/ampapi/plugins/FiveMModule.java @@ -0,0 +1,15 @@ +/** + * Copyright (c) 2025 Dylan Sperrer - dylan@sperrer.ca + * This project is Licensed under MIT + */ +package dev.neuralnexus.ampapi.plugins; + +import dev.neuralnexus.ampapi.AMPAPI; +import dev.neuralnexus.ampapi.auth.AuthProvider; +import dev.neuralnexus.ampapi.types.*; + +public final class FiveMModule extends AMPAPI { + public FiveMModule(AuthProvider authprovider) { + super(authprovider); + } +} diff --git a/libraries/java/src/main/java/dev/neuralnexus/ampapi/plugins/GenericModule.java b/libraries/java/src/main/java/dev/neuralnexus/ampapi/plugins/GenericModule.java index e8a496f..2b674b3 100644 --- a/libraries/java/src/main/java/dev/neuralnexus/ampapi/plugins/GenericModule.java +++ b/libraries/java/src/main/java/dev/neuralnexus/ampapi/plugins/GenericModule.java @@ -65,4 +65,23 @@ public Result ReloadGenericConfig() { public CompletionStage> ReloadGenericConfigAsync() { return CompletableFuture.supplyAsync(() -> this.ReloadGenericConfig()); } + + /** + * Name Description + * + * @return Void + */ + public Result RequestServerInfo() { + Type type = new TypeToken() {}.getType(); + return this.APICall("GenericModule/RequestServerInfo", type); + } + + /** + * Name Description + * + * @return Void + */ + public CompletionStage> RequestServerInfoAsync() { + return CompletableFuture.supplyAsync(() -> this.RequestServerInfo()); + } } diff --git a/libraries/java/src/main/java/dev/neuralnexus/ampapi/plugins/LocalFileBackupPlugin.java b/libraries/java/src/main/java/dev/neuralnexus/ampapi/plugins/LocalFileBackupPlugin.java index 7ed64a3..fccee3d 100644 --- a/libraries/java/src/main/java/dev/neuralnexus/ampapi/plugins/LocalFileBackupPlugin.java +++ b/libraries/java/src/main/java/dev/neuralnexus/ampapi/plugins/LocalFileBackupPlugin.java @@ -197,18 +197,24 @@ public CompletionStage> SetBackupStickyAsync( * @param Description * @param Sticky * @param WasCreatedAutomatically + * @param Local + * @param S3 * @return ActionResult */ public Result TakeBackup( String Title, String Description, Boolean Sticky, - @Nullable Boolean WasCreatedAutomatically) { + @Nullable Boolean WasCreatedAutomatically, + @Nullable Boolean Local, + @Nullable Boolean S3) { Map args = new HashMap<>(); args.put("Title", Title); args.put("Description", Description); args.put("Sticky", Sticky); args.put("WasCreatedAutomatically", WasCreatedAutomatically); + args.put("Local", Local); + args.put("S3", S3); Type type = new TypeToken() {}.getType(); return this.APICall("LocalFileBackupPlugin/TakeBackup", args, type); } @@ -220,15 +226,21 @@ public Result TakeBackup( * @param Description * @param Sticky * @param WasCreatedAutomatically + * @param Local + * @param S3 * @return ActionResult */ public CompletionStage> TakeBackupAsync( String Title, String Description, Boolean Sticky, - @Nullable Boolean WasCreatedAutomatically) { + @Nullable Boolean WasCreatedAutomatically, + @Nullable Boolean Local, + @Nullable Boolean S3) { return CompletableFuture.supplyAsync( - () -> this.TakeBackup(Title, Description, Sticky, WasCreatedAutomatically)); + () -> + this.TakeBackup( + Title, Description, Sticky, WasCreatedAutomatically, Local, S3)); } /** diff --git a/libraries/java/src/main/java/dev/neuralnexus/ampapi/plugins/MinecraftModule.java b/libraries/java/src/main/java/dev/neuralnexus/ampapi/plugins/MinecraftModule.java index ca48cfa..c10ef55 100644 --- a/libraries/java/src/main/java/dev/neuralnexus/ampapi/plugins/MinecraftModule.java +++ b/libraries/java/src/main/java/dev/neuralnexus/ampapi/plugins/MinecraftModule.java @@ -471,6 +471,25 @@ public CompletionStage, AMPError>> LoadOPListAsync() { return CompletableFuture.supplyAsync(() -> this.LoadOPList()); } + /** + * Name Description + * + * @return Boolean + */ + public Result RejectEULA() { + Type type = new TypeToken() {}.getType(); + return this.APICall("MinecraftModule/RejectEULA", type); + } + + /** + * Name Description + * + * @return Boolean + */ + public CompletionStage> RejectEULAAsync() { + return CompletableFuture.supplyAsync(() -> this.RejectEULA()); + } + /** * Name Description * diff --git a/libraries/python/ampapi/auth.py b/libraries/python/ampapi/auth.py index 256f1ae..593394b 100644 --- a/libraries/python/ampapi/auth.py +++ b/libraries/python/ampapi/auth.py @@ -218,6 +218,10 @@ def add(self, authProvider: AuthProvider) -> None: def add(self, instanceId: str, authProvider: AuthProvider) -> None: self._authProviders[instanceId] = authProvider + @overload + def remove(self, authProvider: AuthProvider) -> None: + self.remove(authProvider.instanceId) + def remove(self, instanceId: str) -> None: del self._authProviders[instanceId] diff --git a/libraries/python/ampapi/modules.py b/libraries/python/ampapi/modules.py index 950c9bc..8350eb8 100644 --- a/libraries/python/ampapi/modules.py +++ b/libraries/python/ampapi/modules.py @@ -40,6 +40,27 @@ def __init__(self, auth: AuthProvider): super().__init__(auth) self.ADSModule = ADSModuleAsync(self) +class FiveM(CommonAPI): + AnalyticsPlugin = Final[AnalyticsPlugin] + FiveMModule = Final[FiveMModule] + LocalFileBackupPlugin = Final[LocalFileBackupPlugin] + def __init__(self, auth: AuthProvider): + super().__init__(auth) + self.AnalyticsPlugin = AnalyticsPlugin(self) + self.FiveMModule = FiveMModule(self) + self.LocalFileBackupPlugin = LocalFileBackupPlugin(self) + +class FiveMAsync(CommonAPIAsync): + AnalyticsPlugin = Final[AnalyticsPluginAsync] + FiveMModule = Final[FiveMModuleAsync] + LocalFileBackupPlugin = Final[LocalFileBackupPluginAsync] + + def __init__(self, auth: AuthProvider): + super().__init__(auth) + self.AnalyticsPlugin = AnalyticsPluginAsync(self) + self.FiveMModule = FiveMModuleAsync(self) + self.LocalFileBackupPlugin = LocalFileBackupPluginAsync(self) + class GenericModule(CommonAPI): AnalyticsPlugin = Final[AnalyticsPlugin] GenericModule = Final[GenericModule] diff --git a/libraries/python/ampapi/plugins.py b/libraries/python/ampapi/plugins.py index d122aac..511c0da 100644 --- a/libraries/python/ampapi/plugins.py +++ b/libraries/python/ampapi/plugins.py @@ -82,6 +82,40 @@ def AttachADS(self, Friendly: 'str', IsHTTPS: 'bool', Host: 'str', Port: 'int', 'InstanceID': InstanceID }), ActionResult) + def AttachADSWithPairingCode(self, PairingCode: 'str', Friendly: 'str', IsHTTPS: 'bool', Host: 'str', Port: 'int', InstanceID: 'str') -> ActionResult: + """ + Name Description Optional + :param PairingCode: + :type PairingCode: str + :param Friendly: + :type Friendly: str + :param IsHTTPS: + :type IsHTTPS: bool + :param Host: + :type Host: str + :param Port: + :type Port: int + :param InstanceID: + :type InstanceID: str + :returns: ActionResult + """ + return json_to_obj(self.api_call("ADSModule/AttachADSWithPairingCode", { + 'PairingCode': PairingCode, + 'Friendly': Friendly, + 'IsHTTPS': IsHTTPS, + 'Host': Host, + 'Port': Port, + 'InstanceID': InstanceID + }), ActionResult) + + def CancelPairing(self, ) -> None: + """ + Name Description Optional + + :returns: None + """ + return json_to_obj(self.api_call("ADSModule/CancelPairing", {}), None) + def CloneTemplate(self, Id: 'int', NewName: 'str') -> ActionResult: """ Name Description Optional @@ -107,7 +141,7 @@ def CreateDeploymentTemplate(self, Name: 'str') -> ActionResult: 'Name': Name }), ActionResult) - def CreateInstance(self, TargetADSInstance: 'str', NewInstanceId: 'str', Module: 'str', InstanceName: 'str', FriendlyName: 'str', IPBinding: 'str', PortNumber: 'int', AdminUsername: 'str', AdminPassword: 'str', ProvisionSettings: 'dict[str, str]', AutoConfigure: 'bool', StartOnBoot: 'bool', DisplayImageSource: 'str', TargetDatastore: 'int', PostCreate: 'PostCreateAppActions') -> ActionResult: + def CreateInstance(self, TargetADSInstance: 'str', NewInstanceId: 'str', Module: 'str', InstanceName: 'str', FriendlyName: 'str', IPBinding: 'str', PortNumber: 'int', AdminUsername: 'str', AdminPassword: 'str', ProvisionSettings: 'dict[str, str]', AutoConfigure: 'bool', StartOnBoot: 'bool', DisplayImageSource: 'str', TargetDatastore: 'int', PostCreate: 'PostCreateAppActions', Group: 'str') -> ActionResult: """ Name Description Optional :param TargetADSInstance: @@ -140,6 +174,8 @@ def CreateInstance(self, TargetADSInstance: 'str', NewInstanceId: 'str', Module: :type TargetDatastore: int :param PostCreate: :type PostCreate: PostCreateAppActions + :param Group: + :type Group: str :returns: ActionResult """ return json_to_obj(self.api_call("ADSModule/CreateInstance", { @@ -157,10 +193,11 @@ def CreateInstance(self, TargetADSInstance: 'str', NewInstanceId: 'str', Module: 'StartOnBoot': StartOnBoot, 'DisplayImageSource': DisplayImageSource, 'TargetDatastore': TargetDatastore, - 'PostCreate': PostCreate + 'PostCreate': PostCreate, + 'Group': Group }), ActionResult) - def CreateInstanceFromSpec(self, SpecId: 'str', TargetADSInstance: 'str', FriendlyName: 'str', PostCreate: 'PostCreateAppActions', StartOnBoot: 'bool', TargetDatastore: 'int') -> ActionResult: + def CreateInstanceFromSpec(self, SpecId: 'str', TargetADSInstance: 'str', FriendlyName: 'str', PostCreate: 'PostCreateAppActions', StartOnBoot: 'bool', TargetDatastore: 'int', Group: 'str') -> ActionResult: """ Name Description Optional :param SpecId: @@ -175,6 +212,8 @@ def CreateInstanceFromSpec(self, SpecId: 'str', TargetADSInstance: 'str', Friend :type StartOnBoot: bool :param TargetDatastore: :type TargetDatastore: int + :param Group: + :type Group: str :returns: ActionResult """ return json_to_obj(self.api_call("ADSModule/CreateInstanceFromSpec", { @@ -183,7 +222,8 @@ def CreateInstanceFromSpec(self, SpecId: 'str', TargetADSInstance: 'str', Friend 'FriendlyName': FriendlyName, 'PostCreate': PostCreate, 'StartOnBoot': StartOnBoot, - 'TargetDatastore': TargetDatastore + 'TargetDatastore': TargetDatastore, + 'Group': Group }), ActionResult) def CreateLocalInstance(self, Instance: 'LocalAMPInstance', PostCreate: 'PostCreateAppActions') -> ActionResult: @@ -456,6 +496,14 @@ def GetTargetInfo(self, ) -> RemoteTargetInfo: """ return json_to_obj(self.api_call("ADSModule/GetTargetInfo", {}), RemoteTargetInfo) + def GetTargetPairingCode(self, ) -> ActionResult[str]: + """ + Name Description Optional + + :returns: ActionResult[str] + """ + return json_to_obj(self.api_call("ADSModule/GetTargetPairingCode", {}), ActionResult[str]) + def HandoutInstanceConfigs(self, ForModule: 'str', SettingNode: 'str', Values: 'list[str]') -> ActionResult: """ Name Description Optional @@ -610,6 +658,26 @@ def RegisterTarget(self, controllerUrl: 'str', myUrl: 'str', username: 'str', pa 'friendlyName': friendlyName }), ActionResult) + def RegisterTargetWithCode(self, controllerUrl: 'str', myUrl: 'str', code: 'str', friendlyName: 'str') -> ActionResult: + """ + Name Description Optional + :param controllerUrl: + :type controllerUrl: str + :param myUrl: + :type myUrl: str + :param code: + :type code: str + :param friendlyName: + :type friendlyName: str + :returns: ActionResult + """ + return json_to_obj(self.api_call("ADSModule/RegisterTargetWithCode", { + 'controllerUrl': controllerUrl, + 'myUrl': myUrl, + 'code': code, + 'friendlyName': friendlyName + }), ActionResult) + def RepairDatastore(self, id: 'int') -> RunningTask: """ Name Description Optional @@ -674,18 +742,24 @@ def SetInstanceConfig(self, InstanceName: 'str', SettingNode: 'str', Value: 'str 'Value': Value }), ActionResult) - def SetInstanceNetworkInfo(self, InstanceId: 'str', PortMappings: 'dict[str, int]') -> ActionResult: + def SetInstanceNetworkInfo(self, InstanceId: 'str', PortMappings: 'dict[str, int]', ApplicationIP: 'str', mustStop: 'bool') -> ActionResult: """ Name Description Optional :param InstanceId: :type InstanceId: str :param PortMappings: :type PortMappings: dict[str, int] + :param ApplicationIP: + :type ApplicationIP: str + :param mustStop: + :type mustStop: bool :returns: ActionResult """ return json_to_obj(self.api_call("ADSModule/SetInstanceNetworkInfo", { 'InstanceId': InstanceId, - 'PortMappings': PortMappings + 'PortMappings': PortMappings, + 'ApplicationIP': ApplicationIP, + 'mustStop': mustStop }), ActionResult) def SetInstanceSuspended(self, InstanceName: 'str', Suspended: 'bool') -> ActionResult: @@ -746,26 +820,6 @@ def StopInstance(self, InstanceName: 'str') -> ActionResult: 'InstanceName': InstanceName }), ActionResult) - def TestADSLoginDetails(self, url: 'str', username: 'str', password: 'str', twoFactorToken: 'str') -> ActionResult: - """ - Name Description Optional - :param url: - :type url: str - :param username: - :type username: str - :param password: - :type password: str - :param twoFactorToken: - :type twoFactorToken: str - :returns: ActionResult - """ - return json_to_obj(self.api_call("ADSModule/TestADSLoginDetails", { - 'url': url, - 'username': username, - 'password': password, - 'twoFactorToken': twoFactorToken - }), ActionResult) - def UpdateDatastore(self, updatedDatastore: 'InstanceDatastore') -> ActionResult: """ Name Description Optional @@ -788,7 +842,7 @@ def UpdateDeploymentTemplate(self, templateToUpdate: 'DeploymentTemplate') -> Ac 'templateToUpdate': templateToUpdate }), ActionResult) - def UpdateInstanceInfo(self, InstanceId: 'str', FriendlyName: 'str', Description: 'str', StartOnBoot: 'bool', Suspended: 'bool', ExcludeFromFirewall: 'bool', RunInContainer: 'bool', ContainerMemory: 'int', MemoryPolicy: 'ContainerMemoryPolicy', ContainerMaxCPU: 'float', ContainerImage: 'str', ContainerSwap: 'int', WelcomeMessage: 'str') -> ActionResult: + def UpdateInstanceInfo(self, InstanceId: 'str', FriendlyName: 'str', Description: 'str', StartOnBoot: 'bool', Suspended: 'bool', ExcludeFromFirewall: 'bool', RunInContainer: 'bool', ContainerMemory: 'int', MemoryPolicy: 'ContainerMemoryPolicy', ContainerMaxCPU: 'float', ContainerImage: 'str', ContainerSwap: 'int', WelcomeMessage: 'str', DisplayGroup: 'str', CustomMountBindings: 'dict[str, str]', ExtraContainerPackages: 'list[str]', IsMultiIPAware: 'bool') -> ActionResult: """ Name Description Optional :param InstanceId: @@ -817,6 +871,14 @@ def UpdateInstanceInfo(self, InstanceId: 'str', FriendlyName: 'str', Description :type ContainerSwap: int :param WelcomeMessage: :type WelcomeMessage: str + :param DisplayGroup: + :type DisplayGroup: str + :param CustomMountBindings: + :type CustomMountBindings: dict[str, str] + :param ExtraContainerPackages: + :type ExtraContainerPackages: list[str] + :param IsMultiIPAware: + :type IsMultiIPAware: bool :returns: ActionResult """ return json_to_obj(self.api_call("ADSModule/UpdateInstanceInfo", { @@ -832,7 +894,11 @@ def UpdateInstanceInfo(self, InstanceId: 'str', FriendlyName: 'str', Description 'ContainerMaxCPU': ContainerMaxCPU, 'ContainerImage': ContainerImage, 'ContainerSwap': ContainerSwap, - 'WelcomeMessage': WelcomeMessage + 'WelcomeMessage': WelcomeMessage, + 'DisplayGroup': DisplayGroup, + 'CustomMountBindings': CustomMountBindings, + 'ExtraContainerPackages': ExtraContainerPackages, + 'IsMultiIPAware': IsMultiIPAware }), ActionResult) def UpdateTarget(self, TargetID: 'str') -> None: @@ -972,6 +1038,40 @@ async def AttachADS(self, Friendly: 'str', IsHTTPS: 'bool', Host: 'str', Port: ' 'InstanceID': InstanceID }), ActionResult) + async def AttachADSWithPairingCode(self, PairingCode: 'str', Friendly: 'str', IsHTTPS: 'bool', Host: 'str', Port: 'int', InstanceID: 'str') -> ActionResult: + """ + Name Description Optional + :param PairingCode: + :type PairingCode: str + :param Friendly: + :type Friendly: str + :param IsHTTPS: + :type IsHTTPS: bool + :param Host: + :type Host: str + :param Port: + :type Port: int + :param InstanceID: + :type InstanceID: str + :returns: ActionResult + """ + return json_to_obj(await self.api_call("ADSModule/AttachADSWithPairingCode", { + 'PairingCode': PairingCode, + 'Friendly': Friendly, + 'IsHTTPS': IsHTTPS, + 'Host': Host, + 'Port': Port, + 'InstanceID': InstanceID + }), ActionResult) + + async def CancelPairing(self, ) -> None: + """ + Name Description Optional + + :returns: None + """ + return json_to_obj(await self.api_call("ADSModule/CancelPairing", {}), None) + async def CloneTemplate(self, Id: 'int', NewName: 'str') -> ActionResult: """ Name Description Optional @@ -997,7 +1097,7 @@ async def CreateDeploymentTemplate(self, Name: 'str') -> ActionResult: 'Name': Name }), ActionResult) - async def CreateInstance(self, TargetADSInstance: 'str', NewInstanceId: 'str', Module: 'str', InstanceName: 'str', FriendlyName: 'str', IPBinding: 'str', PortNumber: 'int', AdminUsername: 'str', AdminPassword: 'str', ProvisionSettings: 'dict[str, str]', AutoConfigure: 'bool', StartOnBoot: 'bool', DisplayImageSource: 'str', TargetDatastore: 'int', PostCreate: 'PostCreateAppActions') -> ActionResult: + async def CreateInstance(self, TargetADSInstance: 'str', NewInstanceId: 'str', Module: 'str', InstanceName: 'str', FriendlyName: 'str', IPBinding: 'str', PortNumber: 'int', AdminUsername: 'str', AdminPassword: 'str', ProvisionSettings: 'dict[str, str]', AutoConfigure: 'bool', StartOnBoot: 'bool', DisplayImageSource: 'str', TargetDatastore: 'int', PostCreate: 'PostCreateAppActions', Group: 'str') -> ActionResult: """ Name Description Optional :param TargetADSInstance: @@ -1030,6 +1130,8 @@ async def CreateInstance(self, TargetADSInstance: 'str', NewInstanceId: 'str', M :type TargetDatastore: int :param PostCreate: :type PostCreate: PostCreateAppActions + :param Group: + :type Group: str :returns: ActionResult """ return json_to_obj(await self.api_call("ADSModule/CreateInstance", { @@ -1047,10 +1149,11 @@ async def CreateInstance(self, TargetADSInstance: 'str', NewInstanceId: 'str', M 'StartOnBoot': StartOnBoot, 'DisplayImageSource': DisplayImageSource, 'TargetDatastore': TargetDatastore, - 'PostCreate': PostCreate + 'PostCreate': PostCreate, + 'Group': Group }), ActionResult) - async def CreateInstanceFromSpec(self, SpecId: 'str', TargetADSInstance: 'str', FriendlyName: 'str', PostCreate: 'PostCreateAppActions', StartOnBoot: 'bool', TargetDatastore: 'int') -> ActionResult: + async def CreateInstanceFromSpec(self, SpecId: 'str', TargetADSInstance: 'str', FriendlyName: 'str', PostCreate: 'PostCreateAppActions', StartOnBoot: 'bool', TargetDatastore: 'int', Group: 'str') -> ActionResult: """ Name Description Optional :param SpecId: @@ -1065,6 +1168,8 @@ async def CreateInstanceFromSpec(self, SpecId: 'str', TargetADSInstance: 'str', :type StartOnBoot: bool :param TargetDatastore: :type TargetDatastore: int + :param Group: + :type Group: str :returns: ActionResult """ return json_to_obj(await self.api_call("ADSModule/CreateInstanceFromSpec", { @@ -1073,7 +1178,8 @@ async def CreateInstanceFromSpec(self, SpecId: 'str', TargetADSInstance: 'str', 'FriendlyName': FriendlyName, 'PostCreate': PostCreate, 'StartOnBoot': StartOnBoot, - 'TargetDatastore': TargetDatastore + 'TargetDatastore': TargetDatastore, + 'Group': Group }), ActionResult) async def CreateLocalInstance(self, Instance: 'LocalAMPInstance', PostCreate: 'PostCreateAppActions') -> ActionResult: @@ -1346,6 +1452,14 @@ async def GetTargetInfo(self, ) -> RemoteTargetInfo: """ return json_to_obj(await self.api_call("ADSModule/GetTargetInfo", {}), RemoteTargetInfo) + async def GetTargetPairingCode(self, ) -> ActionResult[str]: + """ + Name Description Optional + + :returns: ActionResult[str] + """ + return json_to_obj(await self.api_call("ADSModule/GetTargetPairingCode", {}), ActionResult[str]) + async def HandoutInstanceConfigs(self, ForModule: 'str', SettingNode: 'str', Values: 'list[str]') -> ActionResult: """ Name Description Optional @@ -1500,6 +1614,26 @@ async def RegisterTarget(self, controllerUrl: 'str', myUrl: 'str', username: 'st 'friendlyName': friendlyName }), ActionResult) + async def RegisterTargetWithCode(self, controllerUrl: 'str', myUrl: 'str', code: 'str', friendlyName: 'str') -> ActionResult: + """ + Name Description Optional + :param controllerUrl: + :type controllerUrl: str + :param myUrl: + :type myUrl: str + :param code: + :type code: str + :param friendlyName: + :type friendlyName: str + :returns: ActionResult + """ + return json_to_obj(await self.api_call("ADSModule/RegisterTargetWithCode", { + 'controllerUrl': controllerUrl, + 'myUrl': myUrl, + 'code': code, + 'friendlyName': friendlyName + }), ActionResult) + async def RepairDatastore(self, id: 'int') -> RunningTask: """ Name Description Optional @@ -1564,18 +1698,24 @@ async def SetInstanceConfig(self, InstanceName: 'str', SettingNode: 'str', Value 'Value': Value }), ActionResult) - async def SetInstanceNetworkInfo(self, InstanceId: 'str', PortMappings: 'dict[str, int]') -> ActionResult: + async def SetInstanceNetworkInfo(self, InstanceId: 'str', PortMappings: 'dict[str, int]', ApplicationIP: 'str', mustStop: 'bool') -> ActionResult: """ Name Description Optional :param InstanceId: :type InstanceId: str :param PortMappings: :type PortMappings: dict[str, int] + :param ApplicationIP: + :type ApplicationIP: str + :param mustStop: + :type mustStop: bool :returns: ActionResult """ return json_to_obj(await self.api_call("ADSModule/SetInstanceNetworkInfo", { 'InstanceId': InstanceId, - 'PortMappings': PortMappings + 'PortMappings': PortMappings, + 'ApplicationIP': ApplicationIP, + 'mustStop': mustStop }), ActionResult) async def SetInstanceSuspended(self, InstanceName: 'str', Suspended: 'bool') -> ActionResult: @@ -1636,26 +1776,6 @@ async def StopInstance(self, InstanceName: 'str') -> ActionResult: 'InstanceName': InstanceName }), ActionResult) - async def TestADSLoginDetails(self, url: 'str', username: 'str', password: 'str', twoFactorToken: 'str') -> ActionResult: - """ - Name Description Optional - :param url: - :type url: str - :param username: - :type username: str - :param password: - :type password: str - :param twoFactorToken: - :type twoFactorToken: str - :returns: ActionResult - """ - return json_to_obj(await self.api_call("ADSModule/TestADSLoginDetails", { - 'url': url, - 'username': username, - 'password': password, - 'twoFactorToken': twoFactorToken - }), ActionResult) - async def UpdateDatastore(self, updatedDatastore: 'InstanceDatastore') -> ActionResult: """ Name Description Optional @@ -1678,7 +1798,7 @@ async def UpdateDeploymentTemplate(self, templateToUpdate: 'DeploymentTemplate') 'templateToUpdate': templateToUpdate }), ActionResult) - async def UpdateInstanceInfo(self, InstanceId: 'str', FriendlyName: 'str', Description: 'str', StartOnBoot: 'bool', Suspended: 'bool', ExcludeFromFirewall: 'bool', RunInContainer: 'bool', ContainerMemory: 'int', MemoryPolicy: 'ContainerMemoryPolicy', ContainerMaxCPU: 'float', ContainerImage: 'str', ContainerSwap: 'int', WelcomeMessage: 'str') -> ActionResult: + async def UpdateInstanceInfo(self, InstanceId: 'str', FriendlyName: 'str', Description: 'str', StartOnBoot: 'bool', Suspended: 'bool', ExcludeFromFirewall: 'bool', RunInContainer: 'bool', ContainerMemory: 'int', MemoryPolicy: 'ContainerMemoryPolicy', ContainerMaxCPU: 'float', ContainerImage: 'str', ContainerSwap: 'int', WelcomeMessage: 'str', DisplayGroup: 'str', CustomMountBindings: 'dict[str, str]', ExtraContainerPackages: 'list[str]', IsMultiIPAware: 'bool') -> ActionResult: """ Name Description Optional :param InstanceId: @@ -1707,6 +1827,14 @@ async def UpdateInstanceInfo(self, InstanceId: 'str', FriendlyName: 'str', Descr :type ContainerSwap: int :param WelcomeMessage: :type WelcomeMessage: str + :param DisplayGroup: + :type DisplayGroup: str + :param CustomMountBindings: + :type CustomMountBindings: dict[str, str] + :param ExtraContainerPackages: + :type ExtraContainerPackages: list[str] + :param IsMultiIPAware: + :type IsMultiIPAware: bool :returns: ActionResult """ return json_to_obj(await self.api_call("ADSModule/UpdateInstanceInfo", { @@ -1722,7 +1850,11 @@ async def UpdateInstanceInfo(self, InstanceId: 'str', FriendlyName: 'str', Descr 'ContainerMaxCPU': ContainerMaxCPU, 'ContainerImage': ContainerImage, 'ContainerSwap': ContainerSwap, - 'WelcomeMessage': WelcomeMessage + 'WelcomeMessage': WelcomeMessage, + 'DisplayGroup': DisplayGroup, + 'CustomMountBindings': CustomMountBindings, + 'ExtraContainerPackages': ExtraContainerPackages, + 'IsMultiIPAware': IsMultiIPAware }), ActionResult) async def UpdateTarget(self, TargetID: 'str') -> None: @@ -2307,6 +2439,20 @@ def GetNewGuid(self, ) -> str: """ return json_to_obj(self.api_call("Core/GetNewGuid", {}), str) + def GetOIDCLoginURL(self, state: 'str', redirect_uri: 'str') -> str: + """ + Name Description Optional + :param state: + :type state: str + :param redirect_uri: + :type redirect_uri: str + :returns: str + """ + return json_to_obj(self.api_call("Core/GetOIDCLoginURL", { + 'state': state, + 'redirect_uri': redirect_uri + }), str) + def GetPermissionsSpec(self, ) -> list[IPermissionsTreeNode]: """ Name Description Optional @@ -2535,6 +2681,23 @@ def Logout(self, ) -> None: """ return json_to_obj(self.api_call("Core/Logout", {}), None) + def OIDCLogin(self, code: 'str', redirect_uri: 'str', serverId: 'str | None') -> dict[str, Any]: + """ + Name Description Optional + :param code: + :type code: str + :param redirect_uri: + :type redirect_uri: str + :param serverId: + :type serverId: str | None + :returns: dict[str, Any] + """ + return json_to_obj(self.api_call("Core/OIDCLogin", { + 'code': code, + 'redirect_uri': redirect_uri, + 'serverId': serverId + }), dict[str, Any]) + def RefreshSettingValueList(self, Node: 'str') -> ActionResult: """ Name Description Optional @@ -2782,6 +2945,17 @@ def UpdateApplication(self, ) -> ActionResult: """ return json_to_obj(self.api_call("Core/UpdateApplication", {}), ActionResult) + def UpdatePublicKey(self, PubKey: 'str') -> ActionResult: + """ + Name Description Optional + :param PubKey: + :type PubKey: str + :returns: ActionResult + """ + return json_to_obj(self.api_call("Core/UpdatePublicKey", { + 'PubKey': PubKey + }), ActionResult) + def UpdateUserInfo(self, Username: 'str', Disabled: 'bool', PasswordExpires: 'bool', CannotChangePassword: 'bool', MustChangePassword: 'bool', EmailAddress: 'str') -> ActionResult: """ Name Description Optional @@ -3314,6 +3488,20 @@ async def GetNewGuid(self, ) -> str: """ return json_to_obj(await self.api_call("Core/GetNewGuid", {}), str) + async def GetOIDCLoginURL(self, state: 'str', redirect_uri: 'str') -> str: + """ + Name Description Optional + :param state: + :type state: str + :param redirect_uri: + :type redirect_uri: str + :returns: str + """ + return json_to_obj(await self.api_call("Core/GetOIDCLoginURL", { + 'state': state, + 'redirect_uri': redirect_uri + }), str) + async def GetPermissionsSpec(self, ) -> list[IPermissionsTreeNode]: """ Name Description Optional @@ -3542,6 +3730,23 @@ async def Logout(self, ) -> None: """ return json_to_obj(await self.api_call("Core/Logout", {}), None) + async def OIDCLogin(self, code: 'str', redirect_uri: 'str', serverId: 'str | None') -> dict[str, Any]: + """ + Name Description Optional + :param code: + :type code: str + :param redirect_uri: + :type redirect_uri: str + :param serverId: + :type serverId: str | None + :returns: dict[str, Any] + """ + return json_to_obj(await self.api_call("Core/OIDCLogin", { + 'code': code, + 'redirect_uri': redirect_uri, + 'serverId': serverId + }), dict[str, Any]) + async def RefreshSettingValueList(self, Node: 'str') -> ActionResult: """ Name Description Optional @@ -3789,6 +3994,17 @@ async def UpdateApplication(self, ) -> ActionResult: """ return json_to_obj(await self.api_call("Core/UpdateApplication", {}), ActionResult) + async def UpdatePublicKey(self, PubKey: 'str') -> ActionResult: + """ + Name Description Optional + :param PubKey: + :type PubKey: str + :returns: ActionResult + """ + return json_to_obj(await self.api_call("Core/UpdatePublicKey", { + 'PubKey': PubKey + }), ActionResult) + async def UpdateUserInfo(self, Username: 'str', Disabled: 'bool', PasswordExpires: 'bool', CannotChangePassword: 'bool', MustChangePassword: 'bool', EmailAddress: 'str') -> ActionResult: """ Name Description Optional @@ -4380,6 +4596,14 @@ async def WriteFileChunk(self, Filename: 'str', Data: 'str', Offset: 'int', Fina 'FinalChunk': FinalChunk }), ActionResult) +class FiveMModule(AMPAPI): + def __init__(self, authprovider: AuthProvider) -> None: + super().__init__(authprovider) + +class FiveMModuleAsync(AMPAPI): + def __init__(self, authprovider: AuthProvider) -> None: + super().__init__(authprovider) + class GenericModule(AMPAPI): def __init__(self, authprovider: AuthProvider) -> None: super().__init__(authprovider) @@ -4403,6 +4627,14 @@ def ReloadGenericConfig(self, ) -> None: """ return json_to_obj(self.api_call("GenericModule/ReloadGenericConfig", {}), None) + def RequestServerInfo(self, ) -> None: + """ + Name Description Optional + + :returns: None + """ + return json_to_obj(self.api_call("GenericModule/RequestServerInfo", {}), None) + class GenericModuleAsync(AMPAPI): def __init__(self, authprovider: AuthProvider) -> None: super().__init__(authprovider) @@ -4426,6 +4658,14 @@ async def ReloadGenericConfig(self, ) -> None: """ return json_to_obj(await self.api_call("GenericModule/ReloadGenericConfig", {}), None) + async def RequestServerInfo(self, ) -> None: + """ + Name Description Optional + + :returns: None + """ + return json_to_obj(await self.api_call("GenericModule/RequestServerInfo", {}), None) + class LocalFileBackupPlugin(AMPAPI): def __init__(self, authprovider: AuthProvider) -> None: super().__init__(authprovider) @@ -4507,7 +4747,7 @@ def SetBackupSticky(self, BackupId: 'str', Sticky: 'bool') -> None: 'Sticky': Sticky }), None) - def TakeBackup(self, Title: 'str', Description: 'str', Sticky: 'bool', WasCreatedAutomatically: 'bool') -> ActionResult: + def TakeBackup(self, Title: 'str', Description: 'str', Sticky: 'bool', WasCreatedAutomatically: 'bool', Local: 'bool', S3: 'bool') -> ActionResult: """ Name Description Optional :param Title: @@ -4518,13 +4758,19 @@ def TakeBackup(self, Title: 'str', Description: 'str', Sticky: 'bool', WasCreate :type Sticky: bool :param WasCreatedAutomatically: :type WasCreatedAutomatically: bool + :param Local: + :type Local: bool + :param S3: + :type S3: bool :returns: ActionResult """ return json_to_obj(self.api_call("LocalFileBackupPlugin/TakeBackup", { 'Title': Title, 'Description': Description, 'Sticky': Sticky, - 'WasCreatedAutomatically': WasCreatedAutomatically + 'WasCreatedAutomatically': WasCreatedAutomatically, + 'Local': Local, + 'S3': S3 }), ActionResult) def UploadToS3(self, BackupId: 'str') -> RunningTask: @@ -4619,7 +4865,7 @@ async def SetBackupSticky(self, BackupId: 'str', Sticky: 'bool') -> None: 'Sticky': Sticky }), None) - async def TakeBackup(self, Title: 'str', Description: 'str', Sticky: 'bool', WasCreatedAutomatically: 'bool') -> ActionResult: + async def TakeBackup(self, Title: 'str', Description: 'str', Sticky: 'bool', WasCreatedAutomatically: 'bool', Local: 'bool', S3: 'bool') -> ActionResult: """ Name Description Optional :param Title: @@ -4630,13 +4876,19 @@ async def TakeBackup(self, Title: 'str', Description: 'str', Sticky: 'bool', Was :type Sticky: bool :param WasCreatedAutomatically: :type WasCreatedAutomatically: bool + :param Local: + :type Local: bool + :param S3: + :type S3: bool :returns: ActionResult """ return json_to_obj(await self.api_call("LocalFileBackupPlugin/TakeBackup", { 'Title': Title, 'Description': Description, 'Sticky': Sticky, - 'WasCreatedAutomatically': WasCreatedAutomatically + 'WasCreatedAutomatically': WasCreatedAutomatically, + 'Local': Local, + 'S3': S3 }), ActionResult) async def UploadToS3(self, BackupId: 'str') -> RunningTask: @@ -4862,6 +5114,14 @@ def LoadOPList(self, ) -> list[OPEntry]: """ return json_to_obj(self.api_call("MinecraftModule/LoadOPList", {}), list[OPEntry]) + def RejectEULA(self, ) -> bool: + """ + Name Description Optional + + :returns: bool + """ + return json_to_obj(self.api_call("MinecraftModule/RejectEULA", {}), bool) + def RemoveOPEntry(self, UserOrUUID: 'str') -> None: """ Name Description Optional @@ -5107,6 +5367,14 @@ async def LoadOPList(self, ) -> list[OPEntry]: """ return json_to_obj(await self.api_call("MinecraftModule/LoadOPList", {}), list[OPEntry]) + async def RejectEULA(self, ) -> bool: + """ + Name Description Optional + + :returns: bool + """ + return json_to_obj(await self.api_call("MinecraftModule/RejectEULA", {}), bool) + async def RemoveOPEntry(self, UserOrUUID: 'str') -> None: """ Name Description Optional @@ -5329,11 +5597,11 @@ def RemoveMapEntry(self, Index: 'int') -> None: 'Index': Index }), None) - def ReplaceMapList(self, MapList: 'String[]') -> None: + def ReplaceMapList(self, MapList: 'list[str]') -> None: """ Name Description Optional :param MapList: - :type MapList: String[] + :type MapList: list[str] :returns: None """ return json_to_obj(self.api_call("srcdsModule/ReplaceMapList", { @@ -5421,11 +5689,11 @@ async def RemoveMapEntry(self, Index: 'int') -> None: 'Index': Index }), None) - async def ReplaceMapList(self, MapList: 'String[]') -> None: + async def ReplaceMapList(self, MapList: 'list[str]') -> None: """ Name Description Optional :param MapList: - :type MapList: String[] + :type MapList: list[str] :returns: None """ return json_to_obj(await self.api_call("srcdsModule/ReplaceMapList", { diff --git a/libraries/python/setup.cfg b/libraries/python/setup.cfg index 0abeb58..8b0745e 100755 --- a/libraries/python/setup.cfg +++ b/libraries/python/setup.cfg @@ -1,12 +1,12 @@ [metadata] name = ampapi -version = 2608.4.4 +version = 2620.5.0 author = Dylan Sperrer - p0t4t0sandwich - thepotatoking3452 author_email = p0t4t0sandwich@gmail.com description = An API that allows you to communicate with AMP installations from within Python. -long_description = file: README.md +long_description = file: Python.md long_description_content_type = text/markdown -url = https://github.com/p0t4t0sandwich/ampapi +url = https://github.com/p0t4t0sandwich/ampapi/blob/main/readmes classifiers = Programming Language :: Python :: 3 License :: OSI Approved :: Apache Software License diff --git a/libraries/python/utils/ampapi_gen.py b/libraries/python/utils/ampapi_gen.py index 5b3bb3e..1165f1c 100644 --- a/libraries/python/utils/ampapi_gen.py +++ b/libraries/python/utils/ampapi_gen.py @@ -24,6 +24,7 @@ "List": "list", "Object": "Any", "String": "str", + "String[]": "list[str]", "TimeSpan": "str", "Uri": "str", "Void": "None",