Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
0594ce2
Add command-line option for ConnectedService.json file
gregwinterstein Aug 22, 2023
82745f3
Make method names consistent
gregwinterstein Jun 14, 2023
2d8b6e3
Fix null reference exception
gregwinterstein Jun 14, 2023
e78d42b
Correct capitalization of JSON
gregwinterstein Aug 9, 2023
de602e2
Move CliUserSettings into Microsoft.OData.CodeGen and refactor UserSe…
gregwinterstein Aug 10, 2023
518b66a
Remove unnecessary methods per comments
gregwinterstein Aug 10, 2023
31b8068
Decrease indentation as requested
gregwinterstein Aug 10, 2023
cdcbb4c
Call base class constructor
gregwinterstein Aug 10, 2023
67fee95
Refactor GetServiceConfiguration() to reduce indentation and throw an…
gregwinterstein Aug 10, 2023
1e84a0c
Correct logic error
gregwinterstein Aug 11, 2023
d54dca2
Rename UserSettings to ConnectedServiceUserSettings
gregwinterstein Aug 22, 2023
c188a7b
Rename CliUserSettings to UserSettings
gregwinterstein Aug 22, 2023
52e532a
Refactor GenerateCommand to avoid calling ReadConfigFile with a null …
gregwinterstein Aug 22, 2023
c89c170
Update for changes introduced with pull request #364 (fix CLI exclusi…
gregwinterstein Aug 22, 2023
d81e034
Clean up after rebase
gregwinterstein Oct 2, 2023
0dcf4f0
Revert class name change per comments in pull request
gregwinterstein Nov 13, 2023
cc8724d
Revert class name change per comments in pull request
gregwinterstein Nov 13, 2023
e94a640
Fix XML comments according to comments in pull request
gregwinterstein Nov 14, 2023
1816eb1
Rename CliConnectedServiceJsonFileData per pull request comments
gregwinterstein Nov 14, 2023
0e65837
Rename CliConnectedServiceJsonFileData per pull request comments
gregwinterstein Nov 14, 2023
9f47904
Use count property instead of .Any() as suggested in pull request com…
gregwinterstein Nov 14, 2023
08a964f
Correct logic to allow command-line options to override config file
gregwinterstein Nov 14, 2023
bdb6af1
Correct string split options as suggested by pull request comments
gregwinterstein Nov 14, 2023
4f7c510
Improve variable name and simplify assignment per comments in pull re…
gregwinterstein Nov 14, 2023
45bf8e5
Simplify connected-service-file option name to config-file as suggest…
gregwinterstein Nov 14, 2023
a28a44a
Attempt to clarify optional/override behavior of metadata-uri in conj…
gregwinterstein Nov 14, 2023
631e7e5
Update summary comments to suggestions made in pull request comments
gregwinterstein Nov 14, 2023
08e4d37
Set boolean defaults to null so that option override logic works prop…
gregwinterstein Nov 15, 2023
380dae5
Comment public properies as requested in pull request comments
gregwinterstein Mar 8, 2024
8a04c25
Post-rebase cleanup
gregwinterstein Mar 11, 2024
a165630
Update src/Microsoft.OData.CodeGen/Models/BaseUserSettings.cs per @ga…
gregwinterstein Mar 26, 2024
a6b14e0
Update src/Microsoft.OData.Cli/GenerateCommand.cs per @gathogojr
gregwinterstein Mar 26, 2024
e84942a
Update src/Microsoft.OData.Cli/GenerateCommand.cs per @gathogojr
gregwinterstein Mar 26, 2024
6f0757b
Update src/Microsoft.OData.Cli/GenerateCommand.cs per @gathogojr
gregwinterstein Mar 26, 2024
1004c84
Update src/Microsoft.OData.Cli/GenerateCommand.cs
gregwinterstein Mar 26, 2024
efa0b1a
Update src/Microsoft.OData.Cli/GenerateCommand.cs
gregwinterstein Mar 26, 2024
818d62f
Update src/Microsoft.OData.Cli/GenerateCommand.cs
gregwinterstein Mar 26, 2024
e0c417f
Update src/Microsoft.OData.Cli/GenerateCommand.cs
gregwinterstein Mar 26, 2024
46da013
Fix variable name typo post-rebase
gregwinterstein Mar 26, 2024
96ae9ee
Correct invalid code reference to ConnectedServiceFileData
gregwinterstein Mar 26, 2024
2e68045
Update exceptions per @gathogojr
gregwinterstein Mar 26, 2024
563602b
Correct exception thrown
gregwinterstein Mar 26, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
204 changes: 140 additions & 64 deletions src/Microsoft.OData.Cli/GenerateCommand.cs

