{"size": 597, "ext": "js", "max_stars_repo_path": "lib/index.js", "max_stars_repo_name": "appmechanix/hooq-provider-amazon-sqs", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "lib/index.js", "max_issues_repo_name": "appmechanix/hooq-provider-amazon-sqs", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "lib/index.js", "max_forks_repo_name": "appmechanix/hooq-provider-amazon-sqs", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 37.3125, "max_line_length": 107, "alphanum_fraction": 0.7169179229}
'use strict';

var SQS = require('aws-sqs');

exports.CreateQueueIfNeeded = function (connectionModel, queueName, callback) {
    var sqs = new SQS(connectionModel.AWSId, connectionModel.AWSSecret, {region: connectionModel.Region});

    sqs.createQueue(queueName, function (err, data) {
        callback(data);
    });
};

exports.Push = function (connectionModel, message, callback) {
    var sqs = new SQS(connectionModel.AWSId, connectionModel.AWSSecret, {region: connectionModel.Region});
    sqs.sendMessage(connectionModel.AmazonSQSUrl, JSON.stringify(message), callback);
};