Class: Schematic::Internal::Types::Model Abstract

Inherits:
Object
  • Object
show all
Includes:
Type
Defined in:
lib/schematic/internal/types/model.rb,
lib/schematic/internal/types/model/field.rb

Overview

This class is abstract.

An abstract model that all data objects will inherit from

Direct Known Subclasses

Accesstokens::Types::IssueTemporaryAccessTokenRequestBody, Accesstokens::Types::IssueTemporaryAccessTokenResponse, Accounts::Types::CountApiKeysParams, Accounts::Types::CountApiKeysRequest, Accounts::Types::CountApiKeysResponse, Accounts::Types::CountAuditLogsParams, Accounts::Types::CountAuditLogsRequest, Accounts::Types::CountAuditLogsResponse, Accounts::Types::CreateApiKeyRequestBody, Accounts::Types::CreateApiKeyResponse, Accounts::Types::CreateEnvironmentRequestBody, Accounts::Types::CreateEnvironmentResponse, Accounts::Types::DeleteApiKeyResponse, Accounts::Types::DeleteEnvironmentResponse, Accounts::Types::GetAccountMemberResponse, Accounts::Types::GetApiKeyResponse, Accounts::Types::GetAuditLogResponse, Accounts::Types::GetEnvironmentResponse, Accounts::Types::GetWhoAmIResponse, Accounts::Types::ListAccountMembersParams, Accounts::Types::ListAccountMembersRequest, Accounts::Types::ListAccountMembersResponse, Accounts::Types::ListApiKeysParams, Accounts::Types::ListApiKeysRequest, Accounts::Types::ListApiKeysResponse, Accounts::Types::ListAuditLogsParams, Accounts::Types::ListAuditLogsRequest, Accounts::Types::ListAuditLogsResponse, Accounts::Types::ListEnvironmentsParams, Accounts::Types::ListEnvironmentsRequest, Accounts::Types::ListEnvironmentsResponse, Accounts::Types::QuickstartResponse, Accounts::Types::UpdateApiKeyRequestBody, Accounts::Types::UpdateApiKeyResponse, Accounts::Types::UpdateEnvironmentRequestBody, Accounts::Types::UpdateEnvironmentResponse, Billing::Types::CountBillingProductsParams, Billing::Types::CountBillingProductsRequest, Billing::Types::CountBillingProductsResponse, Billing::Types::CountCustomersParams, Billing::Types::CountCustomersRequest, Billing::Types::CountCustomersResponse, Billing::Types::CreateBillingCustomerRequestBody, Billing::Types::CreateBillingPriceRequestBody, Billing::Types::CreateBillingProductRequestBody, Billing::Types::CreateBillingSubscriptionRequestBody, Billing::Types::CreateCouponRequestBody, Billing::Types::CreateInvoiceRequestBody, Billing::Types::CreateMeterRequestBody, Billing::Types::CreatePaymentMethodRequestBody, Billing::Types::DeleteBillingProductResponse, Billing::Types::DeleteProductPriceResponse, Billing::Types::ListBillingPricesParams, Billing::Types::ListBillingPricesRequest, Billing::Types::ListBillingPricesResponse, Billing::Types::ListBillingProductPricesParams, Billing::Types::ListBillingProductPricesRequest, Billing::Types::ListBillingProductPricesResponse, Billing::Types::ListBillingProductsParams, Billing::Types::ListBillingProductsRequest, Billing::Types::ListBillingProductsResponse, Billing::Types::ListCouponsParams, Billing::Types::ListCouponsRequest, Billing::Types::ListCouponsResponse, Billing::Types::ListCustomersWithSubscriptionsParams, Billing::Types::ListCustomersWithSubscriptionsRequest, Billing::Types::ListCustomersWithSubscriptionsResponse, Billing::Types::ListInvoicesParams, Billing::Types::ListInvoicesRequest, Billing::Types::ListInvoicesResponse, Billing::Types::ListMetersParams, Billing::Types::ListMetersRequest, Billing::Types::ListMetersResponse, Billing::Types::ListPaymentMethodsParams, Billing::Types::ListPaymentMethodsRequest, Billing::Types::ListPaymentMethodsResponse, Billing::Types::UpsertBillingCouponResponse, Billing::Types::UpsertBillingCustomerResponse, Billing::Types::UpsertBillingMeterResponse, Billing::Types::UpsertBillingPriceResponse, Billing::Types::UpsertBillingProductResponse, Billing::Types::UpsertBillingSubscriptionResponse, Billing::Types::UpsertInvoiceResponse, Billing::Types::UpsertPaymentMethodResponse, Checkout::Types::CancelSubscriptionRequest, Checkout::Types::CancelSubscriptionResponse, Checkout::Types::CheckoutDataRequestBody, Checkout::Types::CheckoutInternalResponse, Checkout::Types::GetCheckoutDataResponse, Checkout::Types::ManagePlanResponse, Checkout::Types::PreviewCheckoutInternalResponse, Checkout::Types::PreviewManagePlanResponse, Checkout::Types::UpdateCustomerSubscriptionTrialEndResponse, Checkout::Types::UpdateTrialEndRequestBody, Companies::Types::CountCompaniesParams, Companies::Types::CountCompaniesRequest, Companies::Types::CountCompaniesResponse, Companies::Types::CountEntityKeyDefinitionsParams, Companies::Types::CountEntityKeyDefinitionsRequest, Companies::Types::CountEntityKeyDefinitionsResponse, Companies::Types::CountEntityTraitDefinitionsParams, Companies::Types::CountEntityTraitDefinitionsRequest, Companies::Types::CountEntityTraitDefinitionsResponse, Companies::Types::CountPlanTraitsParams, Companies::Types::CountPlanTraitsRequest, Companies::Types::CountPlanTraitsResponse, Companies::Types::CountUsersParams, Companies::Types::CountUsersRequest, Companies::Types::CountUsersResponse, Companies::Types::CreateCompanyResponse, Companies::Types::CreateEntityTraitDefinitionRequestBody, Companies::Types::CreateUserResponse, Companies::Types::DeleteCompanyByKeysResponse, Companies::Types::DeleteCompanyMembershipResponse, Companies::Types::DeleteCompanyParams, Companies::Types::DeleteCompanyRequest, Companies::Types::DeleteCompanyResponse, Companies::Types::DeleteUserByKeysResponse, Companies::Types::DeleteUserResponse, Companies::Types::GetActiveCompanySubscriptionParams, Companies::Types::GetActiveCompanySubscriptionRequest, Companies::Types::GetActiveCompanySubscriptionResponse, Companies::Types::GetCompanyResponse, Companies::Types::GetEntityTraitDefinitionResponse, Companies::Types::GetEntityTraitValuesParams, Companies::Types::GetEntityTraitValuesRequest, Companies::Types::GetEntityTraitValuesResponse, Companies::Types::GetOrCreateCompanyMembershipRequestBody, Companies::Types::GetOrCreateCompanyMembershipResponse, Companies::Types::GetOrCreateEntityTraitDefinitionResponse, Companies::Types::GetPlanChangeResponse, Companies::Types::GetPlanTraitResponse, Companies::Types::GetUserResponse, Companies::Types::ListCompaniesParams, Companies::Types::ListCompaniesRequest, Companies::Types::ListCompaniesResponse, Companies::Types::ListCompanyMembershipsParams, Companies::Types::ListCompanyMembershipsRequest, Companies::Types::ListCompanyMembershipsResponse, Companies::Types::ListEntityKeyDefinitionsParams, Companies::Types::ListEntityKeyDefinitionsRequest, Companies::Types::ListEntityKeyDefinitionsResponse, Companies::Types::ListEntityTraitDefinitionsParams, Companies::Types::ListEntityTraitDefinitionsRequest, Companies::Types::ListEntityTraitDefinitionsResponse, Companies::Types::ListPlanChangesParams, Companies::Types::ListPlanChangesRequest, Companies::Types::ListPlanChangesResponse, Companies::Types::ListPlanTraitsParams, Companies::Types::ListPlanTraitsRequest, Companies::Types::ListPlanTraitsResponse, Companies::Types::ListUsersParams, Companies::Types::ListUsersRequest, Companies::Types::ListUsersResponse, Companies::Types::LookupCompanyParams, Companies::Types::LookupCompanyRequest, Companies::Types::LookupCompanyResponse, Companies::Types::LookupUserParams, Companies::Types::LookupUserRequest, Companies::Types::LookupUserResponse, Companies::Types::UpdateEntityTraitDefinitionRequestBody, Companies::Types::UpdateEntityTraitDefinitionResponse, Companies::Types::UpdatePlanTraitBulkRequestBody, Companies::Types::UpdatePlanTraitsBulkResponse, Companies::Types::UpsertCompanyResponse, Companies::Types::UpsertCompanyTraitResponse, Companies::Types::UpsertUserResponse, Companies::Types::UpsertUserTraitResponse, Components::Types::CountComponentsParams, Components::Types::CountComponentsRequest, Components::Types::CountComponentsResponse, Components::Types::CreateComponentRequestBody, Components::Types::CreateComponentResponse, Components::Types::DeleteComponentResponse, Components::Types::GetComponentResponse, Components::Types::ListComponentsParams, Components::Types::ListComponentsRequest, Components::Types::ListComponentsResponse, Components::Types::PreviewComponentDataParams, Components::Types::PreviewComponentDataRequest, Components::Types::PreviewComponentDataResponse, Components::Types::UpdateComponentRequestBody, Components::Types::UpdateComponentResponse, Componentspublic::Types::GetPublicPlansResponse, Credits::Types::CountBillingCreditsGrantsParams, Credits::Types::CountBillingCreditsGrantsRequest, Credits::Types::CountBillingCreditsGrantsResponse, Credits::Types::CountBillingCreditsParams, Credits::Types::CountBillingCreditsRequest, Credits::Types::CountBillingCreditsResponse, Credits::Types::CountBillingPlanCreditGrantsParams, Credits::Types::CountBillingPlanCreditGrantsRequest, Credits::Types::CountBillingPlanCreditGrantsResponse, Credits::Types::CountCompanyGrantsParams, Credits::Types::CountCompanyGrantsRequest, Credits::Types::CountCompanyGrantsResponse, Credits::Types::CountCreditBundlesParams, Credits::Types::CountCreditBundlesRequest, Credits::Types::CountCreditBundlesResponse, Credits::Types::CountCreditEventLedgerParams, Credits::Types::CountCreditEventLedgerRequest, Credits::Types::CountCreditEventLedgerResponse, Credits::Types::CountCreditLedgerParams, Credits::Types::CountCreditLedgerRequest, Credits::Types::CountCreditLedgerResponse, Credits::Types::CreateBillingCreditRequestBody, Credits::Types::CreateBillingCreditResponse, Credits::Types::CreateBillingPlanCreditGrantResponse, Credits::Types::CreateCompanyCreditGrant, Credits::Types::CreateCreditBundleRequestBody, Credits::Types::CreateCreditBundleResponse, Credits::Types::DeleteBillingPlanCreditGrantParams, Credits::Types::DeleteBillingPlanCreditGrantRequest, Credits::Types::DeleteBillingPlanCreditGrantResponse, Credits::Types::DeleteCreditBundleResponse, Credits::Types::GetCreditBundleResponse, Credits::Types::GetEnrichedCreditLedgerParams, Credits::Types::GetEnrichedCreditLedgerRequest, Credits::Types::GetEnrichedCreditLedgerResponse, Credits::Types::GetSingleBillingCreditResponse, Credits::Types::GetSingleBillingPlanCreditGrantResponse, Credits::Types::GrantBillingCreditsToCompanyResponse, Credits::Types::ListBillingCreditsParams, Credits::Types::ListBillingCreditsRequest, Credits::Types::ListBillingCreditsResponse, Credits::Types::ListBillingPlanCreditGrantsParams, Credits::Types::ListBillingPlanCreditGrantsRequest, Credits::Types::ListBillingPlanCreditGrantsResponse, Credits::Types::ListCompanyCreditBalancesParams, Credits::Types::ListCompanyCreditBalancesRequest, Credits::Types::ListCompanyCreditBalancesResponse, Credits::Types::ListCompanyGrantsParams, Credits::Types::ListCompanyGrantsRequest, Credits::Types::ListCompanyGrantsResponse, Credits::Types::ListCreditBundlesParams, Credits::Types::ListCreditBundlesRequest, Credits::Types::ListCreditBundlesResponse, Credits::Types::ListCreditEventLedgerParams, Credits::Types::ListCreditEventLedgerRequest, Credits::Types::ListCreditEventLedgerResponse, Credits::Types::ListGrantsForCreditParams, Credits::Types::ListGrantsForCreditRequest, Credits::Types::ListGrantsForCreditResponse, Credits::Types::SoftDeleteBillingCreditResponse, Credits::Types::UpdateBillingCreditRequestBody, Credits::Types::UpdateBillingCreditResponse, Credits::Types::UpdateBillingPlanCreditGrantResponse, Credits::Types::UpdateCreditBundleDetailsRequestBody, Credits::Types::UpdateCreditBundleDetailsResponse, Credits::Types::ZeroOutGrantRequestBody, Credits::Types::ZeroOutGrantResponse, Dataexports::Types::CreateDataExportRequestBody, Dataexports::Types::CreateDataExportResponse, Entitlements::Types::CountCompanyOverridesParams, Entitlements::Types::CountCompanyOverridesRequest, Entitlements::Types::CountCompanyOverridesResponse, Entitlements::Types::CountFeatureCompaniesParams, Entitlements::Types::CountFeatureCompaniesRequest, Entitlements::Types::CountFeatureCompaniesResponse, Entitlements::Types::CountFeatureUsageParams, Entitlements::Types::CountFeatureUsageRequest, Entitlements::Types::CountFeatureUsageResponse, Entitlements::Types::CountFeatureUsersParams, Entitlements::Types::CountFeatureUsersRequest, Entitlements::Types::CountFeatureUsersResponse, Entitlements::Types::CountPlanEntitlementsParams, Entitlements::Types::CountPlanEntitlementsRequest, Entitlements::Types::CountPlanEntitlementsResponse, Entitlements::Types::CreateBillingLinkedPlanEntitlementRequestBody, Entitlements::Types::CreateCompanyOverrideRequestBody, Entitlements::Types::CreateCompanyOverrideResponse, Entitlements::Types::CreatePlanEntitlementRequestBody, Entitlements::Types::CreatePlanEntitlementResponse, Entitlements::Types::DeleteCompanyOverrideResponse, Entitlements::Types::DeletePlanEntitlementResponse, Entitlements::Types::DuplicatePlanEntitlementsRequestBody, Entitlements::Types::DuplicatePlanEntitlementsResponse, Entitlements::Types::GetCompanyOverrideResponse, Entitlements::Types::GetFeatureUsageByCompanyParams, Entitlements::Types::GetFeatureUsageByCompanyRequest, Entitlements::Types::GetFeatureUsageByCompanyResponse, Entitlements::Types::GetFeatureUsageTimeSeriesParams, Entitlements::Types::GetFeatureUsageTimeSeriesRequest, Entitlements::Types::GetFeatureUsageTimeSeriesResponse, Entitlements::Types::GetPlanEntitlementResponse, Entitlements::Types::ListCompanyOverridesParams, Entitlements::Types::ListCompanyOverridesRequest, Entitlements::Types::ListCompanyOverridesResponse, Entitlements::Types::ListFeatureCompaniesParams, Entitlements::Types::ListFeatureCompaniesRequest, Entitlements::Types::ListFeatureCompaniesResponse, Entitlements::Types::ListFeatureUsageParams, Entitlements::Types::ListFeatureUsageRequest, Entitlements::Types::ListFeatureUsageResponse, Entitlements::Types::ListFeatureUsersParams, Entitlements::Types::ListFeatureUsersRequest, Entitlements::Types::ListFeatureUsersResponse, Entitlements::Types::ListPlanEntitlementsParams, Entitlements::Types::ListPlanEntitlementsRequest, Entitlements::Types::ListPlanEntitlementsResponse, Entitlements::Types::UpdateCompanyOverrideRequestBody, Entitlements::Types::UpdateCompanyOverrideResponse, Entitlements::Types::UpdatePlanEntitlementRequestBody, Entitlements::Types::UpdatePlanEntitlementResponse, Entitlements::Types::UpsertPlanEntitlementForBillingProductResponse, Events::Types::CreateEventBatchRequestBody, Events::Types::CreateEventBatchResponse, Events::Types::CreateEventResponse, Events::Types::GetEventResponse, Events::Types::GetEventSummariesParams, Events::Types::GetEventSummariesRequest, Events::Types::GetEventSummariesResponse, Events::Types::GetSegmentIntegrationStatusResponse, Events::Types::ListEventsParams, Events::Types::ListEventsRequest, Events::Types::ListEventsResponse, Features::Types::CheckFlagResponse, Features::Types::CheckFlagsBulkRequestBody, Features::Types::CheckFlagsBulkResponse, Features::Types::CheckFlagsResponse, Features::Types::CountFeaturesParams, Features::Types::CountFeaturesRequest, Features::Types::CountFeaturesResponse, Features::Types::CountFlagsParams, Features::Types::CountFlagsRequest, Features::Types::CountFlagsResponse, Features::Types::CreateBillingLinkedFeatureRequestBody, Features::Types::CreateFeatureRequestBody, Features::Types::CreateFeatureResponse, Features::Types::CreateFlagResponse, Features::Types::DeleteFeatureResponse, Features::Types::DeleteFlagResponse, Features::Types::GetFeatureResponse, Features::Types::GetFlagResponse, Features::Types::ListFeaturesParams, Features::Types::ListFeaturesRequest, Features::Types::ListFeaturesResponse, Features::Types::ListFlagsParams, Features::Types::ListFlagsRequest, Features::Types::ListFlagsResponse, Features::Types::UpdateFeatureRequestBody, Features::Types::UpdateFeatureResponse, Features::Types::UpdateFlagResponse, Features::Types::UpdateFlagRulesRequestBody, Features::Types::UpdateFlagRulesResponse, Features::Types::UpsertFeatureForBillingProductResponse, Schematic::Insights::Types::GetActivityParams, Schematic::Insights::Types::GetActivityRequest, Schematic::Insights::Types::GetActivityResponse, Schematic::Insights::Types::GetEnvironmentFeatureUsageTimeSeriesParams, Schematic::Insights::Types::GetEnvironmentFeatureUsageTimeSeriesRequest, Schematic::Insights::Types::GetEnvironmentFeatureUsageTimeSeriesResponse, Schematic::Insights::Types::GetEnvironmentTraitUsageTimeSeriesParams, Schematic::Insights::Types::GetEnvironmentTraitUsageTimeSeriesRequest, Schematic::Insights::Types::GetEnvironmentTraitUsageTimeSeriesResponse, Schematic::Insights::Types::GetPlanGrowthParams, Schematic::Insights::Types::GetPlanGrowthRequest, Schematic::Insights::Types::GetPlanGrowthResponse, Schematic::Insights::Types::GetSummaryResponse, Schematic::Insights::Types::GetTopFeaturesByUsageParams, Schematic::Insights::Types::GetTopFeaturesByUsageRequest, Schematic::Insights::Types::GetTopFeaturesByUsageResponse, Schematic::Integrationsapi::Types::GetIntegrationWebhookUrlResponse, Planbundle::Types::CreatePlanBundleRequestBody, Planbundle::Types::CreatePlanBundleResponse, Planbundle::Types::UpdatePlanBundleRequestBody, Planbundle::Types::UpdatePlanBundleResponse, Plangroups::Types::CreatePlanGroupRequestBody, Plangroups::Types::CreatePlanGroupResponse, Plangroups::Types::GetPlanGroupParams, Plangroups::Types::GetPlanGroupRequest, Plangroups::Types::GetPlanGroupResponse, Plangroups::Types::UpdatePlanGroupRequestBody, Plangroups::Types::UpdatePlanGroupResponse, Planmigrations::Types::CountCompanyMigrationsParams, Planmigrations::Types::CountCompanyMigrationsRequest, Planmigrations::Types::CountCompanyMigrationsResponse, Planmigrations::Types::CountMigrationsParams, Planmigrations::Types::CountMigrationsRequest, Planmigrations::Types::CountMigrationsResponse, Planmigrations::Types::GetMigrationResponse, Planmigrations::Types::ListCompanyMigrationsParams, Planmigrations::Types::ListCompanyMigrationsRequest, Planmigrations::Types::ListCompanyMigrationsResponse, Planmigrations::Types::ListMigrationsParams, Planmigrations::Types::ListMigrationsRequest, Planmigrations::Types::ListMigrationsResponse, Plans::Types::CountBillingProductMatchCompaniesParams, Plans::Types::CountBillingProductMatchCompaniesRequest, Plans::Types::CountBillingProductMatchCompaniesResponse, Plans::Types::CountPlansParams, Plans::Types::CountPlansRequest, Plans::Types::CountPlansResponse, Plans::Types::CreateBillingLinkedPlanRequestBody, Plans::Types::CreateCustomPlanRequestBody, Plans::Types::CreateCustomPlanResponse, Plans::Types::CreatePlanResponse, Plans::Types::DeletePlanResponse, Plans::Types::DeletePlanVersionParams, Plans::Types::DeletePlanVersionRequest, Plans::Types::DeletePlanVersionResponse, Plans::Types::GetPlanParams, Plans::Types::GetPlanRequest, Plans::Types::GetPlanResponse, Plans::Types::ListBillingProductMatchCompaniesParams, Plans::Types::ListBillingProductMatchCompaniesRequest, Plans::Types::ListBillingProductMatchCompaniesResponse, Plans::Types::ListCustomPlanBillingsParams, Plans::Types::ListCustomPlanBillingsRequest, Plans::Types::ListCustomPlanBillingsResponse, Plans::Types::ListPlanIssuesParams, Plans::Types::ListPlanIssuesRequest, Plans::Types::ListPlanIssuesResponse, Plans::Types::ListPlansParams, Plans::Types::ListPlansRequest, Plans::Types::ListPlansResponse, Plans::Types::PublishPlanVersionRequestBody, Plans::Types::PublishPlanVersionResponse, Plans::Types::RetryCustomPlanBillingRequestBody, Plans::Types::RetryCustomPlanBillingResponse, Plans::Types::UpdateCompanyPlansRequestBody, Plans::Types::UpdateCompanyPlansResponse, Plans::Types::UpdatePlanResponse, Plans::Types::UpsertBillingProductPlanResponse, Plans::Types::UpsertPlanForBillingProductResponse, Scheduledcheckout::Types::CreateScheduledCheckoutRequest, Scheduledcheckout::Types::CreateScheduledCheckoutResponse, Scheduledcheckout::Types::GetScheduledCheckoutResponse, Scheduledcheckout::Types::ListScheduledCheckoutsParams, Scheduledcheckout::Types::ListScheduledCheckoutsRequest, Scheduledcheckout::Types::ListScheduledCheckoutsResponse, Scheduledcheckout::Types::UpdateScheduledCheckoutRequest, Scheduledcheckout::Types::UpdateScheduledCheckoutResponse, Types::AccountMemberResponseData, Types::ActivityEntryResponseData, Types::ActivityResponseResponseData, Types::ApiError, Types::ApiKeyCreateResponseData, Types::ApiKeyResponseData, Types::AuditLogListResponseData, Types::AuditLogResponseData, Types::BillingCouponResponseData, Types::BillingCreditBundleResponseData, Types::BillingCreditBundleView, Types::BillingCreditGrantResponseData, Types::BillingCreditLedgerResponseData, Types::BillingCreditResponseData, Types::BillingCreditView, Types::BillingCustomerResponseData, Types::BillingCustomerSubscription, Types::BillingCustomerWithSubscriptionsResponseData, Types::BillingLinkedResourceResponseData, Types::BillingMeterResponseData, Types::BillingPlanCreditGrantResponseData, Types::BillingPriceResponseData, Types::BillingPriceView, Types::BillingProductDetailResponseData, Types::BillingProductForSubscriptionResponseData, Types::BillingProductPlanResponseData, Types::BillingProductPriceResponseData, Types::BillingProductPriceTierResponseData, Types::BillingProductPricing, Types::BillingProductResponseData, Types::BillingSubscriptionDiscount, Types::BillingSubscriptionDiscountView, Types::BillingSubscriptionResponseData, Types::BillingSubscriptionView, Types::CaptureRawEvent, Types::CaptureRawEventBatch, Types::ChangeSubscriptionInternalRequestBody, Types::ChangeSubscriptionRequestBody, Types::CheckFlagRequestBody, Types::CheckFlagResponseData, Types::CheckFlagsBulkResponseData, Types::CheckFlagsResponseData, Types::CheckoutDataResponseData, Types::CheckoutSettingsResponseData, Types::CheckoutSubscription, Types::CompanyCreditBalanceResponseData, Types::CompanyDetailResponseData, Types::CompanyEventPeriodMetricsResponseData, Types::CompanyLedgerResponseData, Types::CompanyMembershipDetailResponseData, Types::CompanyMembershipResponseData, Types::CompanyOverrideNoteResponseData, Types::CompanyOverrideResponseData, Types::CompanyPlanDetailResponseData, Types::CompanyPlanWithBillingSubView, Types::CompanyResponseData, Types::CompanySubscriptionResponseData, Types::CompatiblePlans, Types::CompatiblePlansResponseData, Types::ComponentCapabilities, Types::ComponentCheckoutSettings, Types::ComponentDisplaySettings, Types::ComponentHydrateResponseData, Types::ComponentPreviewResponseData, Types::ComponentResponseData, Types::ComponentSettingsResponseData, Types::Condition, Types::ConditionGroup, Types::ConditionGroupResponseData, Types::ConditionGroupView, Types::ConditionResponseData, Types::ConditionView, Types::CountResponse, Types::CouponRequestBody, Types::CreateBillingPlanCreditGrantRequestBody, Types::CreateBillingPriceTierRequestBody, Types::CreateEntitlementInBundleRequestBody, Types::CreateEntitlementReqCommon, Types::CreateEventRequestBody, Types::CreateFlagRequestBody, Types::CreateOrUpdateConditionGroupRequestBody, Types::CreateOrUpdateConditionRequestBody, Types::CreateOrUpdateFlagRequestBody, Types::CreateOrUpdateRuleRequestBody, Types::CreatePlanRequestBody, Types::CreatePriceTierRequestBody, Types::CreditBundleCurrencyPrice, Types::CreditBundleCurrencyPriceRequestBody, Types::CreditBundleCurrencyPriceResponseData, Types::CreditBundlePurchaseResponseData, Types::CreditCompanyGrantView, Types::CreditCurrencyPriceRequestBody, Types::CreditCurrencyPriceResponseData, Types::CreditEventLedgerResponseData, Types::CreditGrantDetail, Types::CreditGrantExpiryRequestBody, Types::CreditLedgerEnrichedEntryResponseData, Types::CreditTransferResponseData, Types::CreditTransferView, Types::CreditTriggerConfig, Types::CreditUsage, Types::CreditUsageAggregation, Types::CreditsAutoTopupCompanySummary, Types::CreditsAutoTopupCreditSummary, Types::CreditsAutoTopupHardFailure, Types::CreditsAutoTopupRetryFailure, Types::CurrencyPriceRequestBody, Types::CustomPlanBillingResponseData, Types::CustomPlanConfig, Types::CustomPlanViewConfigResponseData, Types::DataEventPayload, Types::DataExportResponseData, Types::DatastreamCompanyPlan, Types::DeleteBillingPlanCreditGrantRequestBody, Types::DeleteResponse, Types::DuplicatePlanEntitlementsResponseResponseData, Types::EntitlementCurrencyPricesResponseData, Types::EntitlementTriggerConfig, Types::EntitlementsInPlan, Types::EntityKeyDefinitionResponseData, Types::EntityKeyDetailResponseData, Types::EntityKeyResponseData, Types::EntityTraitDefinitionResponseData, Types::EntityTraitDetailResponseData, Types::EntityTraitResponseData, Types::EntityTraitValue, Types::EnvironmentDetailResponseData, Types::EnvironmentFeatureUsageTimeSeriesResponseData, Types::EnvironmentResponseData, Types::EnvironmentTraitUsageTimeSeriesResponseData, Types::EnvironmentUsagePointResponseData, Types::EventBody, Types::EventBodyFlagCheck, Types::EventBodyIdentify, Types::EventBodyIdentifyCompany, Types::EventBodyTrack, Types::EventDetailResponseData, Types::EventResponseData, Types::EventSummaryResponseData, Types::FeatureCompanyResponseData, Types::FeatureCompanyUserResponseData, Types::FeatureDetailResponseData, Types::FeatureEntitlement, Types::FeatureInPlanResponseData, Types::FeatureLedgerResponseData, Types::FeatureResponseData, Types::FeatureUsageDetailResponseData, Types::FeatureUsageLegacyResponseData, Types::FeatureUsageResponseData, Types::FeatureUsageTimeSeriesResponseData, Types::FeatureView, Types::FlagDetailResponseData, Types::FlagInPlanResponseData, Types::FlagResponseData, Types::FlagView, Types::GenericPreviewObject, Types::InsightsSummaryResponseData, Types::IntegrationWebhookUrlResponseData, Types::InvoiceRequestBody, Types::InvoiceResponseData, Types::IssueTemporaryAccessTokenResponseData, Types::KeysRequestBody, Types::LimitTimeSeriesPointResponseData, Types::ManagePlanPreviewResponseResponseData, Types::ManagePlanRequest, Types::ManagePlanResponseResponseData, Types::MeterRequestBody, Types::MrrResponseData, Types::OrderedPlansInGroup, Types::PaymentMethodRequestBody, Types::PaymentMethodResponseData, Types::PlanBundleCreditGrantRequestBody, Types::PlanBundleEntitlementRequestBody, Types::PlanBundleResponseData, Types::PlanChangeResponseData, Types::PlanCreditGrantView, Types::PlanCurrencyPriceRequestBody, Types::PlanCurrencyPricesResponseData, Types::PlanDetailResponseData, Types::PlanEntitlementResponseData, Types::PlanEntitlementsOrder, Types::PlanGroupBundleOrder, Types::PlanGroupDetailResponseData, Types::PlanGroupPlanDetailResponseData, Types::PlanGroupPlanEntitlementsOrder, Types::PlanGroupResponseData, Types::PlanGrowthPointResponseData, Types::PlanGrowthResponseData, Types::PlanIssueResponseData, Types::PlanResponseData, Types::PlanSelection, Types::PlanSnapshotView, Types::PlanTraitResponseData, Types::PlanVersionCompanyMigrationResponseData, Types::PlanVersionMigrationResponseData, Types::PlanVersionResponseData, Types::PlanVersionSnapshotView, Types::PlanViewPublicResponseData, Types::PreviewObject, Types::PreviewObjectResponseData, Types::PreviewSubscriptionChangeResponseData, Types::PreviewSubscriptionFinanceResponseData, Types::PreviewSubscriptionUpcomingInvoiceLineItems, Types::PublicPlansResponseData, Types::QuickstartResp, Types::RawEventBatchResponseData, Types::RawEventResponseData, Types::Rule, Types::RuleConditionDetailResponseData, Types::RuleConditionGroupDetailResponseData, Types::RuleConditionGroupResponseData, Types::RuleConditionResponseData, Types::RuleDetailResponseData, Types::RuleResponseData, Types::RuleView, Types::RulesDetailResponseData, Types::RulesengineCheckFlagResult, Types::RulesengineCompany, Types::RulesengineCompanyMetric, Types::RulesengineCondition, Types::RulesengineConditionGroup, Types::RulesengineFeatureEntitlement, Types::RulesengineFlag, Types::RulesengineRule, Types::RulesengineSubscription, Types::RulesengineTrait, Types::RulesengineTraitDefinition, Types::RulesengineUser, Types::ScheduledCheckoutResponseData, Types::ScheduledDowngradeResponseData, Types::SegmentStatusResp, Types::SkippedEntitlementErrorResponseData, Types::SkippedEntitlementResponseData, Types::StripeEmbedInfo, Types::SubscriptionTraitUpdate, Types::TemporaryAccessTokenResponseData, Types::TopFeatureByUsageResponseData, Types::TopFeaturesByUsageResponseData, Types::TraitDefinition, Types::UpdateAddOnRequestBody, Types::UpdateBillingPlanCreditGrantRequestBody, Types::UpdateCreditBundleRequestBody, Types::UpdateEntitlementReqCommon, Types::UpdatePayInAdvanceRequestBody, Types::UpdatePlanRequestBody, Types::UpdatePlanTraitTraitRequestBody, Types::UpdateRuleRequestBody, Types::UpsertBillingProductRequestBody, Types::UpsertCompanyRequestBody, Types::UpsertTraitRequestBody, Types::UpsertUserRequestBody, Types::UpsertUserSubRequestBody, Types::UsageBasedEntitlementRequestBody, Types::UsageBasedEntitlementResponseData, Types::UsageTimeSeriesPointResponseData, Types::UserDetailResponseData, Types::UserResponseData, Types::WebFeatureUsageWebhookOutput, Types::WebScheduledDowngradeWebhookOutput, Types::WebhookEventDetailResponseData, Types::WebhookEventResponseData, Types::WebhookResponseData, Types::WebhookUrl, Types::WhoAmIResponseData, Webhooks::Types::CountWebhookEventsParams, Webhooks::Types::CountWebhookEventsRequest, Webhooks::Types::CountWebhookEventsResponse, Webhooks::Types::CountWebhooksParams, Webhooks::Types::CountWebhooksRequest, Webhooks::Types::CountWebhooksResponse, Webhooks::Types::CreateWebhookRequestBody, Webhooks::Types::CreateWebhookResponse, Webhooks::Types::DeleteWebhookResponse, Webhooks::Types::GetWebhookEventResponse, Webhooks::Types::GetWebhookResponse, Webhooks::Types::ListWebhookEventsParams, Webhooks::Types::ListWebhookEventsRequest, Webhooks::Types::ListWebhookEventsResponse, Webhooks::Types::ListWebhooksParams, Webhooks::Types::ListWebhooksRequest, Webhooks::Types::ListWebhooksResponse, Webhooks::Types::UpdateWebhookRequestBody, Webhooks::Types::UpdateWebhookResponse

