# encoding: utf-8
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.

module Azure::CostManagement::Mgmt::V2019_04_01_preview
  module Models
    #
    # States and configurations of Cost Analysis.
    #
    class View < ProxyResource

      include MsRestAzure

      # @return [String] User input name of the view. Required.
      attr_accessor :display_name

      # @return [String] Cost Management scope to save the view on. This
      # includes 'subscriptions/{subscriptionId}' for subscription scope,
      # 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for
      # resourceGroup scope,
      # 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for
      # Billing Account scope,
      # 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}'
      # for Department scope,
      # 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}'
      # for EnrollmentAccount scope,
      # 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}'
      # for BillingProfile scope,
      # 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}'
      # for InvoiceSection scope,
      # 'providers/Microsoft.Management/managementGroups/{managementGroupId}'
      # for Management Group scope,
      # '/providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}'
      # for ExternalBillingAccount scope, and
      # '/providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}'
      # for ExternalSubscription scope.
      attr_accessor :scope

      # @return [DateTime] Date the user created this view.
      attr_accessor :created_on

      # @return [DateTime] Date when the user last modified this view.
      attr_accessor :modified_on

      # @return [String] The type of the report. Usage represents actual usage,
      # forecast represents forecasted data and UsageAndForecast represents
      # both usage and forecasted data. Actual usage and forecasted data can be
      # differentiated based on dates. Default value: 'Usage' .
      attr_accessor :view_type

      # @return [TimeframeType] The time frame for pulling data for the report.
      # If custom, then a specific time period must be provided. Possible
      # values include: 'WeekToDate', 'MonthToDate', 'YearToDate', 'Custom'
      attr_accessor :timeframe

      # @return [ReportConfigTimePeriod] Has time period for pulling data for
      # the report.
      attr_accessor :time_period

      # @return [ReportConfigDataset] Has definition for data in this report
      # config.
      attr_accessor :dataset

      # @return [ChartType] Chart type of the main view in Cost Analysis.
      # Required. Possible values include: 'Area', 'Line', 'StackedColumn',
      # 'GroupedColumn', 'Table'
      attr_accessor :chart

      # @return [AccumulatedType] Show costs accumulated over time. Possible
      # values include: 'true', 'false'
      attr_accessor :accumulated

      # @return [MetricType] Metric to use when displaying costs. Possible
      # values include: 'ActualCost', 'AmortizedCost', 'AHUB'
      attr_accessor :metric

      # @return [Array<KpiProperties>] List of KPIs to show in Cost Analysis
      # UI.
      attr_accessor :kpis

      # @return [Array<PivotProperties>] Configuration of 3 sub-views in the
      # Cost Analysis UI.
      attr_accessor :pivots


      #
      # Mapper for View class as Ruby Hash.
      # This will be used for serialization/deserialization.
      #
      def self.mapper()
        {
          client_side_validation: true,
          required: false,
          serialized_name: 'View',
          type: {
            name: 'Composite',
            class_name: 'View',
            model_properties: {
              id: {
                client_side_validation: true,
                required: false,
                read_only: true,
                serialized_name: 'id',
                type: {
                  name: 'String'
                }
              },
              name: {
                client_side_validation: true,
                required: false,
                read_only: true,
                serialized_name: 'name',
                type: {
                  name: 'String'
                }
              },
              type: {
                client_side_validation: true,
                required: false,
                read_only: true,
                serialized_name: 'type',
                type: {
                  name: 'String'
                }
              },
              e_tag: {
                client_side_validation: true,
                required: false,
                serialized_name: 'eTag',
                type: {
                  name: 'String'
                }
              },
              display_name: {
                client_side_validation: true,
                required: false,
                serialized_name: 'properties.displayName',
                type: {
                  name: 'String'
                }
              },
              scope: {
                client_side_validation: true,
                required: false,
                serialized_name: 'properties.scope',
                type: {
                  name: 'String'
                }
              },
              created_on: {
                client_side_validation: true,
                required: false,
                read_only: true,
                serialized_name: 'properties.createdOn',
                type: {
                  name: 'DateTime'
                }
              },
              modified_on: {
                client_side_validation: true,
                required: false,
                read_only: true,
                serialized_name: 'properties.modifiedOn',
                type: {
                  name: 'DateTime'
                }
              },
              view_type: {
                client_side_validation: true,
                required: true,
                is_constant: true,
                serialized_name: 'properties.query.type',
                default_value: 'Usage',
                type: {
                  name: 'String'
                }
              },
              timeframe: {
                client_side_validation: true,
                required: true,
                serialized_name: 'properties.query.timeframe',
                type: {
                  name: 'String'
                }
              },
              time_period: {
                client_side_validation: true,
                required: false,
                serialized_name: 'properties.query.timePeriod',
                type: {
                  name: 'Composite',
                  class_name: 'ReportConfigTimePeriod'
                }
              },
              dataset: {
                client_side_validation: true,
                required: false,
                serialized_name: 'properties.query.dataset',
                type: {
                  name: 'Composite',
                  class_name: 'ReportConfigDataset'
                }
              },
              chart: {
                client_side_validation: true,
                required: false,
                serialized_name: 'properties.chart',
                type: {
                  name: 'String'
                }
              },
              accumulated: {
                client_side_validation: true,
                required: false,
                serialized_name: 'properties.accumulated',
                type: {
                  name: 'String'
                }
              },
              metric: {
                client_side_validation: true,
                required: false,
                serialized_name: 'properties.metric',
                type: {
                  name: 'String'
                }
              },
              kpis: {
                client_side_validation: true,
                required: false,
                serialized_name: 'properties.kpis',
                type: {
                  name: 'Sequence',
                  element: {
                      client_side_validation: true,
                      required: false,
                      serialized_name: 'KpiPropertiesElementType',
                      type: {
                        name: 'Composite',
                        class_name: 'KpiProperties'
                      }
                  }
                }
              },
              pivots: {
                client_side_validation: true,
                required: false,
                serialized_name: 'properties.pivots',
                type: {
                  name: 'Sequence',
                  element: {
                      client_side_validation: true,
                      required: false,
                      serialized_name: 'PivotPropertiesElementType',
                      type: {
                        name: 'Composite',
                        class_name: 'PivotProperties'
                      }
                  }
                }
              }
            }
          }
        }
      end
    end
  end
end
