func (c *InfoClient) Info(ctx context.Context, name string, options ...InfoOption) (transport.InfoResponse, error) {
	opts := newInfoOptions()
	for _, option := range options {
		option(opts)
	}

	c.logger.Tracef("Info(%s)", name)
	var resp transport.InfoResponse
	path, err := c.path.Join(name)
	if err != nil {
		return resp, errors.Trace(err)
	}

	path, err = path.Query("fields", defaultInfoFilter())
	if err != nil {
		return resp, errors.Trace(err)
	}

	if opts.channel != nil {
		path, err = path.Query("channel", *opts.channel)
		if err != nil {
			return resp, errors.Trace(err)
		}
	}

	restResp, err := c.client.Get(ctx, path, &resp)
	if err != nil {
		return resp, errors.Trace(err)
	}
	if restResp.StatusCode == http.StatusNotFound {
		return resp, errors.NotFoundf(name)
	}
	if err := handleBasicAPIErrors(resp.ErrorList, c.logger); err != nil {
		return resp, errors.Trace(err)
	}

	switch resp.Type {
	case transport.CharmType, transport.BundleType:
	default:
		return resp, errors.Errorf("unexpected response type %q, expected charm or bundle", resp.Type)
	}

	if c.logger.IsTraceEnabled() {
		c.logger.Tracef("Info() unmarshalled: %s", pretty.Sprint(resp))
	}
	return resp, nil
}
// Info requests the information of a given charm. If that charm doesn't exist
// an error stating that fact will be returned.
Info requests the information of a given charm. If that charm doesn't exist
an error stating that fact will be returned.
// Info requests the information of a given charm . If that charm doesn ' t exist // an error stating that fact will be returned .
func (c *InfoClient) Info(ctx context.Context, name string, options ...InfoOption) (transport.InfoResponse, error) {
	opts := newInfoOptions()
	for _, option := range options {
		option(opts)
	}
	c.logger.Tracef("Info(%s)", name)
	var resp transport.InfoResponse
	path, err := c.path.Join(name)
	if err != nil {
		return resp, errors.Trace(err)
	}
	path, err = path.Query("fields", defaultInfoFilter())
	if err != nil {
		return resp, errors.Trace(err)
	}
	if opts.channel != nil {
		path, err = path.Query("channel", *opts.channel)
		if err != nil {
			return resp, errors.Trace(err)
		}
	}
	restResp, err := c.client.Get(ctx, path, &resp)
	if err != nil {
		return resp, errors.Trace(err)
	}
	if restResp.StatusCode == http.StatusNotFound {
		return resp, errors.NotFoundf(name)
	}
	if err := handleBasicAPIErrors(resp.ErrorList, c.logger); err != nil {
		return resp, errors.Trace(err)
	}
	switch resp.Type {
	case transport.CharmType, transport.BundleType:
	default:
		return resp, errors.Errorf("unexpected response type %q, expected charm or bundle", resp.Type)
	}
	if c.logger.IsTraceEnabled() {
		c.logger.Tracef("Info() unmarshalled: %s", pretty.Sprint(resp))
	}
	return resp, nil
}
func ( c * InfoClient ) Info ( ctx context . Context , name string , options ... InfoOption ) ( transport . InfoResponse , error ) { opts := newInfoOptions ( ) for _ , option := range options { option ( opts ) } c . logger . Tracef ( " " , name ) var resp transport . InfoResponse path , err := c . path . Join ( name ) if err != nil { return resp , errors . Trace ( err ) } path , err = path . Query ( " " , defaultInfoFilter ( ) ) if err != nil { return resp , errors . Trace ( err ) } if opts . channel != nil { path , err = path . Query ( " " , * opts . channel ) if err != nil { return resp , errors . Trace ( err ) } } restResp , err := c . client . Get ( ctx , path , & resp ) if err != nil { return resp , errors . Trace ( err ) } if restResp . StatusCode == http . StatusNotFound { return resp , errors . NotFoundf ( name ) } if err := handleBasicAPIErrors ( resp . ErrorList , c . logger ) ; err != nil { return resp , errors . Trace ( err ) } switch resp . Type { case transport . CharmType , transport . BundleType : default : return resp , errors . Errorf ( " " , resp . Type ) } if c . logger . IsTraceEnabled ( ) { c . logger . Tracef ( " " , pretty . Sprint ( resp ) ) } return resp , nil }
Info requests the information of a given charm.
Info requests the information of a given charm .