// Provider returns a terraform.ResourceProvider.
776007
func Provider() terraform.ResourceProvider {
	return &schema.Provider{
		Schema: map[string]*schema.Schema{},

		ResourcesMap: map[string]*schema.Resource{
			"random_id":      resourceId(),
			"random_shuffle": resourceShuffle(),
			"random_pet":     resourcePet(),
			"random_string":  resourceString(),
			"random_integer": resourceInteger(),
			"random_uuid":    resourceUuid(),
		},
	}
}
1073084
func (p *Provider) PrepareProviderConfig(req providers.PrepareProviderConfigRequest) providers.PrepareProviderConfigResponse {
	// At this moment there is nothing to configure for the terraform provider,
	// so we will happily return without taking any action
	var res providers.PrepareProviderConfigResponse
	res.PreparedConfig = req.Config
	return res
}
1294
func (p *Provider) Refresh(
	info *terraform.InstanceInfo,
	s *terraform.InstanceState) (*terraform.InstanceState, error) {
	r, ok := p.ResourcesMap[info.Type]
	if !ok {
		return nil, fmt.Errorf("unknown resource type: %s", info.Type)
	}

	return r.Refresh(s, p.meta)
}
976431
func (l *Client) GetProvider(id string) (Provider, error) {
	res := ApiResp{}
	data := Provider{}

	// make the request
	err := l.Get(parseLyticsURL(providerEndpoint, map[string]string{"id": id}), nil, nil, &res, &data)
	if err != nil {
		return data, err
	}

	return data, nil
}
1032217
func (c *ProvidersClient) Create(ctx context.Context, createProvider *CreateProvider) (*Provider, error) {
	p := "/providers/"

	req, err := c.backend.NewRequest(http.MethodPost, p, nil, createProvider)
	if err != nil {
		return nil, err
	}

	var resp Provider
	_, err = c.backend.Do(ctx, req, &resp, func(code int) error {
		switch code {
		case 400, 403, 409, 500:
			return &Error{}
		default:
			return nil
		}
	})
	if err != nil {
		return nil, err
	}

	return &resp, nil
}
716798
func (*maasEnviron) StorageProvider(t storage.ProviderType) (storage.Provider, error) {
	if t == maasStorageProviderType {
		return maasStorageProvider{}, nil
	}
	return nil, errors.NotFoundf("storage provider %q", t)
}
598472
func (mr *MockEnvironMockRecorder) Provider() *gomock.Call {
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Provider", reflect.TypeOf((*MockEnviron)(nil).Provider))
}
387130
func NewProvider(datafile string) (isp.Provider, error) {
	r, err := geoip2.Open(datafile)
	if err != nil {
		return nil, fmt.Errorf("Unable to open datafile at %v: %v", datafile, err)
	}
	prov := &provider{r}
	return prov, nil
}
638398
func Provider(providerName string) BillProvider {
	if _, ok := BillProviders[providerName]; !ok {
		providerName = "nop"
	}
	return BillProviders[providerName]
}
534104
func CloudOrProvider(cloudName string, cloudByNameFunc func(string) (*jujucloud.Cloud, error)) (cloud *jujucloud.Cloud, err error) {
	if cloud, err = cloudByNameFunc(cloudName); err != nil {
		if !errors.IsNotFound(err) {
			return nil, err
		}
		builtInClouds, err := BuiltInClouds()
		if err != nil {
			return nil, errors.Trace(err)
		}
		if builtIn, ok := builtInClouds[cloudName]; !ok {
			return nil, errors.NotValidf("cloud %v", cloudName)
		} else {
			cloud = &builtIn
		}
	}
	return cloud, nil
}
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
}
157790
func GetProvider(name string) (Provider, error) {
	provider := providers[name]
	if provider == nil {
		return nil, fmt.Errorf("no provider for %s exists", name)
	}
	return provider, nil
}
237031
func (n *NodeAbstractProvider) ProviderConfig() *configs.Provider {
	if n.Config == nil {
		return nil
	}

	return n.Config
}
1313805
func (s *EventFeedbackType) SetProvider(v string) *EventFeedbackType {
	s.Provider = &v
	return s
}
1366804
func (s *DeleteCustomActionTypeInput) SetProvider(v string) *DeleteCustomActionTypeInput {
	s.Provider = &v
	return s
}
104636
func (s *ActionTypeId) SetProvider(v string) *ActionTypeId {
	s.Provider = &v
	return s
}
458756
func (m *Meta) providerPluginSet() discovery.PluginMetaSet {
	plugins := discovery.FindPlugins("provider", m.pluginDirs(true))

	// Add providers defined in the legacy .terraformrc,
	if m.PluginOverrides != nil {
		for k, v := range m.PluginOverrides.Providers {
			log.Printf("[DEBUG] found plugin override in .terraformrc: %q, %q", k, v)
		}
		plugins = plugins.OverridePaths(m.PluginOverrides.Providers)
	}

	plugins, _ = plugins.ValidateVersions()

	for p := range plugins {
		log.Printf("[DEBUG] found valid plugin: %q, %q, %q", p.Name, p.Version, p.Path)
	}

	return plugins
}