// unsourceMappings iterates over the mappings in a profile and replaces file
// set to the remote source URL by collectMappingSources back to empty string.
513702
func unsourceMappings(p *profile.Profile) {
	for _, m := range p.Mapping {
		if m.BuildID == "" {
			if u, err := url.Parse(m.File); err == nil && u.IsAbs() {
				m.File = ""
			}
		}
	}
}
869700
func (x *StructureDefinition) UnmarshalJSON(data []byte) (err error) {
	x2 := structureDefinition{}
	if err = json.Unmarshal(data, &x2); err == nil {
		if x2.Contained != nil {
			for i := range x2.Contained {
				x2.Contained[i] = MapToResource(x2.Contained[i], true)
			}
		}
		*x = StructureDefinition(x2)
		return x.checkResourceType()
	}
	return
}
262233
func (m MultiRESTMapper) AliasesForResource(alias string) (aliases []string, ok bool) {
	for _, t := range m {
		if aliases, ok = t.AliasesForResource(alias); ok {
			return
		}
	}
	return nil, false
}
1137780
func (d *DeferredDiscoveryRESTMapper) RESTMappings(gk schema.GroupKind, versions ...string) (ms []*meta.RESTMapping, err error) {
	del, err := d.getDelegate()
	if err != nil {
		return nil, err
	}
	ms, err = del.RESTMappings(gk, versions...)
	if len(ms) == 0 && !d.cl.Fresh() {
		d.Reset()
		ms, err = d.RESTMappings(gk, versions...)
	}
	return
}
1220034
func GetTagMappings(cfg interface{}) (Mappings, error) {
	return getTagMappingsRecursive("", reflect.Indirect(reflect.ValueOf(cfg)))
}
945522
func (x *BodySite) UnmarshalJSON(data []byte) (err error) {
	x2 := bodySite{}
	if err = json.Unmarshal(data, &x2); err == nil {
		if x2.Contained != nil {
			for i := range x2.Contained {
				x2.Contained[i] = MapToResource(x2.Contained[i], true)
			}
		}
		*x = BodySite(x2)
		return x.checkResourceType()
	}
	return
}
123412
func (s *Service) GetMapping() *GetMappingCall {
	c := &GetMappingCall{s: s, urlParams_: make(gensupport.URLParams)}
	return c
}
355815
func (o *Domain) VNFDomainMappings(info *bambou.FetchingInfo) (VNFDomainMappingsList, *bambou.Error) {

	var list VNFDomainMappingsList
	err := bambou.CurrentSession().FetchChildren(o, VNFDomainMappingIdentity, &list, info)
	return list, err
}
438713
func (x *NamingSystem) UnmarshalJSON(data []byte) (err error) {
	x2 := namingSystem{}
	if err = json.Unmarshal(data, &x2); err == nil {
		if x2.Contained != nil {
			for i := range x2.Contained {
				x2.Contained[i] = MapToResource(x2.Contained[i], true)
			}
		}
		*x = NamingSystem(x2)
		return x.checkResourceType()
	}
	return
}
886283
func (p *Provider) DataSources() []terraform.DataSource {
	keys := make([]string, 0, len(p.DataSourcesMap))
	for k, _ := range p.DataSourcesMap {
		keys = append(keys, k)
	}
	sort.Strings(keys)

	result := make([]terraform.DataSource, 0, len(keys))
	for _, k := range keys {
		result = append(result, terraform.DataSource{
			Name: k,

			// Indicates that a provider is compiled against a new enough
			// version of core to support the GetSchema method.
			SchemaAvailable: true,
		})
	}

	return result
}
1173072
func (r Resource_Metadata) GetServiceResource(serviceName *string, index *int) (resp string, err error) {
	params := []interface{}{
		serviceName,
		index,
	}
	err = r.Session.DoRequest("SoftLayer_Resource_Metadata", "getServiceResource", params, &r.Options, &resp)
	return
}
712798
func (s *ListEventSourceMappingsOutput) SetEventSourceMappings(v []*EventSourceMappingConfiguration) *ListEventSourceMappingsOutput {
	s.EventSourceMappings = v
	return s
}
1164277
func (s *Service) FindUserResourceMappings(ctx context.Context, filter influxdb.UserResourceMappingFilter, opt ...influxdb.FindOptions) ([]*influxdb.UserResourceMapping, int, error) {
	var ms []*influxdb.UserResourceMapping
	err := s.kv.View(ctx, func(tx Tx) error {
		var err error
		ms, err = s.findUserResourceMappings(ctx, tx, filter)
		return err
	})

	if err != nil {
		return nil, 0, err
	}

	return ms, len(ms), nil
}
1309493
func AllResources() map[string]Resource {
	return map[string]Resource{
		"AWS::AmazonMQ::Broker":                                       &resources.AWSAmazonMQBroker{},
		"AWS::AmazonMQ::Configuration":                                &resources.AWSAmazonMQConfiguration{},
		"AWS::AmazonMQ::ConfigurationAssociation":                     &resources.AWSAmazonMQConfigurationAssociation{},
		"AWS::ApiGateway::Account":                                    &resources.AWSApiGatewayAccount{},
		"AWS::ApiGateway::ApiKey":                                     &resources.AWSApiGatewayApiKey{},
		"AWS::ApiGateway::Authorizer":                                 &resources.AWSApiGatewayAuthorizer{},
		"AWS::ApiGateway::BasePathMapping":                            &resources.AWSApiGatewayBasePathMapping{},
		"AWS::ApiGateway::ClientCertificate":                          &resources.AWSApiGatewayClientCertificate{},
		"AWS::ApiGateway::Deployment":                                 &resources.AWSApiGatewayDeployment{},
		"AWS::ApiGateway::DocumentationPart":                          &resources.AWSApiGatewayDocumentationPart{},
		"AWS::ApiGateway::DocumentationVersion":                       &resources.AWSApiGatewayDocumentationVersion{},
		"AWS::ApiGateway::DomainName":                                 &resources.AWSApiGatewayDomainName{},
		"AWS::ApiGateway::GatewayResponse":                            &resources.AWSApiGatewayGatewayResponse{},
		"AWS::ApiGateway::Method":                                     &resources.AWSApiGatewayMethod{},
		"AWS::ApiGateway::Model":                                      &resources.AWSApiGatewayModel{},
		"AWS::ApiGateway::RequestValidator":                           &resources.AWSApiGatewayRequestValidator{},
		"AWS::ApiGateway::Resource":                                   &resources.AWSApiGatewayResource{},
		"AWS::ApiGateway::RestApi":                                    &resources.AWSApiGatewayRestApi{},
		"AWS::ApiGateway::Stage":                                      &resources.AWSApiGatewayStage{},
		"AWS::ApiGateway::UsagePlan":                                  &resources.AWSApiGatewayUsagePlan{},
		"AWS::ApiGateway::UsagePlanKey":                               &resources.AWSApiGatewayUsagePlanKey{},
		"AWS::ApiGateway::VpcLink":                                    &resources.AWSApiGatewayVpcLink{},
		"AWS::ApiGatewayV2::Api":                                      &resources.AWSApiGatewayV2Api{},
		"AWS::ApiGatewayV2::Authorizer":                               &resources.AWSApiGatewayV2Authorizer{},
		"AWS::ApiGatewayV2::Deployment":                               &resources.AWSApiGatewayV2Deployment{},
		"AWS::ApiGatewayV2::Integration":                              &resources.AWSApiGatewayV2Integration{},
		"AWS::ApiGatewayV2::IntegrationResponse":                      &resources.AWSApiGatewayV2IntegrationResponse{},
		"AWS::ApiGatewayV2::Model":                                    &resources.AWSApiGatewayV2Model{},
		"AWS::ApiGatewayV2::Route":                                    &resources.AWSApiGatewayV2Route{},
		"AWS::ApiGatewayV2::RouteResponse":                            &resources.AWSApiGatewayV2RouteResponse{},
		"AWS::ApiGatewayV2::Stage":                                    &resources.AWSApiGatewayV2Stage{},
		"AWS::AppMesh::Mesh":                                          &resources.AWSAppMeshMesh{},
		"AWS::AppMesh::Route":                                         &resources.AWSAppMeshRoute{},
		"AWS::AppMesh::VirtualNode":                                   &resources.AWSAppMeshVirtualNode{},
		"AWS::AppMesh::VirtualRouter":                                 &resources.AWSAppMeshVirtualRouter{},
		"AWS::AppMesh::VirtualService":                                &resources.AWSAppMeshVirtualService{},
		"AWS::AppStream::DirectoryConfig":                             &resources.AWSAppStreamDirectoryConfig{},
		"AWS::AppStream::Fleet":                                       &resources.AWSAppStreamFleet{},
		"AWS::AppStream::ImageBuilder":                                &resources.AWSAppStreamImageBuilder{},
		"AWS::AppStream::Stack":                                       &resources.AWSAppStreamStack{},
		"AWS::AppStream::StackFleetAssociation":                       &resources.AWSAppStreamStackFleetAssociation{},
		"AWS::AppStream::StackUserAssociation":                        &resources.AWSAppStreamStackUserAssociation{},
		"AWS::AppStream::User":                                        &resources.AWSAppStreamUser{},
		"AWS::AppSync::ApiKey":                                        &resources.AWSAppSyncApiKey{},
		"AWS::AppSync::DataSource":                                    &resources.AWSAppSyncDataSource{},
		"AWS::AppSync::FunctionConfiguration":                         &resources.AWSAppSyncFunctionConfiguration{},
		"AWS::AppSync::GraphQLApi":                                    &resources.AWSAppSyncGraphQLApi{},
		"AWS::AppSync::GraphQLSchema":                                 &resources.AWSAppSyncGraphQLSchema{},
		"AWS::AppSync::Resolver":                                      &resources.AWSAppSyncResolver{},
		"AWS::ApplicationAutoScaling::ScalableTarget":                 &resources.AWSApplicationAutoScalingScalableTarget{},
		"AWS::ApplicationAutoScaling::ScalingPolicy":                  &resources.AWSApplicationAutoScalingScalingPolicy{},
		"AWS::Athena::NamedQuery":                                     &resources.AWSAthenaNamedQuery{},
		"AWS::AutoScaling::AutoScalingGroup":                          &resources.AWSAutoScalingAutoScalingGroup{},
		"AWS::AutoScaling::LaunchConfiguration":                       &resources.AWSAutoScalingLaunchConfiguration{},
		"AWS::AutoScaling::LifecycleHook":                             &resources.AWSAutoScalingLifecycleHook{},
		"AWS::AutoScaling::ScalingPolicy":                             &resources.AWSAutoScalingScalingPolicy{},
		"AWS::AutoScaling::ScheduledAction":                           &resources.AWSAutoScalingScheduledAction{},
		"AWS::AutoScalingPlans::ScalingPlan":                          &resources.AWSAutoScalingPlansScalingPlan{},
		"AWS::Batch::ComputeEnvironment":                              &resources.AWSBatchComputeEnvironment{},
		"AWS::Batch::JobDefinition":                                   &resources.AWSBatchJobDefinition{},
		"AWS::Batch::JobQueue":                                        &resources.AWSBatchJobQueue{},
		"AWS::Budgets::Budget":                                        &resources.AWSBudgetsBudget{},
		"AWS::CertificateManager::Certificate":                        &resources.AWSCertificateManagerCertificate{},
		"AWS::Cloud9::EnvironmentEC2":                                 &resources.AWSCloud9EnvironmentEC2{},
		"AWS::CloudFormation::CustomResource":                         &resources.AWSCloudFormationCustomResource{},
		"AWS::CloudFormation::Macro":                                  &resources.AWSCloudFormationMacro{},
		"AWS::CloudFormation::Stack":                                  &resources.AWSCloudFormationStack{},
		"AWS::CloudFormation::WaitCondition":                          &resources.AWSCloudFormationWaitCondition{},
		"AWS::CloudFormation::WaitConditionHandle":                    &resources.AWSCloudFormationWaitConditionHandle{},
		"AWS::CloudFront::CloudFrontOriginAccessIdentity":             &resources.AWSCloudFrontCloudFrontOriginAccessIdentity{},
		"AWS::CloudFront::Distribution":                               &resources.AWSCloudFrontDistribution{},
		"AWS::CloudFront::StreamingDistribution":                      &resources.AWSCloudFrontStreamingDistribution{},
		"AWS::CloudTrail::Trail":                                      &resources.AWSCloudTrailTrail{},
		"AWS::CloudWatch::Alarm":                                      &resources.AWSCloudWatchAlarm{},
		"AWS::CloudWatch::Dashboard":                                  &resources.AWSCloudWatchDashboard{},
		"AWS::CodeBuild::Project":                                     &resources.AWSCodeBuildProject{},
		"AWS::CodeCommit::Repository":                                 &resources.AWSCodeCommitRepository{},
		"AWS::CodeDeploy::Application":                                &resources.AWSCodeDeployApplication{},
		"AWS::CodeDeploy::DeploymentConfig":                           &resources.AWSCodeDeployDeploymentConfig{},
		"AWS::CodeDeploy::DeploymentGroup":                            &resources.AWSCodeDeployDeploymentGroup{},
		"AWS::CodePipeline::CustomActionType":                         &resources.AWSCodePipelineCustomActionType{},
		"AWS::CodePipeline::Pipeline":                                 &resources.AWSCodePipelinePipeline{},
		"AWS::CodePipeline::Webhook":                                  &resources.AWSCodePipelineWebhook{},
		"AWS::Cognito::IdentityPool":                                  &resources.AWSCognitoIdentityPool{},
		"AWS::Cognito::IdentityPoolRoleAttachment":                    &resources.AWSCognitoIdentityPoolRoleAttachment{},
		"AWS::Cognito::UserPool":                                      &resources.AWSCognitoUserPool{},
		"AWS::Cognito::UserPoolClient":                                &resources.AWSCognitoUserPoolClient{},
		"AWS::Cognito::UserPoolGroup":                                 &resources.AWSCognitoUserPoolGroup{},
		"AWS::Cognito::UserPoolUser":                                  &resources.AWSCognitoUserPoolUser{},
		"AWS::Cognito::UserPoolUserToGroupAttachment":                 &resources.AWSCognitoUserPoolUserToGroupAttachment{},
		"AWS::Config::AggregationAuthorization":                       &resources.AWSConfigAggregationAuthorization{},
		"AWS::Config::ConfigRule":                                     &resources.AWSConfigConfigRule{},
		"AWS::Config::ConfigurationAggregator":                        &resources.AWSConfigConfigurationAggregator{},
		"AWS::Config::ConfigurationRecorder":                          &resources.AWSConfigConfigurationRecorder{},
		"AWS::Config::DeliveryChannel":                                &resources.AWSConfigDeliveryChannel{},
		"AWS::DAX::Cluster":                                           &resources.AWSDAXCluster{},
		"AWS::DAX::ParameterGroup":                                    &resources.AWSDAXParameterGroup{},
		"AWS::DAX::SubnetGroup":                                       &resources.AWSDAXSubnetGroup{},
		"AWS::DLM::LifecyclePolicy":                                   &resources.AWSDLMLifecyclePolicy{},
		"AWS::DMS::Certificate":                                       &resources.AWSDMSCertificate{},
		"AWS::DMS::Endpoint":                                          &resources.AWSDMSEndpoint{},
		"AWS::DMS::EventSubscription":                                 &resources.AWSDMSEventSubscription{},
		"AWS::DMS::ReplicationInstance":                               &resources.AWSDMSReplicationInstance{},
		"AWS::DMS::ReplicationSubnetGroup":                            &resources.AWSDMSReplicationSubnetGroup{},
		"AWS::DMS::ReplicationTask":                                   &resources.AWSDMSReplicationTask{},
		"AWS::DataPipeline::Pipeline":                                 &resources.AWSDataPipelinePipeline{},
		"AWS::DirectoryService::MicrosoftAD":                          &resources.AWSDirectoryServiceMicrosoftAD{},
		"AWS::DirectoryService::SimpleAD":                             &resources.AWSDirectoryServiceSimpleAD{},
		"AWS::DocDB::DBCluster":                                       &resources.AWSDocDBDBCluster{},
		"AWS::DocDB::DBClusterParameterGroup":                         &resources.AWSDocDBDBClusterParameterGroup{},
		"AWS::DocDB::DBInstance":                                      &resources.AWSDocDBDBInstance{},
		"AWS::DocDB::DBSubnetGroup":                                   &resources.AWSDocDBDBSubnetGroup{},
		"AWS::DynamoDB::Table":                                        &resources.AWSDynamoDBTable{},
		"AWS::EC2::CustomerGateway":                                   &resources.AWSEC2CustomerGateway{},
		"AWS::EC2::DHCPOptions":                                       &resources.AWSEC2DHCPOptions{},
		"AWS::EC2::EC2Fleet":                                          &resources.AWSEC2EC2Fleet{},
		"AWS::EC2::EIP":                                               &resources.AWSEC2EIP{},
		"AWS::EC2::EIPAssociation":                                    &resources.AWSEC2EIPAssociation{},
		"AWS::EC2::EgressOnlyInternetGateway":                         &resources.AWSEC2EgressOnlyInternetGateway{},
		"AWS::EC2::FlowLog":                                           &resources.AWSEC2FlowLog{},
		"AWS::EC2::Host":                                              &resources.AWSEC2Host{},
		"AWS::EC2::Instance":                                          &resources.AWSEC2Instance{},
		"AWS::EC2::InternetGateway":                                   &resources.AWSEC2InternetGateway{},
		"AWS::EC2::LaunchTemplate":                                    &resources.AWSEC2LaunchTemplate{},
		"AWS::EC2::NatGateway":                                        &resources.AWSEC2NatGateway{},
		"AWS::EC2::NetworkAcl":                                        &resources.AWSEC2NetworkAcl{},
		"AWS::EC2::NetworkAclEntry":                                   &resources.AWSEC2NetworkAclEntry{},
		"AWS::EC2::NetworkInterface":                                  &resources.AWSEC2NetworkInterface{},
		"AWS::EC2::NetworkInterfaceAttachment":                        &resources.AWSEC2NetworkInterfaceAttachment{},
		"AWS::EC2::NetworkInterfacePermission":                        &resources.AWSEC2NetworkInterfacePermission{},
		"AWS::EC2::PlacementGroup":                                    &resources.AWSEC2PlacementGroup{},
		"AWS::EC2::Route":                                             &resources.AWSEC2Route{},
		"AWS::EC2::RouteTable":                                        &resources.AWSEC2RouteTable{},
		"AWS::EC2::SecurityGroup":                                     &resources.AWSEC2SecurityGroup{},
		"AWS::EC2::SecurityGroupEgress":                               &resources.AWSEC2SecurityGroupEgress{},
		"AWS::EC2::SecurityGroupIngress":                              &resources.AWSEC2SecurityGroupIngress{},
		"AWS::EC2::SpotFleet":                                         &resources.AWSEC2SpotFleet{},
		"AWS::EC2::Subnet":                                            &resources.AWSEC2Subnet{},
		"AWS::EC2::SubnetCidrBlock":                                   &resources.AWSEC2SubnetCidrBlock{},
		"AWS::EC2::SubnetNetworkAclAssociation":                       &resources.AWSEC2SubnetNetworkAclAssociation{},
		"AWS::EC2::SubnetRouteTableAssociation":                       &resources.AWSEC2SubnetRouteTableAssociation{},
		"AWS::EC2::TransitGateway":                                    &resources.AWSEC2TransitGateway{},
		"AWS::EC2::TransitGatewayAttachment":                          &resources.AWSEC2TransitGatewayAttachment{},
		"AWS::EC2::TransitGatewayRoute":                               &resources.AWSEC2TransitGatewayRoute{},
		"AWS::EC2::TransitGatewayRouteTable":                          &resources.AWSEC2TransitGatewayRouteTable{},
		"AWS::EC2::TransitGatewayRouteTableAssociation":               &resources.AWSEC2TransitGatewayRouteTableAssociation{},
		"AWS::EC2::TransitGatewayRouteTablePropagation":               &resources.AWSEC2TransitGatewayRouteTablePropagation{},
		"AWS::EC2::TrunkInterfaceAssociation":                         &resources.AWSEC2TrunkInterfaceAssociation{},
		"AWS::EC2::VPC":                                               &resources.AWSEC2VPC{},
		"AWS::EC2::VPCCidrBlock":                                      &resources.AWSEC2VPCCidrBlock{},
		"AWS::EC2::VPCDHCPOptionsAssociation":                         &resources.AWSEC2VPCDHCPOptionsAssociation{},
		"AWS::EC2::VPCEndpoint":                                       &resources.AWSEC2VPCEndpoint{},
		"AWS::EC2::VPCEndpointConnectionNotification":                 &resources.AWSEC2VPCEndpointConnectionNotification{},
		"AWS::EC2::VPCEndpointServicePermissions":                     &resources.AWSEC2VPCEndpointServicePermissions{},
		"AWS::EC2::VPCGatewayAttachment":                              &resources.AWSEC2VPCGatewayAttachment{},
		"AWS::EC2::VPCPeeringConnection":                              &resources.AWSEC2VPCPeeringConnection{},
		"AWS::EC2::VPNConnection":                                     &resources.AWSEC2VPNConnection{},
		"AWS::EC2::VPNConnectionRoute":                                &resources.AWSEC2VPNConnectionRoute{},
		"AWS::EC2::VPNGateway":                                        &resources.AWSEC2VPNGateway{},
		"AWS::EC2::VPNGatewayRoutePropagation":                        &resources.AWSEC2VPNGatewayRoutePropagation{},
		"AWS::EC2::Volume":                                            &resources.AWSEC2Volume{},
		"AWS::EC2::VolumeAttachment":                                  &resources.AWSEC2VolumeAttachment{},
		"AWS::ECR::Repository":                                        &resources.AWSECRRepository{},
		"AWS::ECS::Cluster":                                           &resources.AWSECSCluster{},
		"AWS::ECS::Service":                                           &resources.AWSECSService{},
		"AWS::ECS::TaskDefinition":                                    &resources.AWSECSTaskDefinition{},
		"AWS::EFS::FileSystem":                                        &resources.AWSEFSFileSystem{},
		"AWS::EFS::MountTarget":                                       &resources.AWSEFSMountTarget{},
		"AWS::EKS::Cluster":                                           &resources.AWSEKSCluster{},
		"AWS::EMR::Cluster":                                           &resources.AWSEMRCluster{},
		"AWS::EMR::InstanceFleetConfig":                               &resources.AWSEMRInstanceFleetConfig{},
		"AWS::EMR::InstanceGroupConfig":                               &resources.AWSEMRInstanceGroupConfig{},
		"AWS::EMR::SecurityConfiguration":                             &resources.AWSEMRSecurityConfiguration{},
		"AWS::EMR::Step":                                              &resources.AWSEMRStep{},
		"AWS::ElastiCache::CacheCluster":                              &resources.AWSElastiCacheCacheCluster{},
		"AWS::ElastiCache::ParameterGroup":                            &resources.AWSElastiCacheParameterGroup{},
		"AWS::ElastiCache::ReplicationGroup":                          &resources.AWSElastiCacheReplicationGroup{},
		"AWS::ElastiCache::SecurityGroup":                             &resources.AWSElastiCacheSecurityGroup{},
		"AWS::ElastiCache::SecurityGroupIngress":                      &resources.AWSElastiCacheSecurityGroupIngress{},
		"AWS::ElastiCache::SubnetGroup":                               &resources.AWSElastiCacheSubnetGroup{},
		"AWS::ElasticBeanstalk::Application":                          &resources.AWSElasticBeanstalkApplication{},
		"AWS::ElasticBeanstalk::ApplicationVersion":                   &resources.AWSElasticBeanstalkApplicationVersion{},
		"AWS::ElasticBeanstalk::ConfigurationTemplate":                &resources.AWSElasticBeanstalkConfigurationTemplate{},
		"AWS::ElasticBeanstalk::Environment":                          &resources.AWSElasticBeanstalkEnvironment{},
		"AWS::ElasticLoadBalancing::LoadBalancer":                     &resources.AWSElasticLoadBalancingLoadBalancer{},
		"AWS::ElasticLoadBalancingV2::Listener":                       &resources.AWSElasticLoadBalancingV2Listener{},
		"AWS::ElasticLoadBalancingV2::ListenerCertificate":            &resources.AWSElasticLoadBalancingV2ListenerCertificate{},
		"AWS::ElasticLoadBalancingV2::ListenerRule":                   &resources.AWSElasticLoadBalancingV2ListenerRule{},
		"AWS::ElasticLoadBalancingV2::LoadBalancer":                   &resources.AWSElasticLoadBalancingV2LoadBalancer{},
		"AWS::ElasticLoadBalancingV2::TargetGroup":                    &resources.AWSElasticLoadBalancingV2TargetGroup{},
		"AWS::Elasticsearch::Domain":                                  &resources.AWSElasticsearchDomain{},
		"AWS::Events::EventBusPolicy":                                 &resources.AWSEventsEventBusPolicy{},
		"AWS::Events::Rule":                                           &resources.AWSEventsRule{},
		"AWS::FSx::FileSystem":                                        &resources.AWSFSxFileSystem{},
		"AWS::GameLift::Alias":                                        &resources.AWSGameLiftAlias{},
		"AWS::GameLift::Build":                                        &resources.AWSGameLiftBuild{},
		"AWS::GameLift::Fleet":                                        &resources.AWSGameLiftFleet{},
		"AWS::Glue::Classifier":                                       &resources.AWSGlueClassifier{},
		"AWS::Glue::Connection":                                       &resources.AWSGlueConnection{},
		"AWS::Glue::Crawler":                                          &resources.AWSGlueCrawler{},
		"AWS::Glue::Database":                                         &resources.AWSGlueDatabase{},
		"AWS::Glue::DevEndpoint":                                      &resources.AWSGlueDevEndpoint{},
		"AWS::Glue::Job":                                              &resources.AWSGlueJob{},
		"AWS::Glue::Partition":                                        &resources.AWSGluePartition{},
		"AWS::Glue::Table":                                            &resources.AWSGlueTable{},
		"AWS::Glue::Trigger":                                          &resources.AWSGlueTrigger{},
		"AWS::Greengrass::ConnectorDefinition":                        &resources.AWSGreengrassConnectorDefinition{},
		"AWS::Greengrass::ConnectorDefinitionVersion":                 &resources.AWSGreengrassConnectorDefinitionVersion{},
		"AWS::Greengrass::CoreDefinition":                             &resources.AWSGreengrassCoreDefinition{},
		"AWS::Greengrass::CoreDefinitionVersion":                      &resources.AWSGreengrassCoreDefinitionVersion{},
		"AWS::Greengrass::DeviceDefinition":                           &resources.AWSGreengrassDeviceDefinition{},
		"AWS::Greengrass::DeviceDefinitionVersion":                    &resources.AWSGreengrassDeviceDefinitionVersion{},
		"AWS::Greengrass::FunctionDefinition":                         &resources.AWSGreengrassFunctionDefinition{},
		"AWS::Greengrass::FunctionDefinitionVersion":                  &resources.AWSGreengrassFunctionDefinitionVersion{},
		"AWS::Greengrass::Group":                                      &resources.AWSGreengrassGroup{},
		"AWS::Greengrass::GroupVersion":                               &resources.AWSGreengrassGroupVersion{},
		"AWS::Greengrass::LoggerDefinition":                           &resources.AWSGreengrassLoggerDefinition{},
		"AWS::Greengrass::LoggerDefinitionVersion":                    &resources.AWSGreengrassLoggerDefinitionVersion{},
		"AWS::Greengrass::ResourceDefinitionVersion":                  &resources.AWSGreengrassResourceDefinitionVersion{},
		"AWS::Greengrass::SubscriptionDefinition":                     &resources.AWSGreengrassSubscriptionDefinition{},
		"AWS::Greengrass::SubscriptionDefinitionVersion":              &resources.AWSGreengrassSubscriptionDefinitionVersion{},
		"AWS::GuardDuty::Detector":                                    &resources.AWSGuardDutyDetector{},
		"AWS::GuardDuty::Filter":                                      &resources.AWSGuardDutyFilter{},
		"AWS::GuardDuty::IPSet":                                       &resources.AWSGuardDutyIPSet{},
		"AWS::GuardDuty::Master":                                      &resources.AWSGuardDutyMaster{},
		"AWS::GuardDuty::Member":                                      &resources.AWSGuardDutyMember{},
		"AWS::GuardDuty::ThreatIntelSet":                              &resources.AWSGuardDutyThreatIntelSet{},
		"AWS::IAM::AccessKey":                                         &resources.AWSIAMAccessKey{},
		"AWS::IAM::Group":                                             &resources.AWSIAMGroup{},
		"AWS::IAM::InstanceProfile":                                   &resources.AWSIAMInstanceProfile{},
		"AWS::IAM::ManagedPolicy":                                     &resources.AWSIAMManagedPolicy{},
		"AWS::IAM::Policy":                                            &resources.AWSIAMPolicy{},
		"AWS::IAM::Role":                                              &resources.AWSIAMRole{},
		"AWS::IAM::ServiceLinkedRole":                                 &resources.AWSIAMServiceLinkedRole{},
		"AWS::IAM::User":                                              &resources.AWSIAMUser{},
		"AWS::IAM::UserToGroupAddition":                               &resources.AWSIAMUserToGroupAddition{},
		"AWS::Inspector::AssessmentTarget":                            &resources.AWSInspectorAssessmentTarget{},
		"AWS::Inspector::AssessmentTemplate":                          &resources.AWSInspectorAssessmentTemplate{},
		"AWS::Inspector::ResourceGroup":                               &resources.AWSInspectorResourceGroup{},
		"AWS::IoT1Click::Device":                                      &resources.AWSIoT1ClickDevice{},
		"AWS::IoT1Click::Placement":                                   &resources.AWSIoT1ClickPlacement{},
		"AWS::IoT1Click::Project":                                     &resources.AWSIoT1ClickProject{},
		"AWS::IoT::Certificate":                                       &resources.AWSIoTCertificate{},
		"AWS::IoT::Policy":                                            &resources.AWSIoTPolicy{},
		"AWS::IoT::PolicyPrincipalAttachment":                         &resources.AWSIoTPolicyPrincipalAttachment{},
		"AWS::IoT::Thing":                                             &resources.AWSIoTThing{},
		"AWS::IoT::ThingPrincipalAttachment":                          &resources.AWSIoTThingPrincipalAttachment{},
		"AWS::IoT::TopicRule":                                         &resources.AWSIoTTopicRule{},
		"AWS::IoTAnalytics::Channel":                                  &resources.AWSIoTAnalyticsChannel{},
		"AWS::IoTAnalytics::Dataset":                                  &resources.AWSIoTAnalyticsDataset{},
		"AWS::IoTAnalytics::Datastore":                                &resources.AWSIoTAnalyticsDatastore{},
		"AWS::IoTAnalytics::Pipeline":                                 &resources.AWSIoTAnalyticsPipeline{},
		"AWS::KMS::Alias":                                             &resources.AWSKMSAlias{},
		"AWS::KMS::Key":                                               &resources.AWSKMSKey{},
		"AWS::Kinesis::Stream":                                        &resources.AWSKinesisStream{},
		"AWS::Kinesis::StreamConsumer":                                &resources.AWSKinesisStreamConsumer{},
		"AWS::KinesisAnalytics::Application":                          &resources.AWSKinesisAnalyticsApplication{},
		"AWS::KinesisAnalytics::ApplicationOutput":                    &resources.AWSKinesisAnalyticsApplicationOutput{},
		"AWS::KinesisAnalytics::ApplicationReferenceDataSource":       &resources.AWSKinesisAnalyticsApplicationReferenceDataSource{},
		"AWS::KinesisAnalyticsV2::Application":                        &resources.AWSKinesisAnalyticsV2Application{},
		"AWS::KinesisAnalyticsV2::ApplicationCloudWatchLoggingOption": &resources.AWSKinesisAnalyticsV2ApplicationCloudWatchLoggingOption{},
		"AWS::KinesisAnalyticsV2::ApplicationOutput":                  &resources.AWSKinesisAnalyticsV2ApplicationOutput{},
		"AWS::KinesisAnalyticsV2::ApplicationReferenceDataSource":     &resources.AWSKinesisAnalyticsV2ApplicationReferenceDataSource{},
		"AWS::KinesisFirehose::DeliveryStream":                        &resources.AWSKinesisFirehoseDeliveryStream{},
		"AWS::Lambda::Alias":                                          &resources.AWSLambdaAlias{},
		"AWS::Lambda::EventSourceMapping":                             &resources.AWSLambdaEventSourceMapping{},
		"AWS::Lambda::Function":                                       &resources.AWSLambdaFunction{},
		"AWS::Lambda::LayerVersion":                                   &resources.AWSLambdaLayerVersion{},
		"AWS::Lambda::LayerVersionPermission":                         &resources.AWSLambdaLayerVersionPermission{},
		"AWS::Lambda::Permission":                                     &resources.AWSLambdaPermission{},
		"AWS::Lambda::Version":                                        &resources.AWSLambdaVersion{},
		"AWS::Logs::Destination":                                      &resources.AWSLogsDestination{},
		"AWS::Logs::LogGroup":                                         &resources.AWSLogsLogGroup{},
		"AWS::Logs::LogStream":                                        &resources.AWSLogsLogStream{},
		"AWS::Logs::MetricFilter":                                     &resources.AWSLogsMetricFilter{},
		"AWS::Logs::SubscriptionFilter":                               &resources.AWSLogsSubscriptionFilter{},
		"AWS::Neptune::DBCluster":                                     &resources.AWSNeptuneDBCluster{},
		"AWS::Neptune::DBClusterParameterGroup":                       &resources.AWSNeptuneDBClusterParameterGroup{},
		"AWS::Neptune::DBInstance":                                    &resources.AWSNeptuneDBInstance{},
		"AWS::Neptune::DBParameterGroup":                              &resources.AWSNeptuneDBParameterGroup{},
		"AWS::Neptune::DBSubnetGroup":                                 &resources.AWSNeptuneDBSubnetGroup{},
		"AWS::OpsWorks::App":                                          &resources.AWSOpsWorksApp{},
		"AWS::OpsWorks::ElasticLoadBalancerAttachment":                &resources.AWSOpsWorksElasticLoadBalancerAttachment{},
		"AWS::OpsWorks::Instance":                                     &resources.AWSOpsWorksInstance{},
		"AWS::OpsWorks::Layer":                                        &resources.AWSOpsWorksLayer{},
		"AWS::OpsWorks::Stack":                                        &resources.AWSOpsWorksStack{},
		"AWS::OpsWorks::UserProfile":                                  &resources.AWSOpsWorksUserProfile{},
		"AWS::OpsWorks::Volume":                                       &resources.AWSOpsWorksVolume{},
		"AWS::OpsWorksCM::Server":                                     &resources.AWSOpsWorksCMServer{},
		"AWS::RAM::ResourceShare":                                     &resources.AWSRAMResourceShare{},
		"AWS::RDS::DBCluster":                                         &resources.AWSRDSDBCluster{},
		"AWS::RDS::DBClusterParameterGroup":                           &resources.AWSRDSDBClusterParameterGroup{},
		"AWS::RDS::DBInstance":                                        &resources.AWSRDSDBInstance{},
		"AWS::RDS::DBParameterGroup":                                  &resources.AWSRDSDBParameterGroup{},
		"AWS::RDS::DBSecurityGroup":                                   &resources.AWSRDSDBSecurityGroup{},
		"AWS::RDS::DBSecurityGroupIngress":                            &resources.AWSRDSDBSecurityGroupIngress{},
		"AWS::RDS::DBSubnetGroup":                                     &resources.AWSRDSDBSubnetGroup{},
		"AWS::RDS::EventSubscription":                                 &resources.AWSRDSEventSubscription{},
		"AWS::RDS::OptionGroup":                                       &resources.AWSRDSOptionGroup{},
		"AWS::Redshift::Cluster":                                      &resources.AWSRedshiftCluster{},
		"AWS::Redshift::ClusterParameterGroup":                        &resources.AWSRedshiftClusterParameterGroup{},
		"AWS::Redshift::ClusterSecurityGroup":                         &resources.AWSRedshiftClusterSecurityGroup{},
		"AWS::Redshift::ClusterSecurityGroupIngress":                  &resources.AWSRedshiftClusterSecurityGroupIngress{},
		"AWS::Redshift::ClusterSubnetGroup":                           &resources.AWSRedshiftClusterSubnetGroup{},
		"AWS::RoboMaker::Fleet":                                       &resources.AWSRoboMakerFleet{},
		"AWS::RoboMaker::Robot":                                       &resources.AWSRoboMakerRobot{},
		"AWS::RoboMaker::RobotApplication":                            &resources.AWSRoboMakerRobotApplication{},
		"AWS::RoboMaker::RobotApplicationVersion":                     &resources.AWSRoboMakerRobotApplicationVersion{},
		"AWS::RoboMaker::SimulationApplication":                       &resources.AWSRoboMakerSimulationApplication{},
		"AWS::RoboMaker::SimulationApplicationVersion":                &resources.AWSRoboMakerSimulationApplicationVersion{},
		"AWS::Route53::HealthCheck":                                   &resources.AWSRoute53HealthCheck{},
		"AWS::Route53::HostedZone":                                    &resources.AWSRoute53HostedZone{},
		"AWS::Route53::RecordSet":                                     &resources.AWSRoute53RecordSet{},
		"AWS::Route53::RecordSetGroup":                                &resources.AWSRoute53RecordSetGroup{},
		"AWS::Route53Resolver::ResolverEndpoint":                      &resources.AWSRoute53ResolverResolverEndpoint{},
		"AWS::Route53Resolver::ResolverRule":                          &resources.AWSRoute53ResolverResolverRule{},
		"AWS::Route53Resolver::ResolverRuleAssociation":               &resources.AWSRoute53ResolverResolverRuleAssociation{},
		"AWS::S3::Bucket":                                             &resources.AWSS3Bucket{},
		"AWS::S3::BucketPolicy":                                       &resources.AWSS3BucketPolicy{},
		"AWS::SDB::Domain":                                            &resources.AWSSDBDomain{},
		"AWS::SES::ConfigurationSet":                                  &resources.AWSSESConfigurationSet{},
		"AWS::SES::ConfigurationSetEventDestination":                  &resources.AWSSESConfigurationSetEventDestination{},
		"AWS::SES::ReceiptFilter":                                     &resources.AWSSESReceiptFilter{},
		"AWS::SES::ReceiptRule":                                       &resources.AWSSESReceiptRule{},
		"AWS::SES::ReceiptRuleSet":                                    &resources.AWSSESReceiptRuleSet{},
		"AWS::SES::Template":                                          &resources.AWSSESTemplate{},
		"AWS::SNS::Subscription":                                      &resources.AWSSNSSubscription{},
		"AWS::SNS::Topic":                                             &resources.AWSSNSTopic{},
		"AWS::SNS::TopicPolicy":                                       &resources.AWSSNSTopicPolicy{},
		"AWS::SQS::Queue":                                             &resources.AWSSQSQueue{},
		"AWS::SQS::QueuePolicy":                                       &resources.AWSSQSQueuePolicy{},
		"AWS::SSM::Association":                                       &resources.AWSSSMAssociation{},
		"AWS::SSM::Document":                                          &resources.AWSSSMDocument{},
		"AWS::SSM::MaintenanceWindow":                                 &resources.AWSSSMMaintenanceWindow{},
		"AWS::SSM::MaintenanceWindowTask":                             &resources.AWSSSMMaintenanceWindowTask{},
		"AWS::SSM::Parameter":                                         &resources.AWSSSMParameter{},
		"AWS::SSM::PatchBaseline":                                     &resources.AWSSSMPatchBaseline{},
		"AWS::SSM::ResourceDataSync":                                  &resources.AWSSSMResourceDataSync{},
		"AWS::SageMaker::Endpoint":                                    &resources.AWSSageMakerEndpoint{},
		"AWS::SageMaker::EndpointConfig":                              &resources.AWSSageMakerEndpointConfig{},
		"AWS::SageMaker::Model":                                       &resources.AWSSageMakerModel{},
		"AWS::SageMaker::NotebookInstance":                            &resources.AWSSageMakerNotebookInstance{},
		"AWS::SageMaker::NotebookInstanceLifecycleConfig":             &resources.AWSSageMakerNotebookInstanceLifecycleConfig{},
		"AWS::SecretsManager::ResourcePolicy":                         &resources.AWSSecretsManagerResourcePolicy{},
		"AWS::SecretsManager::RotationSchedule":                       &resources.AWSSecretsManagerRotationSchedule{},
		"AWS::SecretsManager::Secret":                                 &resources.AWSSecretsManagerSecret{},
		"AWS::SecretsManager::SecretTargetAttachment":                 &resources.AWSSecretsManagerSecretTargetAttachment{},
		"AWS::Serverless::Api":                                        &resources.AWSServerlessApi{},
		"AWS::Serverless::Application":                                &resources.AWSServerlessApplication{},
		"AWS::Serverless::Function":                                   &resources.AWSServerlessFunction{},
		"AWS::Serverless::LayerVersion":                               &resources.AWSServerlessLayerVersion{},
		"AWS::Serverless::SimpleTable":                                &resources.AWSServerlessSimpleTable{},
		"AWS::ServiceCatalog::AcceptedPortfolioShare":                 &resources.AWSServiceCatalogAcceptedPortfolioShare{},
		"AWS::ServiceCatalog::CloudFormationProduct":                  &resources.AWSServiceCatalogCloudFormationProduct{},
		"AWS::ServiceCatalog::CloudFormationProvisionedProduct":       &resources.AWSServiceCatalogCloudFormationProvisionedProduct{},
		"AWS::ServiceCatalog::LaunchNotificationConstraint":           &resources.AWSServiceCatalogLaunchNotificationConstraint{},
		"AWS::ServiceCatalog::LaunchRoleConstraint":                   &resources.AWSServiceCatalogLaunchRoleConstraint{},
		"AWS::ServiceCatalog::LaunchTemplateConstraint":               &resources.AWSServiceCatalogLaunchTemplateConstraint{},
		"AWS::ServiceCatalog::Portfolio":                              &resources.AWSServiceCatalogPortfolio{},
		"AWS::ServiceCatalog::PortfolioPrincipalAssociation":          &resources.AWSServiceCatalogPortfolioPrincipalAssociation{},
		"AWS::ServiceCatalog::PortfolioProductAssociation":            &resources.AWSServiceCatalogPortfolioProductAssociation{},
		"AWS::ServiceCatalog::PortfolioShare":                         &resources.AWSServiceCatalogPortfolioShare{},
		"AWS::ServiceCatalog::TagOption":                              &resources.AWSServiceCatalogTagOption{},
		"AWS::ServiceCatalog::TagOptionAssociation":                   &resources.AWSServiceCatalogTagOptionAssociation{},
		"AWS::ServiceDiscovery::HttpNamespace":                        &resources.AWSServiceDiscoveryHttpNamespace{},
		"AWS::ServiceDiscovery::Instance":                             &resources.AWSServiceDiscoveryInstance{},
		"AWS::ServiceDiscovery::PrivateDnsNamespace":                  &resources.AWSServiceDiscoveryPrivateDnsNamespace{},
		"AWS::ServiceDiscovery::PublicDnsNamespace":                   &resources.AWSServiceDiscoveryPublicDnsNamespace{},
		"AWS::ServiceDiscovery::Service":                              &resources.AWSServiceDiscoveryService{},
		"AWS::StepFunctions::Activity":                                &resources.AWSStepFunctionsActivity{},
		"AWS::StepFunctions::StateMachine":                            &resources.AWSStepFunctionsStateMachine{},
		"AWS::WAF::ByteMatchSet":                                      &resources.AWSWAFByteMatchSet{},
		"AWS::WAF::IPSet":                                             &resources.AWSWAFIPSet{},
		"AWS::WAF::Rule":                                              &resources.AWSWAFRule{},
		"AWS::WAF::SizeConstraintSet":                                 &resources.AWSWAFSizeConstraintSet{},
		"AWS::WAF::SqlInjectionMatchSet":                              &resources.AWSWAFSqlInjectionMatchSet{},
		"AWS::WAF::WebACL":                                            &resources.AWSWAFWebACL{},
		"AWS::WAF::XssMatchSet":                                       &resources.AWSWAFXssMatchSet{},
		"AWS::WAFRegional::ByteMatchSet":                              &resources.AWSWAFRegionalByteMatchSet{},
		"AWS::WAFRegional::IPSet":                                     &resources.AWSWAFRegionalIPSet{},
		"AWS::WAFRegional::Rule":                                      &resources.AWSWAFRegionalRule{},
		"AWS::WAFRegional::SizeConstraintSet":                         &resources.AWSWAFRegionalSizeConstraintSet{},
		"AWS::WAFRegional::SqlInjectionMatchSet":                      &resources.AWSWAFRegionalSqlInjectionMatchSet{},
		"AWS::WAFRegional::WebACL":                                    &resources.AWSWAFRegionalWebACL{},
		"AWS::WAFRegional::WebACLAssociation":                         &resources.AWSWAFRegionalWebACLAssociation{},
		"AWS::WAFRegional::XssMatchSet":                               &resources.AWSWAFRegionalXssMatchSet{},
		"AWS::WorkSpaces::Workspace":                                  &resources.AWSWorkSpacesWorkspace{},
		"Alexa::ASK::Skill":                                           &resources.AlexaASKSkill{},
	}
}
783895
func GetMetadataSources(env environs.BootstrapEnviron) ([]simplestreams.DataSource, error) {
	config := env.Config()

	// Add configured and environment-specific datasources.
	var sources []simplestreams.DataSource
	if userURL, ok := config.AgentMetadataURL(); ok {
		verify := utils.VerifySSLHostnames
		if !config.SSLHostnameVerification() {
			verify = utils.NoVerifySSLHostnames
		}
		sources = append(sources, simplestreams.NewURLSignedDataSource(conf.AgentMetadataURLKey, userURL, keys.JujuPublicKey, verify, simplestreams.SPECIFIC_CLOUD_DATA, false))
	}

	envDataSources, err := environmentDataSources(env)
	if err != nil {
		return nil, err
	}
	sources = append(sources, envDataSources...)

	// Add the default, public datasource.
	defaultURL, err := ToolsURL(DefaultBaseURL)
	if err != nil {
		return nil, err
	}
	if defaultURL != "" {
		sources = append(sources,
			simplestreams.NewURLSignedDataSource("default simplestreams", defaultURL, keys.JujuPublicKey, utils.VerifySSLHostnames, simplestreams.DEFAULT_CLOUD_DATA, true))
	}
	return sources, nil
}
1077150
func (hs *HTTPServer) getFrontendSettingsMap(c *m.ReqContext) (map[string]interface{}, error) {
	orgDataSources := make([]*m.DataSource, 0)

	if c.OrgId != 0 {
		query := m.GetDataSourcesQuery{OrgId: c.OrgId}
		err := bus.Dispatch(&query)

		if err != nil {
			return nil, err
		}

		dsFilterQuery := m.DatasourcesPermissionFilterQuery{
			User:        c.SignedInUser,
			Datasources: query.Result,
		}

		if err := bus.Dispatch(&dsFilterQuery); err != nil {
			if err != bus.ErrHandlerNotFound {
				return nil, err
			}

			orgDataSources = query.Result
		} else {
			orgDataSources = dsFilterQuery.Result
		}
	}

	datasources := make(map[string]interface{})
	var defaultDatasource string

	enabledPlugins, err := plugins.GetEnabledPlugins(c.OrgId)
	if err != nil {
		return nil, err
	}

	pluginsToPreload := []string{}

	for _, app := range enabledPlugins.Apps {
		if app.Preload {
			pluginsToPreload = append(pluginsToPreload, app.Module)
		}
	}

	for _, ds := range orgDataSources {
		url := ds.Url

		if ds.Access == m.DS_ACCESS_PROXY {
			url = "/api/datasources/proxy/" + strconv.FormatInt(ds.Id, 10)
		}

		var dsMap = map[string]interface{}{
			"id":   ds.Id,
			"type": ds.Type,
			"name": ds.Name,
			"url":  url,
		}

		meta, exists := enabledPlugins.DataSources[ds.Type]
		if !exists {
			log.Error(3, "Could not find plugin definition for data source: %v", ds.Type)
			continue
		}

		if meta.Preload {
			pluginsToPreload = append(pluginsToPreload, meta.Module)
		}

		dsMap["meta"] = meta

		if ds.IsDefault {
			defaultDatasource = ds.Name
		}

		if ds.JsonData != nil {
			dsMap["jsonData"] = ds.JsonData
		} else {
			dsMap["jsonData"] = make(map[string]string)
		}

		if ds.Access == m.DS_ACCESS_DIRECT {
			if ds.BasicAuth {
				dsMap["basicAuth"] = util.GetBasicAuthHeader(ds.BasicAuthUser, ds.DecryptedBasicAuthPassword())
			}
			if ds.WithCredentials {
				dsMap["withCredentials"] = ds.WithCredentials
			}

			if ds.Type == m.DS_INFLUXDB_08 {
				dsMap["username"] = ds.User
				dsMap["password"] = ds.DecryptedPassword()
				dsMap["url"] = url + "/db/" + ds.Database
			}

			if ds.Type == m.DS_INFLUXDB {
				dsMap["username"] = ds.User
				dsMap["password"] = ds.DecryptedPassword()
				dsMap["url"] = url
			}
		}

		if ds.Type == m.DS_ES {
			dsMap["index"] = ds.Database
		}

		if ds.Type == m.DS_INFLUXDB {
			dsMap["database"] = ds.Database
		}

		if ds.Type == m.DS_PROMETHEUS {
			// add unproxied server URL for link to Prometheus web UI
			dsMap["directUrl"] = ds.Url
		}

		datasources[ds.Name] = dsMap
	}

	// add datasources that are built in (meaning they are not added via data sources page, nor have any entry in datasource table)
	for _, ds := range plugins.DataSources {
		if ds.BuiltIn {
			datasources[ds.Name] = map[string]interface{}{
				"type": ds.Type,
				"name": ds.Name,
				"meta": plugins.DataSources[ds.Id],
			}
		}
	}

	if defaultDatasource == "" {
		defaultDatasource = "-- Grafana --"
	}

	panels := map[string]interface{}{}
	for _, panel := range enabledPlugins.Panels {
		if panel.State == plugins.PluginStateAlpha && !hs.Cfg.PluginsEnableAlpha {
			continue
		}

		if panel.Preload {
			pluginsToPreload = append(pluginsToPreload, panel.Module)
		}

		panels[panel.Id] = map[string]interface{}{
			"module":       panel.Module,
			"baseUrl":      panel.BaseUrl,
			"name":         panel.Name,
			"id":           panel.Id,
			"info":         panel.Info,
			"hideFromList": panel.HideFromList,
			"sort":         getPanelSort(panel.Id),
			"dataFormats":  panel.DataFormats,
			"state":        panel.State,
		}
	}

	jsonObj := map[string]interface{}{
		"defaultDatasource":          defaultDatasource,
		"datasources":                datasources,
		"panels":                     panels,
		"appSubUrl":                  setting.AppSubUrl,
		"allowOrgCreate":             (setting.AllowUserOrgCreate && c.IsSignedIn) || c.IsGrafanaAdmin,
		"authProxyEnabled":           setting.AuthProxyEnabled,
		"ldapEnabled":                setting.LdapEnabled,
		"alertingEnabled":            setting.AlertingEnabled,
		"alertingErrorOrTimeout":     setting.AlertingErrorOrTimeout,
		"alertingNoDataOrNullValues": setting.AlertingNoDataOrNullValues,
		"exploreEnabled":             setting.ExploreEnabled,
		"googleAnalyticsId":          setting.GoogleAnalyticsId,
		"disableLoginForm":           setting.DisableLoginForm,
		"externalUserMngInfo":        setting.ExternalUserMngInfo,
		"externalUserMngLinkUrl":     setting.ExternalUserMngLinkUrl,
		"externalUserMngLinkName":    setting.ExternalUserMngLinkName,
		"viewersCanEdit":             setting.ViewersCanEdit,
		"editorsCanAdmin":            hs.Cfg.EditorsCanAdmin,
		"disableSanitizeHtml":        hs.Cfg.DisableSanitizeHtml,
		"pluginsToPreload":           pluginsToPreload,
		"buildInfo": map[string]interface{}{
			"version":       setting.BuildVersion,
			"commit":        setting.BuildCommit,
			"buildstamp":    setting.BuildStamp,
			"latestVersion": plugins.GrafanaLatestVersion,
			"hasUpdate":     plugins.GrafanaHasUpdate,
			"env":           setting.Env,
			"isEnterprise":  setting.IsEnterprise,
		},
	}

	return jsonObj, nil
}
277042
func (s *TelegrafConfigStore) CreateUserResourceMapping(ctx context.Context, m *platform.UserResourceMapping) error {
	return s.CreateUserResourceMappingF(ctx, m)
}