Skip to content

Commit 69260e0

Browse files
authored
Move relationship related options to update. (#46)
1 parent fdf323c commit 69260e0

File tree

1 file changed

+29
-57
lines changed

1 file changed

+29
-57
lines changed

Hawaii-Cli/src/Models/CommandLineOptions.cs

Lines changed: 29 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using Azure.DataGateway.Config;
1+
using Azure.DataGateway.Config;
22
using CommandLine;
33

44
namespace Hawaii.Cli.Models
@@ -71,13 +71,6 @@ public EntityOptions(
7171
string? graphQLType,
7272
string? fieldsToInclude,
7373
string? fieldsToExclude,
74-
string? relationship,
75-
string? cardinality,
76-
string? targetEntity,
77-
string? linkingObject,
78-
string? linkingSourceFields,
79-
string? linkingTargetFields,
80-
string? mappingFields,
8174
string name)
8275
: base(name)
8376
{
@@ -86,13 +79,6 @@ public EntityOptions(
8679
this.GraphQLType = graphQLType;
8780
this.FieldsToInclude = fieldsToInclude;
8881
this.FieldsToExclude = fieldsToExclude;
89-
this.Relationship = relationship;
90-
this.Cardinality = cardinality;
91-
this.TargetEntity = targetEntity;
92-
this.LinkingObject = linkingObject;
93-
this.LinkingSourceFields = linkingSourceFields;
94-
this.LinkingTargetFields = linkingTargetFields;
95-
this.MappingFields = mappingFields;
9682
}
9783

9884
[Value(0, MetaName = "Entity", Required = true, HelpText = "Name of the entity.")]
@@ -109,27 +95,6 @@ public EntityOptions(
10995

11096
[Option("fields.exclude", Required = false, HelpText = "Fields that are excluded from the action lists.")]
11197
public string? FieldsToExclude { get; }
112-
113-
[Option("relationship", Required = false, HelpText = "Specify relationship between two entities.")]
114-
public string? Relationship { get; }
115-
116-
[Option("cardinality", Required = false, HelpText = "Specify cardinality between two entities.")]
117-
public string? Cardinality { get; }
118-
119-
[Option("target.entity", Required = false, HelpText = "Another exposed entity to which the source entity relates to.")]
120-
public string? TargetEntity { get; }
121-
122-
[Option("linking.object", Required = false, HelpText = "Database object that is used to support an M:N relationship.")]
123-
public string? LinkingObject { get; }
124-
125-
[Option("linking.source.fields", Required = false, HelpText = "Database fields in the linking object to connect to the related item in the source entity.")]
126-
public string? LinkingSourceFields { get; }
127-
128-
[Option("linking.target.fields", Required = false, HelpText = "Database fields in the linking object to connect to the related item in the target entity.")]
129-
public string? LinkingTargetFields { get; }
130-
131-
[Option("mapping.fields", Required = false, HelpText = "Specify fields to be used for mapping the entities.")]
132-
public string? MappingFields { get; }
13398
}
13499

135100
/// <summary>
@@ -146,26 +111,12 @@ public AddOptions(
146111
string? graphQLType,
147112
string? fieldsToInclude,
148113
string? fieldsToExclude,
149-
string? relationship,
150-
string? cardinality,
151-
string? targetEntity,
152-
string? linkingObject,
153-
string? linkingSourceFields,
154-
string? linkingTargetFields,
155-
string? mappingFields,
156114
string name)
157115
: base(entity,
158116
restRoute,
159117
graphQLType,
160118
fieldsToInclude,
161119
fieldsToExclude,
162-
relationship,
163-
cardinality,
164-
targetEntity,
165-
linkingObject,
166-
linkingSourceFields,
167-
linkingTargetFields,
168-
mappingFields,
169120
name)
170121
{
171122
this.Source = source;
@@ -206,23 +157,44 @@ public UpdateOptions(
206157
graphQLType,
207158
fieldsToInclude,
208159
fieldsToExclude,
209-
relationship,
210-
cardinality,
211-
targetEntity,
212-
linkingObject,
213-
linkingSourceFields,
214-
linkingTargetFields,
215-
mappingFields,
216160
name)
217161
{
218162
this.Source = source;
219163
this.Permissions = permissions;
164+
this.Relationship = relationship;
165+
this.Cardinality = cardinality;
166+
this.TargetEntity = targetEntity;
167+
this.LinkingObject = linkingObject;
168+
this.LinkingSourceFields = linkingSourceFields;
169+
this.LinkingTargetFields = linkingTargetFields;
170+
this.MappingFields = mappingFields;
220171
}
221172

222173
[Option('s', "source", Required = false, HelpText = "Name of the source table or container.")]
223174
public string? Source { get; }
224175

225176
[Option("permissions", Required = false, HelpText = "Permissions required to access the source table or container.")]
226177
public string? Permissions { get; }
178+
179+
[Option("relationship", Required = false, HelpText = "Specify relationship between two entities.")]
180+
public string? Relationship { get; }
181+
182+
[Option("cardinality", Required = false, HelpText = "Specify cardinality between two entities.")]
183+
public string? Cardinality { get; }
184+
185+
[Option("target.entity", Required = false, HelpText = "Another exposed entity to which the source entity relates to.")]
186+
public string? TargetEntity { get; }
187+
188+
[Option("linking.object", Required = false, HelpText = "Database object that is used to support an M:N relationship.")]
189+
public string? LinkingObject { get; }
190+
191+
[Option("linking.source.fields", Required = false, HelpText = "Database fields in the linking object to connect to the related item in the source entity.")]
192+
public string? LinkingSourceFields { get; }
193+
194+
[Option("linking.target.fields", Required = false, HelpText = "Database fields in the linking object to connect to the related item in the target entity.")]
195+
public string? LinkingTargetFields { get; }
196+
197+
[Option("mapping.fields", Required = false, HelpText = "Specify fields to be used for mapping the entities.")]
198+
public string? MappingFields { get; }
227199
}
228200
}

0 commit comments

Comments
 (0)