Defined Under Namespace

Classes: Field

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Type

#coerce, #strict!, #strict?

Methods included from JSON::Serializable

#dump, #load

Constructor Details

#initialize(values = {}) ⇒ self

Creates a new instance of this model TODO: Should all this logic be in ‘#coerce` instead?

Parameters:

  • values (Hash) (defaults to: {})
  • strict (Hash)

    a customizable set of options



138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
# File 'lib/schematic/internal/types/model.rb', line 138

def initialize(values = {})
  @data = {}

  values = Utils.symbolize_keys(values.dup)

  self.class.fields.each do |field_name, field|
    value = values.delete(field.api_name.to_sym) || values.delete(field.api_name) || values.delete(field_name)

    field_value = value || (if field.literal?
                              field.value
                            elsif field.default
                              field.default
                            end)

    @data[field_name] = Utils.coerce(field.type, field_value)
  end

  # Any remaining values in the input become extra fields
  values.each do |name, value|
    self.class.add_extra_field_definition(name: name, type: value.class)

    @data[name.to_sym] = value
  end
end

Class Method Details

.===(instance) ⇒ Object



127
128
129
# File 'lib/schematic/internal/types/model.rb', line 127

def ===(instance)
  instance.class.ancestors.include?(self)
end

.add_extra_field_definition(name:, type:) ⇒ void

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

