/// <summary> /// Parse the given JSON representation of an charge detail record token. /// </summary> /// <param name="JSON">The JSON to parse.</param> /// <param name="CustomCDRTokenParser">A delegate to parse custom charge detail record token JSON objects.</param> public static CDRToken Parse(JObject JSON, CustomJObjectParserDelegate <CDRToken> CustomCDRTokenParser = null) { if (TryParse(JSON, out CDRToken cdrToken, out String ErrorResponse, CustomCDRTokenParser)) { return(cdrToken); } throw new ArgumentException("The given JSON representation of an charge detail record token is invalid: " + ErrorResponse, nameof(JSON)); }
/// <summary> /// Parse the given text representation of a clear profile result. /// </summary> /// <param name="Text">The text to parse.</param> /// <param name="CustomClearProfileResultParser">A delegate to parse custom clear profile result JSON objects.</param> public static ClearProfileResult Parse(String Text, CustomJObjectParserDelegate <ClearProfileResult> CustomClearProfileResultParser = null) { if (TryParse(Text, out ClearProfileResult ClearProfileResult, out String ErrorResponse, CustomClearProfileResultParser)) { return(ClearProfileResult); } throw new ArgumentException("The given text representation of a clear profile result is invalid: " + ErrorResponse, nameof(Text)); }
/// <summary> /// Parse the given JSON representation of a charging profile. /// </summary> /// <param name="JSON">The JSON to be parsed.</param> /// <param name="CustomChargingProfileParser">A delegate to parse custom charging profiles.</param> public static ChargingProfile Parse(JObject JSON, CustomJObjectParserDelegate <ChargingProfile> CustomChargingProfileParser = null) { if (TryParse(JSON, out ChargingProfile chargingProfile, out String ErrorResponse, CustomChargingProfileParser)) { return(chargingProfile); } throw new ArgumentException("The given JSON representation of a charging profile is invalid: " + ErrorResponse, nameof(JSON)); }
// https://github.com/hubject/oicp/blob/master/OICP-2.3/OICP%202.3%20CPO/03_CPO_Data_Types.asciidoc#PeriodType // { // "begin": "08:00", // "end": "19:30" // } #endregion #region (static) Parse (JSON, CustomPeriodParser = null) /// <summary> /// Parse the given JSON representation of a time period. /// </summary> /// <param name="JSON">The JSON to parse.</param> /// <param name="CustomPeriodParser">A delegate to parse custom time periods JSON objects.</param> public static Period Parse(JObject JSON, CustomJObjectParserDelegate <Period> CustomPeriodParser = null) { if (TryParse(JSON, out Period period, out String ErrorResponse, CustomPeriodParser)) { return(period); } throw new ArgumentException("The given JSON representation of a time period is invalid: " + ErrorResponse, nameof(JSON)); }
/// <summary> /// Parse the given text representation of an opening time. /// </summary> /// <param name="Text">The text to parse.</param> /// <param name="CustomOpeningTimesParser">A delegate to parse custom opening times JSON objects.</param> public static OpeningTime Parse(String Text, CustomJObjectParserDelegate <OpeningTime> CustomOpeningTimesParser = null) { if (TryParse(Text, out OpeningTime openingTime, out String ErrorResponse, CustomOpeningTimesParser)) { return(openingTime); } throw new ArgumentException("The given text representation of an opening time is invalid: " + ErrorResponse, nameof(Text)); }
/// <summary> /// Parse the given text representation of an energy mix. /// </summary> /// <param name="Text">The text to parse.</param> /// <param name="CustomEnergyMixParser">A delegate to parse custom energy mix JSON objects.</param> public static EnergyMix Parse(String Text, CustomJObjectParserDelegate <EnergyMix> CustomEnergyMixParser = null) { if (TryParse(Text, out EnergyMix energyMix, out String ErrorResponse, CustomEnergyMixParser)) { return(energyMix); } throw new ArgumentException("The given text representation of an energy mix is invalid: " + ErrorResponse, nameof(Text)); }
/// <summary> /// Parse the given text representation of a PullEVSEStatusByOperatorId request. /// </summary> /// <param name="Text">The text to parse.</param> /// <param name="CustomPullEVSEStatusByOperatorIdRequestParser">A delegate to parse custom PullEVSEStatusByOperatorId request JSON objects.</param> public static PullEVSEStatusByOperatorIdRequest Parse(String Text, CustomJObjectParserDelegate <PullEVSEStatusByOperatorIdRequest> CustomPullEVSEStatusByOperatorIdRequestParser = null) { if (TryParse(Text, out PullEVSEStatusByOperatorIdRequest pullEVSEStatusResponse, out String ErrorResponse, CustomPullEVSEStatusByOperatorIdRequestParser)) { return(pullEVSEStatusResponse); } throw new ArgumentException("The given text representation of a PullEVSEStatusByOperatorId request is invalid: " + ErrorResponse, nameof(Text)); }
/// <summary> /// Parse the given JSON representation of a hour. /// </summary> /// <param name="JSON">The JSON to parse.</param> /// <param name="CustomEnvironmentalImpactParser">A delegate to parse custom environmental impact JSON objects.</param> public static EnvironmentalImpact Parse(JObject JSON, CustomJObjectParserDelegate <EnvironmentalImpact> CustomEnvironmentalImpactParser = null) { if (TryParse(JSON, out EnvironmentalImpact energySource, out String ErrorResponse, CustomEnvironmentalImpactParser)) { return(energySource); } throw new ArgumentException("The given JSON representation of a hour is invalid: " + ErrorResponse, nameof(JSON)); }
/// <summary> /// Parse the given JSON representation of a business detail. /// </summary> /// <param name="JSON">The JSON to parse.</param> /// <param name="CustomBusinessDetailsParser">A delegate to parse custom business details JSON objects.</param> public static BusinessDetails Parse(JObject JSON, CustomJObjectParserDelegate <BusinessDetails> CustomBusinessDetailsParser = null) { if (TryParse(JSON, out BusinessDetails businessDetails, out String ErrorResponse, CustomBusinessDetailsParser)) { return(businessDetails); } throw new ArgumentException("The given JSON representation of a business detail is invalid: " + ErrorResponse, nameof(JSON)); }
/// <summary> /// Parse the given text representation of an exceptional period. /// </summary> /// <param name="Text">The text to parse.</param> /// <param name="CustomExceptionalPeriodParser">A delegate to parse custom exceptional period JSON objects.</param> public static ExceptionalPeriod Parse(String Text, CustomJObjectParserDelegate <ExceptionalPeriod> CustomExceptionalPeriodParser = null) { if (TryParse(Text, out ExceptionalPeriod exceptionalPeriod, out String ErrorResponse, CustomExceptionalPeriodParser)) { return(exceptionalPeriod); } throw new ArgumentException("The given text representation of an exceptional period is invalid: " + ErrorResponse, nameof(Text)); }
/// <summary> /// Parse the given text representation of a charge detail record location. /// </summary> /// <param name="Text">The text to parse.</param> /// <param name="CustomCDRLocationParser">A delegate to parse custom location JSON objects.</param> public static CDRLocation Parse(String Text, CustomJObjectParserDelegate <CDRLocation> CustomCDRLocationParser = null) { if (TryParse(Text, out CDRLocation location, out String ErrorResponse, CustomCDRLocationParser)) { return(location); } throw new ArgumentException("The given text representation of a location is invalid: " + ErrorResponse, nameof(Text)); }
/// <summary> /// Parse the given text representation of a client info. /// </summary> /// <param name="Text">The text to parse.</param> /// <param name="CustomClientInfoParser">A delegate to parse custom energy contract JSON objects.</param> public static ClientInfo Parse(String Text, CustomJObjectParserDelegate <ClientInfo> CustomClientInfoParser = null) { if (TryParse(Text, out ClientInfo clientInfo, out String ErrorResponse, CustomClientInfoParser)) { return(clientInfo); } throw new ArgumentException("The given text representation of a client info is invalid: " + ErrorResponse, nameof(Text)); }
/// <summary> /// Parse the given JSON representation of a status schedule. /// </summary> /// <param name="JSON">The JSON to parse.</param> /// <param name="CustomStatusScheduleParser">A delegate to parse custom status schedule JSON objects.</param> public static StatusSchedule Parse(JObject JSON, CustomJObjectParserDelegate <StatusSchedule> CustomStatusScheduleParser = null) { if (TryParse(JSON, out StatusSchedule statusSchedule, out String ErrorResponse, CustomStatusScheduleParser)) { return(statusSchedule); } throw new ArgumentException("The given JSON representation of a status schedule is invalid: " + ErrorResponse, nameof(JSON)); }
/// <summary> /// Parse the given text representation of a status code. /// </summary> /// <param name="Text">The text to parse.</param> /// <param name="CustomStatusCodeParser">A delegate to parse custom status codes JSON objects.</param> public static StatusCode Parse(String Text, CustomJObjectParserDelegate <StatusCode> CustomStatusCodeParser = null) { if (TryParse(Text, out StatusCode statusCode, out String ErrorResponse, CustomStatusCodeParser)) { return(statusCode); } throw new ArgumentException("The given text representation of a status code is invalid: " + ErrorResponse, nameof(Text)); }
/// <summary> /// Parse the given JSON representation of an energy meter. /// </summary> /// <param name="JSON">The JSON to parse.</param> /// <param name="CustomEnergyMeterParser">A delegate to parse custom energy meter JSON objects.</param> public static EnergyMeter Parse(JObject JSON, CustomJObjectParserDelegate <EnergyMeter> CustomEnergyMeterParser = null) { if (TryParse(JSON, out EnergyMeter energyMeter, out String ErrorResponse, CustomEnergyMeterParser)) { return(energyMeter); } throw new ArgumentException("The given JSON representation of an energy meter is invalid: " + ErrorResponse, nameof(JSON)); }
/// <summary> /// Parse the given text representation of an authorization information. /// </summary> /// <param name="Text">The text to parse.</param> /// <param name="CustomAuthorizationInfoParser">A delegate to parse custom authorization information JSON objects.</param> public static AuthorizationInfo Parse(String Text, CustomJObjectParserDelegate <AuthorizationInfo> CustomAuthorizationInfoParser = null) { if (TryParse(Text, out AuthorizationInfo authorizationInfo, out String ErrorResponse, CustomAuthorizationInfoParser)) { return(authorizationInfo); } throw new ArgumentException("The given text representation of an authorization information is invalid: " + ErrorResponse, nameof(Text)); }
/// <summary> /// Parse the given text representation of an image. /// </summary> /// <param name="Text">The text to parse.</param> /// <param name="CustomImageParser">A delegate to parse custom images JSON objects.</param> public static Image Parse(String Text, CustomJObjectParserDelegate <Image> CustomImageParser = null) { if (TryParse(Text, out Image additionalGeoLocation, out String ErrorResponse, CustomImageParser)) { return(additionalGeoLocation); } throw new ArgumentException("The given text representation of an image is invalid: " + ErrorResponse, nameof(Text)); }
/// <summary> /// Parse the given JSON representation of an 'unlock connector' command. /// </summary> /// <param name="JSON">The JSON to parse.</param> /// <param name="CustomUnlockConnectorCommandParser">A delegate to parse custom 'unlock connector' command JSON objects.</param> public static UnlockConnectorCommand Parse(JObject JSON, CustomJObjectParserDelegate <UnlockConnectorCommand> CustomUnlockConnectorCommandParser = null) { if (TryParse(JSON, out UnlockConnectorCommand unlockConnectorCommand, out String ErrorResponse, CustomUnlockConnectorCommandParser)) { return(unlockConnectorCommand); } throw new ArgumentException("The given JSON representation of an 'unlock connector' command is invalid: " + ErrorResponse, nameof(JSON)); }
/// <summary> /// Parse the given JSON representation of a meter value. /// </summary> /// <param name="JSON">The JSON to be parsed.</param> /// <param name="CustomMeterValueParser">A delegate to parse custom MeterValues.</param> public static MeterValue Parse(JObject JSON, CustomJObjectParserDelegate <MeterValue> CustomMeterValueParser = null) { if (TryParse(JSON, out MeterValue meterValue, out String ErrorResponse, CustomMeterValueParser)) { return(meterValue); } throw new ArgumentException("The given JSON representation of a MeterValue is invalid: " + ErrorResponse, nameof(JSON)); }
/// <summary> /// Parse the given text representation of a tariff element. /// </summary> /// <param name="Text">The text to parse.</param> /// <param name="CustomTariffElementParser">A delegate to parse custom tariff element JSON objects.</param> public static TariffElement Parse(String Text, CustomJObjectParserDelegate <TariffElement> CustomTariffElementParser = null) { if (TryParse(Text, out TariffElement tariffElement, out String ErrorResponse, CustomTariffElementParser)) { return(tariffElement); } throw new ArgumentException("The given text representation of a tariff element is invalid: " + ErrorResponse, nameof(Text)); }
/// <summary> /// Parse the given JSON representation of a 'stop session' command. /// </summary> /// <param name="JSON">The JSON to parse.</param> /// <param name="CustomStopSessionCommandParser">A delegate to parse custom 'stop session' command JSON objects.</param> public static StopSessionCommand Parse(JObject JSON, CustomJObjectParserDelegate <StopSessionCommand> CustomStopSessionCommandParser = null) { if (TryParse(JSON, out StopSessionCommand stopSessionCommand, out String ErrorResponse, CustomStopSessionCommandParser)) { return(stopSessionCommand); } throw new ArgumentException("The given JSON representation of a 'stop session' command is invalid: " + ErrorResponse, nameof(JSON)); }
/// <summary> /// Parse the given text representation of an active charging profile. /// </summary> /// <param name="Text">The text to parse.</param> /// <param name="CustomActiveChargingProfileParser">A delegate to parse custom active charging profile JSON objects.</param> public static ActiveChargingProfile Parse(String Text, CustomJObjectParserDelegate <ActiveChargingProfile> CustomActiveChargingProfileParser = null) { if (TryParse(Text, out ActiveChargingProfile activeChargingProfile, out String ErrorResponse, CustomActiveChargingProfileParser)) { return(activeChargingProfile); } throw new ArgumentException("The given text representation of an active charging profile is invalid: " + ErrorResponse, nameof(Text)); }
/// <summary> /// Parse the given JSON representation of a version detail. /// </summary> /// <param name="JSON">The JSON to parse.</param> /// <param name="CustomVersionDetailParser">A delegate to parse custom version detail JSON objects.</param> public static VersionDetail Parse(JObject JSON, CustomJObjectParserDelegate <VersionDetail> CustomVersionDetailParser = null) { if (TryParse(JSON, out VersionDetail versionDetail, out String ErrorResponse, CustomVersionDetailParser)) { return(versionDetail); } throw new ArgumentException("The given JSON representation of a version detail is invalid: " + ErrorResponse, nameof(JSON)); }
/// <summary> /// Parse the given text representation of an 'reserve now' command. /// </summary> /// <param name="Text">The text to parse.</param> /// <param name="CustomReserveNowCommandParser">A delegate to parse custom 'reserve now' command JSON objects.</param> public static ReserveNowCommand Parse(String Text, CustomJObjectParserDelegate <ReserveNowCommand> CustomReserveNowCommandParser = null) { if (TryParse(Text, out ReserveNowCommand unlockConnectorCommand, out String ErrorResponse, CustomReserveNowCommandParser)) { return(unlockConnectorCommand); } throw new ArgumentException("The given text representation of an 'reserve now' command is invalid: " + ErrorResponse, nameof(Text)); }
/// <summary> /// Parse the given JSON representation of a regular hour. /// </summary> /// <param name="JSON">The JSON to parse.</param> /// <param name="CustomRegularHoursParser">A delegate to parse custom regular hour JSON objects.</param> public static RegularHours Parse(JObject JSON, CustomJObjectParserDelegate <RegularHours> CustomRegularHoursParser = null) { if (TryParse(JSON, out RegularHours regularHours, out String ErrorResponse, CustomRegularHoursParser)) { return(regularHours); } throw new ArgumentException("The given JSON representation of a regular hour is invalid: " + ErrorResponse, nameof(JSON)); }
/// <summary> /// Parse the given JSON representation of a 'set charging profile' command. /// </summary> /// <param name="JSON">The JSON to parse.</param> /// <param name="CustomSetChargingProfileParserCommand">A delegate to parse custom 'set charging profile' command JSON objects.</param> public static SetChargingProfileCommand Parse(JObject JSON, CustomJObjectParserDelegate <SetChargingProfileCommand> CustomSetChargingProfileParserCommand = null) { if (TryParse(JSON, out SetChargingProfileCommand setChargingProfileCommand, out String ErrorResponse, CustomSetChargingProfileParserCommand)) { return(setChargingProfileCommand); } throw new ArgumentException("The given JSON representation of a 'set charging profile' command is invalid: " + ErrorResponse, nameof(JSON)); }
/// <summary> /// Parse the given text representation of a credentials role. /// </summary> /// <param name="Text">The text to parse.</param> /// <param name="CustomCredentialsRoleParser">A delegate to parse custom credentials role JSON objects.</param> public static CredentialsRole Parse(String Text, CustomJObjectParserDelegate <CredentialsRole> CustomCredentialsRoleParser = null) { if (TryParse(Text, out CredentialsRole credentialsRole, out String ErrorResponse, CustomCredentialsRoleParser)) { return(credentialsRole); } throw new ArgumentException("The given text representation of a credentials role is invalid: " + ErrorResponse, nameof(Text)); }
/// <summary> /// Parse the given JSON representation of a first response. /// </summary> /// <param name="JSON">The JSON to parse.</param> /// <param name="CustomFirstResponseParser">A delegate to parse custom first response JSON objects.</param> public static FirstResponse Parse(JObject JSON, CustomJObjectParserDelegate <FirstResponse> CustomFirstResponseParser = null) { if (TryParse(JSON, out FirstResponse firstResponse, out String ErrorResponse, CustomFirstResponseParser)) { return(firstResponse); } throw new ArgumentException("The given JSON representation of a first response is invalid: " + ErrorResponse, nameof(JSON)); }
/// <summary> /// Parse the given JSON representation of an active charging profile result. /// </summary> /// <param name="JSON">The JSON to parse.</param> /// <param name="CustomActiveChargingProfileResultParser">A delegate to parse custom active charging profile result JSON objects.</param> public static ActiveChargingProfileResult Parse(JObject JSON, CustomJObjectParserDelegate <ActiveChargingProfileResult> CustomActiveChargingProfileResultParser = null) { if (TryParse(JSON, out ActiveChargingProfileResult activeChargingProfileResult, out String ErrorResponse, CustomActiveChargingProfileResultParser)) { return(activeChargingProfileResult); } throw new ArgumentException("The given JSON representation of an active charging profile result is invalid: " + ErrorResponse, nameof(JSON)); }
/// <summary> /// Parse the given text representation of a charging profile period. /// </summary> /// <param name="Text">The text to parse.</param> /// <param name="CustomChargingProfilePeriodParser">A delegate to parse custom charging profile period JSON objects.</param> public static ChargingProfilePeriod Parse(String Text, CustomJObjectParserDelegate <ChargingProfilePeriod> CustomChargingProfilePeriodParser = null) { if (TryParse(Text, out ChargingProfilePeriod chargingProfilePeriod, out String ErrorResponse, CustomChargingProfilePeriodParser)) { return(chargingProfilePeriod); } throw new ArgumentException("The given text representation of a charging profile period is invalid: " + ErrorResponse, nameof(Text)); }