// GENERATED CODE - DO NOT MODIFY BY HAND
// GENERATED BY CI PACKAGE
// ignore_for_file: type=lint
import 'dart:io';

class Vendor {
  Vendor._(this.name, this.isPullRequest);

  /// The name of the CI vendor.
  final String name;

  /// Whether this CI run is for a Pull Request.
  final bool isPullRequest;

  /// Returns true if AWS CodeBuild is the current CI vendor.
  static bool get IS_CODEBUILD {
    return Platform.environment.containsKey('CODEBUILD_BUILD_ARN');
  }

  /// Returns true if AppVeyor is the current CI vendor.
  static bool get IS_APPVEYOR {
    return Platform.environment.containsKey('APPVEYOR');
  }

  /// Returns true if Appcircle is the current CI vendor.
  static bool get IS_APPCIRCLE {
    return Platform.environment.containsKey('AC_APPCIRCLE');
  }

  /// Returns true if Azure Pipelines is the current CI vendor.
  static bool get IS_AZURE_PIPELINES {
    return Platform.environment
        .containsKey('SYSTEM_TEAMFOUNDATIONCOLLECTIONURI');
  }

  /// Returns true if Bamboo is the current CI vendor.
  static bool get IS_BAMBOO {
    return Platform.environment.containsKey('bamboo_planKey');
  }

  /// Returns true if Bitbucket Pipelines is the current CI vendor.
  static bool get IS_BITBUCKET {
    return Platform.environment.containsKey('BITBUCKET_COMMIT');
  }

  /// Returns true if Bitrise is the current CI vendor.
  static bool get IS_BITRISE {
    return Platform.environment.containsKey('BITRISE_IO');
  }

  /// Returns true if Buddy is the current CI vendor.
  static bool get IS_BUDDY {
    return Platform.environment.containsKey('BUDDY_WORKSPACE_ID');
  }

  /// Returns true if Buildkite is the current CI vendor.
  static bool get IS_BUILDKITE {
    return Platform.environment.containsKey('BUILDKITE');
  }

  /// Returns true if CircleCI is the current CI vendor.
  static bool get IS_CIRCLE {
    return Platform.environment.containsKey('CIRCLECI');
  }

  /// Returns true if Cirrus CI is the current CI vendor.
  static bool get IS_CIRRUS {
    return Platform.environment.containsKey('CIRRUS_CI');
  }

  /// Returns true if Codefresh is the current CI vendor.
  static bool get IS_CODEFRESH {
    return Platform.environment.containsKey('CF_BUILD_ID');
  }

  /// Returns true if Codemagic is the current CI vendor.
  static bool get IS_CODEMAGIC {
    return Platform.environment.containsKey('FCI_BUILD_ID');
  }

  /// Returns true if Codeship is the current CI vendor.
  static bool get IS_CODESHIP {
    return Platform.environment['CI_NAME'] == 'codeship';
  }

  /// Returns true if Drone is the current CI vendor.
  static bool get IS_DRONE {
    return Platform.environment.containsKey('DRONE');
  }

  /// Returns true if Expo Application Services is the current CI vendor.
  static bool get IS_EAS {
    return Platform.environment.containsKey('EAS_BUILD');
  }

  /// Returns true if GitHub Actions is the current CI vendor.
  static bool get IS_GITHUB_ACTIONS {
    return Platform.environment.containsKey('GITHUB_ACTIONS');
  }

  /// Returns true if GitLab CI is the current CI vendor.
  static bool get IS_GITLAB {
    return Platform.environment.containsKey('GITLAB_CI');
  }

  /// Returns true if GoCD is the current CI vendor.
  static bool get IS_GOCD {
    return Platform.environment.containsKey('GO_PIPELINE_LABEL');
  }

  /// Returns true if Hudson is the current CI vendor.
  static bool get IS_HUDSON {
    return Platform.environment.containsKey('HUDSON_URL');
  }

  /// Returns true if Jenkins is the current CI vendor.
  static bool get IS_JENKINS {
    return Platform.environment.containsKey("JENKINS_URL") &&
        Platform.environment.containsKey("BUILD_ID");
  }

  /// Returns true if LayerCI is the current CI vendor.
  static bool get IS_LAYERCI {
    return Platform.environment.containsKey('LAYERCI');
  }

  /// Returns true if Magnum CI is the current CI vendor.
  static bool get IS_MAGNUM {
    return Platform.environment.containsKey('MAGNUM');
  }