This method returns an undefined value.

Adds a new field definition into the class’s extra fields registry

Parameters:

  • name (Symbol)
  • type (Class)
  • required (Hash)

    a customizable set of options

  • optional (Hash)

    a customizable set of options



88
89
90
91
92
93
94
95
# File 'lib/schematic/internal/types/model.rb', line 88

def add_extra_field_definition(name:, type:)
  return if extra_fields.key?(name.to_sym)

  extra_fields[name.to_sym] = Field.new(name: name, type: type, optional: true, nullable: false)

  define_accessor(name)
  define_setter(name)
end

.coerce(value, strict: (respond_to?(:strict?) ? strict? : false)) ⇒ Object

rubocop:disable Lint/UnusedMethodArgument



115
116
117
118
119
120
121
# File 'lib/schematic/internal/types/model.rb', line 115

def coerce(value, strict: (respond_to?(:strict?) ? strict? : false)) # rubocop:disable Lint/UnusedMethodArgument
  return value if value.is_a?(self)

  return value unless value.is_a?(::Hash)

  new(value)
end

.extra_fieldsHash<Symbol, Field>

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Any extra fields that have been created from instantiation

Returns:



31
32
33
# File 'lib/schematic/internal/types/model.rb', line 31

def extra_fields
  @extra_fields ||= {}
