fromJson static method
Returns a new EndpointsUpdate instance and imports its values from
value if it's a Map, null otherwise.
Implementation
// ignore: prefer_constructors_over_static_methods
static EndpointsUpdate? fromJson(dynamic value) {
if (value is Map) {
final json = value.cast<String, dynamic>();
// Ensure that the map contains the required keys.
// Note 1: the values aren't checked for validity beyond being non-null.
// Note 2: this code is stripped in release mode!
assert(() {
return true;
}());
return EndpointsUpdate(
dateCreated: mapDateTime(json, r'date_created', r''),
lastUpdated: mapDateTime(json, r'last_updated', r''),
userId: mapValueOfType<String>(json, r'user_id'),
companyId: mapValueOfType<String>(json, r'company_id'),
connectionId: mapValueOfType<String>(json, r'connection_id'),
industryId: mapValueOfType<int>(json, r'industry_id'),
aucId: mapValueOfType<int>(json, r'auc_id'),
approvalStatus: EndpointsUpdateApprovalStatusEnum.fromJson(json[r'approval_status']),
approvedByUserId: mapValueOfType<String>(json, r'approved_by_user_id'),
approvedAt: mapDateTime(json, r'approved_at', r''),
sellInMarketplace: mapValueOfType<bool>(json, r'sell_in_marketplace'),
name: mapValueOfType<String>(json, r'name'),
slug: mapValueOfType<String>(json, r'slug'),
description: mapValueOfType<String>(json, r'description'),
detailedDescription: mapValueOfType<String>(json, r'detailed_description'),
topQuestions: mapValueOfType<String>(json, r'top_questions'),
sourceSchemaName: mapValueOfType<String>(json, r'source_schema_name'),
sourceTableName: mapValueOfType<String>(json, r'source_table_name'),
customerName: mapValueOfType<String>(json, r'customer_name'),
endpointSchema: mapValueOfType<Object>(json, r'endpoint_schema'),
rateLimitNumber: mapValueOfType<int>(json, r'rate_limit_number'),
rateLimitPeriod: EndpointsUpdateRateLimitPeriodEnum.fromJson(json[r'rate_limit_period']),
rateLimitGranularity: EndpointsUpdateRateLimitGranularityEnum.fromJson(json[r'rate_limit_granularity']),
accessMethod: EndpointsUpdateAccessMethodEnum.fromJson(json[r'access_method']),
accessWhitelist: mapValueOfType<Object>(json, r'access_whitelist'),
status: EndpointsUpdateStatusEnum.fromJson(json[r'status']),
dataTimePeriodStart: mapDateTime(json, r'data_time_period_start', r''),
dataTimePeriodEnd: mapDateTime(json, r'data_time_period_end', r''),
dateCollectionStart: mapDateTime(json, r'date_collection_start', r''),
geographicCoverageType: EndpointsUpdateGeographicCoverageTypeEnum.fromJson(json[r'geographic_coverage_type']),
geographicCoverageDetails: mapValueOfType<String>(json, r'geographic_coverage_details'),
dataSourceRefreshFrequency: EndpointsUpdateDataSourceRefreshFrequencyEnum.fromJson(json[r'data_source_refresh_frequency']),
tags: mapValueOfType<String>(json, r'tags'),
lastAccessed: mapDateTime(json, r'last_accessed', r''),
maxRecordsPerRequest: mapValueOfType<int>(json, r'max_records_per_request'),
exportEnabled: mapValueOfType<bool>(json, r'export_enabled'),
maxRecordsPerExport: mapValueOfType<int>(json, r'max_records_per_export'),
sampleResponse: mapValueOfType<Object>(json, r'sample_response'),
active: mapValueOfType<bool>(json, r'active'),
);
}
return null;
}