// maybeGetStorageClient returns the environment's storage client if it
// has one, and nil if it does not.
760374
func (env *azureEnviron) maybeGetStorageClient() (internalazurestorage.Client, *storage.Account, error) {
	storageClient, storageAccount, err := env.getStorageClient()
	if errors.IsNotFound(err) {
		// Only models created prior to Juju 2.3 will have a storage
		// account. Juju 2.3 onwards exclusively uses managed disks
		// for all new models, and handles both managed and unmanaged
		// disks for upgraded models.
		storageClient = nil
		storageAccount = nil
	} else if err != nil {
		return nil, nil, errors.Trace(err)
	}
	return storageClient, storageAccount, nil
}
1052019
func (c *StorageV1beta1Client) RESTClient() rest.Interface {
	if c == nil {
		return nil
	}
	return c.restClient
}
1271076
func (s *supportImpl) GetChaincodeFromLocalStorage(ccname string, ccversion string) (ccprovider.CCPackage, error) {
	return ccprovider.GetChaincodeFromFS(ccname, ccversion)
}
1369014
func GetClassForVolume(kubeClient clientset.Interface, pv *v1.PersistentVolume) (*storage.StorageClass, error) {
	if kubeClient == nil {
		return nil, fmt.Errorf("Cannot get kube client")
	}
	className := v1helper.GetPersistentVolumeClass(pv)
	if className == "" {
		return nil, fmt.Errorf("Volume has no storage class")
	}

	class, err := kubeClient.StorageV1().StorageClasses().Get(className, metav1.GetOptions{})
	if err != nil {
		return nil, err
	}
	return class, nil
}
547079
func (m *MockStorageClassInterface) Get(arg0 string, arg1 v10.GetOptions) (*v1.StorageClass, error) {
	ret := m.ctrl.Call(m, "Get", arg0, arg1)
	ret0, _ := ret[0].(*v1.StorageClass)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}
960152
func (ec *EthereumClient) GetStorageAt(ctx *Context, account *Address, key *Hash, number int64) (storage []byte, _ error) {
	if number < 0 {
		return ec.client.StorageAt(ctx.context, account.address, key.hash, nil)
	}
	return ec.client.StorageAt(ctx.context, account.address, key.hash, big.NewInt(number))
}
85221
func (provider *HerokuProvider) GetClient(creds *common.Credentials) (*http.Client, error) {
	return oauth2.GetClient(provider.TripperFactory(), creds, provider)
}
1263401
func (r Network_Storage_Hub_Swift_Share) GetFile(fileName *string, container *string) (resp datatypes.Container_Network_Storage_Hub_ObjectStorage_File, err error) {
	params := []interface{}{
		fileName,
		container,
	}
	err = r.Session.DoRequest("SoftLayer_Network_Storage_Hub_Swift_Share", "getFile", params, &r.Options, &resp)
	return
}
1003803
func (c *Config) GetStore() (cstorage.Store, error) {
	return cstorage.GetStore(cstorage.StoreOptions{
		RunRoot:            c.RunRoot,
		GraphRoot:          c.Root,
		GraphDriverName:    c.Storage,
		GraphDriverOptions: c.StorageOptions,
	})
}
460324
func (s *storageClassLister) Get(name string) (*v1.StorageClass, error) {
	obj, exists, err := s.indexer.GetByKey(name)
	if err != nil {
		return nil, err
	}
	if !exists {
		return nil, errors.NewNotFound(v1.Resource("storageclass"), name)
	}
	return obj.(*v1.StorageClass), nil
}
809478
func newGoogleStorageClient(config stow.Config) (*storage.Service, error) {
	json, _ := config.Config(ConfigJSON)
	var httpClient *http.Client
	scopes := []string{storage.DevstorageReadWriteScope}
	if s, ok := config.Config(ConfigScopes); ok && s != "" {
		scopes = strings.Split(s, ",")
	}
	if json != "" {
		jwtConf, err := google.JWTConfigFromJSON([]byte(json), scopes...)
		if err != nil {
			return nil, err
		}
		httpClient = jwtConf.Client(context.Background())

	} else {
		creds, err := google.FindDefaultCredentials(context.Background(), strings.Join(scopes, ","))
		if err != nil {
			return nil, err
		}
		httpClient = oauth2.NewClient(context.Background(), creds.TokenSource)
	}
	service, err := storage.New(httpClient)
	if err != nil {
		return nil, err
	}

	return service, nil
}
248341
func (s *RateLimitedStorage) Get(key interface{}) (interface{}, error) {
	s.wait()
	defer s.signal()

	return s.storage.Get(key)
}
635570
func (_m *MetricsClient) GetAvailableStorage(_a0 time.Duration, _a1 string, _a2 ...string) (*metrics.StorageMetrics, error) {
	ret := _m.Called(_a0, _a1, _a2)

	var r0 *metrics.StorageMetrics
	if rf, ok := ret.Get(0).(func(time.Duration, string, ...string) *metrics.StorageMetrics); ok {
		r0 = rf(_a0, _a1, _a2...)
	} else {
		if ret.Get(0) != nil {
			r0 = ret.Get(0).(*metrics.StorageMetrics)
		}
	}

	var r1 error
	if rf, ok := ret.Get(1).(func(time.Duration, string, ...string) error); ok {
		r1 = rf(_a0, _a1, _a2...)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}
1369170
func (n *Node) GetEthereumClient() (client *EthereumClient, _ error) {
	rpc, err := n.node.Attach()
	if err != nil {
		return nil, err
	}
	return &EthereumClient{ethclient.NewClient(rpc)}, nil
}
360955
func (m *MockRequester) GetClient() fosite.Client {
	ret := m.ctrl.Call(m, "GetClient")
	ret0, _ := ret[0].(fosite.Client)
	return ret0
}
451462
func (s *GenericStorage) Get(key interface{}) (interface{}, error) {
	if s.get == nil && s.getMulti == nil {
		return nil, errors.Newf(
			"'%s' does not have Get/GetMulti implementation",
			s.name)
	}

	s.rwMutex.RLock()
	defer s.rwMutex.RUnlock()

	if s.get != nil {
		return s.get(key)
	}

	items, err := s.getMulti(key)
	if err != nil {
		return nil, err
	}
	return items[0], nil
}
427384
func (s *Storage) GetClient(id string) (osin.Client, error) {
	row := s.db.QueryRow("SELECT id, secret, redirect_uri, extra FROM client WHERE id=$1", id)
	var c osin.DefaultClient
	var extra string

	if err := row.Scan(&c.Id, &c.Secret, &c.RedirectUri, &extra); err == sql.ErrNoRows {
		return nil, pkg.ErrNotFound
	} else if err != nil {
		return nil, errors.New(err)
	}
	c.UserData = extra
	return &c, nil
}