end

.field(name, type, optional: false, nullable: false, api_name: nil, default: nil) ⇒ void

This method returns an undefined value.

Define a new field on this model

Parameters:

  • name (Symbol)

    The name of the field

  • type (Class)

    Type of the field

  • optional (Hash) (defaults to: false)

    a customizable set of options

  • nullable (Hash) (defaults to: false)

    a customizable set of options

  • api_name (Hash) (defaults to: nil)

    a customizable set of options

Options Hash (optional:):

  • If (Boolean)

    it is an optional field

Options Hash (nullable:):

  • If (Boolean)

    it is a nullable field

Options Hash (api_name:):

  • Name (Symbol, String)

    in the API of this field. When serializing/deserializing, will use this field name



44
45
46
47
48
49
50
# File 'lib/schematic/internal/types/model.rb', line 44

def field(name, type, optional: false, nullable: false, api_name: nil, default: nil)
  add_field_definition(name: name, type: type, optional: optional, nullable: nullable, api_name: api_name,
                       default: default)

  define_accessor(name)
  define_setter(name)
end

.fieldsHash<Symbol, Field>

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

The defined fields for this model

Returns:



18
19
20
21
22
23
24
# File 'lib/schematic/internal/types/model.rb', line 18

def fields
  @fields ||= if self < Schematic::Internal::Types::Model
                superclass.fields.dup
              else
                {}
              end
