<commit_before>#!/usr/bin/perl

use strict;
use Test::More tests => 19;
use Net::CampaignMonitor;
use Params::Util qw{_STRING};

my $api_key = '';
my $cm;

if ( Params::Util::_STRING($ENV{'CAMPAIGN_MONITOR_API_KEY'}) ) {
	
	$api_key = $ENV{'CAMPAIGN_MONITOR_API_KEY'};
	
	$cm = Net::CampaignMonitor->new({
			secure  => 1, 
			api_key => $api_key,
		  });
}

# TODO remove:
$api_key = '<KEY>';

	$cm = Net::CampaignMonitor->new({
			secure  => 1, 
			api_key => $api_key,
		  });

SKIP: {
	skip 'Invalid API Key supplied', 13 if $api_key eq '';

	my %new_client = (
		'CompanyName'  => "ACME Limited",
		'ContactName'  => "<NAME>",
		'EmailAddress' => "<EMAIL>", 
		'Country'      => "Australia",
		'TimeZone'     => "(GMT+10:00) Canberra, Melbourne, Sydney"
	);

	my $created_client = $cm->account_clients(%new_client);

	ok( $created_client->{'code'} eq '201', 'Client created' );

	my $client_id = $created_client->{'response'};

	my %basic_access_settings = (
		'AccessLevel' => '23',<commit_msg>Removed hard-coded API key. Fixed call to create client. Some more tests pass. #mess<commit_after>#!/usr/bin/perl

use strict;
use Test::More tests => 19;
use Net::CampaignMonitor;
use Params::Util qw{_STRING};

my $api_key = '';
my $cm;

if ( Params::Util::_STRING($ENV{'CAMPAIGN_MONITOR_API_KEY'}) ) {
	
	$api_key = $ENV{'CAMPAIGN_MONITOR_API_KEY'};
	
	$cm = Net::CampaignMonitor->new({
			secure  => 1, 
			api_key => $api_key,
		  });
}

SKIP: {
	skip 'Invalid API Key supplied', 13 if $api_key eq '';

	my %new_client = (
		'CompanyName'  => "ACME Limited",
		'Country'      => "Australia",
		'TimeZone'     => "(GMT+10:00) Canberra, Melbourne, Sydney"
	);

	my $created_client = $cm->account_clients(%new_client);

	ok( $created_client->{'code'} eq '201', 'Client created' );

	my $client_id = $created_client->{'response'};

	my %basic_access_settings = (
		'AccessLevel' => '23',
{'fraction_non_alphanumeric': 0.1897191308956015, 'fraction_numerical': 0.015368309485956544, 'mean_word_length': 4.273743016759776, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 33, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1723492', 'n_tokens_mistral': 799, 'n_tokens_neox': 718, 'n_words': 154}