Skip to content

Commit e7310b4

Browse files
committed
Added custom header parameter on beta version for custom group cmdlets
1 parent 58cfeb2 commit e7310b4

8 files changed

+87
-16
lines changed

src/Groups/beta/custom/NewMgBetaGroupMember_Create.cs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,15 @@ public partial class NewMgBetaGroupMember_Create : System.Management.Automation.
4343

4444
/// <summary>The reference to the client API class.</summary>
4545
public Groups Client => Module.Instance.ClientAPI;
46+
/// <summary>Backing field for <see cref="CustomHeader" /> property.</summary>
47+
private string _customHeader;
4648

49+
/// <summary>
50+
/// CustomHeader Parameter. This should have a key:value and comma separated for multiple key:value pairs
51+
/// </summary>
52+
[System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "CustomHeader Parameter. This should have a key:value and comma separated for multiple key:value pairs", ValueFromPipeline = true)]
53+
[Category(ParameterCategory.Runtime)]
54+
public string CustomHeader { get => this._customHeader; set => this._customHeader = value; }
4755
/// <summary>Backing field for <see cref="GroupId" /> property.</summary>
4856
private string _groupId;
4957

@@ -262,12 +270,12 @@ protected async System.Threading.Tasks.Task ProcessRecordAsync()
262270
try
263271
{
264272
await ((Runtime.IEventListener)this).Signal(Runtime.Events.CmdletBeforeAPICall); if (((Runtime.IEventListener)this).Token.IsCancellationRequested) { return; }
265-
await this.Client.GroupCreateMemberGraphBPreRef(GroupId, BodyParameter, onNoContent, onDefault, this, Pipeline);
273+
await this.Client.GroupCreateMemberGraphBPreRef(GroupId, CustomHeader, BodyParameter, onNoContent, onDefault, this, Pipeline);
266274
await ((Runtime.IEventListener)this).Signal(Runtime.Events.CmdletAfterAPICall); if (((Runtime.IEventListener)this).Token.IsCancellationRequested) { return; }
267275
}
268276
catch (Microsoft.Graph.Beta.PowerShell.Runtime.UndeclaredResponseException urexception)
269277
{
270-
WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { GroupId = GroupId, body = BodyParameter })
278+
WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { GroupId = GroupId, CustomHeader = CustomHeader, body = BodyParameter })
271279
{
272280
ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action }
273281
});

src/Groups/beta/custom/NewMgBetaGroupMember_CreateExpanded.cs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,15 @@ public partial class NewMgBetaGroupMember_CreateExpanded : System.Management.Aut
3333
/// <summary>The reference to the client API class.</summary>
3434
public Groups Client => Module.Instance.ClientAPI;
3535

36+
/// <summary>Backing field for <see cref="CustomHeader" /> property.</summary>
37+
private string _customHeader;
38+
39+
/// <summary>
40+
/// CustomHeader Parameter. This should have a key:value and comma separated for multiple key:value pairs
41+
/// </summary>
42+
[System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "CustomHeader Parameter. This should have a key:value and comma separated for multiple key:value pairs", ValueFromPipeline = true)]
43+
[Category(ParameterCategory.Runtime)]
44+
public string CustomHeader { get => this._customHeader; set => this._customHeader = value; }
3645
/// <summary>Backing field for <see cref="GroupId" /> property.</summary>
3746
private string _groupId;
3847

@@ -263,12 +272,12 @@ protected async System.Threading.Tasks.Task ProcessRecordAsync()
263272
{
264273
await ((Runtime.IEventListener)this).Signal(Microsoft.Graph.Beta.PowerShell.Runtime.Events.CmdletBeforeAPICall); if (((Runtime.IEventListener)this).Token.IsCancellationRequested) { return; }
265274
_bodyParameter.OdataId = $"https://graph.microsoft.com/beta/directoryObjects/{DirectoryObjectId}";
266-
await this.Client.GroupCreateMemberGraphBPreRef(GroupId, _bodyParameter, onNoContent, onDefault, this, Pipeline);
275+
await this.Client.GroupCreateMemberGraphBPreRef(GroupId, CustomHeader, _bodyParameter, onNoContent, onDefault, this, Pipeline);
267276
await ((Runtime.IEventListener)this).Signal(Microsoft.Graph.Beta.PowerShell.Runtime.Events.CmdletAfterAPICall); if (((Runtime.IEventListener)this).Token.IsCancellationRequested) { return; }
268277
}
269278
catch (Runtime.UndeclaredResponseException urexception)
270279
{
271-
WriteError(new System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), System.Management.Automation.ErrorCategory.InvalidOperation, new { GroupId = GroupId, body = _bodyParameter })
280+
WriteError(new System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), System.Management.Automation.ErrorCategory.InvalidOperation, new { GroupId = GroupId, CustomHeader = CustomHeader, body = _bodyParameter })
272281
{
273282
ErrorDetails = new System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action }
274283
});

