func (c *CredentialsClient) Create(ctx context.Context, cred *apitypes.Credential,
	progress *ProgressFunc) (*apitypes.CredentialEnvelope, error) {

	env := apitypes.CredentialEnvelope{Version: 2, Body: cred}
	req, reqID, err := c.client.NewRequest("POST", "/credentials", nil, &env, false)
	if err != nil {
		return nil, err
	}

	resp := apitypes.CredentialResp{}
	_, err = c.client.Do(ctx, req, &resp, &reqID, progress)
	if err != nil {
		return nil, err
	}

	out, err := createEnvelopeFromResp(resp)
	return out, err
}
// Create creates the given credential
Create creates the given credential
// Create creates the given credential
func (c *CredentialsClient) Create(ctx context.Context, cred *apitypes.Credential,
	progress *ProgressFunc) (*apitypes.CredentialEnvelope, error) {
	env := apitypes.CredentialEnvelope{Version: 2, Body: cred}
	req, reqID, err := c.client.NewRequest("POST", "/credentials", nil, &env, false)
	if err != nil {
		return nil, err
	}
	resp := apitypes.CredentialResp{}
	_, err = c.client.Do(ctx, req, &resp, &reqID, progress)
	if err != nil {
		return nil, err
	}
	out, err := createEnvelopeFromResp(resp)
	return out, err
}
func ( c * CredentialsClient ) Create ( ctx context . Context , cred * apitypes . Credential , progress * ProgressFunc ) ( * apitypes . CredentialEnvelope , error ) { env := apitypes . CredentialEnvelope { Version : 2 , Body : cred } req , reqID , err := c . client . NewRequest ( " " , " " , nil , & env , false ) if err != nil { return nil , err } resp := apitypes . CredentialResp { } _ , err = c . client . Do ( ctx , req , & resp , & reqID , progress ) if err != nil { return nil , err } out , err := createEnvelopeFromResp ( resp ) return out , err }
Create creates the given credential
Create creates the given credential