def create_environmentgroup_with_name(step, stored, name, type_name):
    model = EnvironmentgroupModel()
    name = model.get_stored_or_store_name(stored, name)

    type_resid = EnvironmenttypeModel().get_resid(type_name)[0]

    post_payload = {
                    "name": name,
                    "description": "oh, this old thing...",
                    "companyId": CompanyModel().get_seed_resid()[0],
                    "environmentTypeId": type_resid
                    }
    model.create(post_payload)
def create_environmentgroups(step):
    model = EnvironmentgroupModel()

    for envgrp in step.hashes:

        type_resid = EnvironmenttypeModel().get_resid(envgrp["environmenttype name"],)[0]

        post_payload = {
                        "name": envgrp["name"],
                        "description": envgrp["description"],
                        "companyId": CompanyModel().get_seed_resid()[0],
                        "environmentTypeId": type_resid
                        }
        model.create(post_payload)