src/Groups/beta/custom/NewMgBetaGroupMember_CreateViaIdentity.cs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,15 @@ public partial class NewMgBetaGroupMember_CreateViaIdentity : System.Management.
4444
/// <summary>The reference to the client API class.</summary>
4545
public Groups Client => Module.Instance.ClientAPI;
4646

47+
/// <summary>Backing field for <see cref="CustomHeader" /> property.</summary>
48+
private string _customHeader;
49+
50+
/// <summary>
51+
/// CustomHeader Parameter. This should have a key:value and comma separated for multiple key:value pairs
52+
/// </summary>
53+
[System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "CustomHeader Parameter. This should have a key:value and comma separated for multiple key:value pairs", ValueFromPipeline = true)]
54+
[Category(ParameterCategory.Runtime)]
55+
public string CustomHeader { get => this._customHeader; set => this._customHeader = value; }
4756
/// <summary>SendAsync Pipeline Steps to be appended to the front of the pipeline</summary>
4857
[System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")]
4958
[System.Management.Automation.ValidateNotNull]
@@ -261,12 +270,12 @@ protected async System.Threading.Tasks.Task ProcessRecordAsync()
261270
{
262271
ThrowTerminatingError(new System.Management.Automation.ErrorRecord(new System.Exception("InputObject has null value for InputObject.GroupId"), string.Empty, System.Management.Automation.ErrorCategory.InvalidArgument, InputObject));
263272
}
264-
await this.Client.GroupCreateMemberGraphBPreRef(InputObject.GroupId, BodyParameter, onNoContent, onDefault, this, Pipeline);
273+
await this.Client.GroupCreateMemberGraphBPreRef(InputObject.GroupId, CustomHeader, BodyParameter, onNoContent, onDefault, this, Pipeline);
265274
await ((Runtime.IEventListener)this).Signal(Runtime.Events.CmdletAfterAPICall); if (((Runtime.IEventListener)this).Token.IsCancellationRequested) { return; }
266275
}
267276
catch (Runtime.UndeclaredResponseException urexception)
268277
{
269-
WriteError(new System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), System.Management.Automation.ErrorCategory.InvalidOperation, new { body = BodyParameter })
278+
WriteError(new System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), System.Management.Automation.ErrorCategory.InvalidOperation, new { CustomHeader = CustomHeader, body = BodyParameter })
270279
{
271280
ErrorDetails = new System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action }
272281
});

src/Groups/beta/custom/NewMgBetaGroupMember_CreateViaIdentityExpanded.cs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,15 @@ public partial class NewMgBetaGroupMember_CreateViaIdentityExpanded : System.Man
3333
/// <summary>The reference to the client API class.</summary>
3434
public Groups Client => Module.Instance.ClientAPI;
3535