end

.literal(name, value, api_name: nil) ⇒ void

This method returns an undefined value.

Define a new literal for this model

Parameters:

  • name (Symbol)
  • value (Object)
  • api_name (Hash) (defaults to: nil)

    a customizable set of options

Options Hash (api_name:):

  • (Symbol, String)


58
59
60
61
62
63
# File 'lib/schematic/internal/types/model.rb', line 58

def literal(name, value, api_name: nil)
  add_field_definition(name: name, type: value.class, optional: false, nullable: false, api_name: api_name,
                       value: value)

  define_accessor(name)
end

.load(str) ⇒ Object



123
124
125
# File 'lib/schematic/internal/types/model.rb', line 123

def load(str)
  coerce(::JSON.parse(str, symbolize_names: true))
end

Instance Method Details

#==(other) ⇒ Object



191
192
193
# File 'lib/schematic/internal/types/model.rb', line 191

def ==(other)
  self.class == other.class && to_h == other.to_h
end

#inspectString

Returns:

  • (String)


196
197
198
199
200
201
202
203
204
# File 'lib/schematic/internal/types/model.rb', line 196

def inspect
  attrs = @data.map do |name, value|
    field = self.class.fields[name] || self.class.extra_fields[name]
    display_value = field&.sensitive? ? "[REDACTED]" : value.inspect
    "#{name}=#{display_value}"
  end

  "#<#{self.class.name}:0x#{object_id&.to_s(16)} #{attrs.join(" ")}>"
end

#to_hObject



163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
# File 'lib/schematic/internal/types/model.rb', line 163

def to_h
  result = self.class.fields.merge(self.class.extra_fields).each_with_object({}) do |(name, field), acc|
    # If there is a value present in the data, use that value
    # If there is a `nil` value present in the data, and it is optional but NOT nullable, exclude key altogether
    # If there is a `nil` value present in the data, and it is optional and nullable, use the nil value

    value = @data[name]

    next if value.nil? && field.optional && !field.nullable

    if value.is_a?(::Array)
      value = value.map { |item| item.respond_to?(:to_h) ? item.to_h : item }
    elsif value.respond_to?(:to_h)
      value = value.to_h
    end

    acc[field.api_name] = value
  end

  # Inject union discriminant if this instance was coerced from a discriminated union
  # and the discriminant key is not already present in the result
  discriminant_key = instance_variable_get(:@_fern_union_discriminant_key)
  discriminant_value = instance_variable_get(:@_fern_union_discriminant_value)
  result[discriminant_key] = discriminant_value if discriminant_key && discriminant_value && !result.key?(discriminant_key)

  result
end