  /// Returns true if Netlify CI is the current CI vendor.
  static bool get IS_NETLIFY {
    return Platform.environment.containsKey('NETLIFY');
  }

  /// Returns true if Nevercode is the current CI vendor.
  static bool get IS_NEVERCODE {
    return Platform.environment.containsKey('NEVERCODE');
  }

  /// Returns true if Render is the current CI vendor.
  static bool get IS_RENDER {
    return Platform.environment.containsKey('RENDER');
  }

  /// Returns true if Sail CI is the current CI vendor.
  static bool get IS_SAIL {
    return Platform.environment.containsKey('SAILCI');
  }

  /// Returns true if Screwdriver is the current CI vendor.
  static bool get IS_SCREWDRIVER {
    return Platform.environment.containsKey('SCREWDRIVER');
  }

  /// Returns true if Semaphore is the current CI vendor.
  static bool get IS_SEMAPHORE {
    return Platform.environment.containsKey('SEMAPHORE');
  }

  /// Returns true if Shippable is the current CI vendor.
  static bool get IS_SHIPPABLE {
    return Platform.environment.containsKey('SHIPPABLE');
  }

  /// Returns true if Solano CI is the current CI vendor.
  static bool get IS_SOLANO {
    return Platform.environment.containsKey('TDDIUM');
  }

  /// Returns true if Strider CD is the current CI vendor.
  static bool get IS_STRIDER {
    return Platform.environment.containsKey('STRIDER');
  }

  /// Returns true if TaskCluster is the current CI vendor.
  static bool get IS_TASKCLUSTER {
    return Platform.environment.containsKey("TASK_ID") &&
        Platform.environment.containsKey("RUN_ID");
  }

  /// Returns true if TeamCity is the current CI vendor.
  static bool get IS_TEAMCITY {
    return Platform.environment.containsKey('TEAMCITY_VERSION');
  }

  /// Returns true if Travis CI is the current CI vendor.
  static bool get IS_TRAVIS {
    return Platform.environment.containsKey('TRAVIS');
  }

  /// Returns true if Vercel is the current CI vendor.
  static bool get IS_VERCEL {
    return Platform.environment.containsKey('NOW_BUILDER');
  }

  /// Returns true if Visual Studio App Center is the current CI vendor.
  static bool get IS_APPCENTER {
    return Platform.environment.containsKey('APPCENTER_BUILD_ID');
  }

  /// Returns true if dsari is the current CI vendor.
  static bool get IS_DSARI {
    return Platform.environment.containsKey('DSARI');
  }

