Skip to content

Commit

Permalink
syncing Unity SDK from CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
cdhanna authored and github-actions[bot] committed May 24, 2024
1 parent 0f92f3a commit 8bcc0d0
Show file tree
Hide file tree
Showing 19 changed files with 139 additions and 179 deletions.
7 changes: 7 additions & 0 deletions client/Packages/com.beamable/Editor/BeamCli/Commands/Beam.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ public class BeamArgs : Beamable.Common.BeamCli.IBeamCommandArgs
public string refreshToken;
/// <summary>Extra logs gets printed out</summary>
public string log;
/// <summary>Show help for all commands</summary>
public bool helpAll;
/// <summary>Directory to use for configuration</summary>
public string dir;
/// <summary>Output raw JSON to standard out. This happens by default when the command is being piped</summary>
Expand Down Expand Up @@ -79,6 +81,11 @@ public virtual string Serialize()
genBeamCommandArgs.Add((("--log=\"" + this.log)
+ "\""));
}
// If the helpAll value was not default, then add it to the list of args.
if ((this.helpAll != default(bool)))
{
genBeamCommandArgs.Add(("--help-all=" + this.helpAll));
}
// If the dir value was not default, then add it to the list of args.
if ((this.dir != default(string)))
{
Expand Down
24 changes: 19 additions & 5 deletions client/Packages/com.beamable/Editor/BeamCli/Commands/BeamInit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ namespace Beamable.Editor.BeamCli.Commands

public class InitArgs : Beamable.Common.BeamCli.IBeamCommandArgs
{
/// <summary>Specify user name</summary>
public string username;
/// <summary>the folder that will be initialized as a beamable project. </summary>
public string path;
/// <summary>Specify user email address</summary>
public string email;
/// <summary>User password</summary>
public string password;
/// <summary>The host endpoint for beamable</summary>
Expand All @@ -22,6 +24,8 @@ public class InitArgs : Beamable.Common.BeamCli.IBeamCommandArgs
public bool saveToEnvironment;
/// <summary>Save login refresh token to file</summary>
public bool saveToFile;
/// <summary>Prevent auth tokens from being saved to disk. This replaces the legacy --save-to-file option</summary>
public bool noTokenSave;
/// <summary>Make request customer scoped instead of product only</summary>
public bool customerScoped;
/// <summary>Prints out login request response to console</summary>
Expand All @@ -31,10 +35,15 @@ public virtual string Serialize()
{
// Create a list of arguments for the command
System.Collections.Generic.List<string> genBeamCommandArgs = new System.Collections.Generic.List<string>();
// If the username value was not default, then add it to the list of args.
if ((this.username != default(string)))
// If the path value was not default, then add it to the list of args.
if ((this.path != default(string)))
{
genBeamCommandArgs.Add((("--username=\"" + this.username)
genBeamCommandArgs.Add(this.path.ToString());
}
// If the email value was not default, then add it to the list of args.
if ((this.email != default(string)))
{
genBeamCommandArgs.Add((("--email=\"" + this.email)
+ "\""));
}
// If the password value was not default, then add it to the list of args.
Expand Down Expand Up @@ -77,6 +86,11 @@ public virtual string Serialize()
{
genBeamCommandArgs.Add(("--save-to-file=" + this.saveToFile));
}
// If the noTokenSave value was not default, then add it to the list of args.
if ((this.noTokenSave != default(bool)))
{
genBeamCommandArgs.Add(("--no-token-save=" + this.noTokenSave));
}
// If the customerScoped value was not default, then add it to the list of args.
if ((this.customerScoped != default(bool)))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ public class ProjectGenerateEnvArgs : Beamable.Common.BeamCli.IBeamCommandArgs
public int instanceCount;
/// <summary>When enabled, automatically deploy dependencies that aren't running</summary>
public bool autoDeploy;
/// <summary>INTERNAL This enables a sane workflow for beamable developers to be happy and productive</summary>
public string buildMode;
/// <summary>Serializes the arguments for command line usage.</summary>
public virtual string Serialize()
{
Expand All @@ -42,12 +40,6 @@ public virtual string Serialize()
{
genBeamCommandArgs.Add(("--auto-deploy=" + this.autoDeploy));
}
// If the buildMode value was not default, then add it to the list of args.
if ((this.buildMode != default(string)))
{
genBeamCommandArgs.Add((("--build-mode=\"" + this.buildMode)
+ "\""));
}
string genBeamCommandStr = "";
// Join all the args with spaces
genBeamCommandStr = string.Join(" ", genBeamCommandArgs);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public class ProjectNewCommonLibArgs : Beamable.Common.BeamCli.IBeamCommandArgs
public Beamable.Common.Semantics.ServiceName name;
/// <summary>Automatically create a .beamable folder context if no context exists</summary>
public bool init;
/// <summary>Relative path to the .sln file to use for the new project. If the .sln file does not exist, it will be created. By default, when no value is provided, the .sln path will be <name>/<name>.sln</summary>
/// <summary>Relative path to the .sln file to use for the new project. If the .sln file does not exist, it will be created. When no option is configured, if this command is executing inside a .beamable folder, then the first .sln found in .beamable/.. will be used. If no .sln is found, the .sln path will be <name>.sln. If no .beamable folder exists, then the <project>/<project>.sln will be used</summary>
public string sln;
/// <summary>Specifies version of Beamable project dependencies. Defaults to the current version of the CLI</summary>
public Beamable.Common.PackageVersion version;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@ public class ProjectNewServiceArgs : Beamable.Common.BeamCli.IBeamCommandArgs
public Beamable.Common.Semantics.ServiceName name;
/// <summary>Automatically create a .beamable folder context if no context exists</summary>
public bool init;
/// <summary>Relative path to the .sln file to use for the new project. If the .sln file does not exist, it will be created. By default, when no value is provided, the .sln path will be <name>/<name>.sln</summary>
/// <summary>Relative path to the .sln file to use for the new project. If the .sln file does not exist, it will be created. When no option is configured, if this command is executing inside a .beamable folder, then the first .sln found in .beamable/.. will be used. If no .sln is found, the .sln path will be <name>.sln. If no .beamable folder exists, then the <project>/<project>.sln will be used</summary>
public string sln;
/// <summary>Relative path to directory where project should be created. Defaults to "SOLUTION_DIR/services"</summary>
public string serviceDirectory;
/// <summary>Specifies version of Beamable project dependencies. Defaults to the current version of the CLI</summary>
public Beamable.Common.PackageVersion version;
/// <summary>Created service by default would not be published</summary>
public bool disable;
/// <summary>If passed, will create a common library for this project</summary>
public bool generateCommon;
/// <summary>INTERNAL This enables a sane workflow for beamable developers to be happy and productive</summary>
public bool beamableDev;
/// <summary>Serializes the arguments for command line usage.</summary>
public virtual string Serialize()
{
Expand Down Expand Up @@ -49,16 +49,16 @@ public virtual string Serialize()
{
genBeamCommandArgs.Add(("--version=" + this.version));
}
// If the disable value was not default, then add it to the list of args.
if ((this.disable != default(bool)))
{
genBeamCommandArgs.Add(("--disable=" + this.disable));
}
// If the generateCommon value was not default, then add it to the list of args.
if ((this.generateCommon != default(bool)))
{
genBeamCommandArgs.Add(("--generate-common=" + this.generateCommon));
}
// If the beamableDev value was not default, then add it to the list of args.
if ((this.beamableDev != default(bool)))
{
genBeamCommandArgs.Add(("--beamable-dev=" + this.beamableDev));
}
string genBeamCommandStr = "";
// Join all the args with spaces
genBeamCommandStr = string.Join(" ", genBeamCommandArgs);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,12 @@ public class ProjectNewStorageArgs : Beamable.Common.BeamCli.IBeamCommandArgs
public Beamable.Common.Semantics.ServiceName name;
/// <summary>Automatically create a .beamable folder context if no context exists</summary>
public bool init;
/// <summary>Relative path to the .sln file to use for the new project. If the .sln file does not exist, it will be created. By default, when no value is provided, the .sln path will be <name>/<name>.sln</summary>
/// <summary>Relative path to the .sln file to use for the new project. If the .sln file does not exist, it will be created. When no option is configured, if this command is executing inside a .beamable folder, then the first .sln found in .beamable/.. will be used. If no .sln is found, the .sln path will be <name>.sln. If no .beamable folder exists, then the <project>/<project>.sln will be used</summary>
public string sln;
/// <summary>Relative path to directory where project should be created. Defaults to "SOLUTION_DIR/services"</summary>
public string serviceDirectory;
/// <summary>Specifies version of Beamable project dependencies. Defaults to the current version of the CLI</summary>
public Beamable.Common.PackageVersion version;
/// <summary>Created service by default would not be published</summary>
public bool disable;
/// <summary>The name of the project to link this storage to</summary>
public string[] linkTo;
/// <summary>Serializes the arguments for command line usage.</summary>
Expand Down Expand Up @@ -49,11 +47,6 @@ public virtual string Serialize()
{
genBeamCommandArgs.Add(("--version=" + this.version));
}
// If the disable value was not default, then add it to the list of args.
if ((this.disable != default(bool)))
{
genBeamCommandArgs.Add(("--disable=" + this.disable));
}
// If the linkTo value was not default, then add it to the list of args.
if ((this.linkTo != default(string[])))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class ProjectRegenerateArgs : Beamable.Common.BeamCli.IBeamCommandArgs
public string copyPath;
/// <summary>Specifies version of Beamable project dependencies. Defaults to the current version of the CLI</summary>
public Beamable.Common.PackageVersion version;
/// <summary>Relative path to the .sln file to use for the new project. If the .sln file does not exist, it will be created. By default, when no value is provided, the .sln path will be <name>/<name>.sln</summary>
/// <summary>Relative path to the .sln file to use for the new project. If the .sln file does not exist, it will be created. When no option is configured, if this command is executing inside a .beamable folder, then the first .sln found in .beamable/.. will be used. If no .sln is found, the .sln path will be <name>.sln. If no .beamable folder exists, then the <project>/<project>.sln will be used</summary>
public string sln;
/// <summary>Serializes the arguments for command line usage.</summary>
public virtual string Serialize()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,10 @@ namespace Beamable.Editor.BeamCli.Commands

public class ServicesDeployArgs : Beamable.Common.BeamCli.IBeamCommandArgs
{
/// <summary>These are the ids for services you wish to be enabled once Beam-O receives the updated manifest</summary>
public string[] enable;
/// <summary>These are the ids for services you wish to be disabled once Beam-O receives the updated manifest</summary>
public string[] disable;
/// <summary>If this option is set to a valid path to a ServiceManifest JSON, deploys that instead</summary>
public string fromFile;
/// <summary>Associates this comment along with the published Manifest. You'll be able to read it via the Beamable Portal</summary>
public string comment;
/// <summary>INTERNAL This enables a sane workflow for beamable developers to be happy and productive</summary>
public string buildMode;
/// <summary>Any number of strings in the format BeamoId::Comment
///Associates each comment to the given Beamo Id if it's among the published services. You'll be able to read it via the Beamable Portal</summary>
public string[] serviceComments;
Expand All @@ -26,24 +20,6 @@ public virtual string Serialize()
{
// Create a list of arguments for the command
System.Collections.Generic.List<string> genBeamCommandArgs = new System.Collections.Generic.List<string>();
// If the enable value was not default, then add it to the list of args.
if ((this.enable != default(string[])))
{
for (int i = 0; (i < this.enable.Length); i = (i + 1))
{
// The parameter allows multiple values
genBeamCommandArgs.Add(("--enable=" + this.enable[i]));
}
}
// If the disable value was not default, then add it to the list of args.
if ((this.disable != default(string[])))
{
for (int i = 0; (i < this.disable.Length); i = (i + 1))
{
// The parameter allows multiple values
genBeamCommandArgs.Add(("--disable=" + this.disable[i]));
}
}
// If the fromFile value was not default, then add it to the list of args.
if ((this.fromFile != default(string)))
{
Expand All @@ -56,12 +32,6 @@ public virtual string Serialize()
genBeamCommandArgs.Add((("--comment=\"" + this.comment)
+ "\""));
}
// If the buildMode value was not default, then add it to the list of args.
if ((this.buildMode != default(string)))
{
genBeamCommandArgs.Add((("--build-mode=\"" + this.buildMode)
+ "\""));
}
// If the serviceComments value was not default, then add it to the list of args.
if ((this.serviceComments != default(string[])))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,15 @@ namespace Beamable.Editor.BeamCli.Commands
using Beamable.Common;
using Beamable.Common.BeamCli;

public class ServicesResetArgs : Beamable.Common.BeamCli.IBeamCommandArgs
public class ServicesResetContainerArgs : Beamable.Common.BeamCli.IBeamCommandArgs
{
/// <summary>Either image|container|protocols.'image' will cleanup all your locally built images for the selected Beamo Services.
///'container' will stop all your locally running containers for the selected Beamo Services.
///'protocols' will reset all the protocol data for the selected Beamo Services back to default parameters</summary>
public string target;
/// <summary>The ids for the services you wish to reset</summary>
/// <summary>The list of services to build, defaults to all local services</summary>
public string[] ids;
/// <summary>Serializes the arguments for command line usage.</summary>
public virtual string Serialize()
{
// Create a list of arguments for the command
System.Collections.Generic.List<string> genBeamCommandArgs = new System.Collections.Generic.List<string>();
// Add the target value to the list of args.
genBeamCommandArgs.Add(this.target.ToString());
// If the ids value was not default, then add it to the list of args.
if ((this.ids != default(string[])))
{
Expand All @@ -36,30 +30,31 @@ public virtual string Serialize()
}
public partial class BeamCommands
{
public virtual ServicesResetWrapper ServicesReset(ServicesResetArgs resetArgs)
public virtual ServicesResetContainerWrapper ServicesResetContainer(ServicesResetContainerArgs containerArgs)
{
// Create a list of arguments for the command
System.Collections.Generic.List<string> genBeamCommandArgs = new System.Collections.Generic.List<string>();
genBeamCommandArgs.Add("beam");
genBeamCommandArgs.Add(defaultBeamArgs.Serialize());
genBeamCommandArgs.Add("services");
genBeamCommandArgs.Add("reset");
genBeamCommandArgs.Add(resetArgs.Serialize());
genBeamCommandArgs.Add("container");
genBeamCommandArgs.Add(containerArgs.Serialize());
// Create an instance of an IBeamCommand
Beamable.Common.BeamCli.IBeamCommand command = this._factory.Create();
// Join all the command paths and args into one string
string genBeamCommandStr = string.Join(" ", genBeamCommandArgs);
// Configure the command with the command string
command.SetCommand(genBeamCommandStr);
ServicesResetWrapper genBeamCommandWrapper = new ServicesResetWrapper();
ServicesResetContainerWrapper genBeamCommandWrapper = new ServicesResetContainerWrapper();
genBeamCommandWrapper.Command = command;
// Return the command!
return genBeamCommandWrapper;
}
}
public class ServicesResetWrapper : Beamable.Common.BeamCli.BeamCommandWrapper
public class ServicesResetContainerWrapper : Beamable.Common.BeamCli.BeamCommandWrapper
{
public virtual ServicesResetWrapper OnStreamServicesResetResult(System.Action<ReportDataPoint<BeamServicesResetResult>> cb)
public virtual ServicesResetContainerWrapper OnStreamServicesResetContainerCommandOutput(System.Action<ReportDataPoint<BeamServicesResetContainerCommandOutput>> cb)
{
this.Command.On("stream", cb);
return this;
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ namespace Beamable.Editor.BeamCli.Commands
using Beamable.Common.BeamCli;

[System.SerializableAttribute()]
public class BeamServicesResetResult
public class BeamServicesResetContainerCommandOutput
{
public string Target;
public System.Collections.Generic.List<string> Ids;
public string id;
public string message;
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 8bcc0d0

Please sign in to comment.