Large diffs are not rendered by default.

62 changes: 35 additions & 27 deletions src/Microsoft.OData.Cli/GenerateOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,109 +13,117 @@ namespace Microsoft.OData.Cli
public class GenerateOptions
{
/// <summary>
/// The URI of the metadata document. The value must be set to a valid service document URI or a local file path
/// Gets or sets the URI of the metadata document. The value must be set to a valid service document URI or a local file path.
/// </summary>
public string MetadataUri { get; set; }

/// <summary>
/// Headers that will get sent along with the request when fetching the metadata document from the service. Format: Header1:HeaderValue, Header2:HeaderValue.
/// Gets or sets headers that will get sent along with the request when fetching the metadata document from the service. Format: Header1:HeaderValue, Header2:HeaderValue.
/// </summary>
public string CustomHeaders { get; set; }

/// <summary>
/// Proxy settings. Format: domain\\user:password@SERVER:PORT.
/// Gets or sets the proxy settings. Format: domain\\user:password@SERVER:PORT.
/// </summary>
public string Proxy { get; set; }

/// <summary>
/// The name of the generated file name
/// Gets or sets the name of the generated file name. Defaults to Reference.vb/.cs when not provided.
/// </summary>
public string FileName { get; set; }

/// <summary>
/// The namespace of the client code generated.
/// Example: ODataCliCodeGeneratorSample.NorthWindModel or ODataCliCodeGeneratorSample or it could be a name related to the OData endpoint.
/// Gets or sets the namespace for the generated service proxy classes.
/// </summary>
/// <remarks>
/// Must be a valid C# identifier name, e.g., MyService.Models.
/// When not provided, a namespace that corresponds to the one that the models of the OData service are defined in is used.
/// </remarks>
public string NamespacePrefix { get; set; }

/// <summary>
/// Disables entity and property tracking
/// Gets or sets a value that determines whether to enable entity and property tracking.
/// </summary>
public bool EnableTracking { get; set; }
public bool? EnableTracking { get; set; }
Comment thread
gathogojr marked this conversation as resolved.

/// <summary>
/// Gets or sets a value indicating whether to omit runtime version and code generation timestamp from the generated files.
/// </summary>
public bool OmitVersioningInfo { get; set; }
public bool? OmitVersioningInfo { get; set; }

/// <summary>
/// Disables/Enables upper camel casing
/// Gets or sets a value that determines whether to use C# casing style.
/// </summary>
public bool UpperCamelCase { get; set; }
public bool? UpperCamelCase { get; set; }

/// <summary>
/// Apply the "internal" class modifier on generated classes instead of "public" thereby making them invisible outside the assembly.
/// Gets or sets a value that determines whether to apply the "internal" class modifier on generated classes instead of "public" thereby making them invisible outside the assembly.
/// </summary>
public bool EnableInternal { get; set; }
public bool? EnableInternal { get; set; }

/// <summary>
/// Split the generated classes into separate files instead of generating all the code in a single file.
/// Gets or sets a value that determines whether to split the generated classes into separate files instead of generating all the code in a single file.
/// </summary>
public bool MultipleFiles { get; set; }
public bool? MultipleFiles { get; set; }

/// <summary>
/// Comma-separated list of the names of operation imports to exclude from the generated code. Example: ExcludedOperationImport1,ExcludedOperationImport2.
/// Gets or sets the comma-separated list of the names of operation imports to exclude from the generated code. Example: ExcludedOperationImport1,ExcludedOperationImport2.
/// </summary>
public string ExcludedOperationImports { get; set; }

/// <summary>
/// Comma-separated list of the names of bound operations to exclude from the generated code.Example: BoundOperation1,BoundOperation2.
/// Gets or sets the comma-separated list of the names of bound operations to exclude from the generated code.Example: BoundOperation1,BoundOperation2.
/// </summary>
public string ExcludedBoundOperations { get; set; }

/// <summary>
/// Comma-separated list of the names of entity types to exclude from the generated code.Example: EntityType1,EntityType2,EntityType3.
/// Gets or sets the comma-separated list of the names of entity types to exclude from the generated code.Example: EntityType1,EntityType2,EntityType3.
/// </summary>
public string ExcludedSchemaTypes { get; set; }

/// <summary>
/// This flag indicates whether to ignore unexpected elements and attributes in the metadata document and generate the client code if any.
/// Gets or sets a value that determines whether to ignore unexpected elements and attributes in the metadata document and generate the client code if any.
/// </summary>
public bool IgnoreUnexpectedElements { get; set; }
public bool? IgnoreUnexpectedElements { get; set; }

/// <summary>
/// Full path to output directory
/// Gets or sets the path to output directory
/// </summary>
public string OutputDir { get; set; }

/// <summary>
/// Web proxy network credentials username
/// Gets or sets the web proxy network credentials username.
/// </summary>
public string WebProxyNetworkCredentialsUsername { get; set; }

/// <summary>
/// Web proxy network credentials password
/// Gets or sets the web proxy network credentials password.
/// </summary>
public string WebProxyNetworkCredentialsPassword { get; set; }

/// <summary>
/// Web proxy network credentials domain
/// Gets or sets the web proxy network credentials domain.
/// </summary>
public string WebProxyNetworkCredentialsDomain { get; set; }

/// <summary>
/// A flag to indicate whether to include the web proxy or not
/// Gets or sets a value that determines whether to include the web proxy or not.
/// </summary>
public bool IncludeWebProxy { get; set; }

/// <summary>
/// A web proxy host
/// Gets or sets the web proxy host.
/// </summary>
public string WebProxyHost { get; set; }

/// <summary>
/// A flag to indicate whether to include web proxy network credentials or not.
/// Gets or sets a value that determines whether to include web proxy network credentials or not.
/// </summary>
public bool IncludeWebProxyNetworkCredentials { get; set; }

/// <summary>
/// Gets or sets the path to OData Connected Service config file (i.e., ConnectedService.json)
/// </summary>
public string ConfigFile { get; set; }
}
}
27 changes: 27 additions & 0 deletions src/Microsoft.OData.Cli/Models/ConnectedServiceFileData.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
//-----------------------------------------------------------------------------
// <copyright file="ConnectedServiceFileData.cs" company=".NET Foundation">
// Copyright (c) .NET Foundation and Contributors. All rights reserved.
// See License.txt in the project root for license information.
// </copyright>
//----------------------------------------------------------------------------

using Microsoft.OData.CodeGen.Models;

namespace Microsoft.OData.Cli.Models
{
/// <summary>
/// Represents OData Connected Service config file
/// </summary>
public class ConnectedServiceFileData
{
/// <summary>
/// Gets or sets the unique Provider ID for the provider/handler. This is used to match a provider with its handlers.
/// </summary>
public string ProviderId { get; set; }
Comment thread
gathogojr marked this conversation as resolved.

/// <summary>
/// Gets or sets the OData Connected Service user settings extracted from ConnectedService.json.
/// </summary>
public BaseUserSettings ExtendedData { get; set; }
Comment thread
gathogojr marked this conversation as resolved.
}
}
2 changes: 2 additions & 0 deletions src/Microsoft.OData.CodeGen/Microsoft.OData.CodeGen.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@
<Compile Include="FileHandling\ODataFileOptions.cs" />
<Compile Include="Logging\IMessageLogger.cs" />
<Compile Include="Logging\LogMessageCategory.cs" />
<Compile Include="Logging\LogMessageCategory.cs" />
<Compile Include="Models\BaseUserSettings.cs" />
<Compile Include="PackageInstallation\IPackageInstaller.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Models\BoundOperationModel.cs" />
Expand Down
Loading