  /// Returns the current CI [Vendor] or [null] if no CI vendor detected (e.g. not running on CI).
  static Vendor? get current {
    if (IS_CODEBUILD) {
      return Vendor._(
        'AWS CodeBuild',
        false,
      );
    }

    if (IS_APPVEYOR) {
      return Vendor._(
        'AppVeyor',
        Platform.environment.containsKey('APPVEYOR_PULL_REQUEST_NUMBER'),
      );
    }

    if (IS_APPCIRCLE) {
      return Vendor._(
        'Appcircle',
        false,
      );
    }

    if (IS_AZURE_PIPELINES) {
      return Vendor._(
        'Azure Pipelines',
        Platform.environment.containsKey('SYSTEM_PULLREQUEST_PULLREQUESTID'),
      );
    }

    if (IS_BAMBOO) {
      return Vendor._(
        'Bamboo',
        false,
      );
    }

    if (IS_BITBUCKET) {
      return Vendor._(
        'Bitbucket Pipelines',
        Platform.environment.containsKey('BITBUCKET_PR_ID'),
      );
    }

    if (IS_BITRISE) {
      return Vendor._(
        'Bitrise',
        Platform.environment.containsKey('BITRISE_PULL_REQUEST'),
      );
    }

    if (IS_BUDDY) {
      return Vendor._(
        'Buddy',
        Platform.environment.containsKey('BUDDY_EXECUTION_PULL_REQUEST_ID'),
      );
    }

    if (IS_BUILDKITE) {
      return Vendor._(
        'Buildkite',
        Platform.environment['BUILDKITE_PULL_REQUEST'] != 'false',
      );
    }

    if (IS_CIRCLE) {
      return Vendor._(
        'CircleCI',
        Platform.environment.containsKey('CIRCLE_PULL_REQUEST'),
      );
    }

    if (IS_CIRRUS) {
      return Vendor._(
        'Cirrus CI',
        Platform.environment.containsKey('CIRRUS_PR'),
      );
    }

    if (IS_CODEFRESH) {
      return Vendor._(
        'Codefresh',
        Platform.environment.containsKey("CF_PULL_REQUEST_NUMBER") ||
            Platform.environment.containsKey("CF_PULL_REQUEST_ID"),
      );
    }

    if (IS_CODEMAGIC) {
      return Vendor._(
        'Codemagic',
        Platform.environment['FCI_PULL_REQUEST'] != 'false',
      );
    }

    if (IS_CODESHIP) {
      return Vendor._(
        'Codeship',
        false,
      );
    }

    if (IS_DRONE) {
      return Vendor._(
        'Drone',
        Platform.environment["DRONE_BUILD_EVENT"] == "pull_request",
      );
    }

    if (IS_EAS) {
      return Vendor._(
        'Expo Application Services',
        false,
      );
    }

    if (IS_GITHUB_ACTIONS) {
      return Vendor._(
        'GitHub Actions',
        Platform.environment["GITHUB_EVENT_NAME"] == "pull_request",
      );
    }

    if (IS_GITLAB) {
      return Vendor._(
        'GitLab CI',
        Platform.environment.containsKey('CI_MERGE_REQUEST_ID'),
      );
    }

    if (IS_GOCD) {
      return Vendor._(
        'GoCD',
        false,
      );
    }

    if (IS_HUDSON) {
      return Vendor._(
        'Hudson',
        false,
      );
    }

    if (IS_JENKINS) {
      return Vendor._(
        'Jenkins',
        Platform.environment.containsKey("ghprbPullId") ||
            Platform.environment.containsKey("CHANGE_ID"),
      );
    }

    if (IS_LAYERCI) {
      return Vendor._(
        'LayerCI',
        Platform.environment.containsKey('LAYERCI_PULL_REQUEST'),
      );
    }

    if (IS_MAGNUM) {
      return Vendor._(
        'Magnum CI',
        false,
      );
    }

    if (IS_NETLIFY) {
      return Vendor._(
        'Netlify CI',
        Platform.environment['PULL_REQUEST'] != 'false',
      );
    }

    if (IS_NEVERCODE) {
      return Vendor._(
        'Nevercode',
        Platform.environment['NEVERCODE_PULL_REQUEST'] != 'false',
      );
    }

    if (IS_RENDER) {
      return Vendor._(
        'Render',
        Platform.environment["IS_PULL_REQUEST"] == "true",
      );
    }

    if (IS_SAIL) {
      return Vendor._(
        'Sail CI',
        Platform.environment.containsKey('SAIL_PULL_REQUEST_NUMBER'),
      );
    }

    if (IS_SCREWDRIVER) {
      return Vendor._(
        'Screwdriver',
        Platform.environment['SD_PULL_REQUEST'] != 'false',
      );
    }

    if (IS_SEMAPHORE) {
      return Vendor._(
        'Semaphore',
        Platform.environment.containsKey('PULL_REQUEST_NUMBER'),
      );
    }

    if (IS_SHIPPABLE) {
      return Vendor._(
        'Shippable',
        Platform.environment["IS_PULL_REQUEST"] == "true",
      );
    }

    if (IS_SOLANO) {
      return Vendor._(
        'Solano CI',
        Platform.environment.containsKey('TDDIUM_PR_ID'),
      );
    }

    if (IS_STRIDER) {
      return Vendor._(
        'Strider CD',
        false,
      );
    }

    if (IS_TASKCLUSTER) {
      return Vendor._(
        'TaskCluster',
        false,
      );
    }

    if (IS_TEAMCITY) {
      return Vendor._(
        'TeamCity',
        false,
      );
    }

    if (IS_TRAVIS) {
      return Vendor._(
        'Travis CI',
        Platform.environment['TRAVIS_PULL_REQUEST'] != 'false',
      );
    }

    if (IS_VERCEL) {
      return Vendor._(
        'Vercel',
        false,
      );
    }

    if (IS_APPCENTER) {
      return Vendor._(
        'Visual Studio App Center',
        false,
      );
    }

    if (IS_DSARI) {
      return Vendor._(
        'dsari',
        false,
      );
    }

    return null;
  }
}