36+
/// <summary>Backing field for <see cref="CustomHeader" /> property.</summary>
37+
private string _customHeader;
38+
39+
/// <summary>
40+
/// CustomHeader Parameter. This should have a key:value and comma separated for multiple key:value pairs
41+
/// </summary>
42+
[System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "CustomHeader Parameter. This should have a key:value and comma separated for multiple key:value pairs", ValueFromPipeline = true)]
43+
[Category(ParameterCategory.Runtime)]
44+
public string CustomHeader { get => this._customHeader; set => this._customHeader = value; }
3645
/// <summary>SendAsync Pipeline Steps to be appended to the front of the pipeline</summary>
3746
[System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")]
3847
[System.Management.Automation.ValidateNotNull]
@@ -262,12 +271,12 @@ protected async System.Threading.Tasks.Task ProcessRecordAsync()
262271
ThrowTerminatingError(new System.Management.Automation.ErrorRecord(new System.Exception("InputObject has null value for InputObject.GroupId"), string.Empty, System.Management.Automation.ErrorCategory.InvalidArgument, InputObject));
263272
}
264273
_bodyParameter.OdataId = $"https://graph.microsoft.com/beta/directoryObjects/{DirectoryObjectId}";
265-
await this.Client.GroupCreateMemberGraphBPreRef(InputObject.GroupId, _bodyParameter, onNoContent, onDefault, this, Pipeline);
274+
await this.Client.GroupCreateMemberGraphBPreRef(InputObject.GroupId, CustomHeader, _bodyParameter, onNoContent, onDefault, this, Pipeline);
266275
await ((Runtime.IEventListener)this).Signal(Runtime.Events.CmdletAfterAPICall); if (((Runtime.IEventListener)this).Token.IsCancellationRequested) { return; }
267276
}
268277
catch (Runtime.UndeclaredResponseException urexception)
269278
{
270-
WriteError(new System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), System.Management.Automation.ErrorCategory.InvalidOperation, new { body = _bodyParameter })
279+
WriteError(new System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), System.Management.Automation.ErrorCategory.InvalidOperation, new { CustomHeader = CustomHeader, body = _bodyParameter })
271280
{
272281
ErrorDetails = new System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action }
273282
});

src/Groups/beta/custom/NewMgBetaGroupOwner_Create.cs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,15 @@ public partial class NewMgBetaGroupOwner_Create : System.Management.Automation.P
4242
/// <summary>The reference to the client API class.</summary>
4343
public Groups Client => Module.Instance.ClientAPI;
4444

45+
/// <summary>Backing field for <see cref="CustomHeader" /> property.</summary>
46+
private string _customHeader;
47+
48+
/// <summary>
49+
/// CustomHeader Parameter. This should have a key:value and comma separated for multiple key:value pairs
50+
/// </summary>
51+
[System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "CustomHeader Parameter. This should have a key:value and comma separated for multiple key:value pairs", ValueFromPipeline = true)]
52+
[Category(ParameterCategory.Runtime)]
53+
public string CustomHeader { get => this._customHeader; set => this._customHeader = value; }
4554
/// <summary>Backing field for <see cref="GroupId" /> property.</summary>
4655
private string _groupId;
4756

@@ -260,12 +269,12 @@ protected async System.Threading.Tasks.Task ProcessRecordAsync()
260269
try
261270
{
262271
await ((Runtime.IEventListener)this).Signal(Runtime.Events.CmdletBeforeAPICall); if (((Runtime.IEventListener)this).Token.IsCancellationRequested) { return; }
263-
await this.Client.GroupCreateOwnerGraphBPreRef(GroupId, BodyParameter, onNoContent, onDefault, this, Pipeline);
272+
await this.Client.GroupCreateOwnerGraphBPreRef(GroupId, CustomHeader, BodyParameter, onNoContent, onDefault, this, Pipeline);
264273
await ((Runtime.IEventListener)this).Signal(Runtime.Events.CmdletAfterAPICall); if (((Runtime.IEventListener)this).Token.IsCancellationRequested) { return; }
265274
}
266275
catch (Runtime.UndeclaredResponseException urexception)
267276
{
268-
WriteError(new System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), System.Management.Automation.ErrorCategory.InvalidOperation, new { GroupId = GroupId, body = BodyParameter })
277+
WriteError(new System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), System.Management.Automation.ErrorCategory.InvalidOperation, new { GroupId = GroupId, CustomHeader = CustomHeader, body = BodyParameter })
269278
{
270279
ErrorDetails = new System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action }
271280
});

src/Groups/beta/custom/NewMgBetaGroupOwner_CreateExpanded.cs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,15 @@ public partial class NewMgBetaGroupOwner_CreateExpanded : System.Management.Auto
3333
/// <summary>The reference to the client API class.</summary>
3434
public Groups Client => Module.Instance.ClientAPI;
3535

36+
/// <summary>Backing field for <see cref="CustomHeader" /> property.</summary>
37+
private string _customHeader;
38+
39+
/// <summary>
40+
/// CustomHeader Parameter. This should have a key:value and comma separated for multiple key:value pairs
41+
/// </summary>
42+
[System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "CustomHeader Parameter. This should have a key:value and comma separated for multiple key:value pairs", ValueFromPipeline = true)]
43+
[Category(ParameterCategory.Runtime)]
44+
public string CustomHeader { get => this._customHeader; set => this._customHeader = value; }
3645
/// <summary>Backing field for <see cref="GroupId" /> property.</summary>
3746
private string _groupId;
3847

