func (e *EnvironmentsClient) Create(ctx context.Context, orgID, projectID *identity.ID, name string) error {
	if orgID == nil || projectID == nil {
		return errors.New("invalid org or project")
	}

	envBody := primitive.Environment{
		Name:      name,
		OrgID:     orgID,
		ProjectID: projectID,
	}

	ID, err := identity.NewMutable(&envBody)
	if err != nil {
		return err
	}

	env := apitypes.Environment{
		ID:      ID.String(),
		Version: 1,
		Body:    &envBody,
	}

	req, _, err := e.client.NewRequest("POST", "/envs", nil, env, true)
	if err != nil {
		return err
	}

	_, err = e.client.Do(ctx, req, nil, nil, nil)
	return err
}
// Create generates a new env object for an org/project ID
Create generates a new env object for an org/project ID
// Create generates a new env object for an org / project ID
func (e *EnvironmentsClient) Create(ctx context.Context, orgID, projectID *identity.ID, name string) error {
	if orgID == nil || projectID == nil {
		return errors.New("invalid org or project")
	}
	envBody := primitive.Environment{
		Name:      name,
		OrgID:     orgID,
		ProjectID: projectID,
	}
	ID, err := identity.NewMutable(&envBody)
	if err != nil {
		return err
	}
	env := apitypes.Environment{
		ID:      ID.String(),
		Version: 1,
		Body:    &envBody,
	}
	req, _, err := e.client.NewRequest("POST", "/envs", nil, env, true)
	if err != nil {
		return err
	}
	_, err = e.client.Do(ctx, req, nil, nil, nil)
	return err
}
func ( e * EnvironmentsClient ) Create ( ctx context . Context , orgID , projectID * identity . ID , name string ) error { if orgID == nil || projectID == nil { return errors . New ( " " ) } envBody := primitive . Environment { Name : name , OrgID : orgID , ProjectID : projectID , } ID , err := identity . NewMutable ( & envBody ) if err != nil { return err } env := apitypes . Environment { ID : ID . String ( ) , Version : 1 , Body : & envBody , } req , _ , err := e . client . NewRequest ( " " , " " , nil , env , true ) if err != nil { return err } _ , err = e . client . Do ( ctx , req , nil , nil , nil ) return err }
Create generates a new env object for an org/project ID
Create generates a new env object for an org / project ID