forked from Sitecore/Media-Framework-Brightcove-Edition
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added support for players and experiences
- Loading branch information
Richard Pizzo
authored and
Richard Pizzo
committed
May 16, 2022
1 parent
91aa852
commit d450e29
Showing
26 changed files
with
1,086 additions
and
15 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -385,4 +385,5 @@ FodyWeavers.xsd | |
|
||
# JetBrains Rider | ||
.idea/ | ||
*.sln.iml | ||
*.sln.iml | ||
/package.zip |
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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
using Newtonsoft.Json; | ||
using System; | ||
using System.Collections.Generic; | ||
|
||
namespace Brightcove.Core.Models | ||
{ | ||
/// <summary> | ||
/// Represents a experience object from the Brightcove API | ||
/// For more information, see https://apis.support.brightcove.com/ipx/references/reference.html#operation/GetExperiences | ||
/// </summary> | ||
public class Experience : Asset | ||
{ | ||
[JsonProperty("created_at", NullValueHandling = NullValueHandling.Ignore)] | ||
public DateTime CreationDate { get; set; } | ||
|
||
[JsonProperty("publishedUrl", NullValueHandling = NullValueHandling.Ignore)] | ||
public string Url { get; set; } | ||
|
||
public Experience ShallowCopy() | ||
{ | ||
return (Experience)this.MemberwiseClone(); | ||
} | ||
} | ||
|
||
public class ExperienceList | ||
{ | ||
[JsonProperty("items", NullValueHandling = NullValueHandling.Ignore)] | ||
public IEnumerable<Experience> Items { get; set; } | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,47 @@ | ||
using Newtonsoft.Json; | ||
using System; | ||
using System.Collections.Generic; | ||
|
||
namespace Brightcove.Core.Models | ||
{ | ||
/// <summary> | ||
/// Represents a players object from the Brightcove API | ||
/// For more information, see https://apis.support.brightcove.com/player-management/references/reference.html#operation/GetPlayer | ||
/// </summary> | ||
public class Player : Asset | ||
{ | ||
[JsonProperty("created_at", NullValueHandling = NullValueHandling.Ignore)] | ||
public DateTime CreattionDate { get; set; } | ||
|
||
[JsonProperty("url", NullValueHandling = NullValueHandling.Ignore)] | ||
public string Url { get; set; } | ||
|
||
[JsonProperty("branches", NullValueHandling = NullValueHandling.Ignore)] | ||
public Branches Branches { get; set; } | ||
|
||
public Player ShallowCopy() | ||
{ | ||
return (Player)this.MemberwiseClone(); | ||
} | ||
} | ||
|
||
public class Branches | ||
{ | ||
[JsonProperty("master", NullValueHandling = NullValueHandling.Ignore)] | ||
public Master Master { get; set; } | ||
} | ||
|
||
public class Master | ||
{ | ||
[JsonProperty("updated_at", NullValueHandling = NullValueHandling.Ignore)] | ||
public DateTime UpdatedAt { get; set; } | ||
} | ||
|
||
public class PlayerList | ||
{ | ||
[JsonProperty("items", NullValueHandling = NullValueHandling.Ignore)] | ||
public IEnumerable<Player> Items { get; set; } | ||
} | ||
|
||
|
||
} |
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
31 changes: 31 additions & 0 deletions
31
Brightcove.DataExchangeFramework/Processors/GetExperiencesPipelineStepProcessor.cs
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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
using Brightcove.Core.Services; | ||
using Brightcove.DataExchangeFramework.Settings; | ||
using Sitecore.Data.Fields; | ||
using Sitecore.Data.Items; | ||
using Sitecore.DataExchange.Contexts; | ||
using Sitecore.DataExchange.Models; | ||
using Sitecore.DataExchange.Plugins; | ||
using Sitecore.SecurityModel; | ||
using Sitecore.Services.Core.Diagnostics; | ||
|
||
namespace Brightcove.DataExchangeFramework.Processors | ||
{ | ||
class GetExperiencesPipelineStepProcessor : BasePipelineStepWithWebApiEndpointProcessor | ||
{ | ||
BrightcoveService service; | ||
|
||
protected override void ProcessPipelineStep(PipelineStep pipelineStep = null, PipelineContext pipelineContext = null, ILogger logger = null) | ||
{ | ||
base.ProcessPipelineStep(pipelineStep, pipelineContext, logger); | ||
|
||
service = new BrightcoveService(WebApiSettings.AccountId, WebApiSettings.ClientId, WebApiSettings.ClientSecret); | ||
|
||
var data = service.GetExperiences().Items; | ||
var dataSettings = new IterableDataSettings(data); | ||
|
||
pipelineContext.AddPlugin(dataSettings); | ||
|
||
SetFolderSettings("Experiences"); | ||
} | ||
} | ||
} |
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.