Advertisement
Guest User

Untitled

a guest
Apr 7th, 2020
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 19.41 KB | None | 0 0
  1. using Newtonsoft.Json;
  2. using RestSharp;
  3. using System.Collections.Generic;
  4. using System;
  5. using System.Linq;
  6. using System.Net;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9.                    
  10. public class Program
  11. {
  12.     public static void Main()
  13.     {
  14.         ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
  15.  
  16.         var client = new RestClient("https://store.playstation.com");
  17.         var request = new RestRequest("/store/api/chihiro/00_09_000/container/GB/en/999/EP0177-CUSA05674_00-SONIC20170000000");
  18.  
  19.         var response = client.Execute(request);
  20.         var data = JsonConvert.DeserializeObject<Response>(response.Content);
  21.     }
  22. }
  23.  
  24. public partial class Response
  25.     {
  26.         [JsonProperty("age_limit")]
  27.         public long AgeLimit { get; set; }
  28.  
  29.         [JsonProperty("attributes")]
  30.         public Attributes Attributes { get; set; }
  31.  
  32.         [JsonProperty("bucket")]
  33.         public string Bucket { get; set; }
  34.  
  35.         [JsonProperty("container_type")]
  36.         public string ContainerType { get; set; }
  37.  
  38.         [JsonProperty("content_descriptors")]
  39.         public ContentDescriptor[] ContentDescriptors { get; set; }
  40.  
  41.         [JsonProperty("content_origin")]
  42.         public long ContentOrigin { get; set; }
  43.  
  44.         [JsonProperty("content_rating")]
  45.         public ContentRating ContentRating { get; set; }
  46.  
  47.         [JsonProperty("content_type")]
  48.         public long ContentType { get; set; }
  49.  
  50.         [JsonProperty("default_sku")]
  51.         public SkusClass DefaultSku { get; set; }
  52.  
  53.         [JsonProperty("dob_required")]
  54.         public bool DobRequired { get; set; }
  55.  
  56.         [JsonProperty("gameContentTypesList")]
  57.         public GameContentTypesList[] GameContentTypesList { get; set; }
  58.  
  59.         [JsonProperty("game_contentType")]
  60.         public string GameContentType { get; set; }
  61.  
  62.         [JsonProperty("id")]
  63.         public string Id { get; set; }
  64.  
  65.         [JsonProperty("images")]
  66.         public Image[] Images { get; set; }
  67.  
  68.         [JsonProperty("links")]
  69.         public Link[] Links { get; set; }
  70.  
  71.         [JsonProperty("long_desc")]
  72.         public string LongDesc { get; set; }
  73.  
  74.         [JsonProperty("mediaList")]
  75.         public MediaList MediaList { get; set; }
  76.  
  77.         [JsonProperty("media_layouts")]
  78.         public MediaLayout[] MediaLayouts { get; set; }
  79.  
  80.         [JsonProperty("metadata")]
  81.         public Dictionary<string, Metadatum> Metadata { get; set; }
  82.  
  83.         [JsonProperty("name")]
  84.         public string Name { get; set; }
  85.  
  86.         [JsonProperty("pageTypeId")]
  87.         public long PageTypeId { get; set; }
  88.  
  89.         [JsonProperty("playable_platform")]
  90.         public string[] PlayablePlatform { get; set; }
  91.  
  92.         [JsonProperty("promomedia")]
  93.         public Promomedia[] Promomedia { get; set; }
  94.  
  95.         [JsonProperty("provider_name")]
  96.         public string ProviderName { get; set; }
  97.  
  98.         [JsonProperty("relationships")]
  99.         public Relationship[] Relationships { get; set; }
  100.  
  101.         [JsonProperty("release_date")]
  102.         public DateTimeOffset ReleaseDate { get; set; }
  103.  
  104.         [JsonProperty("restricted")]
  105.         public bool Restricted { get; set; }
  106.  
  107.         [JsonProperty("revision")]
  108.         public long Revision { get; set; }
  109.  
  110.         [JsonProperty("short_name")]
  111.         public string ShortName { get; set; }
  112.  
  113.         [JsonProperty("size")]
  114.         public long Size { get; set; }
  115.  
  116.         [JsonProperty("sku_links")]
  117.         public object[] SkuLinks { get; set; }
  118.  
  119.         [JsonProperty("skus")]
  120.         public SkusClass[] Skus { get; set; }
  121.  
  122.         [JsonProperty("sort")]
  123.         public string Sort { get; set; }
  124.  
  125.         [JsonProperty("star_rating")]
  126.         public StarRating StarRating { get; set; }
  127.  
  128.         [JsonProperty("start")]
  129.         public long Start { get; set; }
  130.  
  131.         [JsonProperty("timestamp")]
  132.         public long Timestamp { get; set; }
  133.  
  134.         [JsonProperty("title_name")]
  135.         public string TitleName { get; set; }
  136.  
  137.         [JsonProperty("top_category")]
  138.         public string TopCategory { get; set; }
  139.  
  140.         [JsonProperty("total_results")]
  141.         public long TotalResults { get; set; }
  142.     }
  143.  
  144.     public partial class Attributes
  145.     {
  146.         [JsonProperty("facets")]
  147.         public Facets Facets { get; set; }
  148.  
  149.         [JsonProperty("next")]
  150.         public object[] Next { get; set; }
  151.     }
  152.  
  153.     public partial class Facets
  154.     {
  155.         [JsonProperty("game_content_type")]
  156.         public AddonType[] GameContentType { get; set; }
  157.  
  158.         [JsonProperty("price")]
  159.         public AddonType[] Price { get; set; }
  160.  
  161.         [JsonProperty("addon_type")]
  162.         public AddonType[] AddonType { get; set; }
  163.  
  164.         [JsonProperty("top_category")]
  165.         public AddonType[] TopCategory { get; set; }
  166.  
  167.         [JsonProperty("relationship")]
  168.         public AddonType[] Relationship { get; set; }
  169.     }
  170.  
  171.     public partial class AddonType
  172.     {
  173.         [JsonProperty("name")]
  174.         public string Name { get; set; }
  175.  
  176.         [JsonProperty("count")]
  177.         public long Count { get; set; }
  178.  
  179.         [JsonProperty("key")]
  180.         public string Key { get; set; }
  181.     }
  182.  
  183.     public partial class ContentDescriptor
  184.     {
  185.         [JsonProperty("description")]
  186.         public string Description { get; set; }
  187.  
  188.         [JsonProperty("url")]
  189.         public Uri Url { get; set; }
  190.  
  191.         [JsonProperty("name")]
  192.         public string Name { get; set; }
  193.     }
  194.  
  195.     public partial class ContentRating
  196.     {
  197.         [JsonProperty("description")]
  198.         public string Description { get; set; }
  199.  
  200.         [JsonProperty("rating_system")]
  201.         public string RatingSystem { get; set; }
  202.  
  203.         [JsonProperty("url")]
  204.         public Uri Url { get; set; }
  205.     }
  206.  
  207.     public partial class SkusClass
  208.     {
  209.         [JsonProperty("amortizeFlag")]
  210.         public bool AmortizeFlag { get; set; }
  211.  
  212.         [JsonProperty("bundleExclusiveFlag")]
  213.         public bool BundleExclusiveFlag { get; set; }
  214.  
  215.         [JsonProperty("chargeImmediatelyFlag")]
  216.         public bool ChargeImmediatelyFlag { get; set; }
  217.  
  218.         [JsonProperty("charge_type_id")]
  219.         public long ChargeTypeId { get; set; }
  220.  
  221.         [JsonProperty("credit_card_required_flag")]
  222.         public long CreditCardRequiredFlag { get; set; }
  223.  
  224.         [JsonProperty("defaultSku")]
  225.         public bool DefaultSku { get; set; }
  226.  
  227.         [JsonProperty("display_price")]
  228.         public string DisplayPrice { get; set; }
  229.  
  230.         [JsonProperty("eligibilities")]
  231.         public object[] Eligibilities { get; set; }
  232.  
  233.         [JsonProperty("entitlements")]
  234.         public SkusEntitlement[] Entitlements { get; set; }
  235.  
  236.         [JsonProperty("id")]
  237.         public string Id { get; set; }
  238.  
  239.         [JsonProperty("is_original")]
  240.         public bool IsOriginal { get; set; }
  241.  
  242.         [JsonProperty("name")]
  243.         public string Name { get; set; }
  244.  
  245.         [JsonProperty("platforms")]
  246.         public long[] Platforms { get; set; }
  247.  
  248.         [JsonProperty("price")]
  249.         public long Price { get; set; }
  250.  
  251.         [JsonProperty("rewards")]
  252.         public Reward[] Rewards { get; set; }
  253.  
  254.         [JsonProperty("seasonPassExclusiveFlag")]
  255.         public bool SeasonPassExclusiveFlag { get; set; }
  256.  
  257.         [JsonProperty("skuAvailabilityOverrideFlag")]
  258.         public bool SkuAvailabilityOverrideFlag { get; set; }
  259.  
  260.         [JsonProperty("sku_type")]
  261.         public long SkuType { get; set; }
  262.  
  263.         [JsonProperty("type")]
  264.         public string Type { get; set; }
  265.     }
  266.  
  267.     public partial class SkusEntitlement
  268.     {
  269.         [JsonProperty("description")]
  270.         public object Description { get; set; }
  271.  
  272.         [JsonProperty("drms")]
  273.         public object[] Drms { get; set; }
  274.  
  275.         [JsonProperty("duration")]
  276.         public long Duration { get; set; }
  277.  
  278.         [JsonProperty("durationOverrideTypeId")]
  279.         public object DurationOverrideTypeId { get; set; }
  280.  
  281.         [JsonProperty("exp_after_first_use")]
  282.         public long ExpAfterFirstUse { get; set; }
  283.  
  284.         [JsonProperty("feature_type_id")]
  285.         public long FeatureTypeId { get; set; }
  286.  
  287.         [JsonProperty("id")]
  288.         public string Id { get; set; }
  289.  
  290.         [JsonProperty("license_type")]
  291.         public long LicenseType { get; set; }
  292.  
  293.         [JsonProperty("metadata")]
  294.         public PurpleMetadata Metadata { get; set; }
  295.  
  296.         [JsonProperty("name")]
  297.         public string Name { get; set; }
  298.  
  299.         [JsonProperty("packageType")]
  300.         public string PackageType { get; set; }
  301.  
  302.         [JsonProperty("packages")]
  303.         public Package[] Packages { get; set; }
  304.  
  305.         [JsonProperty("preorder_placeholder_flag")]
  306.         public bool PreorderPlaceholderFlag { get; set; }
  307.  
  308.         [JsonProperty("size")]
  309.         public long Size { get; set; }
  310.  
  311.         [JsonProperty("subType")]
  312.         public long SubType { get; set; }
  313.  
  314.         [JsonProperty("subtitle_language_codes")]
  315.         public string[] SubtitleLanguageCodes { get; set; }
  316.  
  317.         [JsonProperty("type")]
  318.         public long Type { get; set; }
  319.  
  320.         [JsonProperty("use_count")]
  321.         public long UseCount { get; set; }
  322.  
  323.         [JsonProperty("voice_language_codes")]
  324.         public string[] VoiceLanguageCodes { get; set; }
  325.     }
  326.  
  327.     public partial class PurpleMetadata
  328.     {
  329.         [JsonProperty("voiceLanguageCode")]
  330.         public string[] VoiceLanguageCode { get; set; }
  331.  
  332.         [JsonProperty("subtitleLanguageCode")]
  333.         public string[] SubtitleLanguageCode { get; set; }
  334.     }
  335.  
  336.     public partial class Package
  337.     {
  338.         [JsonProperty("platformId")]
  339.         public long PlatformId { get; set; }
  340.  
  341.         [JsonProperty("platformName")]
  342.         public string PlatformName { get; set; }
  343.  
  344.         [JsonProperty("size")]
  345.         public long Size { get; set; }
  346.     }
  347.  
  348.     public partial class Reward
  349.     {
  350.         [JsonProperty("id")]
  351.         public string Id { get; set; }
  352.  
  353.         [JsonProperty("discount")]
  354.         public long Discount { get; set; }
  355.  
  356.         [JsonProperty("price")]
  357.         public long Price { get; set; }
  358.  
  359.         [JsonProperty("reward_type")]
  360.         public long RewardType { get; set; }
  361.  
  362.         [JsonProperty("display_price")]
  363.         public string DisplayPrice { get; set; }
  364.  
  365.         [JsonProperty("isPlus")]
  366.         public bool IsPlus { get; set; }
  367.  
  368.         [JsonProperty("campaigns")]
  369.         public Campaign[] Campaigns { get; set; }
  370.  
  371.         [JsonProperty("start_date")]
  372.         public DateTimeOffset StartDate { get; set; }
  373.  
  374.         [JsonProperty("end_date")]
  375.         public DateTimeOffset EndDate { get; set; }
  376.  
  377.         [JsonProperty("bonus_discount")]
  378.         public long BonusDiscount { get; set; }
  379.  
  380.         [JsonProperty("bonus_entitlement_id")]
  381.         public string BonusEntitlementId { get; set; }
  382.  
  383.         [JsonProperty("bonus_price")]
  384.         public long BonusPrice { get; set; }
  385.  
  386.         [JsonProperty("reward_source_type_id")]
  387.         public long RewardSourceTypeId { get; set; }
  388.  
  389.         [JsonProperty("bonus_display_price")]
  390.         public string BonusDisplayPrice { get; set; }
  391.     }
  392.  
  393.     public partial class Campaign
  394.     {
  395.         [JsonProperty("id")]
  396.         public string Id { get; set; }
  397.  
  398.         [JsonProperty("start_date")]
  399.         public DateTimeOffset StartDate { get; set; }
  400.  
  401.         [JsonProperty("end_date")]
  402.         public DateTimeOffset EndDate { get; set; }
  403.     }
  404.  
  405.     public partial class GameContentTypesList
  406.     {
  407.         [JsonProperty("name")]
  408.         public string Name { get; set; }
  409.  
  410.         [JsonProperty("key")]
  411.         public string Key { get; set; }
  412.     }
  413.  
  414.     public partial class Image
  415.     {
  416.         [JsonProperty("type")]
  417.         public long Type { get; set; }
  418.  
  419.         [JsonProperty("url")]
  420.         public Uri Url { get; set; }
  421.     }
  422.  
  423.     public partial class Link
  424.     {
  425.         [JsonProperty("bucket")]
  426.         public string Bucket { get; set; }
  427.  
  428.         [JsonProperty("cloud_only_platform")]
  429.         public string[] CloudOnlyPlatform { get; set; }
  430.  
  431.         [JsonProperty("container_type")]
  432.         public string ContainerType { get; set; }
  433.  
  434.         [JsonProperty("content_type")]
  435.         public long ContentType { get; set; }
  436.  
  437.         [JsonProperty("default_sku")]
  438.         public LinkDefaultSku DefaultSku { get; set; }
  439.  
  440.         [JsonProperty("gameContentTypesList")]
  441.         public GameContentTypesList[] GameContentTypesList { get; set; }
  442.  
  443.         [JsonProperty("game_contentType")]
  444.         public string GameContentType { get; set; }
  445.  
  446.         [JsonProperty("id")]
  447.         public string Id { get; set; }
  448.  
  449.         [JsonProperty("images")]
  450.         public Image[] Images { get; set; }
  451.  
  452.         [JsonProperty("name")]
  453.         public string Name { get; set; }
  454.  
  455.         [JsonProperty("playable_platform")]
  456.         public string[] PlayablePlatform { get; set; }
  457.  
  458.         [JsonProperty("provider_name")]
  459.         public string ProviderName { get; set; }
  460.  
  461.         [JsonProperty("release_date")]
  462.         public DateTimeOffset ReleaseDate { get; set; }
  463.  
  464.         [JsonProperty("restricted")]
  465.         public bool Restricted { get; set; }
  466.  
  467.         [JsonProperty("revision")]
  468.         public long Revision { get; set; }
  469.  
  470.         [JsonProperty("short_name")]
  471.         public string ShortName { get; set; }
  472.  
  473.         [JsonProperty("timestamp")]
  474.         public long Timestamp { get; set; }
  475.  
  476.         [JsonProperty("top_category")]
  477.         public string TopCategory { get; set; }
  478.  
  479.         [JsonProperty("url")]
  480.         public Uri Url { get; set; }
  481.     }
  482.  
  483.     public partial class LinkDefaultSku
  484.     {
  485.         [JsonProperty("amortizeFlag")]
  486.         public bool AmortizeFlag { get; set; }
  487.  
  488.         [JsonProperty("bundleExclusiveFlag")]
  489.         public bool BundleExclusiveFlag { get; set; }
  490.  
  491.         [JsonProperty("chargeImmediatelyFlag")]
  492.         public bool ChargeImmediatelyFlag { get; set; }
  493.  
  494.         [JsonProperty("charge_type_id")]
  495.         public long ChargeTypeId { get; set; }
  496.  
  497.         [JsonProperty("credit_card_required_flag")]
  498.         public long CreditCardRequiredFlag { get; set; }
  499.  
  500.         [JsonProperty("defaultSku")]
  501.         public bool DefaultSku { get; set; }
  502.  
  503.         [JsonProperty("display_price")]
  504.         public string DisplayPrice { get; set; }
  505.  
  506.         [JsonProperty("eligibilities")]
  507.         public object[] Eligibilities { get; set; }
  508.  
  509.         [JsonProperty("entitlements")]
  510.         public PurpleEntitlement[] Entitlements { get; set; }
  511.  
  512.         [JsonProperty("id")]
  513.         public string Id { get; set; }
  514.  
  515.         [JsonProperty("is_original")]
  516.         public bool IsOriginal { get; set; }
  517.  
  518.         [JsonProperty("name")]
  519.         public string Name { get; set; }
  520.  
  521.         [JsonProperty("platforms")]
  522.         public long[] Platforms { get; set; }
  523.  
  524.         [JsonProperty("price")]
  525.         public long Price { get; set; }
  526.  
  527.         [JsonProperty("rewards")]
  528.         public object[] Rewards { get; set; }
  529.  
  530.         [JsonProperty("seasonPassExclusiveFlag")]
  531.         public bool SeasonPassExclusiveFlag { get; set; }
  532.  
  533.         [JsonProperty("skuAvailabilityOverrideFlag")]
  534.         public bool SkuAvailabilityOverrideFlag { get; set; }
  535.  
  536.         [JsonProperty("sku_type")]
  537.         public long SkuType { get; set; }
  538.  
  539.         [JsonProperty("type")]
  540.         public string Type { get; set; }
  541.     }
  542.  
  543.     public partial class PurpleEntitlement
  544.     {
  545.         [JsonProperty("description")]
  546.         public object Description { get; set; }
  547.  
  548.         [JsonProperty("drms")]
  549.         public object[] Drms { get; set; }
  550.  
  551.         [JsonProperty("duration")]
  552.         public long Duration { get; set; }
  553.  
  554.         [JsonProperty("durationOverrideTypeId")]
  555.         public object DurationOverrideTypeId { get; set; }
  556.  
  557.         [JsonProperty("exp_after_first_use")]
  558.         public long ExpAfterFirstUse { get; set; }
  559.  
  560.         [JsonProperty("feature_type_id")]
  561.         public long FeatureTypeId { get; set; }
  562.  
  563.         [JsonProperty("id")]
  564.         public string Id { get; set; }
  565.  
  566.         [JsonProperty("license_type")]
  567.         public long LicenseType { get; set; }
  568.  
  569.         [JsonProperty("metadata")]
  570.         public FluffyMetadata Metadata { get; set; }
  571.  
  572.         [JsonProperty("name")]
  573.         public string Name { get; set; }
  574.  
  575.         [JsonProperty("packageType")]
  576.         public string PackageType { get; set; }
  577.  
  578.         [JsonProperty("packages")]
  579.         public Package[] Packages { get; set; }
  580.  
  581.         [JsonProperty("preorder_placeholder_flag")]
  582.         public bool PreorderPlaceholderFlag { get; set; }
  583.  
  584.         [JsonProperty("size")]
  585.         public long Size { get; set; }
  586.  
  587.         [JsonProperty("subType")]
  588.         public long SubType { get; set; }
  589.  
  590.         [JsonProperty("subtitle_language_codes")]
  591.         public object SubtitleLanguageCodes { get; set; }
  592.  
  593.         [JsonProperty("type")]
  594.         public long Type { get; set; }
  595.  
  596.         [JsonProperty("use_count")]
  597.         public long UseCount { get; set; }
  598.  
  599.         [JsonProperty("voice_language_codes")]
  600.         public object VoiceLanguageCodes { get; set; }
  601.     }
  602.  
  603.     public partial class FluffyMetadata
  604.     {
  605.         [JsonProperty("packageSubType")]
  606.         public string[] PackageSubType { get; set; }
  607.     }
  608.  
  609.     public partial class MediaLayout
  610.     {
  611.         [JsonProperty("type")]
  612.         public string Type { get; set; }
  613.  
  614.         [JsonProperty("height")]
  615.         public long Height { get; set; }
  616.  
  617.         [JsonProperty("width")]
  618.         public long Width { get; set; }
  619.     }
  620.  
  621.     public partial class MediaList
  622.     {
  623.         [JsonProperty("previews")]
  624.         public Preview[] Previews { get; set; }
  625.  
  626.         [JsonProperty("screenshots")]
  627.         public Preview[] Screenshots { get; set; }
  628.     }
  629.  
  630.     public partial class Preview
  631.     {
  632.         [JsonProperty("type")]
  633.         public string Type { get; set; }
  634.  
  635.         [JsonProperty("typeId")]
  636.         public long TypeId { get; set; }
  637.  
  638.         [JsonProperty("source")]
  639.         public string Source { get; set; }
  640.  
  641.         [JsonProperty("url")]
  642.         public Uri Url { get; set; }
  643.  
  644.         [JsonProperty("order")]
  645.         public long Order { get; set; }
  646.     }
  647.  
  648.     public partial class Metadatum
  649.     {
  650.         [JsonProperty("name")]
  651.         public string Name { get; set; }
  652.  
  653.         [JsonProperty("values")]
  654.         public string[] Values { get; set; }
  655.     }
  656.  
  657.     public partial class Promomedia
  658.     {
  659.         [JsonProperty("id")]
  660.         public long Id { get; set; }
  661.  
  662.         [JsonProperty("key")]
  663.         public string Key { get; set; }
  664.  
  665.         [JsonProperty("type")]
  666.         public long Type { get; set; }
  667.  
  668.         [JsonProperty("url")]
  669.         public Uri Url { get; set; }
  670.     }
  671.  
  672.     public partial class Relationship
  673.     {
  674.         [JsonProperty("count")]
  675.         public long Count { get; set; }
  676.  
  677.         [JsonProperty("id")]
  678.         public string Id { get; set; }
  679.  
  680.         [JsonProperty("key_name")]
  681.         public string KeyName { get; set; }
  682.  
  683.         [JsonProperty("name")]
  684.         public string Name { get; set; }
  685.  
  686.         [JsonProperty("url")]
  687.         public Uri Url { get; set; }
  688.     }
  689.  
  690.     public partial class StarRating
  691.     {
  692.         [JsonProperty("total")]
  693.         public long Total { get; set; }
  694.  
  695.         [JsonProperty("score")]
  696.         public string Score { get; set; }
  697.  
  698.         [JsonProperty("count")]
  699.         public Count[] Count { get; set; }
  700.     }
  701.  
  702.     public partial class Count
  703.     {
  704.         [JsonProperty("star")]
  705.         public long Star { get; set; }
  706.  
  707.         [JsonProperty("count")]
  708.         public long CountCount { get; set; }
  709.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement