// Create an organization membership with the given options.
Create an organization membership with the given options.
// Create an organization membership with the given options .
func (s *organizationMemberships) Create(ctx context.Context, organization string, options OrganizationMembershipCreateOptions) (*OrganizationMembership, error) {
	if !validStringID(&organization) {
		return nil, errors.New("invalid value for organization")
	}
	if err := options.valid(); err != nil {
		return nil, err
	}
	options.ID = ""
	u := fmt.Sprintf("organizations/%s/organization-memberships", url.QueryEscape(organization))
	req, err := s.client.newRequest("POST", u, &options)
	if err != nil {
		return nil, err
	}
	m := &OrganizationMembership{}
	err = s.client.do(ctx, req, m)
	if err != nil {
		return nil, err
	}
	return m, nil
}
func ( s * organizationMemberships ) Create ( ctx context . Context , organization string , options OrganizationMembershipCreateOptions ) ( * OrganizationMembership , error ) { if ! validStringID ( & organization ) { return nil , errors . New ( " " ) } if err := options . valid ( ) ; err != nil { return nil , err } options . ID = " " u := fmt . Sprintf ( " " , url . QueryEscape ( organization ) ) req , err := s . client . newRequest ( " " , u , & options ) if err != nil { return nil , err } m := & OrganizationMembership { } err = s . client . do ( ctx , req , m ) if err != nil { return nil , err } return m , nil }
Create an organization membership with the given options.
Create an organization membership with the given options .