@@ -263,12 +272,12 @@ protected async System.Threading.Tasks.Task ProcessRecordAsync()
263272
{
264273
await ((Runtime.IEventListener)this).Signal(Microsoft.Graph.Beta.PowerShell.Runtime.Events.CmdletBeforeAPICall); if (((Runtime.IEventListener)this).Token.IsCancellationRequested) { return; }
265274
_bodyParameter.OdataId = $"https://graph.microsoft.com/beta/directoryObjects/{DirectoryObjectId}";
266-
await this.Client.GroupCreateOwnerGraphBPreRef(GroupId, _bodyParameter, onNoContent, onDefault, this, Pipeline);
275+
await this.Client.GroupCreateOwnerGraphBPreRef(GroupId, CustomHeader, _bodyParameter, onNoContent, onDefault, this, Pipeline);
267276
await ((Runtime.IEventListener)this).Signal(Microsoft.Graph.Beta.PowerShell.Runtime.Events.CmdletAfterAPICall); if (((Runtime.IEventListener)this).Token.IsCancellationRequested) { return; }
268277
}
269278
catch (Runtime.UndeclaredResponseException urexception)
270279
{
271-
WriteError(new System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), System.Management.Automation.ErrorCategory.InvalidOperation, new { GroupId = GroupId, body = _bodyParameter })
280+
WriteError(new System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), System.Management.Automation.ErrorCategory.InvalidOperation, new { GroupId = GroupId, CustomHeader = CustomHeader, body = _bodyParameter })
272281
{
273282
ErrorDetails = new System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action }
274283
});

src/Groups/beta/custom/NewMgBetaGroupOwner_CreateViaIdentity.cs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,15 @@ public partial class NewMgBetaGroupOwner_CreateViaIdentity : System.Management.A
4444
/// <summary>The reference to the client API class.</summary>
4545
public Groups Client => Module.Instance.ClientAPI;
4646

47+
/// <summary>Backing field for <see cref="CustomHeader" /> property.</summary>
48+
private string _customHeader;
49+
50+
/// <summary>
51+
/// CustomHeader Parameter. This should have a key:value and comma separated for multiple key:value pairs
52+
/// </summary>
53+
[System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "CustomHeader Parameter. This should have a key:value and comma separated for multiple key:value pairs", ValueFromPipeline = true)]
54+
[Category(ParameterCategory.Runtime)]
55+
public string CustomHeader { get => this._customHeader; set => this._customHeader = value; }
4756
/// <summary>SendAsync Pipeline Steps to be appended to the front of the pipeline</summary>
4857
[System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")]
4958
[System.Management.Automation.ValidateNotNull]
@@ -261,12 +270,12 @@ protected async System.Threading.Tasks.Task ProcessRecordAsync()
261270
{
262271
ThrowTerminatingError(new System.Management.Automation.ErrorRecord(new System.Exception("InputObject has null value for InputObject.GroupId"), string.Empty, System.Management.Automation.ErrorCategory.InvalidArgument, InputObject));
263272
}
264-
await this.Client.GroupCreateOwnerGraphBPreRef(InputObject.GroupId, BodyParameter, onNoContent, onDefault, this, Pipeline);
273+
await this.Client.GroupCreateOwnerGraphBPreRef(InputObject.GroupId, CustomHeader, BodyParameter, onNoContent, onDefault, this, Pipeline);
265274
await ((Runtime.IEventListener)this).Signal(Runtime.Events.CmdletAfterAPICall); if (((Runtime.IEventListener)this).Token.IsCancellationRequested) { return; }
266275
}
267276
catch (Runtime.UndeclaredResponseException urexception)
268277
{
269-
WriteError(new System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), System.Management.Automation.ErrorCategory.InvalidOperation, new { body = BodyParameter })
278+
WriteError(new System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), System.Management.Automation.ErrorCategory.InvalidOperation, new { CustomHeader = CustomHeader, body = BodyParameter })
270279
{
271280
ErrorDetails = new System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action }
272281
});

0 commit comments

Comments
 (0)