func (s *EnvironmentsService) CreateEnvironment(pid interface{}, opt *CreateEnvironmentOptions, options ...OptionFunc) (*Environment, *Response, error) {
	project, err := parseID(pid)
	if err != nil {
		return nil, nil, err
	}
	u := fmt.Sprintf("projects/%s/environments", pathEscape(project))
	req, err := s.client.NewRequest("POST", u, opt, options)
	if err != nil {
		return nil, nil, err
	}
	env := new(Environment)
	resp, err := s.client.Do(req, env)
	if err != nil {
		return nil, resp, err
	}
	return env, resp, err
}
CreateEnvironment adds an environment to a project. This is an idempotent
method and can be called multiple times with the same parameters. Createing
an environment that is already a environment does not affect the
existing environmentship.

GitLab API docs:
https://docs.gitlab.com/ee/api/environments.html#create-a-new-environment
package gitlab
import (
	"fmt"
)
type EnvironmentsService struct {
	client *Client
}
type Environment struct {
	ID          int    `json:"id"`
	Name        string `json:"name"`
	Slug        string `json:"slug"`
	ExternalURL string `json:"external_url"`
}
func (env Environment) String() string {
	return Stringify(env)
}
type ListEnvironmentsOptions ListOptions
func (s *EnvironmentsService) ListEnvironments(pid interface{}, opts *ListEnvironmentsOptions, options ...OptionFunc) ([]*Environment, *Response, error) {
	project, err := parseID(pid)
	if err != nil {
		return nil, nil, err
	}
	u := fmt.Sprintf("projects/%s/environments", pathEscape(project))
	req, err := s.client.NewRequest("GET", u, opts, options)
	if err != nil {
		return nil, nil, err
	}
	var envs []*Environment
	resp, err := s.client.Do(req, &envs)
	if err != nil {
		return nil, resp, err
	}
	return envs, resp, err
}
type CreateEnvironmentOptions struct {
	Name        *string `url:"name,omitempty" json:"name,omitempty"`
	ExternalURL *string `url:"external_url,omitempty" json:"external_url,omitempty"`
}