Skip to content

Commit

Permalink
rebranding
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiez committed Jun 13, 2023
1 parent 2d38864 commit d163281
Show file tree
Hide file tree
Showing 18 changed files with 33 additions and 32 deletions.
2 changes: 1 addition & 1 deletion .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
MIT License

Copyright (c) 2020-present sms77 e.K.
Copyright (c) 2020-2022 sms77 e.K.
Copyright (c) 2023-present seven communications GmbH & Co. KG

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
12 changes: 6 additions & 6 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@
import PackageDescription

let package = Package(
name: "Sms77Client",
name: "SevenClient",
products: [
.library(
name: "Sms77Client",
targets: ["Sms77Client"]),
name: "SevenClient",
targets: ["SevenClient"]),
],
dependencies: [],
targets: [
.target(
name: "Sms77Client",
name: "SevenClient",
dependencies: []),
.testTarget(
name: "Sms77ClientTests",
dependencies: ["Sms77Client"]),
name: "SevenClientTests",
dependencies: ["SevenClient"]),
]
)
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
![Sms77.io Logo](https://www.sms77.io/wp-content/uploads/2019/07/sms77-Logo-400x79.png "Sms77.io Logo")
![](https://www.seven.io/wp-content/uploads/Logo.svg "seven Logo")

# Official Swift Client for the Sms77.io SMS Gateway API
# Official Swift Client for the seven.io SMS Gateway API

## Installation

Expand All @@ -11,20 +11,20 @@ Package.swift:
```swift
let package = Package(
dependencies: [
.package(url: "https://github.com/sms77io/swift-client")
.package(url: "https://github.com/seven-io/swift-client")
]
)
```

### Usage

```swift
import Sms77Client
import SevenClient

let apiKey = "MySms77ioApiKey"
// alternatively setting apiKey to nil will read SMS77_API_KEY from environment
let apiKey = "MySevenApiKey"
// alternatively setting apiKey to nil will read SEVEN_API_KEY from environment
// let apiKey = nil
let client = try! Sms77Client(apiKey: apiKey)
let client = try! SevenClient(apiKey: apiKey)
debugPrint(client.balance())
```

Expand All @@ -34,6 +34,6 @@ debugPrint(client.balance())

##### Support

Need help? Feel free to [contact us](https://www.sms77.io/en/company/contact/).
Need help? Feel free to [contact us](https://www.seven.io/en/company/contact/).

[![MIT](https://img.shields.io/badge/License-MIT-teal.svg)](./LICENSE)
[![MIT](https://img.shields.io/badge/License-MIT-teal.svg)](LICENSE)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ enum StringBool: String, Codable {
case `false`
}

struct Sms77Client {
struct SevenClient {
var debug: Bool = false
var sentWith: String = "Swift"
var apiKey: String

init(apiKey: String = ProcessInfo.processInfo.environment["SMS77_API_KEY"] ?? "") throws {
init(apiKey: String = ProcessInfo.processInfo.environment["SEVEN_API_KEY"] ?? "") throws {
guard !apiKey.isEmpty else {
throw InvalidArgumentError.emptyApiKey
}
Expand All @@ -29,7 +29,7 @@ struct Sms77Client {
group.enter()

var response: Data? = nil
var to = "https://gateway.sms77.io/api/" + endpoint
var to = "https://gateway.seven.io/api/" + endpoint

if hasPayload {
let encodedPayload = try! JSONEncoder().encode(payload)
Expand Down
4 changes: 2 additions & 2 deletions Tests/LinuxMain.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import XCTest

import Sms77ClientTests
import SevenClientTests

var tests = [XCTestCaseEntry]()
tests += Sms77ClientTests.allTests()
tests += SevenClientTests.allTests()
XCTMain(tests)
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import XCTest
@testable import Sms77Client
@testable import SevenClient

final class Sms77ClientTests: XCTestCase {
func initClient() -> Sms77Client {
var client = try! Sms77Client(apiKey: ProcessInfo.processInfo.environment["SMS77_DUMMY_API_KEY"]!)
final class SevenClientTests: XCTestCase {
func initClient() -> SevenClient {
var client = try! SevenClient(apiKey: ProcessInfo.processInfo.environment["SEVEN_DUMMY_API_KEY"]!)

client.debug = true
client.sentWith = "Swift-Test"
Expand Down Expand Up @@ -92,9 +92,9 @@ final class Sms77ClientTests: XCTestCase {

func testLookup() {
let client = initClient()
var mnpParams = LookupParams(type: LookupType.mnp, number: "491771783130")
var mnpParams = LookupParams(type: LookupType.mnp, number: "491716992343")

XCTAssertEqual(client.lookup(params: mnpParams) as! String, "eplus")
XCTAssertEqual(client.lookup(params: mnpParams) as! String, "d1")
sleep(1)

mnpParams.json = true
Expand Down Expand Up @@ -142,7 +142,7 @@ final class Sms77ClientTests: XCTestCase {

func testSms() {
let client = initClient()
var params = SmsParams(text: "HI2U!", to: "491771783130")
var params = SmsParams(text: "HI2U!", to: "491716992343")

XCTAssertEqual((client.sms(params: params) as! String).count, 3)

Expand Down Expand Up @@ -190,7 +190,7 @@ final class Sms77ClientTests: XCTestCase {

func testValidateForVoice() {
let client = initClient()
let params = ValidateForVoiceParams(number: "491771783130")
let params = ValidateForVoiceParams(number: "491716992343")
let res = client.validateForVoice(params: params)

XCTAssertGreaterThan((res!.code ?? " ").count, 0)
Expand All @@ -204,7 +204,7 @@ final class Sms77ClientTests: XCTestCase {

func testVoice() {
let client = initClient()
let params = VoiceParams(text: "Hey friend!", to: "491771783130")
let params = VoiceParams(text: "Hey friend!", to: "491716992343")

XCTAssertEqual((client.voice(params: params) as! String)
.split(whereSeparator: \.isNewline).count, 3)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import XCTest
#if !canImport(ObjectiveC)
public func allTests() -> [XCTestCaseEntry] {
return [
testCase(Sms77ClientTests.allTests),
testCase(SevenClientTests.allTests),
]
}
#endif

0 comments on commit d163281

Please sign in to comment.