-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Renames Add-CloudEvent*Data to Set-CloudEvent*Data #12
Merged
dmilov
merged 8 commits into
cloudevents:main
from
dmilov:topic/dmilov/rename-add-data-to-set-data
Apr 13, 2021
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
9c3f3d0
Rename Add-CloudEvent*Data to Set-CloudEvent*Data
dmilov cd4fb93
Removes module catalog file creation from build.ps1
dmilov 1f546b0
Adress review comment removing the entire catalog file logic from bui…
dmilov a30e360
Adress review comment removing the entire catalog file logic from bui…
dmilov e0debd8
Merge branch 'topic/dmilov/rename-add-data-to-set-data' of github.com…
dmilov f470da2
Address PR comments from embano1
dmilov 3ec7891
Updates descriptions of the `CloudEvent` parameter for Set-CloudEvent…
dmilov c332e53
Adds -Depth parameter explicitly to Set-CloudEventJsonData cmdlet in …
dmilov File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -72,30 +72,30 @@ PROCESS { | |
} | ||
} | ||
|
||
#region Add Data Functions | ||
function Add-CloudEventData { | ||
#region Set Data Functions | ||
function Set-CloudEventData { | ||
<# | ||
.SYNOPSIS | ||
This function adds data to a cloud event. | ||
This function sets data in a cloud event. | ||
|
||
.DESCRIPTION | ||
This function adds data to a cloud event object with the provided parameters. | ||
This function sets data in a cloud event object with the provided parameters. | ||
|
||
.PARAMETER CloudEvent | ||
Specifies the cloud event object to add data to. | ||
Specifies the cloud event object that receives the data. | ||
|
||
.PARAMETER Data | ||
Specifies the data object that is added to the cloud event 'data' attribute. | ||
Specifies the data object for the cloud event 'data' attribute. | ||
|
||
.PARAMETER DataContentType | ||
Specifies the 'datacontenttype' attribute of the cloud event. | ||
|
||
|
||
.EXAMPLE | ||
$cloudEvent = New-CloudEvent -Type 'com.example.object.deleted.v2' -Source 'mailto:[email protected]' -Id '6e8bc430-9c3a-11d9-9669-0800200c9a66' -Time (Get-Date) | ||
$cloudEvent | Add-CloudEventData -Data '<much wow="xml"/>' -DataContentType 'application/xml' | ||
$cloudEvent | Set-CloudEventData -Data '<much wow="xml"/>' -DataContentType 'application/xml' | ||
|
||
Adds xml data to the cloud event | ||
Sets xml data to the cloud event | ||
#> | ||
|
||
[CmdletBinding()] | ||
|
@@ -135,27 +135,32 @@ PROCESS { | |
|
||
} | ||
|
||
function Add-CloudEventJsonData { | ||
function Set-CloudEventJsonData { | ||
<# | ||
.SYNOPSIS | ||
This function adds JSON format data to a cloud event. | ||
This function sets JSON format data in a cloud event. | ||
|
||
.DESCRIPTION | ||
This function converts a PowerShell hashtable to JSON format data and adds it to a cloud event. | ||
This function converts a PowerShell hashtable to JSON format data and sets it in a cloud event. | ||
|
||
.PARAMETER CloudEvent | ||
Specifies the cloud event object to add data to. | ||
Specifies the cloud event object that receives the data. | ||
|
||
.PARAMETER Data | ||
Specifies the PowerShell hashtable object that is added as JSON to the cloud event 'data' attribute. | ||
The 'datacontenttype' attribute is set to 'applicaiton/json' | ||
Specifies the PowerShell hashtable object that is set as JSON on the cloud event 'data' attribute. | ||
The 'datacontenttype' attribute is set to 'application/json' | ||
|
||
.PARAMETER Depth | ||
The maximum depth of the input hashtable specified on the `Data` parameter that will be converted to JSON. | ||
This parameter is passed on the `-Depth` parameter of the `ConvertTo-Json` cmdlet. | ||
The default value is 3 | ||
|
||
|
||
.EXAMPLE | ||
$cloudEvent = New-CloudEvent -Type 'com.example.object.deleted.v2' -Source 'mailto:[email protected]' -Id '6e8bc430-9c3a-11d9-9669-0800200c9a66' -Time (Get-Date) | ||
$cloudEvent | Add-CloudEventJsonData -Data @{ 'key1' = 'value1'; 'key2' = 'value2'; } | ||
$cloudEvent | Set-CloudEventJsonData -Data @{ 'key1' = 'value1'; 'key2' = 'value2'; } | ||
|
||
Adds JSON data to the cloud event | ||
Sets JSON data to the cloud event | ||
#> | ||
|
||
[CmdletBinding()] | ||
|
@@ -193,20 +198,20 @@ PROCESS { | |
|
||
} | ||
|
||
function Add-CloudEventXmlData { | ||
function Set-CloudEventXmlData { | ||
<# | ||
.SYNOPSIS | ||
This function adds XML format data to a cloud event. | ||
This function sets XML format data in a cloud event. | ||
|
||
.DESCRIPTION | ||
This function converts a PowerShell hashtable to XML format data and adds it to a cloud event. | ||
This function converts a PowerShell hashtable to XML format data and sets it in a cloud event. | ||
|
||
.PARAMETER CloudEvent | ||
Specifies the cloud event object to add data to. | ||
Specifies the cloud event object that receives the data. | ||
|
||
.PARAMETER Data | ||
Specifies the PowerShell hashtable object that is added as XML to the cloud event 'data' attribute. | ||
The 'datacontenttype' attribute is set to 'applicaiton/xml' | ||
Specifies the PowerShell hashtable object that is set as XML on the cloud event 'data' attribute. | ||
The 'datacontenttype' attribute is set to 'application/xml' | ||
|
||
.PARAMETER AttributesKeysInElementAttributes | ||
Specifies how to format the XML. If specified and the input Data hashtable has pairs of 'Attributes', 'Value' keys | ||
|
@@ -219,9 +224,9 @@ function Add-CloudEventXmlData { | |
|
||
.EXAMPLE | ||
$cloudEvent = New-CloudEvent -Type 'com.example.object.deleted.v2' -Source 'mailto:[email protected]' -Id '6e8bc430-9c3a-11d9-9669-0800200c9a66' -Time (Get-Date) | ||
$cloudEvent | Add-CloudEventXmlData -Data @{ 'key1' = 'value1'; 'key2' = 'value2'; } -AttributesKeysInElementAttributes $true | ||
$cloudEvent | Set-CloudEventXmlData -Data @{ 'key1' = 'value1'; 'key2' = 'value2'; } -AttributesKeysInElementAttributes $true | ||
|
||
Adds XML data to the cloud event | ||
Sets XML data in the cloud event | ||
#> | ||
|
||
[CmdletBinding()] | ||
|
@@ -256,7 +261,7 @@ PROCESS { | |
} | ||
|
||
} | ||
#endregion Add Data Functions | ||
#endregion Set Data Functions | ||
|
||
#region Read Data Functions | ||
function Read-CloudEventData { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Optional suggestion: Maybe we can remove the whole step Prepare Module for Publishing although the condition for removing the previous catalog file will never be invoked with the removal of the NewFileCatalog call.